From: Steve Sutton Date: Tue, 5 Dec 2017 21:55:59 +0000 (-0500) Subject: WIP for adding invoice line items X-Git-Tag: v1.0.0^2~207 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=4915ecebab9ec1111f4d389e24231365766b919a;p=WP-Plugins%2Fglm-member-db-billing.git WIP for adding invoice line items Price calculation is being done for the items. Need to work on the quantity. --- diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 0000000..486cae0 --- /dev/null +++ b/css/admin.css @@ -0,0 +1,4 @@ +#billing-invoice-form .glm-columns, +#billing-invoice-form .glm-column { + padding: 0; +} diff --git a/models/admin/billing/invoices.php b/models/admin/billing/invoices.php index 616324b..a800a0a 100644 --- a/models/admin/billing/invoices.php +++ b/models/admin/billing/invoices.php @@ -15,6 +15,7 @@ // Load Contacts data class require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH.'/data/dataInvoices.php'; +require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH.'/data/dataInvoiceTypes.php'; class GlmMembersAdmin_billing_invoices extends GlmDataInvoices { @@ -111,6 +112,9 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices $nextStart = false; $start = 1; $limit = 20; // Set to the number of listings per page + $invTypes = array(); + $invoiceTypes = false; + $invoiceTypeJSON = ''; // Get any provided option if (isset($_REQUEST['option'])) { @@ -121,8 +125,22 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices switch ($option) { case 'add': - $invoices = $this->newEntry(); - $view = 'editInvoice'; + $invoices = $this->newEntry(); + $view = 'editInvoice'; + $InvoiceTypesObj = new GlmDataInvoiceTypes( $this->wpdb, $this->config ); + $invoiceTypes = $InvoiceTypesObj->getList(); + $invoiceTypes = $InvoiceTypesObj->sortParentChild($invoiceTypes); + echo '
$invoiceTypes: ' . print_r( $invoiceTypes, true ) . '
'; + if ( isset( $invoiceTypes ) ) { + foreach ( $invoiceTypes as $invoiceType ) { + $invTypes[$invoiceType['id']] = array( + 'id' => $invoiceType['id'], + 'name' => $invoiceType['name'], + 'amount' => $invoiceType['amount'], + ); + } + $invoiceTypeJSON = json_encode( $invTypes, true ); + } break; case 'insert': @@ -277,6 +295,8 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices 'nextStart' => $nextStart, 'start' => $start = 1, 'limit' => $limit, + 'invoiceTypeJSON' => $invoiceTypeJSON, + 'invoiceTypes' => $invoiceTypes, ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/billing/editInvoice.html b/views/admin/billing/editInvoice.html index 97cc79a..4ebb7ee 100644 --- a/views/admin/billing/editInvoice.html +++ b/views/admin/billing/editInvoice.html @@ -7,34 +7,166 @@ {if $invoiceInsertError}Notification Insert Error{/if} {if $invoiceAdded}Notification Added{/if} -
- {if $invoice_id} - - - {else} - - {/if} -
-
-
-
Line One
+
+ + {if $invoice_id} + + + {else} + + {/if} +
+
+
+
+ Member Account +
+
+ +
+
- - -
-
Total Amount:
-
$0.00
+
+
+
+ +
+
+
+
+   +
+
+
+
Total Amount:
+
$0.00
+
- -
-
- - +
+
+ +
+
+ +
+
+
+ + + + + + + +
Invoice Type + +
+
+
{include file='admin/footer.html'}