X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fstock_transfers_ui.inc;h=76adcb37e73dd63f7f46e605ca11064a2803203f;hb=c061e1b478cb41d22c23627ddff39a4ea7d849ed;hp=eb68bc472cc94ce35e36dfa5309c1ffe5938df61;hpb=5cae8206ae7eaf4df4b95b7f2184e2332f85ec8d;p=fa-stable.git
diff --git a/inventory/includes/stock_transfers_ui.inc b/inventory/includes/stock_transfers_ui.inc
index eb68bc47..76adcb37 100644
--- a/inventory/includes/stock_transfers_ui.inc
+++ b/inventory/includes/stock_transfers_ui.inc
@@ -1,5 +1,14 @@
.
+***********************************************************************/
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/ui/items_cart.inc");
@@ -7,90 +16,86 @@ include_once($path_to_root . "/includes/ui/items_cart.inc");
function add_to_order(&$order, $new_item, $new_item_qty, $standard_cost)
{
- if ($order->find_cart_item($new_item))
- display_error(_("For Part :") . $new_item . " " . "This item is already on this order. You can change the quantity ordered of the existing line if necessary.");
- else
- $order->add_to_cart (count($order->line_items), $new_item, $new_item_qty, $standard_cost);
+ $kit = get_item_kit($new_item);
+ foreach($kit as $item) {
+ if ($order->find_cart_item($item['stock_id']))
+ display_error(_("For Part :") . $item['stock_id'] . " " . "This item is already on this document. You can change the quantity on the existing line if necessary.");
+ else
+ $order->add_to_cart (count($order->line_items), $item['stock_id'], $new_item_qty * $item['quantity'], $standard_cost);
+ }
}
//--------------------------------------------------------------------------------
function display_order_header(&$order)
{
- global $table_style;
-
- start_table("width=70% $table_style");
- echo "
"; // outer table
- echo "";
-
- locations_list_row(_("From Location:"), 'FromStockLocation', null);
- locations_list_row(_("To Location:"), 'ToStockLocation', null);
-
- echo " ";
-
- echo " | "; // outer table
-
- echo "";
+ global $Refs;
- ref_row(_("Reference:"), 'ref', '', references::get_next(systypes::location_transfer()));
+ start_outer_table(TABLESTYLE, "width='70%'");
- date_row(_("Date:"), 'AdjDate');
+ table_section(1);
+
+ locations_list_row(_("From Location:"), 'FromStockLocation', null, false, false, $order->fixed_asset);
+ locations_list_row(_("To Location:"), 'ToStockLocation', null,false, false, $order->fixed_asset);
- echo " ";
+ table_section(2, "50%");
- echo " | "; // outer table
+ date_row(_("Date:"), 'AdjDate', '', true);
- echo "";
- movement_types_list_row(_("Transfer Type:"), 'type', null);
- echo " ";
+ ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_LOCTRANSFER, null, array('date'=>get_post('AdjDate'), 'location'=> get_post('FromStockLocation'))), false, ST_LOCTRANSFER);
- echo " |
";
- end_table(1); // outer table
+ end_outer_table(1); // outer table
}
//---------------------------------------------------------------------------------
function display_transfer_items($title, &$order)
{
- global $table_style, $path_to_root;
+ global $path_to_root;
display_heading($title);
div_start('items_table');
- start_table("$table_style width=80%");
+ start_table(TABLESTYLE, "width='80%'");
$th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), '');
+ if (!$order->fixed_asset && count($order->line_items)) $th[] = '';
table_header($th);
- $subtotal = 0;
$k = 0; //row colour counter
+ $low_stock = $order->check_qoh($_POST['FromStockLocation'], $_POST['AdjDate'], true);
$id = find_submit('Edit');
foreach ($order->line_items as $line_no=>$stock_item)
{
if ($id != $line_no)
{
- alt_table_row_color($k);
-
- label_cell("