From 885a63635181150ae3b5bc3c880b1f83cda4bc11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 May 2017 16:35:05 +0200 Subject: [PATCH] Debug new journal list page --- htdocs/accountancy/admin/journals_list.php | 41 ++++++++----------- htdocs/accountancy/index.php | 16 +++++--- htdocs/core/class/translate.class.php | 1 + .../install/mysql/migration/5.0.0-6.0.0.sql | 7 ++++ htdocs/langs/en_US/accountancy.lang | 28 +++++++------ 5 files changed, 50 insertions(+), 43 deletions(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index be532c7c25f..065d750ca82 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -126,10 +126,10 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort, // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") $elementList = array(); $sourceList = array( - '1' => $langs->trans('AccountingJournalType0'), - '2' => $langs->trans('AccountingJournalType1'), - '3' => $langs->trans('AccountingJournalType2'), - '4' => $langs->trans('AccountingJournalType3'), + '1' => $langs->trans('AccountingJournalType1'), + '2' => $langs->trans('AccountingJournalType2'), + '3' => $langs->trans('AccountingJournalType3'), + '4' => $langs->trans('AccountingJournalType4'), '9' => $langs->trans('AccountingJournalType9') ); @@ -212,10 +212,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); - } - else if ($value == 'entity') { + if ($value == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; } if ($i) $sql.=","; @@ -465,7 +462,6 @@ if ($id) if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; } - if ($id == 4) print ''; print ''; print ''; print ''; @@ -475,7 +471,7 @@ if ($id) print ''; // Line to enter new values - print ""; + print ''; $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. @@ -503,13 +499,7 @@ if ($id) print ''; print ""; - $colspan=count($fieldlist)+3; - - if (! empty($alabelisused)) // If there is one label among fields, we show legend of * - { - print '* '.$langs->trans("LabelUsedByDefault").'.'; - } - print ' '; // Keep   to have a line with enough height + print ' '; // Keep   to have a line with enough height } @@ -578,6 +568,9 @@ if ($id) print ''; print ''; print ''; + print ''; + print ''; + print ''; print ''; if ($filterfound) { @@ -605,14 +598,12 @@ if ($id) // Show fields if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); - print ''; - print ''; - print ''; + print ''; print ''; print ''; print ''; - print '
'; print ''; + print '
'; print ''; } else @@ -655,10 +646,7 @@ if ($id) else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } - if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } $canbemodified=$iserasable; - if ($obj->code == 'RECEP') $canbemodified=1; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if ($param) $url .= '&'.$param; @@ -690,9 +678,12 @@ if ($id) } else print ' '; + print ''; + print ''; - print "\n"; } + + print "\n"; $i++; } } diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index ff9ca6fa1a3..c7caa5daac3 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -71,6 +71,10 @@ print "
\n"; // STEPS $step++; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''); +print "
\n"; +print "
\n"; +$step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''); print "
\n"; print "
\n"; @@ -148,24 +152,26 @@ print '
'; print "
\n"; $step = 0; +$langs->loadLangs(array('bills', 'trips')); + $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step)."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."
\n"; print "
\n"; llxFooter(); diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 30cedf57d51..0f2e6a837ef 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -170,6 +170,7 @@ class Translate * @param int $forcelangdir To force a different lang directory * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf. * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK + * @see loadLangs */ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfileonly=0) { diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index a6666d37ee0..f88ffd05687 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -251,3 +251,10 @@ insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type ALTER TABLE llx_events MODIFY COLUMN ip varchar(250); +UPDATE llx_accounting_journal SET nature = 1 where code = 'OD' and nature = 0; +UPDATE llx_accounting_journal SET nature = 2 where code = 'VT' and nature = 1; +UPDATE llx_accounting_journal SET nature = 3 where code = 'AC' and nature = 2; +UPDATE llx_accounting_journal SET nature = 4 where (code = 'BK' or code = 'BQ') and nature = 3; + + + diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index a5788736fbd..9eb4135397f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -32,23 +32,25 @@ ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account AccountancyArea=Accountancy area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year... -AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making thee journalization (writing record in Journals and General ledger) +AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making the journalization (writing record in Journals and General ledger) AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies... + +AccountancyAreaDescJournalSetup=STEP %s: Create or check content of your journal list from menu %s 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 -AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this you can use the menu entry %s. -AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for type of expense report. For this you can use the menu entry %s. -AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this you can use the menu entry %s. -AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expences (miscellaneous taxes). For this you can use the menu entry %s. -AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this you can use the menu entry %s. -AccountancyAreaDescMisc=STEP %s: Define default accounting accounts for miscellaneous transactions. For this you can use the menu entry %s. -AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this you can use the menu entry %s. -AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s. -AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products. 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, so application will be able to journalize transactions in General Ledger in one click. Complete missing bindings. 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, so application will be able to journalize transactions in General Ledger in one click. Complete missing bindings. 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". +AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s. +AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of expense report. For this, use the menu entry %s. +AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this, use the menu entry %s. +AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expences (miscellaneous taxes). For this, use the menu entry %s. +AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s. +AccountancyAreaDescMisc=STEP %s: Define default accounting accounts for miscellaneous transactions. For this, use the menu entry %s. +AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s. +AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s. +AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s. + +AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in General Ledger in one click. Complete missing bindings. For this, use the menu entry %s. +AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the General 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.