Payment_terms table normalization.
[fa-stable.git] / purchasing / includes / ui / invoice_ui.inc
index 8299aa0e1ab7a2191db506816bb7c3dd2f507f23..1b7fb663778ad1142bd6ed7003880e978d7e75f4 100644 (file)
@@ -386,12 +386,6 @@ function display_grn_items_for_selection(&$supp_trans, $k)
 
                        $n = $myrow["id"];
                        label_cell(get_trans_view_str(ST_SUPPRECEIVE, $myrow["grn_batch_id"]), "nowrap align='right'");
-                       hidden('qty_recd'.$n, $myrow["qty_recd"]);
-               hidden('item_code'.$n, $myrow["item_code"]);
-               hidden('item_description'.$n, $myrow["description"]);
-               hidden('prev_quantity_inv'.$n, $myrow['quantity_inv']);
-               hidden('order_price'.$n, $myrow['unit_price']);
-               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"]);
             label_cell($myrow["description"]);
@@ -589,14 +583,14 @@ function get_duedate_from_terms(&$trans)
        {
                $date = Today();
        }
-       if ($trans->terms['day_in_following_month'])
+       if ($trans->terms['type'] == PTT_FOLLOWING)
        { /*Its a day in the following month when due */
                $trans->due_date =
-                       add_days(end_month($date), $trans->terms["day_in_following_month"]);
+                       add_days(end_month($date), $trans->terms["days"]);
        }
        else
        { /*Use the Days Before Due to add to the invoice date */
-               $trans->due_date = add_days($date, $trans->terms["days_before_due"]);
+               $trans->due_date = add_days($date, $trans->terms["days"]);
        }
 }