X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_payments.php;h=b9f945f8d34bdae28866d33714059c6cb2fb4c0c;hb=9242b29b0b78487a0c5b5c9a17a7caa80aeec296;hp=7612a2b4b68cf66bb30bc3432644cdc6b431ec9b;hpb=15637f687c7fc48fde54904fe54c0386b7e90859;p=fa-stable.git diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 7612a2b4..b9f945f8 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -49,7 +49,8 @@ if (!isset($_POST['bank_account'])) { // first page call if (isset($_GET['SInvoice'])) { // get date and supplier $type = !isset($_GET['Type']) ? ST_SALESINVOICE : $_GET['Type']; - $inv = get_customer_trans($_GET['SInvoice'], $type); + $cust = !isset($_GET['customer_id']) ? null : $_GET['customer_id']; + $inv = get_customer_trans($_GET['SInvoice'], $type, $cust); $dflt_act = get_default_bank_account($inv['curr_code']); $_POST['bank_account'] = $dflt_act['id']; if ($inv) { @@ -106,14 +107,14 @@ if (isset($_GET['AddedID'])) { submenu_print(_("&Email This Receipt"), ST_CUSTPAYMENT, $payment_no."-".ST_CUSTPAYMENT, null, 1); submenu_view(_("&View this Customer Payment"), ST_CUSTPAYMENT, $payment_no); + display_note(get_gl_view_str(ST_CUSTPAYMENT, $payment_no, _("&View the GL Journal Entries for this Customer Payment")), 0, 1); submenu_option(_("Enter Another &Customer Payment"), "/sales/customer_payments.php"); submenu_option(_("Enter Other &Deposit"), "/gl/gl_bank.php?NewDeposit=Yes"); submenu_option(_("Enter Payment to &Supplier"), "/purchasing/supplier_payment.php"); submenu_option(_("Enter Other &Payment"), "/gl/gl_bank.php?NewPayment=Yes"); submenu_option(_("Bank Account &Transfer"), "/gl/bank_transfer.php"); - - display_note(get_gl_view_str(ST_CUSTPAYMENT, $payment_no, _("&View the GL Journal Entries for this Customer Payment"))); + submenu_option(_("Add an Attachment"), "/admin/attachments.php?filterType=".ST_CUSTPAYMENT."&trans_no=$payment_no"); display_footer_exit(); } @@ -260,8 +261,8 @@ function read_customer_data() $myrow = get_customer_habit($_POST['customer_id']); - $_POST['HoldAccount'] = $myrow["dissallow_invoices"]; - $_POST['pymt_discount'] = $myrow["pymt_discount"]; + $_POST['HoldAccount'] = !$myrow ? false : $myrow["dissallow_invoices"]; + $_POST['pymt_discount'] = !$myrow ? 0 : $myrow["pymt_discount"]; // To support Edit feature // If page is called first time and New entry fetch the nex reference number if (!$_SESSION['alloc']->trans_no && !isset($_POST['charge'])) @@ -367,8 +368,8 @@ if ($cust_currency != $bank_currency) amount_row(_("Bank Charge:"), 'charge', null, '', $bank_currency); $row = get_customer($_POST['customer_id']); -$_POST['dimension_id'] = $row['dimension_id']; -$_POST['dimension2_id'] = $row['dimension2_id']; +$_POST['dimension_id'] = !$row ? 0 : $row['dimension_id']; +$_POST['dimension2_id'] = !$row ? 0 : $row['dimension2_id']; $dim = get_company_pref('use_dimension'); if ($dim > 0) dimensions_list_row(_("Dimension").":", 'dimension_id',