$ -> Affected files
------------------------------- Release 2.3 RC3 --------------------------------
+26-Oct-2010 Janusz Dobrowolski
! Release 2.3RC3
-25-Oct-2010 Janusz Dobrowolski
$ version.php
# Small fix to tabbed_content behaviour.
$ /includes/ui/ui_controls.inc
+26-Oct-2010 Joe Hunt
+# 0000272: Manufacturing Bugs. Issue GL items moved to wo_work_order_issues.inc
+$ /manufacturing/includes/db/work_orders_quick_db.inc
+ /manufacturing/includes/db/work_order_issues_db.inc
+ /manufacturing/includes/db/work_order_produce_items.inc
+! Layout improvements in work order inquiry and various work order forms
+$ /manufacturing/search_work_orders.php
+ /manufacturing/work_order_add_finished.php
+ /manufacturing/work_order_costs.php
+ /manufacturing/work_order_issue.php
+ /manufacturing/work_order_release.php
+
22-Oct-2010 Janusz Dobrowolski
+ Added greek installer translation by Kyriakos Tsoukalas
$ /install/isession.inc
$number = db_insert_id();
+ $issue_total = $total_cost = 0;
+
foreach ($items as $item)
{
VALUES (".db_escape($number).", ".db_escape($item->stock_id).", "
.db_escape($item->quantity).")";
db_query($sql,"A work order issue item could not be added");
- }
+
+ $standard_cost = get_standard_cost($item->stock_id);
+ $issue_cost = $standard_cost * $item->quantity;
+ $issue = get_stock_gl_code($item->stock_id);
+ $stockitem = get_item($item->stock_id);
+ $total_cost += add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $issue["inventory_account"], 0, 0,
+ $date_.": "._("Issue of")." ".$stockitem["description"], -$issue_cost);
+ $issue_total += $issue_cost;
+ }
+ if ($issue_total != 0)
+ add_issue_cost($details['stock_id'], $details['units_reqd'], $date_, $issue_total);
+ $issue = get_stock_gl_code($details['stock_id']);
+ $stockitem = get_item($details['stock_id']);
+ add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $issue["inventory_account"],
+ 0, 0, $date_.": "._("Issue to")." ".$stockitem["description"], -$total_cost);
if ($memo_)
add_comments(ST_MANUISSUE, $number, $date_, $memo_);
// insert a +ve stock move for the item being manufactured
// negative means "unproduce" or unassemble
add_stock_move(ST_MANURECEIVE, $details["stock_id"], $id,
- $details["loc_code"], $date_, $memo_, $quantity, 0);
+ $details["loc_code"], $date_, $ref, $quantity, 0);
// update wo quantity and close wo if requested
work_order_update_finished_quantity($woid, $quantity, $close_wo);
$bom_accounts = get_stock_gl_code($bom_item["component"]);
$bom_cost = $bom_item["ComponentCost"] * $units_reqd;
-
+
+ $memo = $bom_item["quantity"] ." * ".$bom_item["description"];
if ($advanced)
{
+ $memo = $date_.": ".$memo;
update_wo_requirement_issued($woid, $bom_item['component'], $bom_item["quantity"] * $units_reqd);
// insert a -ve stock move for each item
add_stock_move(ST_MANURECEIVE, $bom_item["component"], $advanced,
$bom_item["loc_code"], $date_, "", -$bom_item["quantity"] * $units_reqd, 0);
}
$total_cost += add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $bom_accounts["inventory_account"], 0, 0,
- $bom_item["quantity"] ." * ".$bom_item["description"], -$bom_cost);
+ $memo, -$bom_cost);
}
if ($advanced)
{
+ $wo = get_work_order($woid);
// also take the additional issues
+ // moved to work_order_issues_db.inc
+ /*
$res = get_additional_issues($woid);
- $wo = get_work_order($woid);
$issue_total = 0;
while ($item = db_fetch($res))
{
$issue = get_stock_gl_code($item['stock_id']);
$stockitem = get_item($item['stock_id']);
$total_cost += add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $issue["inventory_account"], 0, 0,
- _("Issue of")." ".$stockitem["description"], -$issue_cost);
+ $date_.": "._("Issue of")." ".$stockitem["description"], -$issue_cost);
$issue_total += $issue_cost;
}
if ($issue_total != 0)
add_issue_cost($stock_id, $units_reqd, $date_, $issue_total);
+ */
$lcost = get_gl_wo_cost($woid, WO_LABOUR);
add_labour_cost($stock_id, $units_reqd, $date_, $lcost * $units_reqd / $wo['units_reqd']);
$ocost = get_gl_wo_cost($woid, WO_OVERHEAD);
}
// debit total components $total_cost
$stockitem = get_item($stock_id);
+ $memo = _("Produced")." ".$units_reqd. " * ".$stockitem["description"];
+ if ($advanced)
+ $memo = $date_.": ".$memo;
add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $item_accounts["inventory_account"],
- 0, 0, _("Produced")." ".$units_reqd. " * ".$stockitem["description"], -$total_cost);
+ 0, 0, $memo, -$total_cost);
}
//--------------------------------------------------------------------------------------
function view_gl_link($row)
{
- if ($row['closed'] == 0)
- return '';
+ //if ($row['closed'] == 0)
+ // return '';
return get_gl_view_str(ST_WORKORDER, $row['id']);
}
_("Item") => array('fun'=>'view_stock'),
_("Required") => array('fun'=>'dec_amount', 'align'=>'right'),
_("Manufactured") => array('fun'=>'dec_amount', 'align'=>'right'),
- _("Date") => 'date',
+ _("Date") => array('name'=>'date_', 'type'=>'date', 'ord'=>'desc'),
_("Required By") => array('type'=>'date', 'ord'=>''),
array('insert'=>true, 'fun'=> 'edit_link'),
array('insert'=>true, 'fun'=> 'release_link'),
display_note(print_link(_("Print the GL Journal Entries for this Work Order"), 702, $ar), 1);
hyperlink_no_params("search_work_orders.php", _("Select another &Work Order to Process"));
+ br();
end_page();
exit;
set_focus('date_');
return false;
}
-
+ // don't produce more that required. Otherwise change the Work Order.
+ if (input_num('quantity') > ($wo_details["units_reqd"] - $wo_details["units_issued"]))
+ {
+ display_error(_("The production exceeds the quantity needed. Please change the Work Order."));
+ set_focus('quantity');
+ return false;
+ }
// if unassembling we need to check the qoh
if (($_POST['ProductionType'] == 0) && !$SysPrefs->allow_negative_stock())
{
hyperlink_params("work_order_costs.php", _("Enter another additional cost."), "trans_no=$id");
hyperlink_no_params("search_work_orders.php", _("Select another &Work Order to Process"));
+ br();
end_page();
exit;
if (isset($_POST['process']) && can_process() == true)
{
+ $date = $_POST['date_'];
begin_transaction();
add_gl_trans_std_cost(ST_WORKORDER, $_POST['selected_id'], $_POST['date_'], $_POST['cr_acc'],
- 0, 0, $wo_cost_types[$_POST['PaymentType']], -input_num('costs'), PT_WORKORDER, $_POST['PaymentType']);
+ 0, 0, $date.": ".$wo_cost_types[$_POST['PaymentType']], -input_num('costs'), PT_WORKORDER, $_POST['PaymentType']);
$is_bank_to = is_bank_account($_POST['cr_acc']);
if ($is_bank_to)
{
}
add_gl_trans_std_cost(ST_WORKORDER, $_POST['selected_id'], $_POST['date_'], $_POST['db_acc'],
- $_POST['dim1'], $_POST['dim2'], $wo_cost_types[$_POST['PaymentType']], input_num('costs'), PT_WORKORDER,
+ $_POST['dim1'], $_POST['dim2'], $date.": ".$wo_cost_types[$_POST['PaymentType']], input_num('costs'), PT_WORKORDER,
$_POST['PaymentType']);
commit_transaction();
if (isset($_GET['AddedID']))
{
+ $id = $_GET['AddedID'];
display_notification(_("The work order issue has been entered."));
- display_note(get_trans_view_str(ST_WORKORDER, $_GET['AddedID'], _("View this Work Order")));
+ display_note(get_trans_view_str(ST_WORKORDER, $id, _("View this Work Order")));
+
+ display_note(get_gl_view_str(ST_WORKORDER, $id, _("View the GL Journal Entries for this Work Order")), 1);
hyperlink_no_params("search_work_orders.php", _("Select another &Work Order to Process"));
display_note(get_trans_view_str(ST_WORKORDER, $selected_id, _("View this Work Order")));
hyperlink_no_params("search_work_orders.php", _("Select another &work order"));
+ br();
$Ajax->activate('_page_body');
end_page();