begin_transaction();
+ hook_db_prewrite($invoice, ST_SALESINVOICE);
$company_data = get_company_prefs();
$branch_data = get_branch_accounts($invoice->Branch);
if ($trans_no == 0) {
$Refs->save(ST_SALESINVOICE, $invoice_no, $invoice->reference);
- if ($invoice->cash) {
+ if ($invoice->payment_terms['cash_sale']) {
$amount = $items_total + $items_added_tax + $invoice->freight_cost
+ $freight_added_tax;
update_debtor_trans_allocation(ST_CUSTPAYMENT, $pmtno, $amount);
}
}
+ hook_db_postwrite($invoice, ST_SALESINVOICE);
commit_transaction();
return $invoice_no;
{
begin_transaction();
+ hook_db_prevoid($type, $type_no);
void_bank_trans($type, $type_no, true);
void_gl_trans($type, $type_no, true);