From 832403f85f84fc91734eca085a32db6a509ffd3d Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 11 Nov 2015 22:46:51 +0100 Subject: [PATCH] Fixed a couple of refrences to transaction type number instead of type name. --- manufacturing/includes/manufacturing_ui.inc | 4 ++-- manufacturing/view/wo_issue_view.php | 4 ++-- manufacturing/work_order_add_finished.php | 2 +- purchasing/inquiry/po_search.php | 2 +- purchasing/inquiry/po_search_completed.php | 2 +- sales/create_recurrent_invoices.php | 4 ++-- sales/customer_invoice.php | 2 +- sales/includes/db/customers_db.inc | 4 ++-- sales/includes/db/sales_order_db.inc | 4 ++-- sales/inquiry/customer_allocation_inquiry.php | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/manufacturing/includes/manufacturing_ui.inc b/manufacturing/includes/manufacturing_ui.inc index 67db3564..2d55477b 100644 --- a/manufacturing/includes/manufacturing_ui.inc +++ b/manufacturing/includes/manufacturing_ui.inc @@ -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(); diff --git a/manufacturing/view/wo_issue_view.php b/manufacturing/view/wo_issue_view.php index 799a2b47..0738af37 100644 --- a/manufacturing/view/wo_issue_view.php +++ b/manufacturing/view/wo_issue_view.php @@ -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.")); } //------------------------------------------------------------------------------------------------- diff --git a/manufacturing/work_order_add_finished.php b/manufacturing/work_order_add_finished.php index cec7ce78..757f304c 100644 --- a/manufacturing/work_order_add_finished.php +++ b/manufacturing/work_order_add_finished.php @@ -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'])) diff --git a/purchasing/inquiry/po_search.php b/purchasing/inquiry/po_search.php index d660038a..9e77d710 100644 --- a/purchasing/inquiry/po_search.php +++ b/purchasing/inquiry/po_search.php @@ -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) diff --git a/purchasing/inquiry/po_search_completed.php b/purchasing/inquiry/po_search_completed.php index 5b1ac45c..e173bd34 100644 --- a/purchasing/inquiry/po_search_completed.php +++ b/purchasing/inquiry/po_search_completed.php @@ -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'])) diff --git a/sales/create_recurrent_invoices.php b/sales/create_recurrent_invoices.php index 59ac59b5..06c045ec 100644 --- a/sales/create_recurrent_invoices.php +++ b/sales/create_recurrent_invoices.php @@ -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(""); diff --git a/sales/customer_invoice.php b/sales/customer_invoice.php index 9ec89b56..6f38b64d 100644 --- a/sales/customer_invoice.php +++ b/sales/customer_invoice.php @@ -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']; } diff --git a/sales/includes/db/customers_db.inc b/sales/includes/db/customers_db.inc index 74456aad..7e2eb891 100644 --- a/sales/includes/db/customers_db.inc +++ b/sales/includes/db/customers_db.inc @@ -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 diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index b41107b8..95f2ead3 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -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," diff --git a/sales/inquiry/customer_allocation_inquiry.php b/sales/inquiry/customer_allocation_inquiry.php index ab75d237..e3aa9567 100644 --- a/sales/inquiry/customer_allocation_inquiry.php +++ b/sales/inquiry/customer_allocation_inquiry.php @@ -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) -- 2.30.2