NEW Option to manage deposit slips for more payment modes (not only
CHQ). Option BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT.
This commit is contained in:
parent
16fc7d512b
commit
2f5c841f4a
@ -90,6 +90,10 @@ $usercandelete = $user->rights->banque->cheque;
|
||||
|
||||
$permissiontodelete = $user->rights->banque->cheque;
|
||||
|
||||
// List of payment mode to support
|
||||
// Example: BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ','TRA'
|
||||
$arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -139,6 +143,10 @@ if ($action == 'setref' && $user->rights->banque->cheque) {
|
||||
|
||||
if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->banque->cheque) {
|
||||
if (GETPOSTISARRAY('toRemise')) {
|
||||
$object->type = $type;
|
||||
$arrayofid = GETPOST('toRemise', 'array:int');
|
||||
var_dump($arrayofid);
|
||||
|
||||
$result = $object->create($user, GETPOST("accountid", "int"), 0, GETPOST('toRemise', 'array:int'));
|
||||
if ($result > 0) {
|
||||
if ($object->statut == 1) { // If statut is validated, we build doc
|
||||
@ -292,10 +300,14 @@ if (GETPOST('removefilter')) {
|
||||
$filteraccountid = 0;
|
||||
}
|
||||
|
||||
if ($type == 'CHQ') {
|
||||
$title = $langs->trans("Cheques");
|
||||
if ($action == 'new') {
|
||||
$title = $langs->trans("NewChequeDeposit");
|
||||
} else {
|
||||
$title = $type;
|
||||
if ($type == 'CHQ') {
|
||||
$title = $langs->trans("Cheques");
|
||||
} else {
|
||||
$title = ($langs->trans("PaymentType".$type) != "PaymentType".$type ? $langs->trans("PaymentType".$type) : $langs->trans("PaymentMode").' '.$type);
|
||||
}
|
||||
}
|
||||
|
||||
$helpurl = "";
|
||||
@ -368,27 +380,40 @@ if ($action == 'new') {
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$labeltype = ($langs->trans("PaymentType".$type) != "PaymentType".$type ? $langs->trans("PaymentType".$type) : $type);
|
||||
if ($type == 'CHQ') {
|
||||
print '<span class="opacitymedium">'.$langs->trans("SelectChequeTransactionAndGenerate").'</span><br><br>'."\n";
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("SelectPaymentTransactionAndGenerate", $type).'</span><br><br>'."\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("SelectPaymentTransactionAndGenerate", $labeltype).'</span><br><br>'."\n";
|
||||
}
|
||||
|
||||
print '<form class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="new">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
//print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>';
|
||||
// Filter
|
||||
|
||||
if (count($arrayofpaymentmodetomanage) > 1) {
|
||||
$arrayoflabels = array();
|
||||
foreach ($arrayofpaymentmodetomanage as $key => $val) {
|
||||
$labelval = ($langs->trans("PaymentType".$val) != "PaymentType".$val ? $langs->trans("PaymentType".$val) : $val);
|
||||
$arrayoflabels[$key] = $labelval;
|
||||
}
|
||||
// Type
|
||||
print '<tr><td>';
|
||||
print $langs->trans("Type");
|
||||
print '</td><td>';
|
||||
print $form->selectarray('type', $arrayoflabels, $type);
|
||||
print '</td></tr>';
|
||||
}
|
||||
// Date
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
if ($type == 'CHQ') {
|
||||
print $langs->trans("DateChequeReceived");
|
||||
} else {
|
||||
print $langs->trans("DatePaymentForDeposit");
|
||||
print $langs->trans("DatePaymentReceived");
|
||||
}
|
||||
print '</td><td>';
|
||||
// filter by dates from / to
|
||||
@ -462,7 +487,7 @@ if ($action == 'new') {
|
||||
if ($type == 'CHQ') {
|
||||
print '<div class="opacitymedium">'.$langs->trans("NoWaitingChecks").'</div><br>';
|
||||
} else {
|
||||
print '<div class="opacitymedium">'.$langs->trans("NoWaitingPaymentForDeposit", $type).'</div><br>';
|
||||
print '<div class="opacitymedium">'.$langs->trans("NoWaitingPaymentForDeposit", $labeltype).'</div><br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -485,6 +510,7 @@ if ($action == 'new') {
|
||||
';
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="create">';
|
||||
@ -574,7 +600,13 @@ if ($action == 'new') {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
$morehtmlleft = '';
|
||||
$moreghtmlright = '';
|
||||
|
||||
$labelval = ($langs->trans("PaymentType".$object->type) != "PaymentType".$object->type ? $langs->trans("PaymentType".$object->type) : $object->type);
|
||||
$morehtmlref = '<br><div class="refidno">'.$langs->trans("Type").' : '.$labelval.'</div>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, $morehtmlleft, '', 0, $moreghtmlright);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
@ -665,7 +697,7 @@ if ($action == 'new') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (b.fk_account = ba.rowid)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid";
|
||||
$sql .= " WHERE ba.entity IN (".getEntity('bank_account').")";
|
||||
$sql .= " AND b.fk_type= '".$db->escape($type)."'";
|
||||
$sql .= " AND b.fk_type= '".$db->escape($object->type)."'";
|
||||
$sql .= " AND b.fk_bordereau = ".((int) $object->id);
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@ -739,9 +771,9 @@ if ($action == 'new') {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
print '<td colspan="8" class="opacitymedium">';
|
||||
print '<td colspan="9"><span class="opacitymedium">';
|
||||
print $langs->trans("None");
|
||||
print '</td>';
|
||||
print '</span></td>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -215,7 +215,7 @@ class RemiseCheque extends CommonObject
|
||||
if ($this->id > 0 && $this->errno == 0) {
|
||||
$sql = "SELECT b.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql .= " WHERE b.fk_type = 'CHQ'";
|
||||
$sql .= " WHERE b.fk_type = '".$this->db->escape($this->type)."'";
|
||||
$sql .= " AND b.amount > 0";
|
||||
$sql .= " AND b.fk_bordereau = 0";
|
||||
$sql .= " AND b.fk_account = ".((int) $account_id);
|
||||
|
||||
@ -43,6 +43,10 @@ $result = restrictedArea($user, 'banque', '', '');
|
||||
|
||||
$usercancreate = $user->hasRight('banque', 'cheque');
|
||||
|
||||
// List of payment mode to support
|
||||
// Example: BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ','TRA'
|
||||
$arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -55,27 +59,27 @@ $usercancreate = $user->hasRight('banque', 'cheque');
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("ChequesArea"));
|
||||
if (getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ') == 'CHQ') {
|
||||
$title = $langs->trans("ChequesArea");
|
||||
} else {
|
||||
$title = $langs->trans("DocumentsDepositArea");
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
$newcardbutton = '';
|
||||
if ($usercancreate) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewDeposit'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new');
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("ChequesArea"), $newcardbutton, $checkdepositstatic->picto);
|
||||
print load_fiche_titre($title, $newcardbutton, $checkdepositstatic->picto);
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// List of payment mode to support
|
||||
// Example: BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ','TRA'
|
||||
$conf->global->BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ,TRA';
|
||||
$arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ'));
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n";
|
||||
print '<th colspan="2">'.$langs->trans("DocumentsForDeposit")."</th>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($arrayofpaymentmodetomanage as $val) {
|
||||
@ -97,9 +101,9 @@ foreach ($arrayofpaymentmodetomanage as $val) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
if ($val == 'CHQ') {
|
||||
print $langs->trans("BankChecksToReceipt");
|
||||
print $langs->trans("BankChecks");
|
||||
} else {
|
||||
print $val;
|
||||
print ($langs->trans("PaymentType".$val) != "PaymentType".$val ? $langs->trans("PaymentType".$val) : $langs->trans("PaymentMode").' '.$val);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
@ -139,7 +143,8 @@ foreach ($arrayofpaymentmodetomanage as $val) {
|
||||
if ($val == 'CHQ') {
|
||||
print $langs->trans("LastCheckReceiptShort", $max);
|
||||
} else {
|
||||
print $langs->trans("LastPaymentForDepositShort", $max, $val);
|
||||
$labelpaymentmode = ($langs->trans("PaymentType".$val) != "PaymentType".$val ? $langs->trans("PaymentType".$val) : $val);
|
||||
print $langs->trans("LastPaymentForDepositShort", $max, $labelpaymentmode);
|
||||
}
|
||||
print '</th>';
|
||||
print '<th>'.$langs->trans("Date")."</th>";
|
||||
|
||||
@ -73,6 +73,16 @@ $formother = new FormOther($db);
|
||||
$checkdepositstatic = new RemiseCheque($db);
|
||||
$accountstatic = new Account($db);
|
||||
|
||||
// List of payment mode to support
|
||||
// Example: BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ','TRA'
|
||||
$arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ'));
|
||||
|
||||
$arrayoflabels = array();
|
||||
foreach ($arrayofpaymentmodetomanage as $key => $val) {
|
||||
$labelval = ($langs->trans("PaymentType".$val) != "PaymentType".$val ? $langs->trans("PaymentType".$val) : $val);
|
||||
$arrayoflabels[$key] = $labelval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -93,10 +103,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("ChequesReceipts"));
|
||||
llxHeader('', $langs->trans("ChequeDeposits"));
|
||||
|
||||
$sql = "SELECT bc.rowid, bc.ref, bc.date_bordereau,";
|
||||
$sql .= " bc.nbcheque, bc.amount, bc.statut,";
|
||||
$sql .= " bc.nbcheque, bc.amount, bc.statut, bc.type,";
|
||||
$sql .= " ba.rowid as bid, ba.label";
|
||||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
@ -104,7 +114,7 @@ $sqlfields = $sql; // $sql fields to remove for count total
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql .= " WHERE bc.fk_bank_account = ba.rowid";
|
||||
$sql .= " AND bc.entity = ".$conf->entity;
|
||||
$sql .= " AND bc.entity = ".((int) $conf->entity);
|
||||
|
||||
// Search criteria
|
||||
if ($search_ref) {
|
||||
@ -191,10 +201,13 @@ if ($resql) {
|
||||
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
// Type
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre center">';
|
||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||
}
|
||||
@ -217,6 +230,7 @@ if ($resql) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "bc.ref", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "bc.type", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "bc.date_bordereau", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("NbOfCheques", $_SERVER["PHP_SELF"], "bc.nbcheque", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
@ -236,6 +250,7 @@ if ($resql) {
|
||||
$checkdepositstatic->nbcheque = $objp->nbcheque;
|
||||
$checkdepositstatic->amount = $objp->amount;
|
||||
$checkdepositstatic->date_bordereau = $objp->date_bordereau;
|
||||
$checkdepositstatic->type = $objp->type;
|
||||
|
||||
$account = new Account($db);
|
||||
$account->fetch($objp->bid);
|
||||
@ -257,12 +272,15 @@ if ($resql) {
|
||||
|
||||
// Num ref cheque
|
||||
print '<td>';
|
||||
|
||||
print $checkdepositstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
// Type
|
||||
$labelpaymentmode = ($langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) != "PaymentType".$checkdepositstatic->type ? $langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) : $checkdepositstatic->type);
|
||||
print '<td>'.dol_escape_htmltag($labelpaymentmode).'</td>';
|
||||
|
||||
// Date
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau), 'day').'</td>'; // TODO Use date hour
|
||||
print '<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau), 'dayhour', 'tzuser').'</td>';
|
||||
|
||||
// Bank
|
||||
print '<td>';
|
||||
|
||||
@ -120,6 +120,7 @@ ValidateCheckReceipt=Validate this check receipt?
|
||||
ConfirmValidateCheckReceipt=Are you sure that you want to submit this check receipt for validation? No changes will be possible once validated.
|
||||
DeleteCheckReceipt=Delete this check receipt?
|
||||
ConfirmDeleteCheckReceipt=Are you sure you want to delete this check receipt?
|
||||
DocumentsForDeposit=Documents to deposit at the bank
|
||||
BankChecks=Bank checks
|
||||
BankChecksToReceipt=Checks awaiting deposit
|
||||
BankChecksToReceiptShort=Checks awaiting deposit
|
||||
@ -145,6 +146,7 @@ BackToAccount=Back to account
|
||||
ShowAllAccounts=Show for all accounts
|
||||
FutureTransaction=Future transaction. Unable to reconcile.
|
||||
SelectChequeTransactionAndGenerate=Select/filter the checks which are to be included in the check deposit receipt. Then, click on "Create".
|
||||
SelectPaymentTransactionAndGenerate=Select/filter the documents which are to be included in the %s deposit receipt. Then, click on "Create".
|
||||
InputReceiptNumber=Choose the bank statement related with the conciliation. Use a sortable numeric value: YYYYMM or YYYYMMDD
|
||||
EventualyAddCategory=Eventually, specify a category in which to classify the records
|
||||
ToConciliate=To reconcile?
|
||||
|
||||
@ -509,13 +509,14 @@ UseLine=Apply
|
||||
UseDiscount=Use discount
|
||||
UseCredit=Use credit
|
||||
UseCreditNoteInInvoicePayment=Reduce amount to pay with this credit
|
||||
MenuChequeDeposits=Check Deposits
|
||||
MenuChequeDeposits=Deposits slips
|
||||
MenuCheques=Checks
|
||||
MenuChequesReceipts=Check receipts
|
||||
NewChequeDeposit=New deposit
|
||||
ChequesReceipts=Check receipts
|
||||
ChequesArea=Check deposits area
|
||||
ChequeDeposits=Check deposits
|
||||
MenuChequesReceipts=Deposit slips
|
||||
NewChequeDeposit=New deposit slip
|
||||
ChequesReceipts=Cheque deposit slips
|
||||
DocumentsDepositArea=Deposit slip area
|
||||
ChequesArea=Deposit slips area
|
||||
ChequeDeposits=Deposit slips
|
||||
Cheques=Checks
|
||||
DepositId=Id deposit
|
||||
NbCheque=Number of checks
|
||||
|
||||
@ -130,14 +130,17 @@ SalesTurnoverMinimum=Minimum turnover
|
||||
ByExpenseIncome=By expenses & incomes
|
||||
ByThirdParties=By third parties
|
||||
ByUserAuthorOfInvoice=By invoice author
|
||||
CheckReceipt=Check deposit
|
||||
CheckReceiptShort=Check deposit
|
||||
LastCheckReceiptShort=Latest %s check receipts
|
||||
CheckReceipt=Deposit slip
|
||||
CheckReceiptShort=Deposit slip
|
||||
LastCheckReceiptShort=Latest %s deposit slips
|
||||
LastPaymentForDepositShort=Latest %s %s deposit slips
|
||||
NewCheckReceipt=New discount
|
||||
NewCheckDeposit=New check deposit
|
||||
NewCheckDeposit=New deposit slip
|
||||
NewCheckDepositOn=Create receipt for deposit on account: %s
|
||||
NoWaitingChecks=No checks awaiting deposit.
|
||||
NoWaitingPaymentForDeposit=No %s payment awaiting deposit.
|
||||
DateChequeReceived=Check receiving date
|
||||
DatePaymentReceived=Date of document reception
|
||||
NbOfCheques=No. of checks
|
||||
PaySocialContribution=Pay a social/fiscal tax
|
||||
PayVAT=Pay a VAT declaration
|
||||
|
||||
Loading…
Reference in New Issue
Block a user