New: Accountancy Add message when general ledger is witten

This commit is contained in:
aspangaro 2015-09-06 06:43:40 +02:00
parent b268ccf064
commit a4a72d64c0
4 changed files with 43 additions and 8 deletions

View File

@ -402,7 +402,7 @@ if ($action == 'writeBookKeeping')
}
if (empty($error)) {
setEventMessage($langs->trans('Success'), 'mesgs');
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
}
}
// Export

View File

@ -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');
}
}

View File

@ -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') {

View File

@ -157,4 +157,5 @@ ValidateHistory=Validate Automatically
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
FicheVentilation=Breakdown card
FicheVentilation=Breakdown card
GeneralLedgerIsWritten=Operations are written in the general ledger