projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup after merge.
[fa-stable.git]
/
inventory
/
includes
/
db
/
items_transfer_db.inc
diff --git
a/inventory/includes/db/items_transfer_db.inc
b/inventory/includes/db/items_transfer_db.inc
index dc587e3d2c52c4ecd5f0635895aa2f956bec06a3..5d5181f78ce89d7660123c76565e46086f107590 100644
(file)
--- a/
inventory/includes/db/items_transfer_db.inc
+++ b/
inventory/includes/db/items_transfer_db.inc
@@
-13,9
+13,16
@@
function add_stock_transfer($Items, $location_from, $location_to, $date_, $type, $reference, $memo_)
{
function add_stock_transfer($Items, $location_from, $location_to, $date_, $type, $reference, $memo_)
{
+ global $Refs;
+
begin_transaction();
begin_transaction();
+ $args = func_get_args();
+ $args = (object)array_combine(array('Items', 'location_from', 'location_to',
+ 'date_', 'type', 'reference', 'memo_'), $args);
+ $args->trans_no = 0;
+ hook_db_prewrite($args, ST_LOCTRANSFER);
- $transfer_id = get_next_trans_no(
systypes::location_transfer()
);
+ $transfer_id = get_next_trans_no(
ST_LOCTRANSFER
);
foreach ($Items as $line_item)
{
foreach ($Items as $line_item)
{
@@
-23,9
+30,13
@@
function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
$location_to, $date_, $type, $reference, $line_item->quantity);
}
$location_to, $date_, $type, $reference, $line_item->quantity);
}
- add_comments(systypes::location_transfer(), $transfer_id, $date_, $memo_);
+ add_comments(ST_LOCTRANSFER, $transfer_id, $date_, $memo_);
+
+ $Refs->save(ST_LOCTRANSFER, $transfer_id, $reference);
+ add_audit_trail(ST_LOCTRANSFER, $transfer_id, $date_);
- references::save_last($reference, systypes::location_transfer());
+ $args->trans_no = $transfer_id;
+ hook_db_postwrite($args, ST_LOCTRANSFER);
commit_transaction();
commit_transaction();
@@
-42,10
+53,10
@@
function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
function add_stock_transfer_item($transfer_id, $stock_id, $location_from, $location_to,
$date_, $type, $reference, $quantity)
{
function add_stock_transfer_item($transfer_id, $stock_id, $location_from, $location_to,
$date_, $type, $reference, $quantity)
{
- add_stock_move(
systypes::location_transfer()
, $stock_id, $transfer_id, $location_from,
+ add_stock_move(
ST_LOCTRANSFER
, $stock_id, $transfer_id, $location_from,
$date_, $reference, -$quantity, 0, $type);
$date_, $reference, -$quantity, 0, $type);
- add_stock_move(
systypes::location_transfer()
, $stock_id, $transfer_id, $location_to,
+ add_stock_move(
ST_LOCTRANSFER
, $stock_id, $transfer_id, $location_to,
$date_, $reference, $quantity, 0, $type);
}
$date_, $reference, $quantity, 0, $type);
}
@@
-77,7
+88,7
@@
function get_stock_transfer($trans_no)
function get_stock_transfer_items($trans_no)
{
function get_stock_transfer_items($trans_no)
{
- $result = get_stock_moves(
systypes::location_transfer()
, $trans_no);
+ $result = get_stock_moves(
ST_LOCTRANSFER
, $trans_no);
if (db_num_rows($result) == 0)
{
if (db_num_rows($result) == 0)
{
@@
-91,7
+102,8
@@
function get_stock_transfer_items($trans_no)
function void_stock_transfer($type_no)
{
function void_stock_transfer($type_no)
{
- void_stock_move(systypes::location_transfer(), $type_no);
+ hook_db_prevoid(ST_LOCTRANSFER, $type_no);
+ void_stock_move(ST_LOCTRANSFER, $type_no);
}
?>
\ No newline at end of file
}
?>
\ No newline at end of file