diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 1aebdace757..a4deeb51b90 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -42,6 +42,11 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
+$type = GETPOST('type');
+if (empty($type)) {
+ $type = 'CHQ';
+}
+
$object = new RemiseCheque($db);
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -60,6 +65,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits";
+
// filter by dates from / to
$search_date_start_day = GETPOST('search_date_start_day', 'int');
$search_date_start_month = GETPOST('search_date_start_month', 'int');
@@ -132,8 +138,8 @@ if ($action == 'setref' && $user->rights->banque->cheque) {
}
if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->banque->cheque) {
- if (is_array(GETPOST('toRemise'))) {
- $result = $object->create($user, GETPOST("accountid", "int"), 0, GETPOST('toRemise'));
+ if (GETPOSTISARRAY('toRemise')) {
+ $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
$object->fetch($object->id); // To force to reload all properties in correct property name
@@ -286,7 +292,12 @@ if (GETPOST('removefilter')) {
$filteraccountid = 0;
}
-$title = $langs->trans("Cheques")." - ".$langs->trans("Card");
+if ($type == 'CHQ') {
+ $title = $langs->trans("Cheques");
+} else {
+ $title = $type;
+}
+
$helpurl = "";
llxHeader("", $title, $helpurl);
@@ -302,7 +313,7 @@ if ($action == 'new') {
$hselected = $h;
$h++;
- print load_fiche_titre($langs->trans("Cheques"), '', 'bank_account');
+ print load_fiche_titre($title, '', 'bank_account');
} else {
$result = $object->fetch($id, $ref);
if ($result < 0) {
@@ -357,18 +368,29 @@ if ($action == 'new') {
$now = dol_now();
- print ''.$langs->trans("SelectChequeTransactionAndGenerate").'
'."\n";
+ if ($type == 'CHQ') {
+ print ''.$langs->trans("SelectChequeTransactionAndGenerate").'
'."\n";
+ } else {
+ print ''.$langs->trans("SelectPaymentTransactionAndGenerate", $type).'
'."\n";
+ }
print '