diff --git a/ChangeLog b/ChangeLog index 6598ca3d17d..383e3477e0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -124,7 +124,12 @@ 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. +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/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 diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 3cb2399416f..73d1cb720d4 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/class/commande.class.php b/htdocs/commande/class/commande.class.php index b3d90fd562b..086dc5a8073 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2541,7 +2541,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) { @@ -2560,7 +2560,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; } diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 7abe6451141..4c0d2d756da 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.php b/htdocs/compta/facture.php index b48c95edfb6..ededeab44a1 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1659,19 +1659,19 @@ else if ($action == 'builddoc') // En get ou en post if (GETPOST('fk_bank')) $object->fk_bank = GETPOST('fk_bank'); - // Define output language + // 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)) { + 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) { + if ($result <= 0) + { dol_print_error($db, $result); exit(); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index aadd75907ce..3532125ed8e 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/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index c5fd60ccfae..d68aa528122 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -188,7 +188,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); @@ -282,11 +282,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"; @@ -300,7 +300,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"; @@ -313,7 +313,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 ''.$langs->trans("SuppliersInvoices").''; @@ -373,11 +373,11 @@ print ''; * Charges sociales non deductibles */ -print ''.$langs->trans("SocialContributions").''; +print ''.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 0)'; 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"; @@ -387,7 +387,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"; @@ -398,8 +398,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); @@ -447,11 +447,11 @@ print ''; * Charges sociales deductibles */ -print ''.$langs->trans("SocialContributions").''; +print ''.$langs->trans("SocialContributions").' ('.$langs->trans("Type").' 1)'; 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"; @@ -459,12 +459,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"; @@ -474,8 +474,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); @@ -542,6 +542,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti /* * VAT */ + print ''.$langs->trans("VAT").''; $subtotal_ht = 0; $subtotal_ttc = 0; @@ -565,12 +566,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; @@ -607,12 +611,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; @@ -635,7 +642,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"; @@ -676,7 +683,7 @@ else print "".price($amount)."\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"; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 2a7f17733ac..043a2e89f5c 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/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 235d0b194ad..ec53754440f 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -361,25 +361,31 @@ class modAgenda extends DolibarrModules // Exports //-------- - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town', + $r=0; + + $r++; + $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('ac.id'=>"ActionId",'ac.ref_ext'=>"ExternalRef",'ac.datec'=>"ActionDateCreation",'ac.datep'=>"DateActionBegin", + 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Title",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp", + 'cac.libelle'=>"ActionType", + 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town', 'cp.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4', - 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra', - 'ac.id'=>"ActionId",'ac.ref_ext'=>"ExternalRef",'ac.datec'=>"ActionDateCreation",'ac.datep'=>"DateActionBegin", - 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Label",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp", - 'cac.libelle'=>"ActionType"); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text', - 'cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', - 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text', - 'ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date", + 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra'); + $this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date", 'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Number", 'ac.durationp'=>"Duree", - 'cac.libelle'=>"List:c_actioncomm:libelle:rowid"); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company', - 'cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company', - 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company', - 'ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action", + 'cac.libelle'=>"List:c_actioncomm:libelle:rowid", + 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text', + 'cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', + 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text'); + $this->export_entities_array[$r]=array('ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action", 'ac.datep2'=>"action",'ac.label'=>"action",'ac.note'=>"action",'ac.percent'=>"action",'ac.durationp'=>"action", - 'cac.libelle'=>"action"); + 'cac.libelle'=>"action", + 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company', + 'cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company', + 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'actioncomm as ac'; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index dbdfed9003b..49b08003a23 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -214,15 +214,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'=>'VATRate', '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 '; @@ -302,11 +302,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'=>'VATRate', '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/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 405ae03d7f5..b6e35f95f8e 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=''; diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index d503e916414..d244a209b92 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/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index 4da9f5e40c1..f6f634ec7ea 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -123,13 +123,21 @@ if ($search_refsupp) { $sql.= " AND (cf.ref_supplier LIKE '%".$db->escape($search_refsupp)."%')"; } -if ($search_status >= 0) +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; } $sql.= $db->order($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); @@ -146,7 +154,7 @@ if ($resql) if ($search_ttc) $param.="&search_ttc=".$search_ttc; if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; if ($search_status >= 0) $param.="&search_status=".$search_status; - 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 ''; @@ -194,10 +202,10 @@ if ($resql) $filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref); print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print ''."\n"; - + // Ref Supplier print ''."\n"; - + // Company print ''; print ''; print '"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index de1569a91b5..1f75abf0915 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 '
'.$obj->ref_supplier.''.img_object($langs->trans("ShowCompany"),"company").' '; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index a244d85b343..75025a8a539 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -451,6 +451,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) { @@ -1333,7 +1334,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 '
'.$txt.''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
'.$langs->trans('TotalVAT').''.price($objectsrc->total_tva)."
'; print ''; diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 60d6899d5ff..79d5bec834f 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 fea1d7afbb6..9c61c58b49d 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -70,6 +70,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 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 '"; print "\n"; print "\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 '"; print "\n"; print "\n"; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 821686b026c..015e7a8a1e3 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -188,6 +188,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); @@ -228,7 +236,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)) { @@ -500,7 +509,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); diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 9c6e9d80594..00716b9df01 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -529,7 +529,7 @@ if ($resql) print "
'.$langs->trans('TotalMargin')."".price($cumul_vente, null, null, null, null, $rounding)."".price($cumul_achat, null, null, null, null, $rounding)."
'.$langs->trans('TotalMargin')."".price($cumul_vente, null, null, null, null, $rounding)."".price($cumul_achat, null, null, null, null, $rounding)."

"; // 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)