diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 897f60e8aaa..7e2cdc56543 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -2088,7 +2088,7 @@ class BookKeeping extends CommonObject
* FIXME: This function takes the parent of parent to get the root account !
*
* @param string $account Accounting account
- * @return array Array with root account information (max 2 upper level)
+ * @return array|int Array with root account information (max 2 upper level), <0 if KO
*/
public function getRootAccount($account = null)
{
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index ad029628739..9138a757989 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -712,6 +712,7 @@ class Orders extends DolibarrApi
* @throws RestException 401
* @throws RestException 404
* @throws RestException 500 System error
+ *
*/
public function validate($id, $idwarehouse = 0, $notrigger = 0)
{
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 4a6a197aa79..0c46a25ee17 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -2727,7 +2727,7 @@ class Commande extends CommonOrder
* @param int $offset For pagination
* @param string $sortfield Sort criteria
* @param string $sortorder Sort order
- * @return int -1 if KO, array with result if OK
+ * @return int|array -1 if KO, array with result if OK
*/
public function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC')
{
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 1aebdace757..9135f2d2eb5 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');
@@ -84,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
@@ -132,8 +142,11 @@ 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')) {
+ $object->type = $type;
+ $arrayofid = GETPOST('toRemise', 'array:int');
+
+ $result = $object->create($user, GETPOST("accountid", "int"), 0, $arrayofid);
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 +299,16 @@ if (GETPOST('removefilter')) {
$filteraccountid = 0;
}
-$title = $langs->trans("Cheques")." - ".$langs->trans("Card");
+if ($action == 'new') {
+ $title = $langs->trans("NewChequeDeposit");
+} else {
+ if ($type == 'CHQ') {
+ $title = $langs->trans("Cheques");
+ } else {
+ $title = ($langs->trans("PaymentType".$type) != "PaymentType".$type ? $langs->trans("PaymentType".$type) : $langs->trans("PaymentMode").' '.$type);
+ }
+}
+
$helpurl = "";
llxHeader("", $title, $helpurl);
@@ -302,7 +324,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,7 +379,12 @@ if ($action == 'new') {
$now = dol_now();
- print ''.$langs->trans("SelectChequeTransactionAndGenerate").'
'."\n";
+ $labeltype = ($langs->trans("PaymentType".$type) != "PaymentType".$type ? $langs->trans("PaymentType".$type) : $type);
+ if ($type == 'CHQ') {
+ print ''.$langs->trans("SelectChequeTransactionAndGenerate").'
'."\n";
+ } else {
+ print ''.$langs->trans("SelectPaymentTransactionAndGenerate", $labeltype).'
'."\n";
+ }
print '