$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']));
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();
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."));
}
//-------------------------------------------------------------------------------------------------
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']))
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)
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']))
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)),
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("");
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'];
}
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,
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
{
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');
}
}
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,"
function due_date($row)
{
- return $row["type"] == 10 ? $row["due_date"] : '';
+ return $row["type"] == ST_SALESINVOICE ? $row["due_date"] : '';
}
function fmt_balance($row)