diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 29cb1300f4c..5a2b7aa5e21 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -125,18 +125,10 @@ $tabfieldinsert[31] = "pcg_version,label,fk_country"; $tabrowid = array(); $tabrowid[31] = ""; -// Condition to show dictionary in setup page -$tabcond = array(); -$tabcond[31] = isModEnabled('accounting'); - // List of help for fields $tabhelp = array(); $tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); -// List of check for fields (NOT USED YET) -$tabfieldcheck = array(); -$tabfieldcheck[31] = array(); - // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") $elementList = array(); @@ -173,9 +165,12 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($fieldnamekey == 'pcg_version') { $fieldnamekey = 'Pcg_version'; } - if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) { + if ($fieldnamekey == 'label') { $fieldnamekey = 'Label'; } + if ($fieldnamekey == 'country') { + $fieldnamekey = "Country"; + } setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } @@ -453,6 +448,7 @@ if ($id) { print ''; // Form to add a new line + if ($tabname[$id]) { $fieldlist = explode(',', $tabfield[$id]); @@ -467,8 +463,9 @@ if ($id) { if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') { + if ($fieldlist[$field] == 'label') { $valuetoshow = $langs->trans("Label"); + $class = 'minwidth300'; } if ($fieldlist[$field] == 'country') { if (in_array('region_id', $fieldlist)) { @@ -483,6 +480,7 @@ if ($id) { if ($fieldlist[$field] == 'pcg_version' || $fieldlist[$field] == 'fk_pcg_version') { $valuetoshow = $langs->trans("Pcg_version"); } + //var_dump($value); if ($valuetoshow != '') { print ''; + print ''; } else { $tmpaction = 'view'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); @@ -711,6 +711,8 @@ if ($id) { $i++; } + } else { + print ''; } } else { dol_print_error($db); @@ -740,9 +742,8 @@ $db->close(); */ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '') { - global $conf, $langs, $db; + global $langs, $db; global $form; - global $region_id; global $elementList, $sourceList; $formadmin = new FormAdmin($db); @@ -784,21 +785,14 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = print ''; } else { print ''; } } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 363fd2ecbb5..acff0845286 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -267,6 +267,7 @@ if ($action == 'setenablevatreversecharge') { } } + /* * View */ @@ -274,12 +275,16 @@ if ($action == 'setenablevatreversecharge') { $form = new Form($db); $title = $langs->trans('ConfigAccountingExpert'); + llxHeader('', $title); + $linkback = ''; //$linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($title, $linkback, 'accountancy'); +print '
'; + // Show message if accountancy hidden options are activated to help to resolve some problems if (!$user->admin) { if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { @@ -304,6 +309,7 @@ print ''; print ''; // Params +print '
'; print '
'; @@ -625,8 +623,10 @@ if ($id) { fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit'); } - print ' '; - print ' '; + print ' '; + print ' '; + print '
'.$langs->trans("NoRecordFound").'
'; - $size = ''; $class = ''; - if ($fieldlist[$field] == 'code') { - $size = 'size="8" '; + if ($fieldlist[$field] == 'pcg_version') { + $class = 'width150'; } - if ($fieldlist[$field] == 'position') { - $size = 'size="4" '; + if ($fieldlist[$field] == 'label') { + $class = 'width300'; } - if ($fieldlist[$field] == 'libelle') { - $size = 'centpercent'; - } - if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') { - $size = 'size="2" '; - } - print ''; + print ''; print '
'; print ''; print ''; @@ -387,9 +393,12 @@ foreach ($list as $key) { print ''; } print '
'.$langs->trans('Options').'
'; +print ''; + print '
'; // Binding params +print '
'; print ''; print ''; print ''; @@ -403,12 +412,12 @@ foreach ($list_binding as $key) { $label = $langs->trans($key); print ''; // Value - print ''; print '
'.$langs->trans('BindingOptions').''.$label.''; + print ''; if ($key == 'ACCOUNTING_DATE_START_BINDING') { print $form->selectDate((getDolGlobalInt($key) ? (int) getDolGlobalInt($key) : -1), $key, 0, 0, 1); } elseif ($key == 'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER') { $array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear")); - print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage'); + print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage width200'); } else { print ''; } @@ -457,7 +466,8 @@ if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { print '
'; -print '
'; +print '
'; + // Show advanced options @@ -465,6 +475,7 @@ print '
'; // Advanced params +print '
'; print ''; print ''; print ''; @@ -533,6 +544,7 @@ if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { print ''; print '
' . $langs->trans('OptionsAdvanced') . '
'; +print '
'; print '
'; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index d8c49b639f4..4dcc41d38f1 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -40,14 +40,6 @@ $hookmanager->initHooks(array('accountancyindex')); if ($user->socid > 0) { accessforbidden(); } -/* -if (!isModEnabled('accounting')) { - accessforbidden(); -} -if (!$user->hasRight('accounting', 'mouvements', 'lire')) { - accessforbidden(); -} -*/ if (!isModEnabled('comptabilite') && !isModEnabled('accounting') && !isModEnabled('asset') && !isModEnabled('intracommreport')) { accessforbidden(); } @@ -55,6 +47,8 @@ if (!$user->hasRight('compta', 'resultat', 'lire') && !$user->hasRight('accounti accessforbidden(); } +$pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); + /* * Actions @@ -127,18 +121,38 @@ if (isModEnabled('accounting')) { // STEPS $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}'); - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'', $s); print $s; print "
\n"; $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}'); - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'', $s); print $s; print "
\n"; $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}'); - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'', $s); print $s; + if ($pcgver > 0) { + $pcgversion = ''; + $pcglabel = ''; + + $sql = "SELECT a.rowid, a.pcg_version, a.label, a.active"; + $sql .= " FROM ".MAIN_DB_PREFIX."accounting_system as a"; + $sql .= " WHERE a.rowid = ".((int) $pcgver); + + $resqlchart = $db->query($sql); + if ($resqlchart) { + $obj = $db->fetch_object($resqlchart); + if ($obj) { + $pcgversion = $obj->pcg_version; + $pcglabel = $obj->label; + } + } else { + dol_print_error($db); + } + print ' ('.$langs->trans("CurrentChartOfAccount").': '.$pcgversion.')'; + } print "
\n"; print "
\n"; @@ -149,32 +163,32 @@ if (isModEnabled('accounting')) { if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') { $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescFiscalPeriod", $step, '{s}'); - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("FiscalPeriod").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("FiscalPeriod").'', $s); print $s; print "
\n"; } $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}'); - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $s); print $s; print "
\n"; $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n"; - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'', $s); print $s; print "
\n"; $step++; - $textlink = ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").''; + $textlink = ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").''; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}'); $s = str_replace('{s}', $textlink, $s); print $s; print "
\n"; if (isModEnabled('tax')) { - $textlink = ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").''; + $textlink = ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").''; $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}'); $s = str_replace('{s}', $textlink, $s); @@ -191,7 +205,7 @@ if (isModEnabled('accounting')) { $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}'); - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'', $s); print $s; print "
\n"; @@ -210,20 +224,20 @@ if (isModEnabled('accounting')) { $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '{s}')."\n"; - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'', $s); print $s; print "
\n"; $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '{s}')."\n"; - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'', $s); print $s; print "
\n"; if (isModEnabled('expensereport') || isModEnabled('deplacement')) { $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n"; - $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'', $s); + $s = str_replace('{s}', ''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'', $s); print $s; print "
\n"; } @@ -236,8 +250,14 @@ if (isModEnabled('accounting')) { $step++; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))."
\n"; print $s; + + $step++; + $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescClosePeriod", chr(64 + $step))."
\n"; + print $s; + print "
\n"; + print '
'; print ''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b6b36bcab09..4aa247e49d1 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1488,10 +1488,10 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment", $langs->trans("Payments"), 1, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment'); - if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) { - $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customer_bills_tovalid'); + if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION') && preg_match('/customers_bills_payment/', $leftmenu)) { + $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_payment_tovalid", $langs->trans("MenuToValid"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_tovalid'); } - if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu)) { + if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills_payment/', $leftmenu)) { $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_payment_report", $langs->trans("Reportings"), 2, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills_payment_report'); } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 63cf440788f..7939e82498d 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -90,13 +90,13 @@ AccountancyAreaDescProd=STEP %s: Define accounting accounts on your Products/Ser AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s. AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the Ledger. For this, go into menu %s, and click into button %s. -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. +AccountancyAreaDescAnalyze=STEP %s: Read reportings or generate export files for other bookkeepers. +AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't transfer anymore data in the same period in a future. TheFiscalPeriodIsNotDefined=A mandatory step in setup has not been completed (Fiscal period is not defined) TheJournalCodeIsNotDefinedOnSomeBankAccount=A mandatory step in setup has not been completed (accounting code journal not defined for all bank accounts) Selectchartofaccounts=Select active chart of accounts +CurrentChartOfAccount=Current active chart of account ChangeAndLoad=Change and load Addanaccount=Add an accounting account AccountAccounting=Accounting account