function prt_link($row)
{
- if ($row['type'] == ST_SUPPAYMENT || $row['type'] == ST_BANKPAYMENT)
- return print_document_link($row['trans_no'], _("Print Remittance"), true, $row['type'], ICON_PRINT);
+ if ($row['type'] == ST_SUPPAYMENT || $row['type'] == ST_BANKPAYMENT || $row['type'] == ST_SUPPCREDIT)
+ return print_document_link($row['trans_no']."-".$row['type'], _("Print Remittance"), true, ST_SUPPAYMENT, ICON_PRINT);
}
function check_overdue($row)
display_notification_centered( _("Payment has been sucessfully entered"));
- submenu_print(_("&Print This Remittance"), ST_SUPPAYMENT, $payment_id, 'prtopt');
- submenu_print(_("&Email This Remittance"), ST_SUPPAYMENT, $payment_id, null, 1);
+ submenu_print(_("&Print This Remittance"), ST_SUPPAYMENT, $payment_id."-".ST_SUPPAYMENT, 'prtopt');
+ submenu_print(_("&Email This Remittance"), ST_SUPPAYMENT, $payment_id."-".ST_SUPPAYMENT, null, 1);
display_note(get_gl_view_str(22, $payment_id, _("View the GL &Journal Entries for this Payment")));
if (isset($header2type) || isset($linetype))
{
$doc_Invoice_no = ($doctype==ST_CUSTDELIVERY ? _("Delivery Note No.") :
- ($doctype == ST_SUPPAYMENT ? _("Payment No.") :
+ ($doctype == ST_SUPPAYMENT ? _("Remittance No.") :
(($doctype==ST_SALESQUOTE || $doctype==ST_PURCHORDER || $doctype==ST_SALESORDER) ? _("Order no.") :
($doctype==ST_SALESINVOICE ? _("Invoice No.") : ($doctype==ST_WORKORDER ? _("Word Order No") : _("Credit No."))))));
$doc_Delivery_no = _("Delivery Note No.");
if (isset($header2type) || isset($linetype))
{
$doc_Invoice_no = ($doctype==ST_CUSTDELIVERY ? "Delivery Note No." :
- ($doctype == ST_SUPPAYMENT ? "Payment No." :
+ ($doctype == ST_SUPPAYMENT ? "Remittance No." :
(($doctype == ST_SALESQUOTE || $doctype==ST_PURCHORDER || $doctype==ST_SALESORDER) ? "Order no." :
($doctype==ST_SALESINVOICE ? "Invoice No." : ($doctype == ST_WORKORDER ? "Work Order No" : "Credit No.")))));
$doc_Delivery_no = "Delivery Note No.";
'PARAM_4' => '');
break;
case ST_SUPPAYMENT :
- case ST_BANKPAYMENT :
$rep = 210;
// from, to, currency, bank acc, email, comments
$ar = array(
case 'REMITTANCE':
$BP = _("BP");
$SP = _("SP");
+ $CN = _("CN");
$ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
$sql = "SELECT concat(".TB_PREF."supp_trans.trans_no, '-',
- ".TB_PREF."supp_trans.type) AS TNO, concat(".TB_PREF."supp_trans.$ref, if (type=".ST_BANKPAYMENT.", ' $BP ', ' $SP '), ".TB_PREF."suppliers.supp_name) as IName
- FROM ".TB_PREF."suppliers, ".TB_PREF."supp_trans WHERE (type=".ST_BANKPAYMENT." OR type=".ST_SUPPAYMENT.") AND ".TB_PREF."suppliers.supplier_id=".TB_PREF."supp_trans.supplier_id ORDER BY ".TB_PREF."supp_trans.trans_no DESC";
+ ".TB_PREF."supp_trans.type) AS TNO, concat(".TB_PREF."supp_trans.$ref, if (type=".ST_BANKPAYMENT.", ' $BP ', if (type=".ST_SUPPAYMENT.", ' $SP ', ' $CN ')), ".TB_PREF."suppliers.supp_name) as IName
+ FROM ".TB_PREF."suppliers, ".TB_PREF."supp_trans WHERE (type=".ST_BANKPAYMENT." OR type=".ST_SUPPAYMENT." OR type=".ST_SUPPCREDIT.") AND ".TB_PREF."suppliers.supplier_id=".TB_PREF."supp_trans.supplier_id ORDER BY ".TB_PREF."supp_trans.trans_no DESC";
return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
case 'ITEMS':
for ($i = $fno[0]; $i <= $tno[0]; $i++)
{
- for ($j = ST_BANKPAYMENT; $j <= ST_SUPPAYMENT; $j = ($j == ST_BANKPAYMENT ? ST_SUPPAYMENT : 999))
+ if ($fno[0] == $tno[0])
+ $types = array($fno[1]);
+ else
+ $types = array(ST_BANKPAYMENT, ST_SUPPAYMENT, ST_SUPPCREDIT);
+ foreach ($types as $j)
+ //for ($j = ST_BANKPAYMENT; $j <= ST_SUPPAYMENT; $j = ($j == ST_BANKPAYMENT ? ST_SUPPAYMENT : 999))
+ //for ($j = $ft; $j <= $tt; $j = ($j == ST_BANKPAYMENT ? ST_SUPPAYMENT : 999))
{
$myrow = get_remittance($j, $i);
if (!$myrow)