diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index d00296ed2b9..d49b5b3dcf7 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -27,10 +27,13 @@ */ require '../../main.inc.php'; + +// Class require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +// Langs $langs->load("bills"); $langs->load("compta"); $langs->load("main"); @@ -38,23 +41,23 @@ $langs->load("accountancy"); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); +//Search Getpost $search_ref = GETPOST('search_ref','alpha'); $search_invoice = GETPOST('search_invoice','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); $search_amount = GETPOST('search_amount','alpha'); $search_account = GETPOST('search_account','alpha'); +$search_vat = GETPOST('search_vat','alpha'); +//Getpost Order and column and limit page $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); - -//if ($page == -1) { $page = 0; } if ($page < 0) $page = 0; $pageprev = $page - 1; $pagenext = $page + 1; -//$limit = $conf->liste_limit; if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { @@ -62,19 +65,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { } else { $limit = $conf->liste_limit; } -//$offset = $conf->liste_limit * $page; $offset = $limit * $page; -// TODO : remove comment -//elarifr we can not use only -//$sql .= " ORDER BY l.rowid"; -// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04... -// f.facnumber will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA -// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered -//if (! $sortfield) $sortfield="f.facnumber"; + if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid"; -//if (! $sortorder) $sortorder="DESC"; if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { $sortorder = " DESC "; @@ -98,6 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_desc=''; $search_amount=''; $search_account=''; + $search_vat=''; } if (is_array($changeaccount) && count($changeaccount) > 0) { @@ -181,6 +177,10 @@ if (strlen(trim($search_amount))) { if (strlen(trim($search_account))) { $sql .= " AND aa.account_number like '%" . $search_account . "%'"; } +if (strlen(trim($search_vat))) +{ + $sql .= " AND (l.tva_tx like '" . $search_vat . "%')"; +} if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")"; } @@ -210,6 +210,7 @@ if ($result) { print_liste_field_titre($langs->trans("Label"), $_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="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"],"l.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(''); print_liste_field_titre(''); @@ -222,6 +223,7 @@ if ($result) { print ''; print ''; print ''; + print '%'; print ''; print ' '; print ''; @@ -257,6 +259,7 @@ if ($result) { print '' . dol_trunc($objp->product_label, 24) . ''; print '' . nl2br(dol_trunc($objp->description, 32)) . ''; print '' . price($objp->total_ht) . ''; + print '' . price($objp->tva_tx) . ''; print '' . $codecompta . ''; print '' . $objp->rowid . ''; print ''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 80f7bc5e6ee..4dd7cb6c15e 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -26,11 +26,14 @@ */ require '../../main.inc.php'; + +// Class require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +// Langs $langs->load("compta"); $langs->load("bills"); $langs->load("other"); @@ -39,24 +42,45 @@ $langs->load("accountancy"); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); +//Search Getpost $search_ref = GETPOST('search_ref','alpha'); $search_invoice = GETPOST('search_invoice','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); $search_amount = GETPOST('search_amount','alpha'); $search_account = GETPOST('search_account','alpha'); +$search_vat = GETPOST('search_vat','alpha'); +//Getpost Order and column and limit page $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -if ($page == -1) { $page = 0; } +if ($page < 0) $page = 0; $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$limit = $conf->liste_limit; -if (! $sortfield) $sortfield="f.ref"; -if (! $sortorder) $sortorder="DESC"; +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) +{ + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} +else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) +{ + $limit = $conf->liste_limit; +} +else +{ + $limit = $conf->liste_limit; +} +if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid"; + +if (! $sortorder) +{ + if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) + { + $sortorder = " DESC "; + } +} // Security check if ($user->societe_id > 0) @@ -75,6 +99,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_desc=''; $search_amount=''; $search_account=''; + $search_vat=''; } if (is_array($changeaccount) && count($changeaccount) > 0) { @@ -124,9 +149,6 @@ print ''; -/* - * Action - */ /* * Supplier Invoice lines @@ -157,6 +179,10 @@ if (strlen(trim($search_amount))) { if (strlen(trim($search_account))) { $sql .= " AND aa.account_number like '%" . $search_account . "%'"; } +if (strlen(trim($search_vat))) +{ + $sql .= " AND (l.tva_tx like '" . $search_vat . "%')"; +} if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")"; } @@ -187,6 +213,7 @@ if ($result) { print_liste_field_titre($langs->trans("Label"), $_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="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"],"l.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(''); print_liste_field_titre(''); @@ -198,11 +225,12 @@ if ($result) { print ''; print ''; print ''; + print '%'; print ''; print ' '; - print ''; + print ''; print ''; - print "\n"; + print "\n"; $facturefournisseur_static = new FactureFournisseur($db); $product_static = new Product($db); @@ -234,6 +262,7 @@ if ($result) { print '' . dol_trunc($objp->product_label, 24) . ''; print '' . nl2br(dol_trunc($objp->description, 32)) . ''; print '' . price($objp->total_ht) . ''; + print '' . price($objp->tva_tx) . ''; print '' . $codeCompta . ''; print '' . $objp->rowid . ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 02057b31255..3e1622558cb 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent s @@ -41,15 +41,24 @@ $langs->load("main"); $langs->load("accountancy"); $action = GETPOST('action'); + +//Select Box $codeventil = GETPOST('codeventil', 'array'); $mesCasesCochees = GETPOST('mesCasesCochees', 'array'); + +//Search Getpost +$search_invoice = GETPOST('search_invoice','alpha'); $search_ref = GETPOST('search_ref','alpha'); $search_label = GETPOST('search_label','alpha'); $search_desc = GETPOST('search_desc','alpha'); +$search_amount = GETPOST('search_amount','alpha'); +$search_account = GETPOST('search_account','alpha'); +$search_vat = GETPOST('search_vat','alpha'); +//Getpost Order and column and limit page $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); -//Should move to top with all GETPOST + $page = GETPOST('page'); if ($page < 0) $page = 0; @@ -62,18 +71,8 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $limit = $conf->liste_limit; } $offset = $limit * $page; -//End Should move to top with all GETPOST - -// TODO : remove comment -//elarifr we can not use only -//$sql .= " ORDER BY l.rowid"; -// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04... -// f.ref will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA -// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered -//if (! $sortfield) $sortfield="l.rowid"; if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid"; -//if (! $sortorder) $sortorder="DESC"; if (! $sortorder) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) { $sortorder = " DESC "; @@ -103,6 +102,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_ref=''; $search_label=''; $search_desc=''; + $search_amount=''; + $search_account=''; + $search_vat=''; } /* @@ -110,9 +112,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both */ llxHeader('', $langs->trans("Ventilation")); -//debug -//print_r($aarowid_s); -//print_r($aarowid_p); print '