diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index cb3255f981d..3edda4f8587 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -155,19 +155,19 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON aa.account_par $sql .= " WHERE asy.rowid = " . $pcgver; if (strlen(trim($search_account))) { - $sql .= " AND aa.account_number like '%" . $search_account . "%'"; + $sql .= natural_search("aa.account_number", $search_account); } if (strlen(trim($search_label))) { - $sql .= " AND aa.label like '%" . $search_label . "%'"; + $sql .= natural_search("aa.label", $search_label); } if (strlen(trim($search_accountparent))) { - $sql .= " AND aa.account_parent like '%" . $search_accountparent . "%'"; + $sql .= natural_search("aa.account_parent", $search_accountparent); } if (strlen(trim($search_pcgtype))) { - $sql .= " AND aa.pcg_type like '%" . $search_pcgtype . "%'"; + $sql .= natural_search("aa.pcg_type", $search_pcgtype); } if (strlen(trim($search_pcgsubtype))) { - $sql .= " AND aa.pcg_subtype like '%" . $search_pcgsubtype . "%'"; + $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype); } $sql .= $db->order($sortfield, $sortorder); @@ -198,11 +198,9 @@ if ($resql) { print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy'); - $i = 0; - print '
'; - // Box to select active chart of accoun + // Box to select active chart of account $var = ! $var; print $langs->trans("Selectchartofaccounts") . " : "; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + //print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $searchpitco=$form->showFilterAndCheckAddButtons(1); print $searchpitco; @@ -291,28 +294,30 @@ if ($result) { $var = ! $var; $codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte; + $facture_static->ref = $objp->facnumber; + $facture_static->id = $objp->rowid; + + $product_static->ref = $objp->product_ref; + $product_static->id = $objp->product_id; + $product_static->type = $objp->product_type; + $product_static->label = $objp->product_label; + print ''; print '' . $objp->rowid . ''; // Ref Invoice - $facture_static->ref = $objp->facnumber; - $facture_static->id = $objp->rowid; print '' . $facture_static->getNomUrl(1) . ''; + print '' . dol_print_date($objp->datef, 'day') . ''; + // Ref Product - $product_static->ref = $objp->product_ref; - $product_static->id = $objp->product_id; - $product_static->type = $objp->product_type; - $product_static->label = $objp->product_label; print ''; if ($product_static->id) print $product_static->getNomUrl(1); - else - print ' '; + if ($objp->product_label) print '
'.$objp->product_label; print ''; - - print '' . dol_trunc($objp->product_label, 24) . ''; + print '' . nl2br(dol_trunc($objp->description, 32)) . ''; print '' . price($objp->total_ht) . ''; print '' . price($objp->tva_tx) . ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 8ddb34e5082..94d68544c72 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -40,6 +40,7 @@ $langs->load("bills"); $langs->load("other"); $langs->load("main"); $langs->load("accountancy"); +$langs->load("productbatch"); $action = GETPOST('action'); @@ -238,10 +239,11 @@ if ($result) { print ''."\n"; print ''; - print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, 'align="right"', $sortfield, $sortorder); + 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.facnumber", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef, f.facnumber, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("ProductRef"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); + //print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); 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); @@ -253,12 +255,13 @@ if ($result) { // We add search filter print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + //print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; + print ''; + // Ref Product - $product_static->ref = $objp->product_ref; - $product_static->id = $objp->product_id; - $product_static->type = $objp->type; print ''; - - print ''; + + $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; - print ''; + print ''; print '
%%'; @@ -280,6 +283,11 @@ if ($result) { $objp->code_sell_p = ''; $objp->aarowid_suggest = ''; + $product_static->ref = $objp->product_ref; + $product_static->id = $objp->product_id; + $product_static->type = $objp->type; + $product_static->label = $objp->product_label; + $code_sell_p_notset = ''; $objp->aarowid_suggest = $objp->aarowid; @@ -317,22 +325,18 @@ if ($result) { $facture_static->type = $objp->ftype; print '' . $facture_static->getNomUrl(1) . '' . dol_print_date($objp->datef, 'day') . ''; - if ($product_static->id) print $product_static->getNomUrl(1); - else - print ' '; - + if ($objp->product_label) print '
'.$objp->product_label; print '
' . dol_trunc($objp->product_label, 24) . '' . nl2br(dol_trunc($objp->description, $trunclength)) . '' . nl2br(dol_trunc($objp->description, $trunclength)) . ''; print price($objp->total_ht); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 38327cb718c..d42ee8442ed 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -39,6 +39,7 @@ $langs->load("other"); $langs->load("main"); $langs->load("accountancy"); $langs->load("trips"); +$langs->load("productbatch"); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); @@ -60,7 +61,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortfield) - $sortfield = "er.date_create, er.ref, erd.rowid"; + $sortfield = "erd.date, erd.rowid"; if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sortorder = "DESC"; @@ -144,7 +145,9 @@ print '