diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 2d6ee046bbc..ead997a5d8c 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -51,8 +51,8 @@ $action = GETPOST('action', 'alpha'); $list = array ( '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 +// '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 ); @@ -65,28 +65,28 @@ $accounting_mode = defined('ACCOUNTING_MODE') ? ACCOUNTING_MODE : 'RECETTES-DEPE if ($action == 'update') { $error = 0; - + $accounting_modes = array ( 'RECETTES-DEPENSES', - 'CREANCES-DETTES' + 'CREANCES-DETTES' ); - + $accounting_mode = GETPOST('accounting_mode', 'alpha'); - + if (in_array($accounting_mode, $accounting_modes)) { - + if (! dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) { $error ++; } } else { $error ++; } - + if ($error) { setEventMessages($langs->trans("Error"), null, 'errors'); } - foreach ($list as $constname) + foreach ($list as $constname) { $constvalue = GETPOST($constname, 'alpha'); @@ -267,10 +267,10 @@ if (! empty($user->admin)) // Param a user $user->rights->accountancy->chartofaccount can access -foreach ($list as $key) +foreach ($list as $key) { print ''; - + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue; // Param @@ -280,7 +280,7 @@ foreach ($list as $key) print ''; print ''; print ''; - + print ''; } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 5b614061dbc..311aab692ff 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -111,16 +111,16 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP if ($action == 'update') { if (! empty($btn_changetype)) { $error = 0; - + $accounting_product_modes = array ( 'ACCOUNTANCY_SELL', - 'ACCOUNTANCY_BUY' + 'ACCOUNTANCY_BUY' ); - + $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); - + if (in_array($accounting_product_mode, $accounting_product_modes)) { - + if (! dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) { $error ++; } @@ -128,26 +128,26 @@ if ($action == 'update') { $error ++; } } - + if (! empty($btn_changeaccount)) { //$msg = '
' . $langs->trans("Processing") . '...
'; if (! empty($chk_prod)) { - + $accounting = new AccountingAccount($db); - + //$msg .= '
' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '
'; - + $cpt = 0; $ok = 0; $ko = 0; foreach ( $chk_prod as $productid ) { - + $accounting_account_id = GETPOST('codeventil_' . $productid); - + $result = $accounting->fetch($accounting_account_id, null, 1); if ($result < 0) { // setEventMessages(null, $accounting->errors, 'errors'); $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '
' . $sql . '
'; } else { - + $sql = " UPDATE " . MAIN_DB_PREFIX . "product"; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { $sql .= " SET accountancy_code_buy = " . $accounting->account_number; @@ -156,7 +156,7 @@ if ($action == 'update') { $sql .= " SET accountancy_code_sell = " . $accounting->account_number; } $sql .= " WHERE rowid = " . $productid; - + dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG); if ($db->query($sql)) { $ok++; @@ -166,7 +166,7 @@ if ($action == 'update') { //$msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '
' . $sql . '
'; } } - + $cpt ++; } } else { @@ -258,11 +258,11 @@ $sql .= $db->plimit($limit + 1, $offset); dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG); $result = $db->query($sql); -if ($result) +if ($result) { $num = $db->num_rows($result); $i = 0; - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -271,7 +271,7 @@ if ($result) if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc); if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account); if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid); - + print '
'; if ($optioncss != '') print ''; print ''; @@ -280,14 +280,14 @@ if ($result) print ''; print ''; print ''; - + print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy'); print '
'; - + print $langs->trans("InitAccountancyDesc") . '
'; print '
'; - - // Select mode + + // Select mode print ''; print ''; print ''; @@ -298,20 +298,20 @@ if ($result) print ''; print '\n"; print "
' . $langs->trans('Options') . '' . $langs->trans('Description') . '
' . $langs->trans('OptionModeProductBuy') . ''.$langs->trans('OptionModeProductBuyDesc')."
\n"; - + print '
'; - + print "
\n"; - + // Filter on categories $moreforfilter=''; $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + $texte=$langs->trans("ListOfProductsServices"); print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); - + print ''; print ''; @@ -334,7 +334,7 @@ if ($result) print $searchpicto; print ''; print ''; - + print ''; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); @@ -350,9 +350,9 @@ if ($result) $clickpitco=$form->showCheckAddButtons('checkforselect', 1); print_liste_field_titre($clickpitco, '', '', '', '', 'align="center"'); print ''; - + $product_static = new Product($db); - + $var = true; $i=0; while ($i < min($num,$limit)) @@ -367,7 +367,7 @@ if ($result) $product_static->description = $obj->description; $product_static->status = $obj->tosell; $product_static->status_buy = $obj->tobuy; - + if ($obj->product_type == 0) { $compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodsell_id = $aarowid_prodsell; @@ -375,7 +375,7 @@ if ($result) $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodsell_id = $aarowid_servsell; } - + if ($obj->product_type == 0) { $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodbuy_id = $aarowid_prodbuy; @@ -383,41 +383,41 @@ if ($result) $compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $compta_prodbuy_id = $aarowid_servbuy; } - + print ''; - + print ''; - + print ''; - - if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) + + if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) { // TODO ADJUST DESCRIPTION SIZE // print ''; // TODO: we shoul set a user defined value to adjust user square / wide screen size - $trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64; + $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print ''; } - + print ''; - + print ''; - + // Current accounting account print ''; - + // Dedicated account $defaultvalue=''; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { @@ -440,7 +440,7 @@ if ($result) print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1); print ''; } - + // Checkbox select print ''; @@ -448,7 +448,7 @@ if ($result) $i ++; } print '
'; print $product_static->getNomUrl(1); print ''.$obj->label.'' . $obj->description . '' . nl2br(dol_trunc($obj->description, $trunclengh)) . ''.$product_static->getLibStatut(3, 0).''.$product_static->getLibStatut(3, 1).''; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { print length_accountg($obj->accountancy_code_buy); - if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); + if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); } else { print length_accountg($obj->accountancy_code_sell); - if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); + if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount")); } print ''; print '
'; - + // Example : Adding jquery code print ''; - - + + print '
'; - + print '
'; - + $db->free($result); } else { dol_print_error($db); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index b5778ce86f2..d6d006c6556 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -121,7 +121,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); } - + $account_parent = ''; // Protection to avoid to mass apply it a second time } @@ -240,7 +240,7 @@ if ($result) { if ($search_tvaintra) $param .= "&search_tvaintra=" . $search_tvaintra; - + print '
' . "\n"; print ''; if ($optioncss != '') print ''; @@ -249,7 +249,7 @@ if ($result) { print ''; print ''; print ''; - + print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print $langs->trans("DescVentilDoneCustomer") . '
'; @@ -317,7 +317,7 @@ if ($result) { print '' . $facture_static->getNomUrl(1) . ''; print '' . dol_print_date($db->jdate($objp->datef), 'day') . ''; - + // Ref Product print ''; if ($product_static->id) @@ -327,7 +327,7 @@ if ($result) { print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print ''; @@ -355,7 +355,7 @@ if ($result) { if ($nbtotalofrecords > $limit) { print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1); } - + print '
'; } else { print $db->lasterror(); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 85a97fb3a1e..75c1a59aa30 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -144,10 +144,10 @@ if ($massaction == 'ventil') { $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet"; $sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " WHERE rowid = " . $monId; - + $accountventilated = new AccountingAccount($db); $accountventilated->fetch($monCompte, ''); - + dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG); if ($db->query($sql)) { $msg.= '
' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
'; @@ -157,7 +157,7 @@ if ($massaction == 'ventil') { $ko++; } } - + $cpt++; } $msg.=''; @@ -375,10 +375,10 @@ if ($result) { print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print ''; - + print ''; print price($objp->total_ht); print ''; @@ -404,7 +404,7 @@ if ($result) { print ''; print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; - + print ''; print 'aarowid ? "checked" : "") . '/>'; print ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 5a386c82522..2237f578069 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -1,10 +1,10 @@ * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -94,13 +94,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP if (is_array($changeaccount) && count($changeaccount) > 0) { $error = 0; - + $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd"; $sql1 .= " SET erd.fk_code_ventilation=" . GETPOST('account_parent'); $sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')'; - + dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1); $resql1 = $db->query($sql1); if (! $resql1) { @@ -193,7 +193,7 @@ $result = $db->query($sql); if ($result) { $num_lines = $db->num_rows($result); $i = 0; - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -210,8 +210,8 @@ if ($result) { if ($search_country) $param .= "&search_country=" . $search_country; if ($search_tvaintra) - $param .= "&search_tvaintra=" . $search_tvaintra; - + $param .= "&search_tvaintra=" . $search_tvaintra; + print '
' . "\n"; print ''; if ($optioncss != '') print ''; @@ -220,7 +220,7 @@ if ($result) { print ''; print ''; print ''; - + print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print $langs->trans("DescVentilDoneExpenseReport") . '
'; @@ -273,7 +273,7 @@ if ($result) { $expensereport_static->ref = $objp->ref; $expensereport_static->id = $objp->erid; - + print ''; print '' . $objp->rowid . ''; @@ -282,12 +282,12 @@ if ($result) { print '' . $expensereport_static->getNomUrl(1) . ''; print '' . dol_print_date($db->jdate($objp->date), 'day') . ''; - + print '' . ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))) . ''; print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments)); - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments); print ''; @@ -300,20 +300,20 @@ if ($result) { print ''; print img_edit(); print ''; - + print ''; - + print ""; $i ++; } - + print ""; print ""; - + if ($nbtotalofrecords > $limit) { print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1); } - + print '
'; } else { print $db->error(); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 7fb5f26b28b..8e7b9c60c92 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -139,10 +139,10 @@ if ($massaction == 'ventil') { $sql = " UPDATE " . MAIN_DB_PREFIX . "expensereport_det"; $sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " WHERE rowid = " . $monId; - + $accountventilated = new AccountingAccount($db); $accountventilated->fetch($monCompte, ''); - + dol_syslog('accountancy/expensereport/list.php:: sql=' . $sql, LOG_DEBUG); if ($db->query($sql)) { $msg.= '
' . $langs->trans("LineOfExpenseReport") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
'; @@ -152,7 +152,7 @@ if ($massaction == 'ventil') { $ko++; } } - + $cpt++; } $msg.=''; @@ -224,7 +224,7 @@ if ($result) { $i = 0; $arrayofselected=is_array($toselect)?$toselect:array(); - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -237,8 +237,8 @@ if ($result) { //if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); //if ($massaction == 'presend') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('ventil', $arrayofmassactions, 1); - - + + print '
' . "\n"; print ''; if ($optioncss != '') print ''; @@ -247,7 +247,7 @@ if ($result) { print ''; print ''; print ''; - + print_barre_liste($langs->trans("ExpenseReportLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print $langs->trans("DescVentilTodoExpenseReport") . '

'; @@ -290,8 +290,8 @@ if ($result) { if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1); print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); print "\n"; - - + + $expensereport_static = new ExpenseReport($db); $form = new Form($db); @@ -323,7 +323,7 @@ if ($result) { // Fees description -- Can be null print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments)); - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments); print ''; @@ -356,7 +356,7 @@ if ($result) { print ''; print ""; - + print '
'; } else { print $db->error(); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index dc6b5e7ec20..9c7a72cb94c 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,10 +1,10 @@ * Copyright (C) 2013-2017 Alexandre Spangaro - * Copyright (C) 2014-2015 Ari Elbaz (elarifr) + * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -98,13 +98,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP if (is_array($changeaccount) && count($changeaccount) > 0) { $error = 0; - + $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l"; $sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent'); $sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')'; - + dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1); $resql1 = $db->query($sql1); if (! $resql1) { @@ -202,7 +202,7 @@ $result = $db->query($sql); if ($result) { $num_lines = $db->num_rows($result); $i = 0; - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -221,8 +221,8 @@ if ($result) { if ($search_country) $param .= "&search_country=" . $search_country; if ($search_tvaintra) - $param .= "&search_tvaintra=" . $search_tvaintra; - + $param .= "&search_tvaintra=" . $search_tvaintra; + print '
' . "\n"; print ''; if ($optioncss != '') print ''; @@ -231,20 +231,20 @@ if ($result) { print ''; print ''; print ''; - + print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); - + print $langs->trans("DescVentilDoneSupplier") . '
'; - + print '
' . $langs->trans("ChangeAccount") . '
'; print $formaccounting->select_account(GETPOST('account_parent'), 'account_parent', 1); print '
'; - + $moreforfilter = ''; - + print '
'; print ''."\n"; - + print ''; print ''; print ''; @@ -261,7 +261,7 @@ if ($result) { print $searchpicto; print ''; print "\n"; - + print ''; print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); @@ -276,68 +276,68 @@ if ($result) { $checkpicto=$form->showCheckAddButtons(); print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"'); print "\n"; - + $facturefournisseur_static = new FactureFournisseur($db); $product_static = new Product($db); - + while ($i < min($num_lines, $limit)) { $objp = $db->fetch_object($result); $codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label; - + $facturefournisseur_static->ref = $objp->facnumber; $facturefournisseur_static->id = $objp->facid; - + $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->type = $objp->type; $product_static->label = $objp->product_label; - + print ''; - + print ''; - + // Ref Invoice print ''; - + print ''; - + print ''; - + // Ref Product print ''; - + print ''; - + print ''; print ''; print ''; - + print ''; - + print ""; $i ++; } print "
' . $objp->rowid . '' . $facturefournisseur_static->getNomUrl(1) . ''; print $objp->invoice_label; print '' . dol_print_date($db->jdate($objp->datef), 'day') . ''; if ($product_static->id) print $product_static->getNomUrl(1); if ($objp->product_label) print '
'.$objp->product_label; print '
'; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print '' . price($objp->total_ht) . '' . price($objp->tva_tx) . ''; print $codecompta . ' '; print img_edit(); print '
"; print "
"; - + if ($nbtotalofrecords > $limit) { print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1); } - + print '
'; } else { print $db->error(); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 93aeb1746f5..ff39aad67f4 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -104,7 +104,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP { $search_lineid = ''; $search_ref = ''; - $search_invoice = ''; + $search_invoice = ''; $search_label = ''; $search_desc = ''; $search_amount = ''; @@ -146,10 +146,10 @@ if ($massaction == 'ventil') { $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " WHERE rowid = " . $monId; - + $accountventilated = new AccountingAccount($db); $accountventilated->fetch($monCompte, ''); - + dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG); if ($db->query($sql)) { $msg.= '
' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '
'; @@ -159,7 +159,7 @@ if ($massaction == 'ventil') { $ko++; } } - + $cpt++; } $msg.=''; @@ -332,7 +332,7 @@ if ($result) { $facturefourn_static->ref = $objp->ref; $facturefourn_static->id = $objp->facid; $facturefourn_static->type = $objp->type; - + $code_buy_p_notset = ''; $objp->aarowid_suggest = $objp->aarowid; @@ -356,7 +356,7 @@ if ($result) { // $objp->code_buy_p is now code of product/service // $objp->code_buy_l is now default code of product/service - + print ''; // Line id @@ -381,7 +381,7 @@ if ($result) { // Description print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description)); - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print ''; @@ -422,7 +422,7 @@ if ($result) { print ''; print ""; - + print ''; } else { print $db->error(); diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 8a348dba57a..e3e6e9a4f20 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -266,7 +266,7 @@ class FormAccounting extends Form } else { - $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT) ? 50 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT; $sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";