From 7b059445304982322f030ef5aff0d96f5b3030a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 11 May 2014 13:14:45 +0200 Subject: [PATCH 01/15] Corrected strings not translated and typos in English language --- htdocs/core/modules/modAgenda.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 20 ++++++++++---------- htdocs/exports/export.php | 3 ++- htdocs/langs/en_US/exports.lang | 4 ++-- htdocs/langs/en_US/products.lang | 2 ++ 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index fea2915e011..dbb810f9923 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -368,7 +368,7 @@ class modAgenda extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="ExportDataset_event1"; $this->export_permission[$r]=array(array("agenda","export")); - $this->export_fields_array[$r]=array('a.id'=>'IdAgenda','a.label'=>'Actions','a.datep'=>'DateActionStart', + $this->export_fields_array[$r]=array('a.id'=>'IdAgenda','a.label'=>'Title','a.datep'=>'DateActionStart', 'a.datea'=>'DateActionEnd','a.percent'=>'PercentDone','a.fk_user_author'=>'ActionAskedBy','a.fk_user_action'=>'ActionAffectedTo', 'a.fk_user_done'=>"ActionDoneBy","a.priority"=>"Priority","a.fulldayevent"=>"EventOnFullDay","a.location"=>"Location", "a.fk_soc"=>"ThirdParty","a.fk_contact"=>"ThirdPartyContact","a.fk_action"=>"Type"); diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 088c688a4fd..c6e473f38e2 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -254,15 +254,15 @@ class modProduct extends DolibarrModules $this->export_label[$r]="ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("produit","export")); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref", - 'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel", - 'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC", - 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", - 'pr.tva_tx'=>'PriceLevelVATRate', + 'pr.price_base_type'=>"PriceBase",'pr.price_level'=>"PriceLevel", + 'pr.price'=>"HT",'pr.price_ttc'=>"TTC", + 'pr.price_min'=>"MinPriceHT",'pr.price_min_ttc'=>"MinPriceTTC", + 'pr.tva_tx'=>'VAT', 'pr.date_price'=>'DateCreation'); $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product", 'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product", 'pr.price_ttc'=>"product", - 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", + 'pr.price_min'=>"product",'pr.price_min_ttc'=>"product", 'pr.tva_tx'=>'product', 'pr.date_price'=>"product"); $this->export_sql_start[$r]='SELECT DISTINCT '; @@ -282,11 +282,11 @@ class modProduct extends DolibarrModules $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('pr'=>MAIN_DB_PREFIX.'product_price'); $this->import_tables_creator_array[$r]=array('pr'=>'fk_user_author'); // Fields to store import user id - $this->import_fields_array[$r]=array('pr.fk_product'=>"ProductRowid*", - 'pr.price_base_type'=>"PriceLevelPriceBase",'pr.price_level'=>"PriceLevel", - 'pr.price'=>"PriceLevelUnitPriceHT",'pr.price_ttc'=>"PriceLevelUnitPriceTTC", - 'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", - 'pr.tva_tx'=>'PriceLevelVATRate', + $this->import_fields_array[$r]=array('pr.fk_product'=>"Id*", + 'pr.price_base_type'=>"PriceBase",'pr.price_level'=>"PriceLevel", + 'pr.price'=>"HT",'pr.price_ttc'=>"TTC", + 'pr.price_min'=>"MinPriceHT",'pr.price_min_ttc'=>"MinPriceTTC", + 'pr.tva_tx'=>'VAT', 'pr.date_price'=>'DateCreation*'); $this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1", diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 5a3e4485441..f99969c35d1 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -94,7 +94,8 @@ $entitytolang = array( 'shipment_line'=> 'ShipmentLine', 'project' => 'Projects', 'projecttask' => 'Tasks', - 'task_time' => 'TaskTimeSpent' + 'task_time' => 'TaskTimeSpent', + 'action' => 'Action' ); $array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array(); diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 38d25738a64..eb5cbb9e90d 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -8,7 +8,7 @@ ImportableDatas=Importable dataset SelectExportDataSet=Choose dataset you want to export... SelectImportDataSet=Choose dataset you want to import... SelectExportFields=Choose fields you want to export, or select a predefined export profile -SelectImportFields=Choose source file fields you want to import and their target field in database by moving them up and down with anchor %s, or select a predefined import profil: +SelectImportFields=Choose source file fields you want to import and their target field in database by moving them up and down with anchor %s, or select a predefined import profile: NotImportedFields=Fields of source file not imported SaveExportModel=Save this export profile if you plan to reuse it later... SaveImportModel=Save this import profile if you plan to reuse it later... @@ -81,7 +81,7 @@ DoNotImportFirstLine=Do not import first line of source file NbOfSourceLines=Number of lines in source file NowClickToTestTheImport=Check import parameters you have defined. If they are correct, click on button "%s" to launch a simulation of import process (no data will be changed in your database, it's only a simulation for the moment)... RunSimulateImportFile=Launch the import simulation -FieldNeedSource=This fiels in database require a data from source file +FieldNeedSource=This field requires data from the source file SomeMandatoryFieldHaveNoSource=Some mandatory fields have no source from data file InformationOnSourceFile=Information on source file InformationOnTargetTables=Information on target fields diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 21d27d839cd..35e9c640092 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -66,6 +66,8 @@ PublicPrice=Public price CurrentPrice=Current price NewPrice=New price MinPrice=Minim. selling price +MinPriceHT=Minim. selling price (net of tax) +MinPriceTTC=Minim. selling price (inc. tax) CantBeLessThanMinPrice=The selling price can't be lower than minimum allowed for this product (%s without tax). This message can also appears if you type a too important discount. ContractStatus=Contract status ContractStatusClosed=Closed From 847fa3827b56a0381fc428e0bd5b0520a7bc4dbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 May 2014 17:56:29 +0200 Subject: [PATCH 02/15] Fix: use wrong css --- htdocs/margin/tabs/productMargins.php | 2 +- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index f215a3870eb..825d2043683 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref)) $marginRate = ($cumul_achat != 0)?(100 * $totalMargin / $cumul_achat):''; $markRate = ($cumul_vente != 0)?(100 * $totalMargin / $cumul_vente):''; } - print ''; + print ''; print ''.$langs->trans('TotalMargin').""; print "".price($cumul_vente, null, null, null, null, $rounding)."\n"; print "".price($cumul_achat, null, null, null, null, $rounding)."\n"; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 533ade010a3..8e7807817a6 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -232,7 +232,7 @@ if ($socid > 0) $marginRate = ($cumul_achat != 0)?(100 * $totalMargin / $cumul_achat):''; $markRate = ($cumul_vente != 0)?(100 * $totalMargin / $cumul_vente):''; } - print ''; + print ''; print ''.$langs->trans('TotalMargin').""; print "".price($cumul_vente, null, null, null, null, $rounding)."\n"; print "".price($cumul_achat, null, null, null, null, $rounding)."\n"; From 09b5971b7da3e46cdc0e18df77deb455e0562ebe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 May 2014 18:05:59 +0200 Subject: [PATCH 03/15] Fix: [ bug #1381 ] PHP Warning when listing stock transactions page --- htdocs/product/stock/mouvement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 5b7b56d6720..a0adae277e3 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -517,7 +517,7 @@ if ($resql) print "
"; // Add number of product when there is a filter on period - if (count($arrayofuniqueproduct) == 1) + if (count($arrayofuniqueproduct) == 1 && is_numeric($year)) { $productidselected=0; foreach ($arrayofuniqueproduct as $key => $val) From bcfc9f8aa1df2f93b2c9d4833a089cd985db876a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 May 2014 18:06:30 +0200 Subject: [PATCH 04/15] Fix: [ bug #1381 ] PHP Warning when listing stock transactions page --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cc38390b9fd..c12773475c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,8 @@ Fix: [ bug #1362 ] Note is not saved. Fix: tr/td balance. Fix: [ bug #1360 ] note indicator for member tab. Fix: Nb of notes and doc not visible onto tasks. -Fix: [ bug #1372 ] Margin calculation does not work in proposals +Fix: [ bug #1372 ] Margin calculation does not work in proposals. +Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. From bafc53ad958e869813b1e28948d728f227e10962 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 May 2014 19:05:51 +0200 Subject: [PATCH 05/15] Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error --- htdocs/compta/facture.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a3d5067bfa8..29f4e61c7c7 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1855,21 +1855,25 @@ else if ($action == 'builddoc') // En get ou en post if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank'); - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) + // object->modelpdf can be empty when we are using odt template by default and builddoc is called by POS module (invoice was just created and no template ODT template was selected). + if (! empty($object->modelpdf)) { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } } } From 6f4a39078018ddd80a1aa83fe735e50a15bb6cdc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 May 2014 19:06:17 +0200 Subject: [PATCH 06/15] Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index c12773475c5..27ebfed92ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ Fix: [ bug #1360 ] note indicator for member tab. Fix: Nb of notes and doc not visible onto tasks. Fix: [ bug #1372 ] Margin calculation does not work in proposals. Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. +Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. From 5f0c4dbe48defc14c0a8e847d77c866c6d514288 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 May 2014 10:07:57 +0200 Subject: [PATCH 07/15] Fix: TCPDF error file not found in member card generation --- ChangeLog | 1 + htdocs/core/modules/member/doc/pdf_standard.class.php | 9 ++++++--- .../modules/printsheet/doc/pdf_standardlabel.class.php | 6 ++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27ebfed92ee..03f35cae0cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ Fix: Nb of notes and doc not visible onto tasks. Fix: [ bug #1372 ] Margin calculation does not work in proposals. Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. +Fix: TCPDF error file not found in member card generation. ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 4f8e909d2b1..c259d027a8e 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -161,9 +161,12 @@ class pdf_standard // Define photo $dir=$conf->adherent->dir_output; - $file=get_exdir($idmember,2).'photos/'.$photo; - $photo=$dir.'/'.$file; - if (empty($photo) || ! is_readable($photo)) $photo=''; + if (! empty($photo)) + { + $file=get_exdir($idmember,2).'photos/'.$photo; + $photo=$dir.'/'.$file; + if (! is_readable($photo)) $photo=''; + } // Define background image $backgroundimage=''; diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 9c6d1eb3353..dd3f8155918 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -157,6 +157,12 @@ class pdf_standardlabel } } + // Define photo + if (! empty($photo)) + { + if (! is_readable($photo)) $photo=''; + } + // Define background image $backgroundimage=''; From f13c146908775c7bb4002100e9e2ed4a9061492c Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Mon, 12 May 2014 11:00:58 +0200 Subject: [PATCH 08/15] Fix page numerotation as in company list --- htdocs/comm/propal/list.php | 11 ++++++++++- htdocs/commande/liste.php | 11 ++++++++++- htdocs/compta/facture/list.php | 11 ++++++++++- htdocs/fourn/commande/liste.php | 12 +++++++++++- htdocs/fourn/facture/list.php | 10 +++++++++- htdocs/product/liste.php | 13 +++++++++++-- 6 files changed, 61 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7a652631d67..df24b195b7f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -210,6 +210,15 @@ if ($search_user > 0) $sql.= ' ORDER BY '.$sortfield.' '.$sortorder.', p.ref DESC'; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->plimit($limit + 1,$offset); $result=$db->query($sql); @@ -236,7 +245,7 @@ if ($result) if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_author) $param.='&search_author='.$search_author; if ($search_town) $param.='&search_town='.$search_town; - print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); // Lignes des champs de filtre print '
'; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index c4a416f1898..2e96a5451d4 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -200,6 +200,15 @@ if ($search_user > 0) } $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->plimit($limit + 1,$offset); //print $sql; @@ -245,7 +254,7 @@ if ($resql) if ($search_sale > 0) $param.='&search_sale='.$search_sale; $num = $db->num_rows($resql); - print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; // Lignes des champs de filtre diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 42d08c3b02c..12d2f0f032b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -231,6 +231,15 @@ $sql.= ' ORDER BY '; $listfield=explode(',',$sortfield); foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.','; $sql.= ' f.rowid DESC '; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->plimit($limit+1,$offset); //print $sql; @@ -255,7 +264,7 @@ if ($resql) if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; print ''."\n"; diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index d6c4bb9427d..ef6e839dd09 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -119,6 +119,16 @@ if (GETPOST('statut')) } $sql.= " ORDER BY $sortfield $sortorder "; + +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + + $sql.= $db->plimit($conf->liste_limit+1, $offset); $resql = $db->query($sql); @@ -133,7 +143,7 @@ if ($resql) if ($search_nom) $param.="&search_nom=".$search_nom; if ($search_user) $param.="&search_user=".$search_user; if ($search_ttc) $param.="&search_ttc=".$search_ttc; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords); print ''; print ''; print ''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index dd8d778d63a..4b3b375a047 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -169,6 +169,14 @@ if (GETPOST("search_montant_ttc")) $sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'"; } +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -193,7 +201,7 @@ if ($resql) if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht")); if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc")); - print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); + print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ''; print '
'; print ''; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 28330586070..e5dbd9ba3c3 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -189,6 +189,14 @@ else $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte"; $sql .= ', p.desiredstock'; //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet + + $nbtotalofrecords = 0; + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) + { + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); + } + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); @@ -229,7 +237,8 @@ else $param.=($fourn_id?"&fourn_id=".$fourn_id:""); $param.=($search_categ?"&search_categ=".$search_categ:""); $param.=isset($type)?"&type=".$type:""; - print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder,'',$num); + + print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder,'',$num ,$nbtotalofrecords); if (! empty($catid)) { @@ -501,7 +510,7 @@ else $param.=($fourn_id?"&fourn_id=".$fourn_id:""); $param.=($search_categ?"&search_categ=".$search_categ:""); $param.=isset($type)?"&type=".$type:""; - print_barre_liste('', $page, "liste.php", $param, $sortfield, $sortorder,'',$num); + print_barre_liste('', $page, "liste.php", $param, $sortfield, $sortorder,'',$num,$nbtotalofrecords); $db->free($resql); From bd061f42454a36ddc9d15dc23ae1778718b39bdd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 May 2014 01:29:01 +0200 Subject: [PATCH 09/15] Fix: [ bug #1380 ] Customer invoices are not grouped in company results report --- ChangeLog | 1 + htdocs/compta/resultat/clientfourn.php | 57 +++++++++++++++----------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03f35cae0cd..3bb088b99f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ Fix: [ bug #1372 ] Margin calculation does not work in proposals. Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. Fix: TCPDF error file not found in member card generation. +Fix: [ bug #1380 ] Customer invoices are not grouped in company results report. ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index d28f457fb2b..9a08c76abe7 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -187,7 +187,7 @@ else $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY s.nom, s.rowid"; -$sql.= " ORDER BY s.nom"; +$sql.= " ORDER BY s.nom, s.rowid"; dol_syslog("get customer invoices sql=".$sql); $result = $db->query($sql); @@ -281,11 +281,11 @@ print ''; /* - * Frais, factures fournisseurs. + * Suppliers invoices */ if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT s.nom, s.rowid as socid, date_format(f.datef,'%Y-%m') as dm, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; + $sql = "SELECT s.nom, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; $sql.= " WHERE f.fk_soc = s.rowid"; @@ -299,7 +299,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { - $sql = "SELECT s.nom, s.rowid as socid, date_format(p.datep,'%Y-%m') as dm, sum(pf.amount) as amount_ttc"; + $sql = "SELECT s.nom, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -312,7 +312,7 @@ else } $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql .= " GROUP BY s.nom, s.rowid, dm"; +$sql .= " GROUP BY s.nom, s.rowid"; $sql .= " ORDER BY s.nom, s.rowid"; print ''; @@ -372,11 +372,11 @@ print ''; * Charges sociales non deductibles */ -print ''; +print ''; if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, sum(cs.amount) as amount"; + $sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE cs.fk_type = c.id"; @@ -386,7 +386,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { - $sql = "SELECT c.libelle as nom, sum(p.amount) as amount"; + $sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; @@ -397,8 +397,8 @@ else $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } $sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle"; -$sql.= " ORDER BY c.libelle"; +$sql.= " GROUP BY c.libelle, c.id"; +$sql.= " ORDER BY c.libelle, c.id"; dol_syslog("get social contributions deductible=0 sql=".$sql); $result=$db->query($sql); @@ -446,11 +446,11 @@ print ''; * Charges sociales deductibles */ -print ''; +print ''; if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, sum(cs.amount) as amount"; + $sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE cs.fk_type = c.id"; @@ -458,12 +458,12 @@ if ($modecompta == 'CREANCES-DETTES') if (! empty($date_start) && ! empty($date_end)) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; $sql.= " AND cs.entity = ".$conf->entity; - $sql.= " GROUP BY c.libelle"; - $sql.= " ORDER BY c.libelle"; + $sql.= " GROUP BY c.libelle, c.id"; + $sql.= " ORDER BY c.libelle, c.id"; } else { - $sql = "SELECT c.libelle as nom, sum(p.amount) as amount"; + $sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; @@ -473,8 +473,8 @@ else if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; $sql.= " AND cs.entity = ".$conf->entity; - $sql.= " GROUP BY c.libelle"; - $sql.= " ORDER BY c.libelle"; + $sql.= " GROUP BY c.libelle, c.id"; + $sql.= " ORDER BY c.libelle, c.id"; } dol_syslog("get social contributions deductible=1 sql=".$sql); @@ -541,6 +541,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti /* * VAT */ + print ''; $subtotal_ht = 0; $subtotal_ttc = 0; @@ -564,12 +565,15 @@ if ($modecompta == 'CREANCES-DETTES') dol_syslog("get vat to pay sql=".$sql); $result=$db->query($sql); - if ($result) { + if ($result) + { $num = $db->num_rows($result); $var=false; $i = 0; - if ($num) { - while ($i < $num) { + if ($num) + { + while ($i < $num) + { $obj = $db->fetch_object($result); $amount -= $obj->amount; @@ -606,12 +610,15 @@ if ($modecompta == 'CREANCES-DETTES') dol_syslog("get vat received back sql=".$sql); $result=$db->query($sql); - if ($result) { + if ($result) + { $num = $db->num_rows($result); $var=true; $i = 0; - if ($num) { - while ($i < $num) { + if ($num) + { + while ($i < $num) + { $obj = $db->fetch_object($result); $amount += $obj->amount; @@ -634,7 +641,7 @@ if ($modecompta == 'CREANCES-DETTES') } else { - // TVA reellement deja payee + // VAT really already paid $amount=0; $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; @@ -675,7 +682,7 @@ else print "\n"; print "\n"; - // TVA recuperee + // VAT really received $amount=0; $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; From 98bd78a277f5737241e18cd78ea17274d3bd0ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 14 May 2014 01:07:07 +0200 Subject: [PATCH 10/15] Corrected untranslated string when creating invoice linked to a supplier order --- htdocs/fourn/facture/fiche.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 6ca01ff56a4..f0b60a9a33c 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1314,7 +1314,10 @@ if ($action == 'create') print ''; $txt=$langs->trans($classname); - if ($classname=='CommandeFournisseur') $txt=$langs->trans("SupplierOrder"); + if ($classname=='CommandeFournisseur') { + $langs->load('orders'); + $txt=$langs->trans("SupplierOrder"); + } print ''; print ''; print '"; From 8ab09d63a238743ef02078a544c473b4a1b25065 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 May 2014 11:16:12 +0200 Subject: [PATCH 11/15] Fix: Rss features --- build/exe/doliwamp/php.ini.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/exe/doliwamp/php.ini.install b/build/exe/doliwamp/php.ini.install index 5b1c898eea1..46e4dc685b7 100644 --- a/build/exe/doliwamp/php.ini.install +++ b/build/exe/doliwamp/php.ini.install @@ -603,7 +603,7 @@ upload_max_filesize = 2M ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. -allow_url_fopen = Off +allow_url_fopen = On ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. allow_url_include = Off From 4fc818d329443804fe3697df84962e601667f8fc Mon Sep 17 00:00:00 2001 From: guerinaxel Date: Wed, 14 May 2014 10:23:03 +0200 Subject: [PATCH 12/15] Correcting var name Correcting var name for contrat updateline --- htdocs/contrat/class/contrat.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a2856794837..6eda2558daf 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1151,11 +1151,11 @@ class Contrat extends CommonObject $this->db->begin(); // Calcul du total TTC et de la TVA pour la ligne a partir de - // qty, pu, remise_percent et txtva + // qty, pu, remise_percent et tvatx // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $localtaxes_type=getLocalTaxesFromRate($txtva,0,$mysoc); + $localtaxes_type=getLocalTaxesFromRate($tvatx,0,$mysoc); $tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type); $total_ht = $tabprice[0]; From 9ae9f062ac26b2107dbc6bc0b31b93f69d5e3910 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 May 2014 12:25:30 +0200 Subject: [PATCH 13/15] Checkstyle --- htdocs/product/liste.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index e5dbd9ba3c3..501e0c60794 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -189,14 +189,14 @@ else $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte"; $sql .= ', p.desiredstock'; //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet - + $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); @@ -237,8 +237,8 @@ else $param.=($fourn_id?"&fourn_id=".$fourn_id:""); $param.=($search_categ?"&search_categ=".$search_categ:""); $param.=isset($type)?"&type=".$type:""; - - print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder,'',$num ,$nbtotalofrecords); + + print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); if (! empty($catid)) { @@ -286,7 +286,7 @@ else if (empty($conf->global->PRODUIT_MULTIPRICES)) $colspan++; if ($user->rights->fournisseur->lire) $colspan++; if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) $colspan+=2; - + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; @@ -370,10 +370,10 @@ else print ''; } - print ''; - + print ''; @@ -501,7 +501,7 @@ else print ''; print ''; - + print "\n"; $i++; } From fa212438c6fd261241bcc8b42d21fb12fad5d3ed Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Wed, 14 May 2014 18:50:28 +0200 Subject: [PATCH 14/15] FIX alert for customer order wasn't on delivery_date if exist --- htdocs/commande/class/commande.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 22516fe81cc..146d9e777c2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2516,7 +2516,7 @@ class Commande extends CommonOrder $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; - $sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut"; + $sql = "SELECT c.rowid, c.date_creation as datec, c.date_livraison as delivery_date, c.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) { @@ -2535,7 +2535,9 @@ class Commande extends CommonOrder while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++; + + $date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date; + if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->client->warning_delay)) $this->nbtodolate++; } return 1; } From 39b0ed7fc23ed2465dea259f58aacaa0b82c4df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 14 May 2014 22:47:19 +0200 Subject: [PATCH 15/15] Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice. --- ChangeLog | 1 + htdocs/fourn/facture/fiche.php | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3bb088b99f3..07cc056c322 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. Fix: TCPDF error file not found in member card generation. Fix: [ bug #1380 ] Customer invoices are not grouped in company results report. +Fix: [ bug #1393 ] PHP Warning when creating a supplier invoice. ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index f0b60a9a33c..566ae26f640 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -461,6 +461,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) $db->commit(); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + $outputlangs = $langs; $result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) {
'.$langs->trans("SuppliersInvoices").'
'.$langs->trans("SocialContributions").'
'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 0)
'.$langs->trans("SocialContributions").'
'.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 1)
'.$langs->trans("VAT").'
".price($amount)."
'.$txt.''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
'.$langs->trans('TotalVAT').''.price($objectsrc->total_tva)."
'; + print ''; print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1); print ''; print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1); print ''.$product_static->LibStatut($objp->tobuy,5,1).'