public function detail() { //get expenseaccount $expenseaccountobj = new expenseaccount(); $detail['expense_account_all'] = $expenseaccountobj->get_all(); //get customers with domain_id from session by constructor $customerobj = new customer(); $detail['customer'] = $customerobj->get(); $detail['customer_all'] = $customerobj->get_all(); //get billers with domain_id from session by constructor $billerobj = new biller(); $detail['biller_all'] = $billerobj->get_all(); //get invoices $invoiceobj = new invoice(); $detail['invoice_all'] = $invoiceobj->get_all(); //get products $productobj = new product(); $detail['product_all'] = $productobj->get_all(); return $detail; }
public static function detail() { //get customers $detail['expense_account_all'] = expenseaccount::get_all(); //get customers $detail['customer'] = customer::get(); $detail['customer_all'] = customer::get_all(); //get billers $detail['biller_all'] = biller::get_all(); //get invoices $detail['invoice_all'] = invoice::get_all(); //get products $detail['product_all'] = product::get_all(); return $detail; }
//stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); $SI_SYSTEM_DEFAULTS = new SimpleInvoices_Db_Table_SystemDefaults(); $SI_TAX = new SimpleInvoices_Db_Table_Tax(); #get the invoice id $expense_id = $_GET['id']; $expense = expense::get($expense_id); $detail = expense::detail(); $detail['customer'] = customer::get($expense['customer_id']); $detail['biller'] = biller::select($expense['biller_id']); $detail['invoice'] = invoice::select($expense['invoice_id']); $detail['product'] = product::get($expense['product_id']); $detail['expense_account'] = expenseaccount::select($expense['expense_account_id']); $detail['expense_tax'] = expensetax::get_all($expense_id); $detail['expense_tax_total'] = $expense['amount'] + expensetax::get_sum($expense_id); $detail['expense_tax_grouped'] = expensetax::grouped($expense_id); $detail['status_wording'] = $expense['status']==1?$LANG['paid']:$LANG['not_paid']; $taxes = $SI_TAX->fetchAllActive(); #$tax_selected = getTaxRate($product['default_tax_id']); $defaults = $SI_SYSTEM_DEFAULTS->fetchAll(); $smarty -> assign('expense',$expense); $smarty -> assign('detail',$detail); $smarty -> assign('taxes',$taxes); $smarty -> assign('defaults',$defaults); $smarty -> assign('tax_selected',$tax_selected); $smarty -> assign('customFieldLabel',$customFieldLabel);
<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); $number_of_rows = expenseaccount::count(); $smarty -> assign("number_of_rows",$number_of_rows); $smarty -> assign('pageActive', 'expense_account'); $smarty -> assign('active_tab', '#money'); ?>
<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); #get the invoice id $id = $_GET['id']; $expense_account = expenseaccount::select($id); $smarty -> assign('expense_account',$expense_account); $smarty -> assign('pageActive', 'expense_account'); $subPageActive = $_GET['action'] =="view" ? "view" : "edit" ; $smarty -> assign('subPageActive', $subPageActive); $smarty -> assign('active_tab', '#money'); ?>
<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); $expenseaccountobj = new expenseaccount(); # Deal with op and add some basic sanity checking $op = !empty($_POST['op']) ? addslashes($_POST['op']) : NULL; #insert product $saved = false; if ($op === 'insert') { if ($expenseaccountobj->insert()) { $saved = true; //saveCustomFieldValues($_POST['categorie'], lastInsertId()); } } if ($op === 'edit') { if ($expenseaccountobj->update()) { $saved = true; } } $refresh_total = isset($refresh_total) ? $refresh_total : ' '; $smarty->assign('saved', $saved); $smarty->assign('pageActive', 'expense_account_manage'); $smarty->assign('active_tab', '#money');
<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); #get the invoice id $expense_id = $_GET['id']; $expenseobj = new expense(); $customerobj = new customer(); $billerobj = new biller(); $invoiceobj = new invoice(); $productobj = new product(); $expenseaccountobj = new expenseaccount(); $expensetaxobj = new expensetax(); $expense = $expenseobj->get($expense_id); $detail = $expenseobj->detail(); $detail['customer'] = $customerobj->get($expense['customer_id']); $detail['biller'] = $billerobj->select($expense['biller_id']); $detail['invoice'] = $invoiceobj->select($expense['invoice_id']); $detail['product'] = $productobj->get($expense['product_id']); $detail['expense_account'] = $expenseaccountobj->select($expense['expense_account_id']); $detail['expense_tax'] = $expensetaxobj->get_all($expense_id); $detail['expense_tax_total'] = $expense['amount'] + $expensetaxobj->get_sum($expense_id); $detail['expense_tax_grouped'] = $expensetaxobj->grouped($expense_id); $detail['status_wording'] = $expense['status'] == 1 ? $LANG['paid'] : $LANG['not_paid']; $taxes = getActiveTaxes(); #$tax_selected = getTaxRate($product['default_tax_id']); $defaults = getSystemDefaults(); $smarty->assign('expense', $expense); $smarty->assign('detail', $detail); $smarty->assign('taxes', $taxes); $smarty->assign('defaults', $defaults);
<?php //stop the direct browsing to this file - let index.php handle which files get displayed checkLogin(); $expenseaccountobj = new expenseaccount(); #get the invoice id $id = $_GET['id']; $expense_account = $expenseaccountobj->select($id); $smarty->assign('expense_account', $expense_account); $smarty->assign('pageActive', 'expense_account'); $subPageActive = $_GET['action'] == "view" ? "view" : "edit"; $smarty->assign('subPageActive', $subPageActive); $smarty->assign('active_tab', '#money');
# Deal with op and add some basic sanity checking $op = !empty( $_POST['op'] ) ? addslashes( $_POST['op'] ) : NULL; #insert product $saved = false; if ( $op === 'insert' ) { if(expenseaccount::insert()) { $saved = true; //saveCustomFieldValues($_POST['categorie'], lastInsertId()); } } if ($op === 'edit' ) { if (expenseaccount::update()) { $saved = true; } } $refresh_total = isset($refresh_total) ? $refresh_total : ' '; $smarty->assign('saved',$saved); $smarty -> assign('pageActive', 'expense_account_manage'); $smarty -> assign('active_tab', '#money'); ?>