$email = $_POST['PARAM_3'];
$pay_service = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
- $orientation = $_POST['PARAM_6'];
+ $customer = $_POST['PARAM_6'];
+ $orientation = $_POST['PARAM_7'];
if (!$from || !$to) return;
continue;
$sign = 1;
$myrow = get_customer_trans($i, ST_SALESINVOICE);
+
+ if($customer && $myrow['debtor_no'] != $customer) {
+ continue;
+ }
$baccount = get_default_bank_account($myrow['curr_code']);
$params['bankaccount'] = $baccount['id'];
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
- $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], false);
+ $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], true);
$baccount['payment_service'] = $pay_service;
$rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_SALESINVOICE, $contacts);
$rep->NewPage();
$rep->End();
}
-?>
\ No newline at end of file
+?>