Old ineffective sql_trail superseded by new improved db_trail logging only calls...
[fa-stable.git] / sales / includes / db / sales_credit_db.inc
index 998a6a204a2828b35441ad8a2ac488b2ba6f599e..105007bdb06bb616159fd6dd867b55507bbe354d 100644 (file)
@@ -17,6 +17,8 @@ function write_credit_note(&$credit_note, $write_off_acc)
 {
        global $Refs;
 
+       begin_transaction(__FUNCTION__, func_get_args());
+
        if (is_array($credit_note->src_docs))
        {
                $docs = array_keys($credit_note->src_docs);
@@ -35,7 +37,6 @@ 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();