NEW Add Transfer Number (#35665)
* NEW Add Transfer Number * NEW Add Transfer Number --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
0c2f6ea9b0
commit
d67db1e685
1 changed files with 11 additions and 2 deletions
|
|
@ -9,6 +9,7 @@
|
|||
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
|
||||
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Lenin Rivas <lenin.rivas777@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -83,6 +84,7 @@ if ($action == 'add' && $user->hasRight('banque', 'transfer')) {
|
|||
$accountfrom = array();
|
||||
$accountto = array();
|
||||
$type = array();
|
||||
$number = array();
|
||||
$tabnum = array();
|
||||
$maxtab = 1;
|
||||
|
||||
|
|
@ -94,6 +96,7 @@ if ($action == 'add' && $user->hasRight('banque', 'transfer')) {
|
|||
$accountfrom[$i] = GETPOSTINT($i.'_account_from');
|
||||
$accountto[$i] = GETPOSTINT($i.'_account_to');
|
||||
$type[$i] = GETPOSTINT($i.'_type');
|
||||
$number[$i] = GETPOST($i.'_num_chq', 'alpha');
|
||||
|
||||
$tabnum[$i] = 0;
|
||||
if (!empty($label[$i]) || !($amount[$i] <= 0) || !($accountfrom[$i] < 0) || !($accountto[$i] < 0)) {
|
||||
|
|
@ -173,13 +176,13 @@ if ($action == 'add' && $user->hasRight('banque', 'transfer')) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], (float) price2num(-1 * (float) $amount[$n]), '', 0, $user);
|
||||
$bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], (float) price2num(-1 * (float) $amount[$n]), $number[$n], 0, $user);
|
||||
}
|
||||
if (!($bank_line_id_from > 0)) {
|
||||
$error++;
|
||||
}
|
||||
if (!$error) {
|
||||
$bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], (float) $amountto[$n], '', 0, $user);
|
||||
$bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], (float) $amountto[$n], $number[$n], 0, $user);
|
||||
}
|
||||
if (!($bank_line_id_to > 0)) {
|
||||
$error++;
|
||||
|
|
@ -303,6 +306,7 @@ print '<th>'.$langs->trans("TransferFrom").'</th>';
|
|||
print '<th>'.$langs->trans("TransferTo").'</th>';
|
||||
print '<th>'.$langs->trans("Type").'</th>';
|
||||
print '<th>'.$langs->trans("Date").'</th>';
|
||||
print '<th>'.$langs->trans("Number").'</th>';
|
||||
print '<th>'.$langs->trans("Description").'</th>';
|
||||
print '<th class="right">'.$langs->trans("Amount").'</th>';
|
||||
print '<td class="hideobject multicurrency right">'.$langs->trans("AmountToOthercurrency").'</td>';
|
||||
|
|
@ -312,11 +316,13 @@ for ($i = 1 ; $i < $MAXLINESFORTRANSFERT; $i++) {
|
|||
$label = '';
|
||||
$amount = '';
|
||||
$amountto = '';
|
||||
$number = '';
|
||||
|
||||
if ($error) {
|
||||
$label = GETPOST($i.'_label', 'alpha');
|
||||
$amount = GETPOST($i.'_amount', 'alpha');
|
||||
$amountto = GETPOST($i.'_amountto', 'alpha');
|
||||
$number = GETPOST($i.'_num_chq', 'alpha');
|
||||
}
|
||||
|
||||
if ($i == 1) {
|
||||
|
|
@ -348,6 +354,9 @@ for ($i = 1 ; $i < $MAXLINESFORTRANSFERT; $i++) {
|
|||
print $form->selectDate((!empty($dateo[$i]) ? $dateo[$i] : ''), $i.'_', 0, 0, 0, 'add');
|
||||
print "</td>\n";
|
||||
|
||||
// Number
|
||||
print '<td><input name="'.$i.'_num_chq" class="flat quatrevingtpercent selectjs" type="text" value="'.dol_escape_htmltag($number).'"></td>';
|
||||
|
||||
// Description
|
||||
print '<td><input name="'.$i.'_label" class="flat quatrevingtpercent selectjs" type="text" value="'.dol_escape_htmltag($label).'"></td>';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue