diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index d05e2d339a6..edb030ff912 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2021 Alexandre Spangaro * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -70,6 +70,8 @@ class PaymentVarious extends CommonObject public $amount; public $type_payment; public $num_payment; + public $chqemetteur; + public $chqbank; public $category_transaction; /** @@ -424,7 +426,7 @@ class PaymentVarious extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -6; } - if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) + if (!empty($conf->banque->enabled) && (empty($this->type_payment))) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -7; @@ -499,8 +501,8 @@ class PaymentVarious extends CommonObject $this->num_payment, ($this->category_transaction > 0 ? $this->category_transaction : 0), $user, - '', - '', + $this->chqemetteur, + $this->chqbank, '', $this->datev ); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 0c2db362e75..94f671c6dd5 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -49,7 +49,7 @@ $accountid = GETPOST("accountid") > 0 ? GETPOST("accountid", "int") : 0; $label = GETPOST("label", "alpha"); $sens = GETPOST("sens", "int"); $amount = price2num(GETPOST("amount", "alpha")); -$paymenttype = GETPOST("paymenttype", "int"); +$paymenttype = GETPOST("paymenttype", "aZ09"); $accountancy_code = GETPOST("accountancy_code", "alpha"); $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { @@ -113,8 +113,10 @@ if (empty($reshook)) $object->amount = price2num(GETPOST("amount", 'alpha')); $object->label = GETPOST("label", 'restricthtml'); $object->note = GETPOST("note", 'restricthtml'); - $object->type_payment = GETPOST("paymenttype", 'int') > 0 ? GETPOST("paymenttype", "int") : 0; + $object->type_payment = dol_getIdFromCode($db, GETPOST('paymenttype'), 'c_paiement', 'code', 'id', 1); $object->num_payment = GETPOST("num_payment", 'alpha'); + $object->chqemetteur = GETPOST("chqemetteur", 'alpha'); + $object->chqbank = GETPOST("chqbank", 'alpha'); $object->fk_user_author = $user->id; $object->category_transaction = GETPOST("category_transaction", 'alpha'); @@ -345,6 +347,43 @@ foreach ($bankcateg->fetchAll() as $bankcategory) { /* ************************************************************************** */ if ($action == 'create') { + // Update fields properties in realtime + if (!empty($conf->use_javascript_ajax)) + { + print "\n".''."\n"; + } + print '
'; print ''; print ''; @@ -390,20 +429,28 @@ if ($action == 'create') } // Type payment - print ''; - print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; - $form->select_types_paiements($paymenttype, "paymenttype"); - print ''; + print ''.$langs->trans('PaymentMode').''; + $form->select_types_paiements($paymenttype, 'paymenttype', '', 2); + print "\n"; + print ''; // Number - if (!empty($conf->banque->enabled)) - { - // Number - print ''; - print ''."\n"; - } + print ''; + print ''."\n"; + + // Check transmitter + print ''; + print ''; + + // Bank name + print ''; + print ''; // Accountancy account if (!empty($conf->accounting->enabled)) {