From: Maxime Bourget Date: Thu, 13 Jun 2013 17:59:22 +0000 (+0100) Subject: Display picking checkbox but change flag needs to be removed. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=81318d468c8c684566901387488a4eab6dbba417;p=order_line_extra.git Display picking checkbox but change flag needs to be removed. --- diff --git a/includes/order_lines.inc b/includes/order_lines.inc index f0dd375..2acbfac 100644 --- a/includes/order_lines.inc +++ b/includes/order_lines.inc @@ -118,6 +118,8 @@ function bulk_update_order_details() { commit_transaction(); } + + function compute_input_name($row, $field) { $row_id = $row['id']; return "detail[$row_id][$field]"; @@ -223,14 +225,12 @@ function pick_checkbox($row) { $id = $row['debtor_no']."_".$row['branch_code']; $name = "chgpck" .$id; - $value = $row['type'] ? 1:0; - //$value = onpick($row['debtor_no'], $row['branch_code']); + $value = $row['quantity_to_pick'] > 0 ? 1:0; // save also in hidden field for testing during 'Update' - return checkbox(null, $name, $value, true, - _('Set this order for picking')) - . hidden('last['.$id.']', $value, false); + _('Pick all possible item for this branch.')) + . hidden('pick['.$id.']', $value, false); } function get_order_details_extra($customer_id, $location, $item_like) { diff --git a/includes/picking.inc b/includes/picking.inc new file mode 100644 index 0000000..c92bd01 --- /dev/null +++ b/includes/picking.inc @@ -0,0 +1,51 @@ +insertAllForBranch($id); + } + else { + $picker->deleteAllForBranch($id); + } + $Ajax->activate('order_line_view'); +} + + +class Picker { + function insertAllForBranch($id) { + list($debtor_no, $branch_code) = $this->branchForId($id); + display_warning("inserting for $id"); + + } + + function deleteAllForBranch($id) { + display_warning("inserting for $id"); + list($debtor_no, $branch_code) = $this->branchForId($id); + } + + function branchForId($id) { + return explode('_', $id); + } + + + +} + + diff --git a/order_lines_view.php b/order_lines_view.php index 02ffdb2..f1dd3fb 100644 --- a/order_lines_view.php +++ b/order_lines_view.php @@ -19,6 +19,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc"); include_once("includes/order_lines.inc"); include_once("includes/splitter.inc"); include_once("includes/bulk_updater.inc"); +include_once("includes/picking.inc"); $page_security = 'SA_ORDERLINEX_EDIT'; add_access_extensions(); @@ -31,6 +32,8 @@ update_extra_order_details(); split_order_details(); bulk_update_order_details(); +process_picking_flag(); + $js = ""; if ($use_popup_windows) @@ -41,6 +44,7 @@ page($_SESSION['page_title'], false, false, "", $js); //--------------------------------------------------------------------------------------------- +div_start('order_line_view'); start_form(); start_table(TABLESTYLE_NOBORDER); @@ -123,7 +127,7 @@ _("Comments") => array('ord' => '', 'fun' => 'aggregate_comment'), _("comment 2 ") => 'skip', _("Q to Pick") => array('ord' => '', 'type' => 'qty'), _("A to Pick") => array('ord' => '', 'type' => 'amount'), -//_("Pick").' array('insert'=>true, 'fun'=>'pick_checkbox'), +_("Pick")=> array('insert'=>true, 'fun'=>'pick_checkbox'), ); } @@ -169,8 +173,9 @@ br(1); submit_center_first('Update', _("Update"), '', 'default', false); submit_center_last('Cancel', _("Cancel"), '', 'cancel', false); - end_form(); - end_page(); +end_form(); +div_end(); +end_page(); ?>