From: Steve Sutton Date: Sat, 10 Mar 2018 14:05:11 +0000 (-0500) Subject: Last minute edits from work. X-Git-Tag: v1.0.0^2~160 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=e6612646eaf910e66e338634c73ec1146138c095;p=WP-Plugins%2Fglm-member-db-billing.git Last minute edits from work. invoices Adding amount to invoice --- diff --git a/models/admin/billing/index.php b/models/admin/billing/index.php index 0ed8bce..2a54d8f 100644 --- a/models/admin/billing/index.php +++ b/models/admin/billing/index.php @@ -217,7 +217,7 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices break; case 'list': // Get list of pending invoices ( not overdue ) - $pendingWhere = 'T.paid <> true AND due_date > NOW()'; + $pendingWhere = 'T.paid <> true AND T.due_date > now()'; $start = 1; $pending = $this->getList( $pendingWhere, 'transaction_time', true, 'id', $start, $limit ); /** @@ -226,10 +226,10 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices $numberPending = ( isset( $pending['returned'] ) ? $pending['returned'] : 0 ); // Get the number of over due invoices - $overDueWhere = 'T.paid <> true AND due_date > NOW()'; + $overDueWhere = 'T.paid <> true AND T.due_date < now()'; $start = 1; $overdue = $this->getList( $overDueWhere, 'transaction_time', true, 'id', $start, $limit ); - $numberOverDue = $overdue['returned']; + $numberOverdue = $overdue['returned']; break; } diff --git a/models/admin/billing/invoices.php b/models/admin/billing/invoices.php index 220adac..b8d42e1 100644 --- a/models/admin/billing/invoices.php +++ b/models/admin/billing/invoices.php @@ -181,6 +181,9 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices $_REQUEST['due_date'] = date('Y-m-d', strtotime($_REQUEST['due_date'])); // echo '
' . print_r( $_REQUEST, true ) . '
'; $invoices = $this->insertEntry(); + + // TODO: Need to check to see if we received a good response + // For adding the new Invoice. $this->invoice_id = $invoices['fieldData']['id']; // After the Invoice is created need to add each line item if ( isset( $_REQUEST['line_items'] ) ) { diff --git a/views/admin/billing/editInvoice.html b/views/admin/billing/editInvoice.html index 6aea838..bc47a27 100644 --- a/views/admin/billing/editInvoice.html +++ b/views/admin/billing/editInvoice.html @@ -387,6 +387,9 @@ jQuery(document).ready(function($){ return valid; } + /** + * Add a single line item to the invoice page + */ function addLineItemToInvoice( lineItem ) { lineItem.qty = parseInt(1); @@ -584,6 +587,7 @@ jQuery(document).ready(function($){ invoiceTypeJSON = data; // console.log( 'invoiceTypeJSON', invoiceTypeJSON ); addLineItemToInvoice( invoiceTypeJSON[lineItemId] ); + totalInvoice(); }); } diff --git a/views/admin/billing/invoices.html b/views/admin/billing/invoices.html index 25aed15..30cc89b 100644 --- a/views/admin/billing/invoices.html +++ b/views/admin/billing/invoices.html @@ -45,6 +45,7 @@ Member Name Time Due Date + Amount Total Balance View @@ -62,6 +63,7 @@ {$t.member_name} {$t.transaction_time.datetime} {$t.due_date.date} + {$t.amount_total} {$t.balance} View