Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Bookings Panel #8

Open
Pauldro opened this issue Apr 16, 2018 · 1 comment
Open

Customer Bookings Panel #8

Pauldro opened this issue Apr 16, 2018 · 1 comment
Assignees

Comments

@Pauldro
Copy link
Member

Pauldro commented Apr 16, 2018

Make the class CustomerBookings
Call the file BookingsPanelCustomer.class.php
in the first line after the curly braces
paste use OrderPanelCustomerTraits;
include it in site**/templates/content/common/initialize.php**
Copy all the functions from BookingsPanel.class.php and paste into CustomerBookings
Copy all the files and directories from site/templates/dashboard/bookings
into
site/templates/customer/cust-page/bookings/
then in bookings-panel.php you'll want to include a call to set_customer($customer->custid, $customer->shipid);

public function setup_pageurl() {
	$this->pageurl->path = DplusWire::wire('config')->pages->ajaxload."bookings/customer/$this->custID";
      if (!empty($this->shipID)) {
     $this->pageurl->path->add("shipto-$this->shipID");
}
       
}

Notice for the following functions you'll have to supply the custID and shipID in the urls
generate_viewsalesordersbydayurl($date)
generate_viewsalesorderdayurl($ordn, $date)

You'll also have to configure site/templates/content/ajax/load/bookings-router.php to fetch the
custID and shipID from the URL for cases sales-orders

bbullemer added a commit that referenced this issue Apr 17, 2018
- created class file
- created js file for chart
- created files to show panel
bbullemer added a commit that referenced this issue Apr 17, 2018
bbullemer added a commit that referenced this issue Apr 17, 2018
@Pauldro
Copy link
Member Author

Pauldro commented Apr 17, 2018

@bbullemer The functions get_bookings, get_daybookingordernumbers(), get_daybookingordernumbers(), count_daybookingordernumbers(), count_todaysbookings() need to call new database functions which you'll create based off the old ones except this one will have a different name.

For example in get_bookings()
the function get_userbookings from _dbfunc.php will need a new function that will will be called get_customerbookings and after sessionID supply the panel's custID and shipID,
The function in _dbfunc.php can be copied from get_userbookings except the table you're going to use when querying for a customer is bookingc, and remember to add the to search the customerID on the query, and also shipID if it's not empty.

Then you're going to copy the get_bookingsummarybycustomer() and its _dbfunc.php function.
Then you're going to paste it to be get_bookingsummarybyshipto(), and same for the _dbfunc.php function. Again you'll copy the function _dbfunc.php point it to bookingc and then in the db function make sure it's looking for that customer and shipto if applicable.

bbullemer added a commit that referenced this issue Apr 18, 2018
bbullemer added a commit that referenced this issue Apr 18, 2018
Pauldro added a commit that referenced this issue Apr 18, 2018
bbullemer added a commit that referenced this issue Apr 19, 2018
- file name corrected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants