$Ajax->activate('_ex_rate');
}
-if (list_updated('supplier_id')) {
- $_POST['amount'] = price_format(0);
- $_SESSION['alloc']->person_id = get_post('supplier_id');
- $Ajax->activate('amount');
-} elseif (list_updated('bank_account'))
- $Ajax->activate('alloc_tbl');
-
//----------------------------------------------------------------------------------------
if (!isset($_POST['bank_account'])) { // first page call
$_SESSION['alloc'] = new allocation(ST_SUPPAYMENT, 0, get_post('supplier_id'));
if (isset($_GET['PInvoice'])) {
+ $supp = isset($_POST['supplier_id']) ? $_POST['supplier_id'] : null;
// get date and supplier
- $inv = get_supp_trans($_GET['PInvoice'], $_GET['trans_type']);
+ $inv = get_supp_trans($_GET['PInvoice'], $_GET['trans_type'], $supp);
if ($inv) {
$_SESSION['alloc']->person_id = $_POST['supplier_id'] = $inv['supplier_id'];
$_SESSION['alloc']->read();
display_note(get_gl_view_str(ST_SUPPAYMENT, $payment_id, _("View the GL &Journal Entries for this Payment")), 0, 1);
submenu_option(_("Enter another supplier &payment"), "/purchasing/supplier_payment.php?supplier_id=".$_POST['supplier_id']);
+
+ submenu_option(_("Enter &Supplier Invoice"), "/purchasing/supplier_invoice.php?New=1");
+ submenu_option(_("Enter direct &Invoice"), "/purchasing/po_entry_items.php?NewInvoice=Yes");
+
submenu_option(_("Enter Other &Payment"), "/gl/gl_bank.php?NewPayment=Yes");
submenu_option(_("Enter &Customer Payment"), "/sales/customer_payments.php");
submenu_option(_("Enter Other &Deposit"), "/gl/gl_bank.php?NewDeposit=Yes");
{
$payment_id = write_supp_payment(0, $_POST['supplier_id'], $_POST['bank_account'],
$_POST['DatePaid'], $_POST['ref'], input_num('amount'), input_num('discount'), $_POST['memo_'],
- input_num('charge'), input_num('bank_amount', input_num('amount')));
+ input_num('charge'), input_num('bank_amount', input_num('amount')), $_POST['dimension_id'], $_POST['dimension2_id']);
new_doc_date($_POST['DatePaid']);
$_SESSION['alloc']->trans_no = $payment_id;
supplier_list_row(_("Payment To:"), 'supplier_id', null, false, true);
+ if (list_updated('supplier_id')) {
+ $_POST['amount'] = price_format(0);
+ $_SESSION['alloc']->person_id = get_post('supplier_id');
+ $Ajax->activate('amount');
+ } elseif (list_updated('bank_account'))
+ $Ajax->activate('alloc_tbl');
+
if (list_updated('supplier_id') || list_updated('bank_account')) {
$_SESSION['alloc']->read();
$_POST['memo_'] = $_POST['amount'] = '';
amount_row(_("Bank Charge:"), 'charge', null, '', $bank_currency);
+ $row = get_supplier($_POST['supplier_id']);
+ $_POST['dimension_id'] = @$row['dimension_id'];
+ $_POST['dimension2_id'] = @$row['dimension2_id'];
+ $dim = get_company_pref('use_dimension');
+ if ($dim > 0)
+ dimensions_list_row(_("Dimension").":", 'dimension_id',
+ null, true, ' ', false, 1, false);
+ else
+ hidden('dimension_id', 0);
+ if ($dim > 1)
+ dimensions_list_row(_("Dimension")." 2:", 'dimension2_id',
+ null, true, ' ', false, 2, false);
+ else
+ hidden('dimension2_id', 0);
end_outer_table(1);