From 6ded9e843d3448bcec8e7789b59fdf5e96075b8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2018 01:03:46 +0200 Subject: [PATCH] NEW The binding step in accountancy has a country filter like a combo --- htdocs/accountancy/customer/lines.php | 14 +++++++++----- htdocs/accountancy/customer/list.php | 10 +++++++--- htdocs/accountancy/expensereport/lines.php | 2 -- htdocs/accountancy/supplier/lines.php | 15 +++++++++++---- htdocs/accountancy/supplier/list.php | 14 +++++++++----- htdocs/core/class/html.form.class.php | 2 +- 6 files changed, 37 insertions(+), 20 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 83ddd1bd888..d9e5aa80a3f 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -17,7 +17,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -173,7 +172,8 @@ $sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd $sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,"; $sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,"; $sql.= " fd.situation_percent,"; -$sql.= " co.label as country, s.tva_intra"; +$sql.= " co.code as country_code, co.label as country,"; +$sql.= " s.tva_intra"; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; @@ -229,7 +229,7 @@ else if ($search_year > 0) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; } if (strlen(trim($search_country))) { - $sql .= natural_search("co.label", $search_country); + $sql .= natural_search("co.code", $search_country); } if (strlen(trim($search_tvaintra))) { $sql .= natural_search("s.tva_intra", $search_tvaintra); @@ -307,7 +307,10 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; + print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2'); + //print ''; + print ''; print ''; print ''; print ''; @@ -370,9 +373,10 @@ if ($result) { print ''; print '' . price($objp->total_ht) . ''; + print '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . ''; - print '' . $objp->country .''; + print '' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')'; print '' . $objp->tva_intra . ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index b5fec4a0e7c..fb604988582 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -212,7 +212,8 @@ $sql = "SELECT f.rowid as facid, f.facnumber as ref, f.datef, f.type as ftype,"; $sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,"; $sql.= " aa.rowid as aarowid,"; -$sql.= " co.label as country, s.tva_intra"; +$sql.= " co.code as country_code, co.label as country,"; +$sql.= " s.tva_intra"; $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; @@ -265,7 +266,7 @@ else if ($search_year > 0) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; } if (strlen(trim($search_country))) { - $sql .= natural_search("co.label", $search_country); + $sql .= natural_search("co.code", $search_country); } if (strlen(trim($search_tvaintra))) { $sql .= natural_search("s.tva_intra", $search_tvaintra); @@ -371,7 +372,10 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; + print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2'); + //print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index ae368a20de1..b328cf73455 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -236,8 +236,6 @@ if ($result) { if ($search_day) $param .= '&search_day='.urlencode($search_day); if ($search_month) $param .= '&search_month='.urlencode($search_month); if ($search_year) $param .= '&search_year='.urlencode($search_year); - if ($search_country) $param .= "&search_country=" . urlencode($search_country); - if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra); print '
' . "\n"; print ''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 326d249f86d..48bde2dfb87 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -172,7 +172,9 @@ print '