FIX Enter a direct bank transaction
This commit is contained in:
parent
8363bee234
commit
31f580ad93
@ -177,7 +177,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_dt_start='';
|
$search_dt_start='';
|
||||||
$search_dt_end='';
|
$search_dt_end='';
|
||||||
@ -297,7 +297,7 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
|
$insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user);
|
||||||
if ($insertid > 0)
|
if ($insertid > 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
|
|||||||
@ -390,7 +390,7 @@ class Account extends CommonObject
|
|||||||
* @param string $label Descripton
|
* @param string $label Descripton
|
||||||
* @param float $amount Amount
|
* @param float $amount Amount
|
||||||
* @param string $num_chq Numero cheque ou virement
|
* @param string $num_chq Numero cheque ou virement
|
||||||
* @param string $categorie Categorie optionnelle
|
* @param int $categorie Category id (optionnal)
|
||||||
* @param User $user User that create
|
* @param User $user User that create
|
||||||
* @param string $emetteur Name of cheque writer
|
* @param string $emetteur Name of cheque writer
|
||||||
* @param string $banque Bank of cheque writer
|
* @param string $banque Bank of cheque writer
|
||||||
@ -480,8 +480,8 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
$this->error = $this->db->error();
|
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user