Skip to content
Snippets Groups Projects
Commit a4a72d64 authored by aspangaro's avatar aspangaro
Browse files

New: Accountancy Add message when general ledger is witten

parent b268ccf0
No related branches found
No related tags found
No related merge requests found
......@@ -402,7 +402,7 @@ if ($action == 'writeBookKeeping')
}
if (empty($error)) {
setEventMessage($langs->trans('Success'), 'mesgs');
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}
// Export
......
......@@ -157,6 +157,7 @@ if ($result) {
// Bookkeeping Write
if ($action == 'writebookkeeping') {
$now = dol_now();
$error = 0;
foreach ( $tabfac as $key => $val ) {
foreach ( $tabttc[$key] as $k => $mt ) {
......@@ -179,7 +180,11 @@ if ($action == 'writebookkeeping') {
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
// Product / Service
......@@ -205,7 +210,11 @@ if ($action == 'writebookkeeping') {
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}
......@@ -232,10 +241,18 @@ if ($action == 'writebookkeeping') {
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}
if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}
......
......@@ -170,6 +170,7 @@ if ($result) {
// Bookkeeping Write
if ($action == 'writebookkeeping') {
$now = dol_now();
$error = 0;
foreach ( $tabfac as $key => $val ) {
foreach ( $tabttc[$key] as $k => $mt ) {
......@@ -190,7 +191,11 @@ if ($action == 'writebookkeeping') {
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
// Product / Service
......@@ -216,7 +221,11 @@ if ($action == 'writebookkeeping') {
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}
......@@ -242,10 +251,18 @@ if ($action == 'writebookkeeping') {
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
$bookkeeping->fk_user_author = $user->id;
$bookkeeping->create();
$result = $bookkeeping->create();
if ($result < 0) {
$error ++;
setEventMessage($object->errors, 'errors');
}
}
}
}
if (empty($error)) {
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}
// Export
if ($action == 'export_csv') {
......
......@@ -157,4 +157,5 @@ ValidateHistory=Validate Automatically
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
FicheVentilation=Breakdown card
\ No newline at end of file
FicheVentilation=Breakdown card
GeneralLedgerIsWritten=Operations are written in the general ledger
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment