From aae4524fe21d44e1e24f9333f655d66d4a36e682 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 30 Sep 2016 18:38:48 +0200 Subject: [PATCH] Debug module accountancy --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/list.php | 2 +- .../class/html.formventilation.class.php | 12 +++++++----- htdocs/accountancy/customer/index.php | 13 +++++++++---- htdocs/accountancy/customer/lines.php | 10 +++++----- htdocs/accountancy/supplier/index.php | 12 ++++++++---- htdocs/accountancy/supplier/lines.php | 6 +++--- htdocs/langs/en_US/accountancy.lang | 14 +++++++++----- 8 files changed, 43 insertions(+), 28 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 736aec48644..b0949a7007f 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -64,7 +64,7 @@ $formventilation = new FormVentilation($db); $formother = new FormOther($db); $form = new Form($db); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_accountancy_code_start = ''; $search_accountancy_code_end = ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 7e4e898408f..eb27d4cbefe 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -277,7 +277,7 @@ if ($result < 0) { } if ($action == 'delmouv') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1); print $formconfirm; } if ($action == 'delbookkeepingyear') { diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index 9294cf7f6a8..738a98bb57e 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -308,14 +308,16 @@ class FormVentilation extends Form /** * Return HTML combo list of years existing into book keepping * - * @param string $selected Preselected value - * @param string $htmlname Name of HTML select object - * @param int $useempty Affiche valeur vide dans liste - * @param string $output_format (html/opton (for option html only)/array (to return options arrays + * @param string $selected Preselected value + * @param string $htmlname Name of HTML select object + * @param int $useempty Affiche valeur vide dans liste + * @param string $output_format Html/option (for option html only)/array (to return options arrays * @return string/array */ function selectjournal_accountancy_bookkepping($selected = '', $htmlname = 'journalid', $useempty = 0, $output_format = 'html') { + global $langs; + $out_array = array(); $sql = "SELECT DISTINCT code_journal"; @@ -330,7 +332,7 @@ class FormVentilation extends Form return -1; } while ($obj = $this->db->fetch_object($resql)) { - $out_array[$obj->code_journal] = $obj->code_journal; + $out_array[$obj->code_journal] = $obj->code_journal?$obj->code_journal:$langs->trans("NotDefined"); // TODO Not defined is accepted ? We should avoid this, shouldn't we ? } $this->db->free($resql); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 1d670bc4ece..be23efb56ea 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -85,7 +85,7 @@ if ($action == 'validatehistory') { setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); + setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs'); } } elseif ($action == 'fixaccountancycode') { $error = 0; @@ -133,9 +133,11 @@ if ($action == 'validatehistory') { } } + /* * View */ + llxHeader('', $langs->trans("CustomersVentilation")); $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>'; @@ -143,11 +145,14 @@ $textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); -print $langs->trans("DescVentilCustomer") . '<br><br>'; +print $langs->trans("DescVentilCustomer") . '<br>'; +print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToDispatch")) . '<br>'; +print '<br>'; print '<div class="inline-block divButAction">'; print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>'; -print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>'; -print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>'; +print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>'; +// TODO Remove this. Should be done always. +print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>'; print '</div>'; $sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd"; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 31e4ea7ccff..a579daf1a9d 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -263,7 +263,7 @@ if ($result) { print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("IntracommunityVATNumber"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"'); print "</tr>\n"; @@ -272,11 +272,11 @@ if ($result) { print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . $search_label . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount . '"></td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '">%</td>'; + print '<td class="liste_titre" align="right"><input type="text" class="flat" size="6" name="search_amount" value="' . $search_amount . '"></td>'; + print '<td class="liste_titre" align="right"><input type="text" class="flat" size="3" name="search_vat" value="' . $search_vat . '">%</td>'; print '<td class="liste_titre" align="center"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="10" name="search_country" value="' . $search_country . '"></td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="10" name="search_tavintra" value="' . $search_tavintra . '"></td>'; + print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_country" value="' . $search_country . '"></td>'; + print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_tavintra" value="' . $search_tavintra . '"></td>'; print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">'; print "</td></tr>\n"; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 36a750b57dd..2506267ac15 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -81,7 +81,7 @@ if ($action == 'validatehistory') { setEventMessages($db->lasterror(), null, 'errors'); } else { $db->commit(); - setEventMessages($langs->trans('Dispatched'), null, 'mesgs'); + setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs'); } } elseif ($action == 'fixaccountancycode') { $error = 0; @@ -140,11 +140,15 @@ $textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur print load_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); -print $langs->trans("DescVentilSupplier") . '<br><br>'; +print $langs->trans("DescVentilSupplier") . '<br>'; +print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToDispatch")) . '<br>'; +print '<br>'; + print '<div class="inline-block divButAction">'; print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>'; -print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>'; -print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>'; +print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>'; +// TODO Remove this. Should be done always. +print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>'; print '</div>'; $y = $year_current; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 18b1c4b6b74..bbb76f7c15c 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -223,9 +223,9 @@ if ($result) { print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . $search_label . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount . '"></td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '">%</td>'; - print '<td class="liste_titre" align="center"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>'; + print '<td class="liste_titre" align="right"><input type="text" class="flat" size="6" name="search_amount" value="' . $search_amount . '"></td>'; + print '<td class="liste_titre" align="right"><input type="text" class="flat" size="3" name="search_vat" value="' . $search_vat . '">%</td>'; + print '<td class="liste_titre" align="center"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>'; print '<td class="liste_titre" colspan="2"> </td>'; print '<td class="liste_titre" align="right">'; $searchpitco=$form->showFilterAndCheckAddButtons(0); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 469453df0ee..99c2779768b 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -29,7 +29,7 @@ NewAccount=New accounting account Create=Create CreateMvts=Create movement UpdateMvts=Modification of a movement -WriteBookKeeping=Record accounts in general ledger +WriteBookKeeping=Write records in general ledger Bookkeeping=General ledger AccountBalance=Account balance @@ -89,7 +89,8 @@ NotMatch=Not Set DeleteMvt=Delete general ledger lines DelYear=Year to delete DelJournal=Journal to delete -ConfirmDeleteMvt=This will delete all line of of the general ledger for year and/or from a specifics journal +ConfirmDeleteMvt=This will delete all lines of the general ledger for year and/or from a specifics journal +ConfirmDeleteMvtPartial=This will delete the selected line(s) of the general ledger DelBookKeeping=Delete the records of the general ledger @@ -116,9 +117,11 @@ Pcgtype=Class of account Pcgsubtype=Under class of account Accountparent=Root of the account -DescVentilCustomer=Consult here the list of customer invoice lines binded or not yet binded to a product bookkeeping account TotalVente=Total turnover before tax TotalMarge=Total sales margin + +DescVentilCustomer=Consult here the list of customer invoice lines binded (or not) to a product bookkeeping account +DescVentilMore=In most cases, if you use predefined products or services and you set the account number on the product/service card, the application will be able to make all the binding between your invoice lines and the bookkeeping account of your chart of accounts, just in one click with the button <strong>"%s"</strong>. If account was not set on product/service cards or if you still has some lines not binded to any account, you will have to make a manual binding from the menu "<strong>%s</strong>". DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their product bookkeeping account DescVentilTodoCustomer=Bind your lines of customer invoice with a product bookkeeping account ChangeAccount=Change the accounting account for lines selected by the account: @@ -126,7 +129,8 @@ Vide=- DescVentilSupplier=Consult here the list of supplier invoice lines binded or not yet binded to a product bookkeeping account DescVentilDoneSupplier=Consult here the list of the lines of invoices supplier and their bookkeeping account -ValidateHistory=Validate Automatically +ValidateHistory=Bind Automatically +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 @@ -160,7 +164,7 @@ OptionModeProductBuy=Mode purchases OptionModeProductSellDesc=Show all products with no accounting account defined for sales. OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases. CleanFixHistory=Remove accountancy code from lines that not exists into charts of account -CleanHistory=Reset all accountancy for selected year +CleanHistory=Reset all bindings for selected year ## Dictionary Range=Range of accounting account -- GitLab