Make a new branch from master call it quote-listing
The files you'll need to change are
site/templates/content/customer/cust-page/quotes/quotes-panel.php
site/templates/content/customer/cust-page/quotes/quotes-table.php
site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php
vendor/cptechinc/dpluso-processwire-classes/src/QuotePanelCustomer.class.php
site/templates/_dbfunc.php
You'll need this as a reference
vendor/cptechinc/dpluso-processwire-classes/src/Model/Quote.class.php
vendor/cptechinc/dpluso-processwire-classes/src/SalesOrderPanelCustomer.class.php
-
Add the column Quote Total to site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php . Place it before Notes
-
Add this new column to site/templates/content/customer/cust-page/quotes/quotes-table.php before the notes link. The field we will be using will be called subtotal ($quote->subtotal).
-
Look at site/templates/content/customer/cust-page/orders/orders-thead-rows.php
We will be modeling site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php after this file
-
Quotepanel has all of these functions so take one of the a links and copy it to site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php
-
The every heading will be can be sorted except for Detail, Notes, and Edit. So Paste the link for each heading but remember to keep the heading and to have the function sort by the column name which you can find in vendor/cptechinc/dpluso-processwire-classes/src/Model/Quote.class.php
-
Open vendor/cptechinc/dpluso-processwire-classes/src/QuotePanelCustomer.class.php
the function we are going to edit is get_quotes(), Notice that it already has the ability to do the orderby
it just needs the queries and the custom queries for dates. You can look at vendor/cptechinc/dpluso-processwire-classes/src/SalesOrderPanelCustomer.class.php for reference in its get_orders() function
-
First Let's do the most simple one. Go to _dbfunc.php and find the function get_customerquotes()
Copy the function and paste it underneath renaming the function change the parameters to match
get_customerquotesorderby($sessionID, $custID, $limit = 10, $page = 1, $useclass = false, $sortrule, $orderby, $debug = false).
-
Edit the query to do the sorting, I'll let you handle this one by yourself, if you need to debug the query you can always go to site/templates/content/customer/cust-page/quotes/quotes-panel.php and echo $quotepanel->get_quotes(true)
-
Now go to _dbfunc.php copy the function get_customerordersorderdate()
paste it under get_customerquotesorderby(), again I'll let you handle the query on this one you'll have to make sure it's pointing to the right column and remove the type = 'O' from that query. You'll have to do this for both Review Date and Expire Date so rename your functions accordingly and have them point to the right columns.
-
Update vendor/cptechinc/dpluso-processwire-classes/src/QuotePanelCustomer.class.php get_quotes() to have the if statements look for the column names for the expire date and review date sorting.
-
Remove all the $ajax->* from site/templates/content/customer/cust-page/quotes/quotes-panel.php
Test, and have me review it.
Make a new branch from master call it quote-listing
The files you'll need to change are
site/templates/content/customer/cust-page/quotes/quotes-panel.php
site/templates/content/customer/cust-page/quotes/quotes-table.php
site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php
vendor/cptechinc/dpluso-processwire-classes/src/QuotePanelCustomer.class.php
site/templates/_dbfunc.php
You'll need this as a reference
vendor/cptechinc/dpluso-processwire-classes/src/Model/Quote.class.php
vendor/cptechinc/dpluso-processwire-classes/src/SalesOrderPanelCustomer.class.php
Add the column Quote Total to site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php . Place it before Notes
Add this new column to site/templates/content/customer/cust-page/quotes/quotes-table.php before the notes link. The field we will be using will be called subtotal (
$quote->subtotal).Look at site/templates/content/customer/cust-page/orders/orders-thead-rows.php
We will be modeling site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php after this file
Quotepanel has all of these functions so take one of the a links and copy it to site/templates/content/customer/cust-page/quotes/quotes-thead-rows.php
The every heading will be can be sorted except for Detail, Notes, and Edit. So Paste the link for each heading but remember to keep the heading and to have the function sort by the column name which you can find in vendor/cptechinc/dpluso-processwire-classes/src/Model/Quote.class.php
Open vendor/cptechinc/dpluso-processwire-classes/src/QuotePanelCustomer.class.php
the function we are going to edit is
get_quotes(), Notice that it already has the ability to do the orderbyit just needs the queries and the custom queries for dates. You can look at vendor/cptechinc/dpluso-processwire-classes/src/SalesOrderPanelCustomer.class.php for reference in its
get_orders() functionFirst Let's do the most simple one. Go to _dbfunc.php and find the function
get_customerquotes()Copy the function and paste it underneath renaming the function change the parameters to match
get_customerquotesorderby($sessionID, $custID, $limit = 10, $page = 1, $useclass = false, $sortrule, $orderby, $debug = false).Edit the query to do the sorting, I'll let you handle this one by yourself, if you need to debug the query you can always go to site/templates/content/customer/cust-page/quotes/quotes-panel.php and echo
$quotepanel->get_quotes(true)Now go to _dbfunc.php copy the function
get_customerordersorderdate()paste it under get_customerquotesorderby(), again I'll let you handle the query on this one you'll have to make sure it's pointing to the right column and remove the
type = 'O' from that query. You'll have to do this for both Review Date and Expire Date so rename your functions accordingly and have them point to the right columns.Update vendor/cptechinc/dpluso-processwire-classes/src/QuotePanelCustomer.class.php
get_quotes()to have the if statements look for the column names for the expire date and review date sorting.Remove all the $ajax->* from site/templates/content/customer/cust-page/quotes/quotes-panel.php
Test, and have me review it.