Fixed a couple of refrences to transaction type number instead of type name.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 11 Nov 2015 21:46:51 +0000 (22:46 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 11 Nov 2015 21:49:51 +0000 (22:49 +0100)
manufacturing/includes/manufacturing_ui.inc
manufacturing/view/wo_issue_view.php
manufacturing/work_order_add_finished.php
purchasing/inquiry/po_search.php
purchasing/inquiry/po_search_completed.php
sales/create_recurrent_invoices.php
sales/customer_invoice.php
sales/includes/db/customers_db.inc
sales/includes/db/sales_order_db.inc
sales/inquiry/customer_allocation_inquiry.php

index 67db356454ab158ee59d532bd69b8ae115431c58..2d55477ba767fb01651173eb6e5ea9ac930b1359 100644 (file)
@@ -168,7 +168,7 @@ function display_wo_productions($woid)
 
                        $total_qty += $myrow['quantity'];
 
-               label_cell(get_trans_view_str(29, $myrow["id"]));
+               label_cell(get_trans_view_str(ST_MANURECEIVE, $myrow["id"]));
                        label_cell($myrow['reference']);
                        label_cell(sql2date($myrow["date_"]));
                        qty_cell($myrow['quantity'], false, get_qty_dec($myrow['reference']));
@@ -208,7 +208,7 @@ function display_wo_issues($woid)
 
                        alt_table_row_color($k);
 
-               label_cell(get_trans_view_str(28, $myrow["issue_no"]));
+               label_cell(get_trans_view_str(ST_MANUISSUE, $myrow["issue_no"]));
                        label_cell($myrow['reference']);
                        label_cell(sql2date($myrow["issue_date"]));
                        end_row();
index 799a2b47ed5170a22b7460860beb0ea9686e3e73..0738af37be4d8aaccd22de5b35f4e36fadc2f298 100644 (file)
@@ -53,11 +53,11 @@ function display_wo_issue($issue_no)
        label_cell(sql2date($myrow["issue_date"]));
        end_row();
 
-    comments_display_row(28, $issue_no);
+    comments_display_row(ST_MANUISSUE, $issue_no);
 
        end_table(1);
 
-       is_voided_display(28, $issue_no, _("This issue has been voided."));
+       is_voided_display(ST_MANUISSUE, $issue_no, _("This issue has been voided."));
 }
 
 //-------------------------------------------------------------------------------------------------
index cec7ce78cdb067ecfa034f732a1b216b99af242e..757f304ce4128df7f2b5befe80179412ad462adf 100644 (file)
@@ -182,7 +182,7 @@ if (!isset($_POST['quantity']) || $_POST['quantity'] == '')
 start_table(TABLESTYLE2);
 br();
 
-ref_row(_("Reference:"), 'ref', '', $Refs->get_next(29, null, get_post('date_')), false, ST_MANUISSUE);
+ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_MANURECEIVE, null, get_post('date_')), false, ST_MANURECEIVE);
 date_row(_("Date:"), 'date_');
 
 if (!isset($_POST['ProductionType']))
index d660038a3a1dbe4c3b5da1b4d213f879ad6f5d34..9e77d7104d038d8379f93ec974a29f5febaa30cb 100644 (file)
@@ -91,7 +91,7 @@ function edit_link($row)
 
 function prt_link($row)
 {
-       return print_document_link($row['order_no'], _("Print"), true, 18, ICON_PRINT);
+       return print_document_link($row['order_no'], _("Print"), true, ST_PURCHORDER, ICON_PRINT);
 }
 
 function receive_link($row) 
index 5b1ac45caa9b1f7c1063df2a2de6f353fd31a578..e173bd3454e4ec9777ffd33e9d3227e0d5a0e8d6 100644 (file)
@@ -40,7 +40,7 @@ function edit_link($row)
 
 function prt_link($row)
 {
-       return print_document_link($row['order_no'], _("Print"), true, 18, ICON_PRINT);
+       return print_document_link($row['order_no'], _("Print"), true, ST_PURCHORDER, ICON_PRINT);
 }
 
 if (isset($_GET['order_number']))
index 59ac59b52646caeed9403eef0a9d73e026d9de59..06c045ec3fbde8b1976d7fb05284d42cdbc25cf6 100644 (file)
@@ -177,7 +177,7 @@ if ($id != -1)
                start_form();
                start_table(TABLESTYLE, "width=50%");
                label_row(_('Description:'), $myrow["description"]);
