X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_adjust_db.inc;fp=inventory%2Fincludes%2Fdb%2Fitems_adjust_db.inc;h=5274584d13a35b4748d60cda53d5cce691cb8d9c;hb=46c5f7a65a7659a44ae8254c63152074363d3987;hp=ae2e25c709574014170217d6793756f780e25e58;hpb=35f482e2a9246960de37e5f1d975c734e08951e6;p=fa-stable.git diff --git a/inventory/includes/db/items_adjust_db.inc b/inventory/includes/db/items_adjust_db.inc index ae2e25c7..5274584d 100644 --- a/inventory/includes/db/items_adjust_db.inc +++ b/inventory/includes/db/items_adjust_db.inc @@ -16,6 +16,11 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe global $Refs; begin_transaction(); + $args = func_get_args(); + $args = (object)array_combine(array('items', 'location', 'date_', 'type', 'increase', + 'reference', 'memo_'), $args); + $args->trans_no = 0; + hook_db_prewrite($args, ST_INVADJUST); $adj_id = get_next_trans_no(ST_INVADJUST); @@ -34,6 +39,8 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe $Refs->save(ST_INVADJUST, $adj_id, $reference); add_audit_trail(ST_INVADJUST, $adj_id, $date_); + $args->trans_no = $adj_id; + hook_db_postwrite($args, ST_INVADJUST); commit_transaction(); return $adj_id; @@ -43,6 +50,7 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe function void_stock_adjustment($type_no) { + hook_db_prevoid(ST_INVADJUST, $type_no); void_gl_trans(ST_INVADJUST, $type_no); void_stock_move(ST_INVADJUST, $type_no); }