if(!isset($_GET['id'])) { throw new SimpleInvoices_Exception('Invalid invoice identifier'); } $SI_PRODUCTS = new SimpleInvoices_Db_Table_Products(); $SI_SYSTEM_DEFAULTS = new SimpleInvoices_Db_Table_SystemDefaults(); $SI_TAX = new SimpleInvoices_Db_Table_Tax(); $SI_CUSTOMERS = new SimpleInvoices_Db_Table_Customers(); $SI_BILLER = new SimpleInvoices_Db_Table_Biller(); $SI_PREFERENCES = new SimpleInvoices_Db_Table_Preferences(); #get the invoice id $master_invoice_id = $_GET['id']; $invoice = new SimpleInvoices_Invoice($_GET['id']); //$invoice = getInvoice($master_invoice_id); $invoiceItems = invoice::getInvoiceItems($invoice->getId()); //var_dump($invoiceItems); $customers = $SI_CUSTOMERS->fetchAllActive(); $preference = $invoice->getPreference(); $billers = $SI_BILLER->fetchAllActive(); //$taxes = $SI_TAX->fetchAllActive(); $defaults = $SI_SYSTEM_DEFAULTS->fetchAll(); $taxes = $SI_TAX->fetchAll(); $preferences = $SI_PREFERENCES->fetchAllActive(); $products = $SI_PRODUCTS->findActive(); $invoice_array = $invoice->toArray(); for($i=1;$i<=4;$i++) {
<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); //TODO - replace get..Payments with simple count - as data is got by xml.php now $query = null;$inv_id = null;$c_id = null; #if coming from another page where you want to filter by just one invoice $preference = 0; $customer = 0; if (!empty($_GET['id'])) { $inv_id = $_GET['id']; $invoice = new SimpleInvoices_Invoice($_GET['id']); $query = $invoice->getPayments(); $preference = $invoice->getPreference(); $subPageActive = "payment_filter_invoice"; } #if coming from another page where you want to filter by just one customer elseif (!empty($_GET['c_id'])) { $c_id = $_GET['c_id']; $query = getCustomerPayments($_GET['c_id']); $customer = customer::get($_GET['c_id']); $subPageActive = "payment_filter_customer"; } #if you want to show all invoices - no filters else { $query = getPayments(); $subPageActive = "payment_manage"; } $payments = progressPayments($query);
* GPL v2 or above * * Website: * http://www.simpleinvoices.or */ checkLogin(); $SI_SYSTEM_DEFAULTS = new SimpleInvoices_Db_Table_SystemDefaults(); $SI_CUSTOM_FIELDS = new SimpleInvoices_Db_Table_CustomFields(); if (!isset($_GET['id'])) { throw new SimpleInvoices_Exception('Invalid invoice'); } $invoice = new SimpleInvoices_Invoice($_GET['id']); $invoice_number_of_taxes = $invoice->getNumberOfTaxes(); $invoice_type = $invoice->getType(); $customer = $invoice->getCustomer(); $biller = $invoice->getBiller(); $preference = $invoice->getPreference(); $defaults = $SI_SYSTEM_DEFAULTS->fetchAll(); $invoiceItems = invoice::getInvoiceItems($invoice->getId()); $eway_check = new eway(); $eway_check->invoice = $invoice->toArray(); $eway_pre_check = $eway_check->pre_check(); #Invoice Age - number of days - start if ($invoice->owing > 0 ) {
jsValidateifNum("ac_date",$LANG['date']); jsFormValidationEnd(); jsEnd(); /* end validataion code */ $today = date("Y-m-d"); $invoice = null; if(!isset($_GET['id'])) { throw new SimpleInvoices_Exception('Invalid invoice identifier.'); } //$invoice = invoice::select($_GET['id']); $invoice = new SimpleInvoices_Invoice($_GET['id']); // NOTE: Doesn't this mess up payments? //else { // $sth = dbQuery("SELECT * FROM ".TB_PREFIX."invoices"); // $invoice = $sth->fetch(); // #$sth = new invoice(); // #$invoice = $sth->select_all(); //} $customer = $invoice->getCustomer(); $biller = $invoice->getBiller(); $defaults = $SI_SYSTEM_DEFAULTS->fetchAll(); $pt = $SI_PAYMENT_TYPES->getPaymentTypeById($defaults['payment_type']);