projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sending location email when below reorder also in Itmes Transfer and Adjustment
[fa-stable.git]
/
inventory
/
includes
/
db
/
items_adjust_db.inc
diff --git
a/inventory/includes/db/items_adjust_db.inc
b/inventory/includes/db/items_adjust_db.inc
index 7be0f9bbb05a1b759b9cb816f8a14af19592008d..f9ecd6f314de160d939ff1969ee42b84e658775a 100644
(file)
--- a/
inventory/includes/db/items_adjust_db.inc
+++ b/
inventory/includes/db/items_adjust_db.inc
@@
-13,7
+13,7
@@
function add_stock_adjustment($items, $location, $date_, $type, $increase, $reference, $memo_)
{
function add_stock_adjustment($items, $location, $date_, $type, $increase, $reference, $memo_)
{
- global $Refs;
+ global $
loc_notification, $path_to_root, $
Refs;
begin_transaction();
$args = func_get_args();
begin_transaction();
$args = func_get_args();
@@
-24,9
+24,20
@@
function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe
$adj_id = get_next_trans_no(ST_INVADJUST);
$adj_id = get_next_trans_no(ST_INVADJUST);
+ if ($loc_notification == 1 && !$increase)
+ {
+ include_once($path_to_root . "/inventory/includes/inventory_db.inc");
+ $st_ids = array();
+ $st_names = array();
+ $st_num = array();
+ $st_reorder = array();
+ }
foreach ($items as $line_item)
{
foreach ($items as $line_item)
{
+ if ($loc_notification == 1 && !$increase)
+ $loc = calculate_reorder_level($location, $line_item, $st_ids, $st_names, $st_num, $st_reorder);
+
if (!$increase)
$line_item->quantity = -$line_item->quantity;
if (!$increase)
$line_item->quantity = -$line_item->quantity;
@@
-42,6
+53,8
@@
function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe
$args->trans_no = $adj_id;
hook_db_postwrite($args, ST_INVADJUST);
commit_transaction();
$args->trans_no = $adj_id;
hook_db_postwrite($args, ST_INVADJUST);
commit_transaction();
+ if ($loc_notification == 1 && !$increase && count($st_ids) > 0)
+ send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
return $adj_id;
}
return $adj_id;
}