$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++) { $customFields[$i] = show_custom_field("invoice_cf$i",$invoice_array["custom_field$i"],"write",'',"details_screen",'','',''); } $smarty -> assign("invoice",$invoice->toArray()); $smarty -> assign("defaults",$defaults); $smarty -> assign("invoiceItems",$invoiceItems); $smarty -> assign("customers",$customers); $smarty -> assign("preference",$preference); $smarty -> assign("billers",$billers); $smarty -> assign("taxes",$taxes); $smarty -> assign("preferences",$preferences); $smarty -> assign("products",$products); $smarty -> assign("customFields",$customFields); $smarty -> assign("lines",count($invoiceItems));
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 ) { $invoice_age_days = number_format((strtotime(date('Y-m-d')) - strtotime($invoice->calc_date)) / (60 * 60 * 24),0); $invoice_age = "$invoice_age_days {$LANG['days']}"; } else { $invoice_age =""; } $url_for_pdf = "./index.php?module=export&view=pdf&id=" . $invoice->getId(); $invoice->url_for_pdf = $url_for_pdf;