Code cleanup in supplier_invoice.php and supplier_credit.php
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 6 Jul 2019 18:49:17 +0000 (20:49 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 6 Jul 2019 18:49:17 +0000 (20:49 +0200)
purchasing/includes/supp_trans_class.inc
purchasing/includes/ui/invoice_ui.inc
purchasing/supplier_credit.php
purchasing/supplier_invoice.php

index 8a70e41488f47b4565511838be523cf5f42c8fe4..be9ec00d3760477bee42b9102f76ee2a4248f935 100644 (file)
@@ -74,7 +74,7 @@ class supp_trans
 
        function add_grn_to_trans($grn_item_id, $po_detail_item, $item_code, $item_description, 
                $qty_recd, $prev_quantity_inv, $this_quantity_inv, $order_price, $chg_price, 
-               $std_cost_unit, $gl_code)
+               $std_cost_unit=null, $gl_code='')
        {
                $this->grn_items[$grn_item_id] = new grn_item($grn_item_id, $po_detail_item, 
                        $item_code, $item_description, $qty_recd, $prev_quantity_inv, $this_quantity_inv, 
index d6258d281b5c180c842686f36d5a53a82d7f01d3..e21c1adf02f1b03cd1f2954f6e10a06db5acd38d 100644 (file)
@@ -393,7 +393,6 @@ function display_grn_items_for_selection(&$supp_trans, $k)
                hidden('item_description'.$n, $myrow["description"]);
                hidden('prev_quantity_inv'.$n, $myrow['quantity_inv']);
                hidden('order_price'.$n, $myrow['unit_price']);
-               hidden('std_cost_unit'.$n, $myrow['std_cost_unit']);
                hidden('po_detail_item'.$n, $myrow['po_detail_item']);
                label_cell(get_trans_view_str(ST_PURCHORDER, $myrow["purch_order_no"]), "nowrap align='right'");
             label_cell($myrow["item_code"]);
index b7e30fcefa7904c0e4955518075f4e64099771b2..461c80443496d3c64ca223dd2e8aa77d1c2266b0 100644 (file)
@@ -282,8 +282,7 @@ function commit_item_data($n)
                $_POST['po_detail_item'.$n], $_POST['item_code'.$n],
                $_POST['item_description'.$n], $_POST['qty_recd'.$n],
                $_POST['prev_quantity_inv'.$n], input_num('This_QuantityCredited'.$n),
-               $_POST['order_price'.$n], input_num('ChgPrice'.$n),
-               $_POST['std_cost_unit'.$n], "");
+               $_POST['order_price'.$n], input_num('ChgPrice'.$n));
                reset_tax_input();
        }
 }
index a21d0c9123d846c8f98ab1c8903472e7d6e3bde5..0dc1a77ad90444f74649e2ceefbec5e118c8dd13 100644 (file)
@@ -295,20 +295,10 @@ function commit_item_data($n)
 {
        if (check_item_data($n))
        {
-       if (input_num('this_quantity_inv'.$n) >= ($_POST['qty_recd'.$n] - $_POST['prev_quantity_inv'.$n]))
-       {
-               $complete = true;
-       }
-       else
-       {
-               $complete = false;
-       }
-
                $_SESSION['supp_trans']->add_grn_to_trans($n, $_POST['po_detail_item'.$n],
                        $_POST['item_code'.$n], $_POST['item_description'.$n], $_POST['qty_recd'.$n],
                        $_POST['prev_quantity_inv'.$n], input_num('this_quantity_inv'.$n),
-                       $_POST['order_price'.$n], input_num('ChgPrice'.$n), $complete,
-                       $_POST['std_cost_unit'.$n], "");
+                       $_POST['order_price'.$n], input_num('ChgPrice'.$n));
                reset_tax_input();
        }
 }