-               label_row(_('Template:'), get_customer_trans_view_str(30, $myrow["order_no"]));
+               label_row(_('Template:'), get_customer_trans_view_str(ST_SALESORDER, $myrow["order_no"]));
                label_row(_('Number of invoices:'), $count);
                date_row(_('Invoice date:'), 'trans_date');
                text_row(_('Invoice notice:'), 'memo', sprintf(_("Recurrent Invoice covers period %s - %s."), $from, add_days($to, -1)),
@@ -215,7 +215,7 @@ while ($myrow = db_fetch($result))
                alt_table_row_color($k);
 
        label_cell($myrow["description"]);
-       label_cell(get_customer_trans_view_str(30, $myrow["order_no"]));
+       label_cell(get_customer_trans_view_str(ST_SALESORDER, $myrow["order_no"]));
        if ($myrow["debtor_no"] == 0)
        {
                label_cell("");
index 9ec89b569eede7069de04c40653e9714a729ca54..6f38b64d718b9ef7f0472af845839c0287a8738f 100644 (file)
@@ -234,7 +234,7 @@ function set_delivery_shipping_sum($delivery_notes)
     
     foreach($delivery_notes as $delivery_num) 
     {
-        $myrow = get_customer_trans($delivery_num, 13);
+        $myrow = get_customer_trans($delivery_num, ST_CUSTDELIVERY);
 
         $shipping += $myrow['ov_freight'];
     }
index 74456aad153ac1193c0838db67ac76dcd5633a46..7e2eb891c8248a952981641a54acb095aa1daf8c 100644 (file)
@@ -76,7 +76,7 @@ function get_customer_details($customer_id, $to=null, $all=true)
     else               
        $value = "IFNULL($sign*(trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount - 
                trans.alloc),0)";
-       $due = "IF (trans.type=10, trans.due_date, trans.tran_date)";
+       $due = "IF (trans.type=".ST_SALESINVOICE.", trans.due_date, trans.tran_date)";
     $sql = "SELECT debtor.name, debtor.curr_code, terms.terms, debtor.credit_limit,
                        credit_status.dissallow_invoices, credit_status.reason_description,
                                Sum(IFNULL($value,0)) AS Balance,
@@ -84,7 +84,7 @@ function get_customer_details($customer_id, $to=null, $all=true)
                                Sum(IF ((TO_DAYS('$todate') - TO_DAYS($due)) > $past1,$value,0)) AS Overdue1,
                                Sum(IF ((TO_DAYS('$todate') - TO_DAYS($due)) > $past2,$value,0)) AS Overdue2
                        FROM ".TB_PREF."debtors_master debtor
-                                LEFT JOIN ".TB_PREF."debtor_trans trans ON trans.tran_date <= '$todate' AND debtor.debtor_no = trans.debtor_no AND trans.type <> 13,"
+                                LEFT JOIN ".TB_PREF."debtor_trans trans ON trans.tran_date <= '$todate' AND debtor.debtor_no = trans.debtor_no AND trans.type <> ".ST_CUSTDELIVERY.","
                                 .TB_PREF."payment_terms terms,"
                                 .TB_PREF."credit_status credit_status
                        WHERE
index b41107b88b9e95076738d502109a36db0b841ef0..95f2ead3b740f030f28a842e492c709317ac33eb 100644 (file)
@@ -109,7 +109,7 @@ function update_sales_order_version($order)
 {
   foreach ($order as $so_num => $so_ver) {
   $sql= 'UPDATE '.TB_PREF.'sales_orders SET version=version+1 WHERE order_no='. db_escape($so_num).
-       ' AND version='.$so_ver . " AND trans_type=30";
+       ' AND version='.$so_ver . " AND trans_type=".ST_SALESORDER;
   db_query($sql, 'Concurrent editing conflict while sales order update');
   }
 }
@@ -418,7 +418,7 @@ function get_customer_to_order($customer_id) {
                  cust.discount,
                  cust.payment_terms,
                  cust.pymt_discount,
-                 cust.credit_limit - Sum(IFNULL(IF(trans.type=11 OR trans.type=12 OR trans.type=2,
+                 cust.credit_limit - Sum(IFNULL(IF(trans.type IN(".implode(',', array(ST_CUSTCREDIT, ST_CUSTPAYMENT, ST_BANKDEPOSIT))."),
                        -1, 1) * (ov_amount + ov_gst + ov_freight + ov_freight_tax + ov_discount),0)) as cur_credit
                FROM ".TB_PREF."debtors_master cust
                  LEFT JOIN ".TB_PREF."debtor_trans trans ON trans.type!=".ST_CUSTDELIVERY." AND trans.debtor_no = cust.debtor_no,"
index ab75d23767f914807f353a57303c75d92ae72469..e3aa9567082a2e45dea005cd09e260808ee3a04f 100644 (file)
@@ -82,7 +82,7 @@ function view_link($trans)
 
 function due_date($row)
 {
-       return $row["type"] == 10 ? $row["due_date"] : '';
+       return $row["type"] == ST_SALESINVOICE ? $row["due_date"] : '';
 }
 
 function fmt_balance($row)