Added db_write/db_void hooks.
[fa-stable.git] / sales / includes / db / sales_credit_db.inc
index 7fc09668a83badd4c6f4bdb37ebbf22cc158516a..ce1cb17f14ae5fd9097cc7ab5476eaf530a4fa37 100644 (file)
@@ -31,6 +31,7 @@ function write_credit_note(&$credit_note, $write_off_acc)
        $credit_type = $write_off_acc == 0 ? 'Return' : 'WriteOff';
 
        begin_transaction();
+       hook_db_prewrite($credit_note, ST_CUSTCREDIT);
 
        $company_data = get_company_prefs();
        $branch_data = get_branch_accounts($credit_note->Branch);
@@ -160,6 +161,7 @@ function write_credit_note(&$credit_note, $write_off_acc)
        if ($trans_no == 0) {
                $Refs->save(ST_CUSTCREDIT, $credit_no, $credit_note->reference);
        }
+       hook_db_postwrite($credit_note, ST_CUSTCREDIT);
        commit_transaction();
 
        return $credit_no;