From 275e198041ffa82b0a878f8971187f249ec40db6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Jan 2015 19:57:38 +0100 Subject: [PATCH 1/6] New: Selection of project use the new select2 component. --- htdocs/comm/propal.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/deplacement/card.php | 4 ++-- htdocs/compta/facture.php | 2 +- htdocs/contrat/card.php | 6 +++--- htdocs/core/class/html.form.class.php | 13 ++++++++----- htdocs/core/class/html.formprojet.class.php | 21 +++++++++++++-------- htdocs/core/lib/ajax.lib.php | 17 ++++++++++------- htdocs/expedition/shipment.php | 4 ++-- htdocs/fichinter/card.php | 4 ++-- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/commande/list.php | 1 + htdocs/fourn/facture/card.php | 2 +- 13 files changed, 46 insertions(+), 34 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 4ce9cfe9621..302b49fbdb7 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1894,7 +1894,7 @@ if ($action == 'create') print ''; print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0); + $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } else { $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b44a8b0f457..1f24b2e7662 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1975,7 +1975,7 @@ if ($action == 'create' && $user->rights->commande->creer) { print ''; // print "$object->id, $object->socid, $object->fk_project"; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0); + $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } else { $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0); } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index bcef3512c33..20dc403f7c3 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -486,11 +486,11 @@ else if ($id) print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid'); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid', 0, 0, 1); } else { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none'); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none', 0, 0); } print ''; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 865d7d95f9f..c9fe00b4594 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3352,7 +3352,7 @@ if ($action == 'create') print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0); + $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } else { $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0); } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4770ff10e50..2a78f8a8616 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1192,11 +1192,11 @@ else print ''; if ($action == "classify") { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,"projectid"); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,"projectid", 0, 0, 1); } else { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,"none"); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,"none", 0, 0); } print ""; } @@ -1730,7 +1730,7 @@ else if ($user->societe_id == 0) { print '
'; - + $parameters=array(); $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a8bd15afe89..97039adea57 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1226,12 +1226,13 @@ class Form if ($num) { // Enhance with select2 - if ($conf->use_javascript_ajax) + $nodatarole=''; + /*if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname); + $out.= ajax_combobox($htmlname); $nodatarole=' data-role="none"'; - } + }*/ $out.= ''; print ''; print ''; print ''; print ''; print '
'; - $formproject->select_projects($socid,$selected,$htmlname,$maxlength,0,1,$discard_closed); + $formproject->select_projects($socid,$selected,$htmlname,$maxlength,0,1,$discard_closed, $forcefocus); print '
'; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 6fb331670ed..aba8abf78a3 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -52,9 +52,10 @@ class FormProjets * @param int $option_only Return only html options lines without the select tag * @param int $show_empty Add an empty line * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) + * @param int $forcefocus Force focus on field (works with javascript only) * @return int Nber of project if OK, <0 if KO */ - function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0) + function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0) { global $user,$conf,$langs; @@ -85,8 +86,17 @@ class FormProjets $resql=$this->db->query($sql); if ($resql) { + // Use select2 selector + $nodatarole=''; + if (! empty($conf->use_javascript_ajax)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname, '', 0, $forcefocus); + $nodatarole=' data-role="none"'; + } + if (empty($option_only)) { - $out.= ''; } if (!empty($show_empty)) { $out.= ''; @@ -162,14 +172,9 @@ class FormProjets if (empty($option_only)) { $out.= ''; } + print $out; - // Use select2 selector - if (! empty($conf->use_javascript_ajax)) - { - - } - $this->db->free($resql); return $num; } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 96c7bc8d05a..ee876aa87c6 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -314,25 +314,28 @@ function ajax_dialog($title,$message,$w=350,$h=150) * @param string $htmlname Name of html select field * @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete + * @param int $forcefocus Force focus on field * @return string Return html string to convert a select field into a combo */ -function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) +function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0) { global $conf; //if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) //if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - if (empty($conf->use_javascript_ajax)) return ''; - + if (empty($conf->use_javascript_ajax)) return ''; + if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0; - + $msg = '\n"; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index bce365447e1..339d0f0d662 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -337,11 +337,11 @@ if ($id > 0 || ! empty($ref)) print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid'); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'projectid', 0, 0, 1); } else { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'none'); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->socid, $commande->fk_project, 'none', 0, 0); } print ''; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index f618e6ff9ad..1746db04abf 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1270,11 +1270,11 @@ else if ($id > 0 || ! empty($ref)) print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid'); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid', 0, 0, 1); } else { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none'); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none', 0, 0); } print ''; print ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index a06998eaeed..96de2262d25 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1615,7 +1615,7 @@ elseif (! empty($object->id)) //print "$object->id, $object->socid, $object->fk_project"; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid', 0, 0); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1'), $object->fk_project, 'projectid', 0, 0, 1); } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5cb8e3fbd57..88d8d495737 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -215,6 +215,7 @@ if ($resql) $userstatic = new User($db); $objectstatic=new CommandeFournisseur($db); + $projectstatic=new Project($db); while ($i < min($num,$conf->liste_limit)) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index fafadfafd82..7f75f34a149 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1941,7 +1941,7 @@ else print ''; if ($action == 'classify') { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid', 0, 0); + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1'), $object->fk_project, 'projectid', 0, 0, 1); } else { From 0ea4a5db7ddb5f13b6a7d9a9ebc7435ba8e86da2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 00:08:45 +0100 Subject: [PATCH 2/6] Fixed: Error management on triggers --- htdocs/commande/card.php | 4 ++++ htdocs/compta/facture.php | 6 ++++-- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/facture/card.php | 15 +++++++-------- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 99414909426..5b76dd59323 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -928,6 +928,10 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c4ea066f801..8e74c674084 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2399,7 +2399,8 @@ if ($action == 'create') } // Confirmation de la validation - if ($action == 'valid') { + if ($action == 'valid') + { // on verifie si l'objet est en numerotation provisoire $objectref = substr($object->ref, 1, 4); if ($objectref == 'PROV') { @@ -2430,7 +2431,8 @@ if ($action == 'create') $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) { + if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change) + { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f4823f81f4c..96e00aba182 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -947,7 +947,7 @@ class FactureFournisseur extends CommonInvoice } // Triggers call - if (! $error && $notrigger) + if (! $error && empty($notrigger)) { // Call trigger $result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 2f4e3f45782..022b46f6a9b 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -531,8 +531,8 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fournisseu } } else - { - setEventMessage($object->error, 'errors'); + { + setEventMessages($object->error, $object->errors, 'errors'); } // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 9542fc062e7..f3e752ed9d4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -154,8 +154,7 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni $result = $object->validate($user,'',$idwarehouse); if ($result < 0) { - setEventMessage($object->error,'errors'); - setEventMessage($object->errors,'errors'); + setEventMessages($object->error,$object->errors,'errors'); } } } @@ -300,13 +299,13 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) $_GET['socid']=$_POST['socid']; $error++; } - + // Fill array 'array_options' with data from add form - + if (! $error) { $db->begin(); - + $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error ++; @@ -1183,7 +1182,7 @@ if ($action == 'create') { $facturestatic = new FactureFournisseur($db); $extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element); - + print_fiche_titre($langs->trans('NewBill')); dol_htmloutput_events(); @@ -1424,7 +1423,7 @@ if ($action == 'create') print ''; // print ''; print ''; - + if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); @@ -1540,7 +1539,7 @@ else $societe = new Fournisseur($db); $result=$societe->fetch($object->socid); if ($result < 0) dol_print_error($db); - + // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); From 2684b327e55817eac3be1ed952eec75f806fe1ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 00:23:10 +0100 Subject: [PATCH 3/6] Fixed bad sql error --- htdocs/fourn/commande/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 88d8d495737..241d1a4a15d 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -135,7 +135,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid; //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'int') !== '') { - $sql .= " AND fk_statut IN (".GETPOST('statut').")"; + $sql .= " AND cf.fk_statut IN (".GETPOST('statut').")"; } if ($search_refsupp) { @@ -143,8 +143,8 @@ if ($search_refsupp) } if ($search_status >= 0) { - if ($search_status == 6 || $search_status == 7) $sql.=" AND fk_statut IN (6,7)"; - else $sql.=" AND fk_statut = ".$search_status; + if ($search_status == 6 || $search_status == 7) $sql.=" AND cf.fk_statut IN (6,7)"; + else $sql.=" AND cf.fk_statut = ".$search_status; } $sql.= $db->order($sortfield,$sortorder); From 03cc1bd03931bd65aa9be90e0cc7c062213e8925 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 00:27:35 +0100 Subject: [PATCH 4/6] Fixed bad sql error --- htdocs/fourn/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 241d1a4a15d..a1da1959618 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -124,7 +124,7 @@ if ($search_user) } if ($search_ttc) { - $sql .= " AND total_ttc = '".$db->escape(price2num($search_ttc))."'"; + $sql .= " AND cf.total_ttc = '".$db->escape(price2num($search_ttc))."'"; } if ($sall) { From 74dafbe0348837a4135116a87f54a2f54d8333e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 00:45:55 +0100 Subject: [PATCH 5/6] Fix missing class --- htdocs/fourn/commande/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index a1da1959618..ff4026d8c6b 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("orders"); $langs->load("sendings"); From d0cc56d616a2dd47128716f849c5c9783175da68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Jan 2015 01:12:05 +0100 Subject: [PATCH 6/6] Showing price without tax also. --- htdocs/fourn/commande/list.php | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index ff4026d8c6b..e477fef8722 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -42,6 +42,7 @@ $search_ref=GETPOST('search_ref'); $search_refsupp=GETPOST('search_refsupp'); $search_company=GETPOST('search_company'); $search_user=GETPOST('search_user'); +$search_ht=GETPOST('search_ht'); $search_ttc=GETPOST('search_ttc'); $sall=GETPOST('search_all'); $search_status=GETPOST('search_status','int'); @@ -65,12 +66,14 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_refsupp=''; $search_company=''; $search_user=''; + $search_ht=''; $search_ttc=''; $search_status=''; } if ($search_status == '') $search_status=-1; + /* * View */ @@ -90,17 +93,14 @@ if ($socid > 0) llxHeader('',$title); + if ($sortorder == "") $sortorder="DESC"; if ($sortfield == "") $sortfield="cf.date_creation"; $offset = $conf->liste_limit * $page ; -/* - * Mode Liste - */ - $sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,"; -$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,cf.date_livraison,"; +$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.total_ht, cf.fk_user_author,cf.date_livraison,"; $sql.= " p.rowid as project_id, p.ref as project_ref,"; $sql.= " u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,"; @@ -123,6 +123,10 @@ if ($search_user) { $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'"; } +if ($search_ht) +{ + $sql .= " AND cf.total_ht = '".$db->escape(price2num($search_ht))."'"; +} if ($search_ttc) { $sql .= " AND cf.total_ttc = '".$db->escape(price2num($search_ttc))."'"; @@ -184,7 +188,8 @@ if ($resql) print_liste_field_titre($langs->trans("Thirdparty"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","",$param,$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"cf.total_ht","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"cf.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('DateDeliveryPlanned'),$_SERVER["PHP_SELF"],'cf.date_livraison','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","",$param,'align="right"',$sortfield,$sortorder); @@ -194,15 +199,16 @@ if ($resql) print ''; print ''; - if (empty($conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER)) print ''; + if (empty($conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER)) print ''; print ''; if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) { print ''; print ''; } - print ''; - print ''; + print ''; + print ''; + print ''; print ' '; print ' '; print ''; @@ -233,7 +239,7 @@ if ($resql) print ''."\n"; // Ref Supplier - if (empty($conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER)) print ''.$obj->ref_supplier.''."\n"; + if (empty($conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER)) print ''.$obj->ref_supplier.''."\n"; // Thirdparty print ''; @@ -260,7 +266,10 @@ if ($resql) else print " "; print ""; - // Amount + // Amount net + print ''.price($obj->total_ht).""; + + // Amount with tax print ''.price($obj->total_ttc).""; // Date