projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb2691a
)
Clone Manufactured Item -> Clone BOM.
author
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sat, 17 Aug 2019 15:39:07 +0000
(17:39 +0200)
committer
Joe Hunt
<joe.hunt.consulting@gmail.com>
Sat, 17 Aug 2019 15:39:07 +0000
(17:39 +0200)
manufacturing/manage/bom_edit.php
patch
|
blob
|
history
diff --git
a/manufacturing/manage/bom_edit.php
b/manufacturing/manage/bom_edit.php
index 35230ddb5ab0a70ccb489d1e7be0adbb0d1ee8a2..697629bcf923aad5f574ecd5a515e8a6b84115eb 100644
(file)
--- a/
manufacturing/manage/bom_edit.php
+++ b/
manufacturing/manage/bom_edit.php
@@
-45,9
+45,10
@@
function display_bom_items($selected_parent)
table_header($th);
$k = 0;
table_header($th);
$k = 0;
+ $found = false;
while ($myrow = db_fetch($result))
{
while ($myrow = db_fetch($result))
{
-
+ $found = true;
alt_table_row_color($k);
label_cell($myrow["component"]);
alt_table_row_color($k);
label_cell($myrow["component"]);
@@
-62,9
+63,29
@@
function display_bom_items($selected_parent)
} //END WHILE LIST LOOP
end_table();
} //END WHILE LIST LOOP
end_table();
+
+ if ($found) {
+ start_table(TABLESTYLE, "width='60%'");
+ stock_manufactured_items_list_row(_("Copy BOM to another manufacturable item"), 'new_stock_id', $selected_parent, false, true);
+ end_table();
+ }
+
div_end();
}
div_end();
}
+function copy_bom_items($stock_id, $new_stock_id)
+{
+ $result = get_bom($stock_id);
+ while ($myrow = db_fetch($result))
+ {
+ $_POST['component'] = $myrow["component"];
+ $_POST['loc_code'] = $myrow["loc_code"];
+ $_POST['workcentre_added'] = $myrow["workcentre_added"];
+ $_POST['quantity'] = $myrow["quantity"];
+ on_submit($new_stock_id, -1);
+ }
+}
+
//--------------------------------------------------------------------------------------------------
function on_submit($selected_parent, $selected_component=-1)
//--------------------------------------------------------------------------------------------------
function on_submit($selected_parent, $selected_component=-1)
@@
-135,6
+156,14
@@
if ($Mode == 'RESET')
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
+if (list_updated('new_stock_id')) {
+ copy_bom_items($_POST['stock_id'], $_POST['new_stock_id']);
+ $item = get_item($_POST['new_stock_id']);
+ $_POST['stock_id'] = $_POST['new_stock_id'];
+ $Ajax->activate('_page_body');
+ display_notification(_("BOM copied to ") . $item['description']);
+}
+
start_form();
start_form(false, true);
start_form();
start_form(false, true);