From 31f580ad936ddbf4621b93af0c3f7afdba9e6cd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Apr 2017 01:25:52 +0200 Subject: [PATCH 1/2] FIX Enter a direct bank transaction --- htdocs/compta/bank/bankentries.php | 4 ++-- htdocs/compta/bank/class/account.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index de0e6d70b4c..72e82dd0dd7 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -177,7 +177,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e 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_end=''; @@ -297,7 +297,7 @@ if (GETPOST('save') && $id && ! $cancel && $user->rights->banque->modifier) if (! $error) { $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) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index be4ec60b7f8..7867f9bd753 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -390,7 +390,7 @@ class Account extends CommonObject * @param string $label Descripton * @param float $amount Amount * @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 string $emetteur Name of cheque writer * @param string $banque Bank of cheque writer @@ -480,8 +480,8 @@ class Account extends CommonObject $result = $this->db->query($sql); if (!$result) { + $this->error = $this->db->lasterror(); $this->db->rollback(); - $this->error = $this->db->error(); return -3; } } From 7f7ba6279a122a3de825b62e7d1813ad2bf0bbf1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Apr 2017 14:02:07 +0200 Subject: [PATCH 2/2] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d305eb5e540..be60fc5db7c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1583,7 +1583,7 @@ HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight) TextTitleColor=Color of page title LinkColor=Color of links -PressF5AfterChangingThis=Press F5 on keyboard or clear your browser cache after changing this value to have it effective +PressF5AfterChangingThis=Press CTRL+F5 on keyboard or clear your browser cache after changing this value to have it effective NotSupportedByAllThemes=Will works with core themes, may not be supported by external themes BackgroundColor=Background color TopMenuBackgroundColor=Background color for Top menu