From 04c0e87d792c727e1c1465f645f9ae833c59211f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Oct 2016 15:51:28 +0200 Subject: [PATCH] Work on accounting module --- htdocs/accountancy/admin/account.php | 3 + htdocs/accountancy/admin/defaultaccounts.php | 223 ++---------------- htdocs/accountancy/admin/index.php | 181 +++++++++++++- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/index.php | 33 ++- .../accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 12 +- htdocs/langs/en_US/accountancy.lang | 30 ++- htdocs/langs/en_US/admin.lang | 2 - htdocs/langs/en_US/compta.lang | 11 +- htdocs/langs/en_US/salaries.lang | 4 +- 13 files changed, 253 insertions(+), 254 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 6ac97260e61..872f279ccc2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class. // Langs $langs->load("compta"); +$langs->load("bills"); +$langs->load("admin"); $langs->load("accountancy"); +$langs->load("salaries"); $mesg = ''; $action = GETPOST('action'); diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 0e879acd0aa..51b530cbc12 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -48,15 +48,6 @@ if (! empty($user->rights->accountancy->chartofaccount)) $action = GETPOST('action', 'alpha'); -// Parameters ACCOUNTING_* and others -$list = array ( - //'ACCOUNTING_LIMIT_LIST_VENTILATION', Useless, we can change value dynamically, so we use default global setup - 'ACCOUNTING_MANAGE_ZERO', - 'ACCOUNTING_LENGTH_GACCOUNT', - 'ACCOUNTING_LENGTH_AACCOUNT' , - 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc - 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc -); $list_account = array ( 'ACCOUNTING_ACCOUNT_SUPPLIER', @@ -99,25 +90,6 @@ if (GETPOST('change_chart')) if ($action == 'update') { $error = 0; - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - - if (! empty($chartofaccounts)) { - - if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { - $error ++; - } - } else { - $error ++; - } - - foreach ( $list as $constname ) { - $constvalue = GETPOST($constname, 'alpha'); - - if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { - $error ++; - } - } - foreach ( $list_account as $constname ) { $constvalue = GETPOST($constname, 'alpha'); @@ -133,56 +105,6 @@ if ($action == 'update') { } } -// TO DO Mutualize code for yes/no constants -if ($action == 'setlistsorttodo') { - $setlistsorttodo = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } -} - -if ($action == 'setlistsortdone') { - $setlistsortdone = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } -} - -if ($action == 'setmanagezero') { - $setmanagezero = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } -} - -if ($action == 'setdisabledirectinput') { - $setdisabledirectinput = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } -} - /* * View @@ -196,149 +118,34 @@ $formaccountancy = new FormVentilation($db); $linkback = ''; print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy'); +print '
'; +print $langs->trans("DefaultBindingDesc").'
'; +print '
'; print '
'; print ''; print ''; - -// Box to select active chart of accoun -$var = ! $var; -print $langs->trans("Selectchartofaccounts") . " : "; -print '"; -print ''; -print '
'; -print "
\n"; - - /* * Define Chart of accounts */ -// Others params - print ''; -print ''; -print ''; -print "\n"; -if (! empty($user->admin)) -{ - // TO DO Mutualize code for yes/no constants - $var = ! $var; - print ""; - print ''; - if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { - print ''; - } else { - print ''; - } - print ''; - - $var = ! $var; - print ""; - print ''; - if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { - print ''; - } else { - print ''; - } - print ''; - - $var = ! $var; - print ""; - print ''; - if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; - } else { - print ''; - } - print ''; +foreach ( $list_account as $key ) { + $var = ! $var; + + print ''; + // Param + $label = $langs->trans($key); + print ''; + // Value + print ''; + print ''; } -// Param a user $user->rights->accountancy->chartofaccount can access -if (! empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount)) -{ - foreach ( $list as $key ) { - $var = ! $var; - - if ($key != 'ACCOUNTING_MANAGE_ZERO') - { - print ''; - // Param - $label = $langs->trans($key); - print ''; - // Value - print ''; - print ''; - } - if ($key == 'ACCOUNTING_MANAGE_ZERO') - { - $var = ! $var; - print ""; - print ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; - } else { - print ''; - } - print ''; - } - } - - foreach ( $list_account as $key ) { - $var = ! $var; - - print ''; - // Param - $label = $langs->trans($key); - print ''; - // Value - print ''; - print ''; - } -} print "
' . $langs->trans('OtherOptions') . '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print '
' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print '
' . $label . ''; + print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); + print '
'.$label.''; - print ''; - print '
' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print '
' . $label . ''; - print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1); - print '
\n"; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 8e60510b03d..4eb95d298c5 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -48,6 +48,17 @@ if (empty($user->admin)) $action = GETPOST('action', 'alpha'); +// Parameters ACCOUNTING_* and others +$list = array ( + //'ACCOUNTING_LIMIT_LIST_VENTILATION', Useless, we can change value dynamically, so we use default global setup + 'ACCOUNTING_MANAGE_ZERO', + 'ACCOUNTING_LENGTH_GACCOUNT', + 'ACCOUNTING_LENGTH_AACCOUNT' , + 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc + 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc +); + + /* * Actions @@ -79,6 +90,70 @@ if ($action == 'update') { } else { setEventMessages($langs->trans("Error"), null, 'errors'); } + + foreach ( $list as $constname ) { + $constvalue = GETPOST($constname, 'alpha'); + + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error ++; + } + } + + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + +// TO DO Mutualize code for yes/no constants +if ($action == 'setlistsorttodo') { + $setlistsorttodo = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + +if ($action == 'setlistsortdone') { + $setlistsortdone = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + +if ($action == 'setmanagezero') { + $setmanagezero = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + +if ($action == 'setdisabledirectinput') { + $setdisabledirectinput = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } @@ -103,9 +178,9 @@ print ''; dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron'); -print ''; +// Default mode for calculating turnover (parameter ACCOUNTING_MODE) -// Cas du parametre ACCOUNTING_MODE +print '
'; print ''; print ''; @@ -129,6 +204,108 @@ print '\n"; + +print '
'; + + +// Others params + +print '
' . $langs->trans('OptionMode') . '' . $langs->trans('Description') . '' . nl2br($langs->trans('OptionModeVirtualDesc')) . "
'; +print ''; +print ''; +print "\n"; + +if (! empty($user->admin)) +{ + // TO DO Mutualize code for yes/no constants + $var = ! $var; + print ""; + print ''; + if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { + print ''; + } else { + print ''; + } + print ''; + + $var = ! $var; + print ""; + print ''; + if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { + print ''; + } else { + print ''; + } + print ''; + + $var = ! $var; + print ""; + print ''; + if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { + print ''; + } else { + print ''; + } + print ''; +} + + +// Param a user $user->rights->accountancy->chartofaccount can access +foreach ( $list as $key ) { + $var = ! $var; + + if ($key != 'ACCOUNTING_MANAGE_ZERO') + { + print ''; + // Param + $label = $langs->trans($key); + print ''; + // Value + print ''; + print ''; + } + if ($key == 'ACCOUNTING_MANAGE_ZERO') + { + $var = ! $var; + print ""; + print ''; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + print ''; + } else { + print ''; + } + print ''; + } +} + + +print '
' . $langs->trans('OtherOptions') . '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
'.$label.''; + print ''; + print '
' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
'; + + + + + + + + dol_fiche_end(); print '
'; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 94b3c7df6a4..022634ce22f 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -278,7 +278,7 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; $searchpitco=$form->showFilterAndCheckAddButtons(1); print $searchpitco; print "\n"; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index eaba769677e..d215cf1826e 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -86,23 +86,26 @@ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, print "
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, ''.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Dictionaries")."-".$langs->transnoentitiesnoconv("DictionaryVAT").''); +$textlink = ''.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Dictionaries")."-".$langs->transnoentitiesnoconv("DictionaryVAT").''; +//$textlink.= ' '.$langs->trans("and").' '; +//$textlink.= ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy").'-'.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink); print "
\n"; print "
\n"; if (! empty($conf->tax->enabled)) { $textlink = ''.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Dictionaries")."-".$langs->transnoentitiesnoconv("DictionarySocialContributions").''; - $textlink.= ' '.$langs->trans("and").' '; - $textlink.= ''.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Modules")."-".$langs->transnoentitiesnoconv("Accountancy").''; + //$textlink.= ' '.$langs->trans("and").' '; + //$textlink.= ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''; $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink); print "
\n"; print "
\n"; } -if (! empty($conf->salaries->enabled)) +/*if (! empty($conf->salaries->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Modules")."-".$langs->transnoentitiesnoconv("Accountancy").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); // htdocs/admin/salaries.php print "
\n"; print "
\n"; @@ -110,11 +113,17 @@ if (! empty($conf->salaries->enabled)) if (! empty($conf->don->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("Modules")."-".$langs->transnoentitiesnoconv("Accountancy").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); print "
\n"; print "
\n"; -} -// Other: bank transfer, bank accounts +}*/ + +$step++; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'')."
\n"; +print "
\n"; +$step++; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("ProductsBinding").'')."
\n"; +print "
\n"; print "
\n"; print_fiche_titre($langs->trans("AccountancyAreaDescActionFreq"), '', 'object_calendarweek'); @@ -122,9 +131,6 @@ print '
'; print "
\n"; $step = 0; -$step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("ProductsBinding").'')."
\n"; -print "
\n"; $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."
\n"; print "
\n"; @@ -134,8 +140,9 @@ print "
\n"; $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step, ''.$langs->transnoentitiesnoconv("Financial").'-'.$langs->transnoentitiesnoconv("Accountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."
\n"; print "
\n"; - - +$step++; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."
\n"; +print "
\n"; llxFooter(); $db->close(); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 00630c726f5..91436669ba8 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -295,7 +295,7 @@ if ($action == 'writebookkeeping') { } - if (empty($error)) { + if (empty($error) && count($tabpay)) { setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } elseif (count($tabpay) == $error) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index a592f7b0659..f73af79ff89 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -313,7 +313,7 @@ if ($action == 'writebookkeeping') { } - if (empty($error)) { + if (empty($error) && count($tabpay) > 0) { setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } elseif (count($tabpay) == $error) diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 09093494d0d..2f00bd67bd6 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -249,7 +249,7 @@ if ($result) { print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("AccountAccounting"), '', '', '', '', 'align="center"'); + print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"'); print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"'); print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('', '', '', '', '', 'align="center"'); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index da483a6d966..551b8ac1e5f 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -942,13 +942,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Chart of account - $langs->load("admin"); - if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 1); - if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 1); - if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 2); + if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); + if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 2); + if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 3); + if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 2); + if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy", $langs->trans("ProductsBinding"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 2); // Binding - if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy", $langs->trans("ProductsBinding"), 1, $user->admin); if (preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); if (preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); @@ -963,7 +963,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Journals if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - if (preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journaux"),1,$user->rights->accounting->comptarapport->lire); + if (preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire); $sql = "SELECT rowid, label, accountancy_journal"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index ca8ab6f65e0..8966dd2055b 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -11,9 +11,11 @@ ACCOUNTING_EXPORT_PREFIX_SPEC=Specify the prefix for the file name AccountancySetupDoneFromAccountancyMenu=Most setup of the accountancy is done from the menu %s ConfigAccountingExpert=Configuration of the module accounting expert +Journalization=Journalization Journaux=Journals JournalFinancial=Financial journals BackToChartofaccounts=Return chart of accounts +Chartofaccounts=Chart of accounts AccountancyArea=Accountancy area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: @@ -21,33 +23,36 @@ AccountancyAreaDescActionOnce=The following actions are usually executed one tim AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies... AccountancyAreaDescChartModel=STEP %s: Create a model of chart of account from menu %s AccountancyAreaDescChart=STEP %s: Create or check content of your chart of account from menu %s -AccountancyAreaDescProd=STEP %s: Check the binding between products/services and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on your invoice lines.
For this you can use the menu entry %s. AccountancyAreaDescBank=STEP %s: Check the binding between bank accounts and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on your payment lines.
For this, go on the card of each financial account. You can start from page %s. AccountancyAreaDescVat=STEP %s: Check the binding between vat payment and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to VAT payments.
You can set accounting accounts to use for each VAT from page %s. AccountancyAreaDescSal=STEP %s: Check the binding between salaries payment and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payment of salaries.
For this you can use the menu entry %s. -AccountancyAreaDescContrib=STEP %s: Check the binding between special expences (social or fiscal contributions) and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payments of social contributions.
For this you can use the menu entry %s. +AccountancyAreaDescContrib=STEP %s: Check the binding between special expences (miscellaneous taxes) and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payments of taxes.
For this you can use the menu entry %s. AccountancyAreaDescDonation=STEP %s: Check the binding between donation and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payments of donation.
You can set the account dedicated for that from the menu entry %s. +AccountancyAreaDescMisc=STEP %s: Check the default binding between miscellaneous transaction lines and accounting account is done. Complete missing bindings.
For this you can use the menu entry %s. +AccountancyAreaDescProd=STEP %s: Check the binding between products/services and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on your invoice lines.
For this you can use the menu entry %s. -AccountancyAreaDescCustomer=STEP %s: Check the binding between existing customer invoice lines and accounting account is done. Complete missing bindings. Once binding is complete, application will be able to record transactions in General Ledger in one click.
For this you can use the menu entry %s. -AccountancyAreaDescSupplier=STEP %s: Check the binding between existing supplier invoice lines and accounting account is done. Complete missing bindings. Once binding is complete, application will be able to record transactions in General Ledger in one click.
For this you can use the menu entry %s. -AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the General Ledger. Add or edit existing transactions and generate reports +AccountancyAreaDescCustomer=STEP %s: Check the binding between existing customer invoice lines and accounting account is done. Complete missing bindings. Once binding is complete, application will be able to journalize transactions in General Ledger in one click.
For this you can use the menu entry %s. +AccountancyAreaDescSupplier=STEP %s: Check the binding between existing supplier invoice lines and accounting account is done. Complete missing bindings. Once binding is complete, application will be able to journalize transactions in General Ledger in one click.
For this you can use the menu entry %s. +AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the General Ledger. For this, go into each Journal, and click into button "Journalize transactions in General Ledger". +AccountancyAreaDescAnalyze=STEP %s: Add or edit existing transactions and generate reports and exports. +AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future. + +MenuAccountancy=Accountancy Selectchartofaccounts=Select active chart of accounts ChangeAndLoad=Change and load Addanaccount=Add an accounting account AccountAccounting=Accounting account AccountAccountingShort=Account AccountAccountingSuggest=Accounting account suggest -Ventilation=Binding to accounts -ProductsBinding=Products binding - -MenuAccountancy=Accountancy MenuDefaultAccounts=Default accounts +ProductsBinding=Products accounts +Ventilation=Binding to accounts CustomersVentilation=Customer invoice binding SuppliersVentilation=Supplier invoice binding CreateMvts=Create new transaction UpdateMvts=Modification of a transaction -WriteBookKeeping=Record operations in General Ledger +WriteBookKeeping=Journalize transactions in General Ledger Bookkeeping=General ledger AccountBalance=Account balance @@ -151,7 +156,7 @@ AutomaticBindingDone=Automatic binding done ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s FicheVentilation=Binding card -GeneralLedgerIsWritten=Operations are written in the general ledger +GeneralLedgerIsWritten=Transactions are written in the general ledger GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be recorded. NoNewRecordSaved=No new record saved ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account @@ -177,7 +182,8 @@ Modelcsv_cogilog=Export towards Cogilog ## Tools - Init accounting account on product / service InitAccountancy=Init accountancy -InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accountancy account defined for sales and purchases. Check before that setup of chart of accounts is complete. +InitAccountancyDesc=This page can be used to initialize an accounting account on products and services that does not have accountancy account defined for sales and purchases. +DefaultBindingDesc=This page can be used to set a default account to use to link transactions record about payment salaries, donation, taxes and vat when no specific accounting account were already set. Options=Options OptionModeProductSell=Mode sales OptionModeProductBuy=Mode purchases diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3437a96a2a6..f67a3df5429 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -53,8 +53,6 @@ ErrorModuleRequireDolibarrVersion=Error, this module requires Dolibarr version % ErrorDecimalLargerThanAreForbidden=Error, a precision higher than %s is not supported. DictionarySetup=Dictionary setup Dictionary=Dictionaries -Chartofaccounts=Chart of accounts -FiscalPeriod=Accounting period ErrorReservedTypeSystemSystemAuto=Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record ErrorCodeCantContainZero=Code can't contain value 0 DisableJavascript=Disable JavaScript and Ajax functions (Recommended for blind person or text browsers) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 838f98baf13..b6f998e29be 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -184,11 +184,11 @@ CalculationRuleDescSupplier=According to supplier, choose appropriate method to TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a cash accountancy mode is not relevant. This report is only available when using engagement accountancy mode (see setup of accountancy module). CalculationMode=Calculation mode AccountancyJournal=Accountancy code journal -ACCOUNTING_VAT_SOLD_ACCOUNT=Default accountancy code for collecting VAT (VAT on sales) -ACCOUNTING_VAT_BUY_ACCOUNT=Default accountancy code for recovered VAT (VAT on purchases) -ACCOUNTING_VAT_PAY_ACCOUNT=Default accountancy code for paying VAT -ACCOUNTING_ACCOUNT_CUSTOMER=Accountancy code by default for customer thirdparties -ACCOUNTING_ACCOUNT_SUPPLIER=Accountancy code by default for supplier thirdparties +ACCOUNTING_VAT_SOLD_ACCOUNT=Accounting account by default for collecting VAT (VAT on sales) +ACCOUNTING_VAT_BUY_ACCOUNT=Accounting account by default for recovered VAT (VAT on purchases) +ACCOUNTING_VAT_PAY_ACCOUNT=Accounting account by default for paying VAT +ACCOUNTING_ACCOUNT_CUSTOMER=Accounting account by default for customer thirdparties +ACCOUNTING_ACCOUNT_SUPPLIER=Accounting account by default for supplier thirdparties CloneTax=Clone a social/fiscal tax ConfirmCloneTax=Confirm the clone of a social/fiscal tax payment CloneTaxForNextMonth=Clone it for next month @@ -202,3 +202,4 @@ LinkedFichinter=Link to an intervention ImportDataset_tax_contrib=Import social/fiscal taxes ImportDataset_tax_vat=Import vat payments ErrorBankAccountNotFound=Error: Bank account not found +FiscalPeriod=Accounting period diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 52abe69ded8..5fedb79823d 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - salaries -SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Accountancy code for salaries payments -SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accountancy code for personnel expenses +SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Accounting account by default for salaries payments +SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for personnel expenses Salary=Salary Salaries=Salaries NewSalaryPayment=New salary payment