From 91c6d47a60059b5f70bfcd55d9b55a41c7b21629 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 00:06:14 +0200 Subject: [PATCH 01/28] Fix: Clean param Conflicts: htdocs/fourn/class/fournisseur.facture.class.php --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index be2ce721356..dbaf9ac2cea 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1126,6 +1126,7 @@ class FactureFournisseur extends CommonInvoice if ($type < 0) return -1; // Clean parameters + if (empty($vatrate)) $vatrate=0; if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; From 8d63c2f9c53b5d1e31473d0649ffd8a27acde715 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 00:44:55 +0200 Subject: [PATCH 02/28] Fix: ref_ext was not loaded Conflicts: htdocs/contact/class/contact.class.php --- htdocs/contact/class/contact.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 036b99f9ae3..4a05f112eba 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -469,7 +469,7 @@ class Contact extends CommonObject /** - * Charge l'objet contact + * Load object contact * * @param int $id id du contact * @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact @@ -481,7 +481,7 @@ class Contact extends CommonObject $langs->load("companies"); - $sql = "SELECT c.rowid, c.fk_soc, c.civilite as civilite_id, c.lastname, c.firstname,"; + $sql = "SELECT c.rowid, c.fk_soc, c.ref_ext, c.civilite as civilite_id, c.lastname, c.firstname,"; $sql.= " c.address, c.zip, c.town,"; $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; @@ -510,6 +510,7 @@ class Contact extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; + $this->ref_ext = $obj->ref_ext; $this->civilite_id = $obj->civilite_id; $this->lastname = $obj->lastname; $this->firstname = $obj->firstname; From 845deb9a63b9c26fb50b4b6b643deb829dbbf13f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 8 Oct 2013 09:17:04 +0200 Subject: [PATCH 03/28] Add multilang management in ODT models --- htdocs/core/class/translate.class.php | 10 ++++++++++ .../commande/doc/doc_generic_order_odt.modules.php | 14 +++++++++++++- .../doc/doc_generic_shipment_odt.modules.php | 14 +++++++++++++- .../doc/doc_generic_invoice_odt.modules.php | 14 +++++++++++++- .../pdf/doc_generic_project_odt.modules.php | 14 +++++++++++++- .../doc/doc_generic_proposal_odt.modules.php | 14 +++++++++++++- .../societe/doc/doc_generic_odt.modules.php | 12 ++++++++++++ 7 files changed, 87 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index ffa06230d20..a4830ebe0a9 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -784,6 +784,16 @@ class Translate return -1; } } + + function get_translations_for_substitutions() { + $substitutionarray = array(); + + foreach($this->tab_translate as $code => $label) { + $substitutionarray['lang_'.$code] = $label; + } + + return $substitutionarray; + } } ?> diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index b4c115bbac2..e195e55e214 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $this->option_modereg = 0; // Affiche mode reglement $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text @@ -534,6 +534,18 @@ class doc_generic_order_odt extends ModelePDFCommandes dol_syslog($this->error, LOG_WARNING); return -1; } + + // Replace labels translated + $tmparray=$outputlangs->get_translations_for_substitutions(); + foreach($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + } // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index a5b975430d3..73571a65646 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $this->option_modereg = 0; // Affiche mode reglement $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text @@ -534,6 +534,18 @@ class doc_generic_shipment_odt extends ModelePdfExpedition dol_syslog($this->error, LOG_WARNING); return -1; } + + // Replace labels translated + $tmparray=$outputlangs->get_translations_for_substitutions(); + foreach($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + } // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 1f0120c2074..084dee16402 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $this->option_modereg = 0; // Affiche mode reglement $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text @@ -514,6 +514,18 @@ class doc_generic_invoice_odt extends ModelePDFFactures dol_syslog($this->error, LOG_WARNING); return -1; } + + // Replace labels translated + $tmparray=$outputlangs->get_translations_for_substitutions(); + foreach($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + } // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); diff --git a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php index bb1252d7dc9..3e0b9c93fb4 100644 --- a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php @@ -90,7 +90,7 @@ class doc_generic_project_odt extends ModelePDFProjects $this->option_modereg = 0; // Affiche mode reglement $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text @@ -976,6 +976,18 @@ class doc_generic_project_odt extends ModelePDFProjects dol_syslog($this->error, LOG_WARNING); return -1; } + + // Replace labels translated + $tmparray=$outputlangs->get_translations_for_substitutions(); + foreach($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + } // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 45c4d6e9755..7843cf8e057 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -74,7 +74,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $this->option_modereg = 0; // Affiche mode reglement $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues + $this->option_multilang = 1; // Dispo en plusieurs langues $this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text @@ -487,6 +487,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales dol_syslog($this->error, LOG_WARNING); return -1; } + + // Replace labels translated + $tmparray=$outputlangs->get_translations_for_substitutions(); + foreach($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + } // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index d1f06c6f9ec..1259177432f 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -318,6 +318,18 @@ class doc_generic_odt extends ModeleThirdPartyDoc // setVars failed, probably because key not found } } + + // Replace labels translated + $tmparray=$outputlangs->get_translations_for_substitutions(); + foreach($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + } // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); From ef86f150beddcc02db9b4a59146a79ba1e77144e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 12:25:41 +0200 Subject: [PATCH 04/28] Fix: duplicate field --- htdocs/comm/propal/list.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b0f51e442c6..45e69448f43 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -296,9 +296,6 @@ if ($result) print ''; print ''; print ''; - print ''; - print ''; - print ''; print ''; print $langs->trans('Month').': '; print ' '.$langs->trans('Year').': '; From 87ca1d2e2ec82ebda57d760ca437dea70d75af58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 15:18:00 +0200 Subject: [PATCH 05/28] Fix: translation --- htdocs/langs/fr_FR/categories.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 661ac882adf..e877f8e4b41 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -79,10 +79,10 @@ ProductsCategoryShort=Catégorie produits MembersCategoryShort=Catégorie adhérent SuppliersCategoriesShort=Catégories fournisseurs CustomersCategoriesShort=Catégories clients -CustomersProspectsCategoriesShort=Catégories clients/prospects +CustomersProspectsCategoriesShort=Catégories clients/prosp. ProductsCategoriesShort=Catégories produits MembersCategoriesShort=Catégories adhérents -ContactCategoriesShort=Catégorie Contacts +ContactCategoriesShort=Catégories contacts ThisCategoryHasNoProduct=Cette catégorie ne contient aucun produit. ThisCategoryHasNoSupplier=Cette catégorie ne contient aucun fournisseur. ThisCategoryHasNoCustomer=Cette catégorie ne contient aucun client. From eb10b2c5e98faf09f184a937f65601a7d317c123 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 21:14:54 +0200 Subject: [PATCH 06/28] Fix: missing property --- htdocs/adherents/fiche.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 2648a8ae721..251eb062b15 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -273,6 +273,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->pass = trim($_POST["pass"]); $object->societe = trim($_POST["societe"]); + $object->company = trim($_POST["societe"]); + $object->address = trim($_POST["address"]); $object->zip = trim($_POST["zipcode"]); $object->town = trim($_POST["town"]); From e343d3bc6ff12ea7536b0de0e382565437904f96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 21:14:54 +0200 Subject: [PATCH 07/28] Fix: missing property --- htdocs/adherents/fiche.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index d297e6aad81..bca9710c2c7 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -273,6 +273,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->pass = trim($_POST["pass"]); $object->societe = trim($_POST["societe"]); + $object->company = trim($_POST["societe"]); + $object->address = trim($_POST["address"]); $object->zip = trim($_POST["zipcode"]); $object->town = trim($_POST["town"]); From 603c2aa938eb525f35d0529787a54a40c49abab6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2013 21:35:44 +0200 Subject: [PATCH 08/28] Qual: Removed not used file --- htdocs/societe/class/address.class.php | 524 ------------------------- 1 file changed, 524 deletions(-) delete mode 100644 htdocs/societe/class/address.class.php diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php deleted file mode 100644 index 0f1091b37ce..00000000000 --- a/htdocs/societe/class/address.class.php +++ /dev/null @@ -1,524 +0,0 @@ - - * Copyright (C) 2004-2006 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/societe/class/address.class.php - * \ingroup societe - * \brief Fichier de la classe des adresses des tiers - */ - - -/** - * \class Address - * \brief Class to manage addresses - */ -class Address -{ - var $db; - - var $id; - var $type; - var $label; - var $socid; - var $name; - var $address; - var $zip; - var $town; - var $country_id; - var $country_code; - var $phone; - var $fax; - var $note; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } - - /** - * Create address into database - * - * @param int $socid Company socid - * @param User $user Object user making creation - * @return int 0 if OK, < 0 if KO - */ - function create($socid, $user='') - { - global $langs,$conf; - - // Nettoyage parametres - $this->name = trim($this->name); - $this->label = trim($this->label); - - dol_syslog(get_class($this)."::create label=".$this->label); - - $this->db->begin(); - - $result = $this->verify(); - - if ($result >= 0) - { - $now=dol_now(); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_address (label, fk_soc, name, datec, fk_user_creat) "; - $sql .= " VALUES ('".$this->db->escape($this->label)."', '".$socid."', '".$this->db->escape($this->name)."', ".$this->db->idate($now).", '".$user->id."')"; - - $result=$this->db->query($sql); - if ($result) - { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_address"); - - $ret = $this->update($this->id, $socid, $user); - - if ($ret >= 0) - { - dol_syslog(get_class($this)."::create success id=".$this->id); - $this->db->commit(); - return 0; - } - else - { - dol_syslog(get_class($this)."::create echec update"); - $this->db->rollback(); - return -3; - } - } - else - - { - if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - - $this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom); - } - else - { - dol_syslog(get_class($this)."::create echec insert sql=$sql"); - } - $this->db->rollback(); - return -2; - } - - } - else - { - $this->db->rollback(); - dol_syslog(get_class($this)."::create echec verify sql=$sql"); - return -1; - } - } - - - /** - * Verification lors de la modification de l'adresse - * - * @return int 0 if OK, <0 if KO - */ - function verify() - { - $this->label = trim($this->label); - $this->name = trim($this->name); - $result = 0; - if (!$this->name || !$this->label) - { - $this->error = "The name of company and the label can not be empty.\n"; - $result = -2; - } - return $result; - } - - - /** - * Mise a jour des parametres de l'adresse - * - * @param int $id id address - * @param int $socid id third party - * @param User $user Utilisateur qui demande la mise a jour - * @return int <0 if KO, >=0 if OK - */ - function update($id, $socid, $user='') - { - global $langs; - - // Clean parameters - $this->fk_soc = $socid; - $this->label = trim($this->label); - $this->name = trim($this->name); - $this->address = trim($this->address); - $this->zip = trim($this->zip); - $this->town = trim($this->town); - $this->country_id = trim($this->country_id); - $this->phone = trim($this->phone); - $this->phone = preg_replace("/\s/","",$this->phone); - $this->phone = preg_replace("/\./","",$this->phone); - $this->fax = trim($this->fax); - $this->fax = preg_replace("/\s/","",$this->fax); - $this->fax = preg_replace("/\./","",$this->fax); - $this->note = trim($this->note); - - $result = $this->verify(); // Verifie que nom et label obligatoire - - if ($result >= 0) - { - dol_syslog(get_class($this)."::Update verify ok"); - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."societe_address"; - $sql.= " SET label = '" . $this->db->escape($this->label) ."'"; // Champ obligatoire - $sql.= ", name = '" . $this->db->escape($this->name) ."'"; // Champ obligatoire - $sql.= ", address = ".($this->address?"'".$this->db->escape($this->address)."'":"null"); - $sql.= ", zip = ".($this->zip?"'".$this->db->escape($this->zip)."'":"null"); - $sql.= ", town = ".($this->town?"'".$this->db->escape($this->town)."'":"null"); - $sql.= ", fk_pays = '" . ($this->country_id?$this->db->escape($this->country_id):'0') ."'"; - $sql.= ", note = ".($this->note?"'".$this->db->escape($this->note)."'":"null"); - $sql.= ", phone = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null"); - $sql.= ", fax = ".($this->fax?"'".$this->db->escape($this->fax)."'":"null"); - if ($user) $sql .= ",fk_user_modif = '".$user->id."'"; - $sql .= " WHERE fk_soc = '" . $socid ."' AND rowid = '" . $this->db->escape($id) ."'"; - - dol_syslog(get_class($this)."::Update sql=".$sql, LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - dol_syslog(get_class($this)."::Update success"); - $this->db->commit(); - return 1; - } - else - { - if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - - $this->error=$langs->trans("ErrorDuplicateField",$this->name); - $result=-1; - } - else - { - $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::Update error sql=".$sql, LOG_ERR); - $result=-2; - } - $this->db->rollback(); - return $result; - } - } - - } - - /** - * Charge depuis la base toutes les adresses d'une societe - * - * @param int $socid Id de la societe a charger en memoire - * @param User $user Objet de l'utilisateur - * @return int >0 si ok, <0 si ko - */ - function fetch_lines($socid, $user=0) - { - global $langs, $conf; - - $sql = 'SELECT rowid, nom, client, fournisseur'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'societe'; - $sql .= ' WHERE rowid = '.$socid; - - $resqlsoc=$this->db->query($sql); - if ($resqlsoc) - { - if ($this->db->num_rows($resqlsoc)) - { - $obj = $this->db->fetch_object($resqlsoc); - - $this->socname = $obj->nom; - $this->socid = $obj->rowid; - $this->id = $obj->rowid; - $this->client = $obj->client; - $this->fournisseur = $obj->fournisseur; - } - - $this->db->free($resqlsoc); - - $this->lines = array(); - - // Adresses liees a la societe - if ($this->socid) - { - $sql = 'SELECT a.rowid as id, a.label, a.name, a.address, a.datec as dc'; - $sql .= ', a.tms as date_update, a.fk_soc'; - $sql .= ', a.zip, a.town, a.note, a.fk_pays as country_id, a.phone, a.fax'; - $sql .= ', p.code as country_code, p.libelle as country'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.fk_pays = p.rowid'; - $sql .= ' WHERE a.fk_soc = '.$this->socid; - - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $objp = $this->db->fetch_object($resql); - - $line = new AddressLine($this->db); - - $line->id = $objp->id; - $line->date_creation = $this->db->jdate($objp->dc); - $line->date_update = $this->db->jdate($objp->date_update); - $line->label = $objp->label; - $line->name = $objp->name; - $line->address = $objp->address; - $line->zip = $objp->zip; - $line->town = $objp->town; - $line->country_id = $objp->country_id; - $line->country_code = $objp->country_id?$objp->country_code:''; - $line->country = $objp->country_id?($langs->trans('Country'.$objp->country_code)!='Country'.$objp->country_code?$langs->trans('Country'.$objp->country_code):$objp->country):''; - $line->phone = $objp->phone; - $line->fax = $objp->fax; - $line->note = $objp->note; - - $this->lines[$i] = $line; - $i++; - } - $this->db->free($resql); - return $num; - } - else - { - dol_syslog(get_class($this).'::Fetch Erreur: aucune adresse', LOG_ERR); - return 0; - } - } - else - { - dol_syslog(get_class($this).'::Fetch Erreur: societe inconnue', LOG_ERR); - return -1; - } - } - else - { - dol_syslog(get_class($this).'::Fetch '.$this->db->error(), LOG_ERR); - $this->error=$this->db->error(); - } - } - - /** - * Charge depuis la base l'objet adresse - * - * @param int $id Id de l'adresse a charger en memoire - * @param User $user Objet de l'utilisateur - * @return int >0 si ok, <0 si ko - */ - function fetch_address($id, $user=0) - { - global $langs; - global $conf; - - $sql = 'SELECT a.rowid, a.fk_soc, a.label, a.name, a.address, a.datec as date_creation'; - $sql .= ', a.tms as date_update'; - $sql .= ', a.zip, a.town, a.note, a.fk_pays as country_id, a.phone, a.fax'; - $sql .= ', p.code as country_code, p.libelle as country'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.fk_pays = p.rowid'; - $sql .= ' WHERE a.rowid = '.$id; - $resql=$this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); - - $this->id = $obj->rowid; - $this->socid = $obj->fk_soc; - - $this->date_update = $this->db->jdate($obj->date_update); - $this->date_creation = $this->db->jdate($obj->date_creation); - - $this->label = $obj->label; - $this->name = $obj->name; - $this->address = $obj->address; - $this->zip = $obj->zip; - $this->town = $obj->town; - - $this->country_id = $obj->country_id; - $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->trans('Country'.$obj->country_code):$obj->country):''; - - $this->phone = $obj->phone; - $this->fax = $obj->fax; - $this->note = $obj->note; - - $result = 1; - } - else - { - dol_syslog('Erreur Societe::Fetch aucune adresse avec id='.$this->id.' - '.$sql); - $this->error='Erreur Societe::Fetch aucune adresse avec id='.$this->id.' - '.$sql; - $result = -2; - } - - $this->db->free($resql); - } - else - { - dol_syslog('Erreur Societe::Fetch echec sql='.$sql); - dol_syslog('Erreur Societe::Fetch '.$this->db->error()); - $this->error=$this->db->error(); - $result = -3; - } - - return $result; - } - - - /** - * Suppression d'une adresse - * - * @param int $id id de la societe a supprimer - * @param int $socid id third party - * @return void - */ - function delete($id,$socid) - { - dol_syslog("Address::Delete"); - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_address"; - $sql.= " WHERE rowid = ".$id; - $sql.= " AND fk_soc = ".$socid; - - $result = $this->db->query($sql); - - if (!$result) - { - print $this->db->error() . '
' . $sql; - } - } - - /** - * Return name of address with link (and eventually picto) - * Use $this->id, $this->label, $this->socid - * - * @param int $withpicto Include picto with link - * @param string $option Where the link point to - * @return string String with URL - */ - function getNomUrl($withpicto=0,$option='') - { - global $langs; - - $result=''; - - $lien = ''; - $lienfin=''; - - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAddress").': '.$this->label,'address').$lienfin.' '); - $result.=$lien.$this->label.$lienfin; - return $result; - } - - - /** - * Charge les informations d'ordre info dans l'objet societe - * - * @param int $id id de la societe a charger - * @return void - */ - function info($id) - { - $sql = "SELECT s.rowid, s.nom, datec, datea,"; - $sql.= " fk_user_creat, fk_user_modif"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.rowid = ".$id; - - $result=$this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); - - $this->id = $obj->rowid; - - if ($obj->fk_user_creat) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_creat); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_modif) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_modif); - $this->user_modification = $muser; - } - $this->ref = $obj->nom; - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datea); - } - - $this->db->free($result); - - } - else - { - dol_print_error($this->db); - } - } - -} - - -/** - * \class AddressLine - * \brief Class to manage one address line - */ -class AddressLine -{ - - var $id; - var $date_creation; - var $date_update; - var $label; - var $name; - var $address; - var $zip; - var $town; - var $country_id; - var $country_code; - var $country; - var $phone; - var $fax; - var $note; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } -} -?> \ No newline at end of file From d2c4de9232174650d8b03e051dbc18be936c6132 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 15:00:42 +0200 Subject: [PATCH 09/28] Fix: translation --- htdocs/langs/el_GR/admin.lang | 126 ++++++++++++++++----------------- htdocs/langs/el_GR/propal.lang | 56 +++++++-------- htdocs/langs/en_US/propal.lang | 2 +- 3 files changed, 92 insertions(+), 92 deletions(-) diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index 6ee42a9b1ba..0bfe2e313f3 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -10,36 +10,36 @@ VersionDevelopment=Υπό ανάπτυξη VersionUnknown=Άγνωστη VersionRecommanded=Προτεινόμενη SessionId=ID Συνόδου -SessionSaveHandler=Φορέα εξυπηρέτησης για να σώσει συνεδρίες +SessionSaveHandler=Φορέας χειρισμού αποθήκευσης συνεδριών SessionSavePath=Αποθήκευση τοπικής προσαρμογής συνεδρίας PurgeSessions=Διαγραφή συνόδων ConfirmPurgeSessions=Είστε σίγουροι ότι θέλετε να εκκαθαρίσετε όλες τις συνεδρίες; Αυτό θα αποσυνδέσει όλους τους χρήστες (εκτός από τον εαυτό σας). -NoSessionListWithThisHandler=Save session handler configured in your PHP does not allow to list all running sessions. -LockNewSessions=Κλειδώσετε τις νέες συνδέσεις -ConfirmLockNewSessions=Είστε σίγουροι ότι θέλετε να περιορίσει κάθε νέα σύνδεση Dolibarr για τον εαυτό σας. Μόνο ο χρήστης %s θα είναι σε θέση να συνδεθεί μετά από αυτό. +NoSessionListWithThisHandler=Ο Φορέας χειρισμού αποθήκευσης συνεδριών που έχει διαμορφωθεί στο PHP σας δεν επιτρέπει καταχώρηση όλων των τρέχοντων συνεδριών. +LockNewSessions=Κλειδώστε τις νέες συνδέσεις +ConfirmLockNewSessions=Είστε σίγουροι ότι θέλετε να περιορίσετε κάθε νέα σύνδεση Dolibarr για τον εαυτό σας. Μόνο ο χρήστης %s θα είναι σε θέση να συνδεθεί μετά από αυτό. UnlockNewSessions=Κατάργηση κλειδώματος σύνδεσης YourSession=Η σύνοδος σας Sessions=Σύνοδοι χρηστών -WebUserGroup=Διακομιστή Web χρήστη / ομάδα -NoSessionFound=Your PHP seems to not allow to list active sessions. Directory used to save sessions (%s) might be protected (For example, by OS permissions or by PHP directive open_basedir). -HTMLCharset=Σετ χαρακτήρων που δημιουργούνται για HTML σελίδες +WebUserGroup=Χειριστής/Ομάδα Διακομιστή Web +NoSessionFound=Το PHP σας δεν επιτρέπει την καταγραφή όλων των ενεργοποιημένων συνεδριών. Ο κατάλογος που χρησιμοποιείται για να αποθηκεύετε συνεδρίες (%s) πιθανόν προστατεύεται (Για παράδειγμα, από OS άδειες ή από οδηγίες PHP open_basedir). +HTMLCharset=Σετ χαρακτήρων για δημιουργημένες HTML σελίδες DBStoringCharset=Σύνολο χαρακτήρων βάσης δεδομένων για την αποθήκευση δεδομένων -DBSortingCharset=Σύνολο χαρακτήρων βάσης δεδομένων για να ταξινομήσετε τα δεδομένα +DBSortingCharset=Σετ χαρακτήρων βάσης δεδομένων για ταξινόμηση δεδομένων WarningModuleNotActive=Το άρθρωμα %s πρέπει να ενεργοποιηθεί -WarningOnlyPermissionOfActivatedModules=Τα μόνο δικαιώματα που σχετίζονται με ενεργοποιημένες ενότητες που παρουσιάζονται εδώ. Μπορείτε να ενεργοποιήσετε άλλες ενότητες στο Αρχική-> Ρυθμίσεις-> σελίδα Αρθρώματα. +WarningOnlyPermissionOfActivatedModules=Εδώ φαίνονται μόνο τα δικαιώματα που σχετίζονται με ενεργοποιημένες ενότητες. Μπορείτε να ενεργοποιήσετε άλλες ενότητες στο Αρχική-> Ρυθμίσεις-> σελίδα Αρθρώματα. DolibarrSetup=Εγκατάσταση ή αναβάθμιση του Dolibarr DolibarrUser=Χρήστης Dolibarr InternalUser=Εσωτερικός χρήστης ExternalUser=Εξωτερικός χρήστης InternalUsers=Εσωτερικοί χρήστες ExternalUsers=Εξωτερικοί χρήστες -GlobalSetup=Καθολική Διαχείριση +GlobalSetup=Σφαιρική Διαχείριση GUISetup=Εμφάνιση SetupArea=Περιοχή Παραμετροποίησης -FormToTestFileUploadForm=Form to test file upload (according to setup) +FormToTestFileUploadForm=Έντυπο για να ελέγξετε το αρχείο μεταφόρτωσης (ανάλογα με τις ρυθμίσεις) IfModuleEnabled=Σημείωση: ναι, είναι αποτελεσματική μόνο αν η ενότητα %s είναι ενεργοποιημένη -RemoveLock=Αφαίρεση αρχείου %s αν υπάρχει για να επιτρέψει τη χρήση του εργαλείου ενημέρωσης. -RestoreLock=Επαναφορά αρχείου %s, με δικαίωμα ανάγνωσης μόνο, για να απενεργοποιήσετε οποιαδήποτε χρήση του εργαλείου ενημέρωσης. +RemoveLock=Αφαίρεστε το αρχείο %s, αν υπάρχει, για να επιτραπεί η χρήση του εργαλείου ενημέρωσης. +RestoreLock=Επαναφέρατε το αρχείο %s, με δικαίωμα ανάγνωσης μόνο, για να απενεργοποιηθεί οποιαδήποτε χρήση του εργαλείου ενημέρωσης. SecuritySetup=Διαχείριση Ασφάλειας ErrorModuleRequirePHPVersion=Λάθος, αυτή η ενότητα απαιτεί έκδοση PHP %s ή υψηλότερη ErrorModuleRequireDolibarrVersion=Λάθος, αυτή η ενότητα απαιτεί Dolibarr έκδοση %s ή υψηλότερη @@ -52,58 +52,58 @@ DisableJavascript=Απενεργοποίηση συναρτήσεων JavaScript ConfirmAjax=Χρήση διαλόγων επιβεβαίωσης Ajax UseSearchToSelectCompany=Χρήση φόρμας αναζήτησης για επιλογή εταιρίας (αντί χρήσης πλαισίων λίστας). Αν έχετε μεγάλο αριθμό στοιχείων (>100000) μπορείτε να αυξήσετε την ταχύτητα θέτοντας την μεταβλητή SOCIETE_DONOTSEARCH_ANYWHERE σε 1 στο μενού Ρυθμίσεις -> Άλλες Ρυθμίσεις ActivityStateToSelectCompany= Προσθέστε μια επιλογή φίλτρου για εμφάνιση / απόκρυψη τρίτα μέρη τα οποία βρίσκονται σε λειτουργία ή έχει παύσει -UseSearchToSelectContact=Use autocompletion fields to choose contact (instead of using a list box).

Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. +UseSearchToSelectContact=Χρησιμοποιήστε τα πεδία αυτόματης συμπλήρωσης για να επιλέξετε επαφή (αντί να χρησιμοποιήσετε ένα πλαίσιο λίστας).

Επίσης, αν έχετε ένα μεγάλο αριθμό τρίτων (> 100 000), μπορείτε να αυξήσετε την ταχύτητα με τη σταθερή CONTACT_DONOTSEARCH_ANYWHERE στο 1 στην Εγκατάσταση->Άλλα. Η αναζήτηση μετά θα περιορίζεται απο την έναρξη της συμβολοσειράς. SearchFilter=Αναζήτηση επιλογές φίλτρων NumberOfKeyToSearch=Πλήθος χαρακτήρων για να ξεκινήσει η αναζήτηση: %s -ViewFullDateActions=Show full dates actions in the third sheet +ViewFullDateActions=Εμφάνιση πλήρους χρονοδιαγράματος γεγονότων στο τρίτο φύλλο NotAvailableWhenAjaxDisabled=Δεν είναι διαθέσιμο όταν το Ajax είναι απενεργοποιημένο JavascriptDisabled=Η JavaScript είναι απενεργοποιημένη UsePopupCalendar=Χρήση popup για είσοδο ημερομηνιών UsePreviewTabs=Χρήση καρτελών προεπισκόπησης ShowPreview=Εμφάνιση προεπισκόπησης PreviewNotAvailable=Η προεπισκόπηση δεν είναι διαθέσιμη -ThemeCurrentlyActive=Ενεργή θεματική παραλλαγή +ThemeCurrentlyActive=Θεματική Επι του Παρόντος Ενεργή CurrentTimeZone=TimeZone PHP (server) Space=Κενό Table=Πίνακας Fields=Πεδία -Index=Index +Index=Ευρετήριο Mask=Μάσκα NextValue=Επόμενο NextValueForInvoices=Επόμενο (τιμολόγιο) NextValueForCreditNotes=Επόμενη αξία (πιστωτικά σημειώματα) -MustBeLowerThanPHPLimit=Note: your PHP limits each file upload's size to %s %s, whatever this parameter's value is -NoMaxSizeByPHPLimit=Note: No limit is set in your PHP configuration +MustBeLowerThanPHPLimit=Σημείωση: Η PHP σας περιορίζει το μέγεθος κάθε αρχείου αποστολής σε % s %s, ανεξάρτητα από το ποιά είναι η αξία αυτής της παραμέτρου. +NoMaxSizeByPHPLimit=Σημείωση: Κανένα όριο δεν έχει οριστεί στη διαμόρφωση του PHP σας MaxSizeForUploadedFiles=Μέγιστο μέγεθος για μεταφόρτωση αρχείων (0 απορρίπτει οποιοδήποτε upload) -UseCaptchaCode=Use graphical code (CAPTCHA) on login page +UseCaptchaCode=Χρησιμοποιήστε το γραφικό κώδικα (CAPTCHA) στη σελίδα εισόδου UseAvToScanUploadedFiles=Χρήση αντιβιοτικού για έλεγχο των αρχείων που θα μεταφορτωθούν στο διακομιστή -AntiVirusCommand= Πλήρης διαδρομή για το εκτελέσιμο αρχείο του αντιβιοτικού +AntiVirusCommand= Πλήρης διαδρομή για εντολή αντιβιοτικού AntiVirusCommandExample= Παράδειγμα για ClamWin: c:\\Program Files (x86)\\ClamWin\\bin\\clamscan.exe
Παράδειγμα για ClamAv: /usr/bin/clamscan AntiVirusParam= Περισσότερες παράμετροι στην γραμμή εντολής -AntiVirusParamExample= Example for ClamWin: --database="C:\\Program Files (x86)\\ClamWin\\lib" -ComptaSetup=Accounting module setup +AntiVirusParamExample= Παράδειγμα για το ClamWin: --database="C:\\Program Files (x86)\\ClamWin\\lib" +ComptaSetup=Εγκατάσταση Λογιστικής Ενότητας UserSetup=Ρύθμιση χρήστη MenuSetup=Ρύθμιση Menu MenuLimits=Όρια και ακρίβεια -MenuIdParent=Parent menu ID -DetailMenuIdParent=ID of parent menu (empty for a top menu) -DetailPosition=Αριθμός Ταξινόμηση για να καθορίσει τη θέση του μενού -PersonalizedMenusNotSupported=Εξατομικευμένα μενού που δεν υποστηρίζονται +MenuIdParent=ID Μητρικού Μενού +DetailMenuIdParent=ID του μητρικού μενού (άδειο για μενού κορυφής) +DetailPosition=Αριθμός Ταξινόμησης για να καθορίστει η θέση του μενού +PersonalizedMenusNotSupported=Εξατομικευμένα μενού δεν υποστηρίζονται AllMenus=Όλα -NotConfigured=Δεν έχει καθοριστεί +NotConfigured=Η ενότητα δεν έχει ρυθμιστεί Setup=Διαχείριση Activation=Ενεργοποίηση -Active=Active +Active=Ενεργό SetupShort=Διαχείριση OtherOptions=Άλλες Επιλογές OtherSetup=Άλλες Ρυθμίσεις -CurrentValueSeparatorDecimal=Decimal separator -CurrentValueSeparatorThousand=Thousand separator -Modules=Αρθρώματα -ModulesCommon=Βασικά Αρθρώματα -ModulesOther=Άλλα Αρθρώματα -ModulesInterfaces=Αρθρώματα Διεπαφής -ModulesSpecial=Modules very specific +CurrentValueSeparatorDecimal=Διαχωριστικό Δεκαδικών +CurrentValueSeparatorThousand=Διαχωριστικό Χιλιάδων +Modules=Ενότητες +ModulesCommon=Βασικές Ενότητες +ModulesOther=Άλλες Ενότητες +ModulesInterfaces=Ενότητες Διεπαφής +ModulesSpecial=Ειδικές Ενότητες ParameterInDolibarr=Παράμετρος %s LanguageParameter=Παράμετρος γλώσσας %s LanguageBrowserParameter=Παράμετρος %s @@ -118,7 +118,7 @@ DaylingSavingTime=Η θερινή ώρα (χρήστη) CurrentHour=PHP server hour CompanyTZ=Time Zone company (main company) CompanyHour=Hour company (main company) -CurrentSessionTimeOut=Current session timeout +CurrentSessionTimeOut=Χρονικό όριο περιόδου λειτουργίας τρεχούσης συνοδού YouCanEditPHPTZ=Για να ορίσετε μια διαφορετική ζώνη ώρας της PHP (δεν απαιτείται), μπορείτε να δοκιμάσετε να προσθέσετε ένα αρχείο .htacces με μια γραμμή σαν αυτό "TZ setenv Europe / Paris" OSEnv=Περιβάλλον OS Box=Πλαίσιο @@ -126,8 +126,8 @@ Boxes=Πλαίσια MaxNbOfLinesForBoxes=Μέγιστο πλήθος γραμμών για τα πλαίσια πληροφοριών PositionByDefault=Προκαθορισμένη σειρά Position=Σειρά -MenusDesc=Μενού διαχειριστές καθορίζουν το περιεχόμενο των 2 μπαρ μενού (οριζόντια γραμμή και κάθετη γραμμή). -MenusEditorDesc=The menu editor allow you to define personalized entries in menus. Use it carefully to avoid making dolibarr unstable and menu entries permanently unreachable.
Some modules add entries in the menus (in menu All in most cases). If you removed some of these entries by mistake, you can restore them by disabling and reenabling the module. +MenusDesc=Οι διαχειριστές μενού καθορίζουν το περιεχόμενο των 2 μπαρ μενού (οριζόντια γραμμή και κάθετη γραμμή). +MenusEditorDesc=Ο επεξεργαστής μενού σας επιτρέπει να ορίσετε προσωπικές καταχωρήσεις στα μενού. Χρησιμοποιήστε το με προσοχή για να αποφύγετε να κάνετε το dolibarr ασταθές και τις καταχωρήσεις μενού μόνιμα απρόσιτες.
Μερικές μονάδες προσθέτουν καταχωρήσεις στα μενού (στο μενού All στις περισσότερες περιπτώσεις). Εάν αφαιρεθεί κάποια από αυτές τις καταχωρήσεις κατά λάθος, μπορείτε να τα επαναφέρετε με την απενεργοποίηση και εκ νέου ενεργοποίηση της μονάδας. MenuForUsers=Μενού για τους χρήστες LangFile=Αρχείο .lang System=Σύστημα @@ -136,10 +136,10 @@ SystemTools=Εργαλεία Συστήματος SystemToolsArea=Περιοχή Εργαλειών Συστήματος SystemToolsAreaDesc=Αυτή η περιοχή παρέχει δυνατότητες διαχείρισης. Χρησιμοποιήστε το μενού για να επιλέξετε τη λειτουργία που ψάχνετε. Purge=Εκκαθάριση -PurgeAreaDesc=This page allows you to delete all files built or stored by Dolibarr (temporary files or all files in %s directory). Using this feature is not necessary. It is provided for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files built by the web server. -PurgeDeleteLogFile=Delete log file %s defined for Syslog module (no risk to loose data) +PurgeAreaDesc=Αυτή η σελίδα σας επιτρέπει να διαγράψετε όλα τα αρχεία που κατασκευάζονται ή αποθηκεύονται από Dolibarr (προσωρινά αρχεία ή όλα τα αρχεία σε % s directory). Η χρήση αυτής της λειτουργίας δεν είναι απαραίτητη. Παρέχεται για χρήστες των οποίων το Dolibarr φιλοξενείται από πάροχο, που δεν προσφέρει δικαιώμα διαγραφής αρχείων που κατασκευάστηκαν από τον web server. +PurgeDeleteLogFile=Διαγραφή αρχείου καταγραφής % s που ορίζεται για τη μονάδα syslog (δεν υπάρχει κίνδυνος απώλειας δεδομένων) PurgeDeleteTemporaryFiles=Διαγραφή όλων των προσωρινών αρχείων (ΔΕΝ υπάρχει κίνδυνος απώλειας δεδομένων) -PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory %s. Temporary files but also database backup dumps, files attached to elements (third parties, invoices, ...) and uploaded into the ECM module will be deleted. +PurgeDeleteAllFilesInDocumentsDir=Διαγραφή όλων των αρχείων στον κατάλογο % s. Προσωρινά αρχεία αλλά και βάση δεδομένων αντιγράφων ασφαλείας κάδου απορριμάτων, αρχεία που συνδέονται με τα στοιχεία (τρίτοι, τιμολόγια, ...) και μεταφορτώνονται στη μονάδα ECM θα διαγραφούν. PurgeRunNow=Διαγραφή τώρα PurgeNothingToDelete=Δεν υπάρχει κατάλογος ή αρχείο για διαγραφή. PurgeNDirectoriesDeleted=%s αρχεία ή κατάλογοι που διαγραφήκαν. @@ -148,46 +148,46 @@ ConfirmPurgeAuditEvents=Είστε σίγουροι ότι θέλετε να δ NewBackup=Νέο αντίγραφο ασφαλείας GenerateBackup=Δημιουργία αντιγράφου ασφαλείας Backup=Αντίγραφα Ασφαλείας -Restore=Επαναφορά Αντιγράφων +Restore=Επαναφορά RunCommandSummary=Το Backup έχει ξεκινήσει με την ακόλουθη εντολή RunCommandSummaryToLaunch=Backup μπορεί να ξεκινήσει με την ακόλουθη εντολή WebServerMustHavePermissionForCommand=Ο web server σας πρέπει να έχει την άδεια για να τρέξει αυτές τις εντολές BackupResult=Αποτέλεσμα αντιγράφων ασφαλείας -BackupFileSuccessfullyCreated=Δημιουργία αντιγράφων ασφαλείας το αρχείο ολοκληρώθηκε με επιτυχία -YouCanDownloadBackupFile=Τα αρχεία μπορείτε τώρα να τα κατεβάσετε -NoBackupFileAvailable=Δεν υπάρχουν αρχεία αντιγράφων ασφαλείας. +BackupFileSuccessfullyCreated=Το Αρχείο δημιουργίας αντιγράφων ασφαλείας δημιουργήθηκε με επιτυχία +YouCanDownloadBackupFile=Τα παραγόμενα αρχεία μπορούν τώρα να κατέβουν. +NoBackupFileAvailable=Δεν υπάρχουν διαθέσιμα αρχεία αντιγράφων ασφαλείας. ExportMethod=Μέθοδος Εξαγωγής ImportMethod=Μέθοδος Εισαγωγής -ToBuildBackupFileClickHere=To build a backup file, click here. +ToBuildBackupFileClickHere=Για να δημιουργήσετε ένα αρχείο αντιγράφων ασφαλείας, κάντε κλίκ εδώ. ImportMySqlDesc=Για να εισαγάγετε ένα αρχείο αντιγράφου ασφαλείας, θα πρέπει να χρησιμοποιήσετε mysql εντολή από την γραμμή εντολών: ImportPostgreSqlDesc=Για την εισαγωγή ενός αντιγράφου ασφαλείας, πρέπει να χρησιμοποιήσετε pg_restore εντολή από την γραμμή εντολών: ImportMySqlCommand=%s %s < mybackupfile.sql ImportPostgreSqlCommand=%s %s mybackupfile.sql FileNameToGenerate=Όνομα αρχείου προς δημιουργία Compression=Συμπίεση -CommandsToDisableForeignKeysForImport=Command to disable foreign keys on import -CommandsToDisableForeignKeysForImportWarning=Mandatory if you want to be able to restore your sql dump later -ExportCompatibility=Compatibility of generated export file -MySqlExportParameters=MySQL export parameters -PostgreSqlExportParameters= PostgreSQL export parameters -UseTransactionnalMode=Use transactional mode -FullPathToMysqldumpCommand=Full path to mysqldump command +CommandsToDisableForeignKeysForImport=Εντολή απενεργοποίησης ξένων πλήκτρων κάτα την εισαγωγή +CommandsToDisableForeignKeysForImportWarning=Αναγκαίο, εαν θέλετε να έχετε αργότερα την δυνατότητα αποκαταστασης του sql dump σας +ExportCompatibility=Συμβατότητα των παραχθέντων αρχείων εξαγωγής +MySqlExportParameters=MySQL Παραμετροι Εξαγωγών +PostgreSqlExportParameters= PostgreSQL Παράμετροι Εξαγωγών +UseTransactionnalMode=Χρήση Συναλλακτικής Λειτουργίας +FullPathToMysqldumpCommand=Πλήρης διαδρομή προς την εντολ mysqldump FullPathToPostgreSQLdumpCommand=Η πλήρης διαδρομή προς pg_dump εντολή ExportOptions=Επιλογές Εξαγωγής -AddDropDatabase=Add DROP DATABASE command -AddDropTable=Add DROP TABLE command -ExportStructure=Structure +AddDropDatabase=Προσθήκη εντολής DROP DATABASE +AddDropTable=Προσθήκη εντολής DROP TABLE +ExportStructure=Δομή Datas=Δεδομένα NameColumn=Όνοματα Στηλών -ExtendedInsert=Extended INSERT -NoLockBeforeInsert=Δεν εντολές κλειδαριά ασφαλείας γύρω από INSERT -DelayedInsert=Delayed insert -EncodeBinariesInHexa=Encode binary data in hexadecimal -IgnoreDuplicateRecords=Ignore errors of duplicate records (INSERT IGNORE) +ExtendedInsert=Εκτεταμένη INSERT +NoLockBeforeInsert=Δεν υπάρχουν εντολές κλειδώματος ασφαλείας γύρω από INSERT +DelayedInsert=Καθυστέρηση ένθετου +EncodeBinariesInHexa=Κωδικοποίηση δυαδικών δεδομένων σε δεκαεξαδική +IgnoreDuplicateRecords=Αγνοήστε τα λάθη των διπλών εγγραφών (Insert IGNORE) Yes=Ναι No=Όχι AutoDetectLang=Αυτόματη Ανίχνευση (γλώσσα φυλλομετρητή) -FeatureDisabledInDemo=Feature disabled in demo +FeatureDisabledInDemo=Δυνατότητα απενεργοποίησης στο demo Rights=Δικαιώματα BoxesDesc=Boxes are screen area that show a piece of information on some pages. You can choose between showing the box or not by selecting target page and clicking 'Activate', or by clicking the dustbin to disable it. OnlyActiveElementsAreShown=Only elements from enabled modules are shown. diff --git a/htdocs/langs/el_GR/propal.lang b/htdocs/langs/el_GR/propal.lang index 0c389e38861..271a6df7dca 100644 --- a/htdocs/langs/el_GR/propal.lang +++ b/htdocs/langs/el_GR/propal.lang @@ -3,9 +3,9 @@ CHARSET=UTF-8 Proposals=Εμπορικές προτάσεις Proposal=Εμπορική πρόταση ProposalShort=Πρόταση -ProposalsDraft=Draft commercial proposals -ProposalDraft=Draft commercial proposal -ProposalsOpened=Opened commercial proposals +# ProposalsDraft=Draft commercial proposals +# ProposalDraft=Draft commercial proposal +# ProposalsOpened=Opened commercial proposals Prop=Εμπορικές προτάσεις CommercialProposal=Εμπορική πρόταση CommercialProposals=Εμπορικές προτάσεις @@ -18,35 +18,35 @@ ProspectList=Λίστα προοπτικών DeleteProp=Διαγραφή εμπορικής πρότασης ValidateProp=Επικύρωση εμπορικής πρότασης AddProp=Προσθήκη πρότασης -ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ? -ConfirmValidateProp=Are you sure you want to validate this commercial proposal ? -LastPropals=Last %s proposals -LastClosedProposals=Last %s closed proposals +# ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ? +# ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name %s ? +# LastPropals=Last %s proposals +# LastClosedProposals=Last %s closed proposals LastModifiedProposals=%s τελευταίες εμπορικές προτάσεις AllPropals=Όλες οι προτάσεις LastProposals=Τελευταίες προτάσεις SearchAProposal=Εύρεση πρότασης -ProposalsStatistics=Commercial proposal's statistics -NumberOfProposalsByMonth=Number by month -AmountOfProposalsByMonthHT=Amount by month (net of tax) -NbOfProposals=Number of commercial proposals -ShowPropal=Show proposal -PropalsDraft=Drafts -PropalsOpened=Opened -PropalsNotBilled=Closed not billed -PropalStatusDraft=Draft (needs validation) -PropalStatusValidated=Validated (proposal is open) -PropalStatusOpened=Validated (proposal is open) -PropalStatusClosed=Closed -PropalStatusSigned=Signed (needs billing) -PropalStatusNotSigned=Not signed (closed) -PropalStatusBilled=Billed -PropalStatusDraftShort=Draft -PropalStatusValidatedShort=Validated -PropalStatusOpenedShort=Opened -PropalStatusClosedShort=Closed -PropalStatusSignedShort=Signed -PropalStatusNotSignedShort=Not signed +# ProposalsStatistics=Commercial proposal's statistics +# NumberOfProposalsByMonth=Number by month +# AmountOfProposalsByMonthHT=Amount by month (net of tax) +# NbOfProposals=Number of commercial proposals +# ShowPropal=Show proposal +# PropalsDraft=Drafts +# PropalsOpened=Opened +# PropalsNotBilled=Closed not billed +# PropalStatusDraft=Draft (needs validation) +# PropalStatusValidated=Validated (proposal is open) +# PropalStatusOpened=Validated (proposal is open) +# PropalStatusClosed=Closed +# PropalStatusSigned=Signed (needs billing) +# PropalStatusNotSigned=Not signed (closed) +# PropalStatusBilled=Billed +# PropalStatusDraftShort=Draft +# PropalStatusValidatedShort=Validated +# PropalStatusOpenedShort=Opened +# PropalStatusClosedShort=Closed +# PropalStatusSignedShort=Signed +# PropalStatusNotSignedShort=Not signed PropalStatusBilledShort=Χρεωμένη PropalsToClose=Εμπορικές προτάσεις προς κλείσιμο PropalsToBill=Υπογεγραμμένες εμπορικές προτάσεις προς χρέωση diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index a54bdfb0b2b..ae6e0a72cc8 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -34,7 +34,7 @@ ShowPropal=Show proposal PropalsDraft=Drafts PropalsOpened=Opened PropalsNotBilled=Closed not billed -PropalStatusDraft=Draft (needs validation) +PropalStatusDraft=Draft (needs to be validated) PropalStatusValidated=Validated (proposal is open) PropalStatusOpened=Validated (proposal is open) PropalStatusClosed=Closed From 43fd4d0784273a3cf63094353dc8cfdc2d05e438 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 16:04:06 +0200 Subject: [PATCH 10/28] Complete debian packager tuto --- build/debian/README.howto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/debian/README.howto b/build/debian/README.howto index 4978b686070..6f06f5ab91b 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -207,8 +207,11 @@ Note: If there was errors managed manually, you may need to make a git commit bu > sbuild ... > dput ... -* Go into page. You should see new package into unstable. -http://packages.qa.debian.org/t/tcpdf.html +* Package arrives into FTPmaster taskboard with status NEW (pending upload). You can view it at: +http://ftp-master.debian.org/new/ + +* Once package is validated, you should see it into area unstable at: +http://packages.qa.debian.org * Package will be into release when test will be moved as stable. From f4a83f0851369519aaf24dffa6cebbcdc2cc133d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 20:30:49 +0200 Subject: [PATCH 11/28] Qual: Debug of replenishment feature --- htdocs/core/menus/init_menu_auguria.sql | 2 + htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/en_US/products.lang | 6 +- htdocs/langs/en_US/stocks.lang | 6 +- htdocs/langs/fr_FR/stocks.lang | 6 +- htdocs/product/stock/replenish.php | 802 ++++++++++++----------- htdocs/product/stock/replenishorders.php | 47 +- 7 files changed, 454 insertions(+), 417 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index f59aa43a6af..140fc3480ea 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -102,6 +102,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/liste.php', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3103__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/valo.php', 'EnhancedValue', 1, 'stocks', '$user->rights->stock->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/mouvement.php', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); + -- Product - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3201__+MAX_llx_menu__, 'products', '', 3200__+MAX_llx_menu__, '/categories/fiche.php?action=create&type=0', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f6604ff0253..98021186e34 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1007,7 +1007,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/liste.php", $langs->trans("List"), 1, $user->rights->stock->lire); if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/valo.php", $langs->trans("EnhancedValue"), 1, $user->rights->stock->lire); if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); - if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire); + if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire); } // Expeditions diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index fde34aa52a0..27108adef18 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -143,11 +143,11 @@ NoStockForThisProduct=No stock for this product NoStock=No Stock Restock=Restock ProductSpecial=Special -QtyMin=Min. Order Qty. +QtyMin=Minimum Qty PriceQty=Price for this quantity -PriceQtyMin=MOQ Price (w/o discount) +PriceQtyMin=Price for this min. qty (w/o discount) VATRateForSupplierProduct=VAT Rate (for this supplier/product) -DiscountQtyMin=MOQ Discount (by default) +DiscountQtyMin=Default discount for qty NoPriceDefinedForThisSupplier=No price/qty defined for this supplier/product NoSupplierPriceDefinedForThisProduct=No supplier price/qty defined for this product RecordedProducts=Products recorded diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 80b8fb352ac..b26970e110d 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -95,8 +95,10 @@ Replenishment=Replenishment ReplenishmentOrders=Replenishment orders UseVirtualStock=Use virtual stock instead of physical stock RuleForStockReplenishment=Rule for stocks replenishment -SelectProduct=Select at least one product +SelectProductWithNotNullQty=Select at least one product with a qty not null and a supplier AlertOnly= Alerts only WarehouseForStockDecrease=The warehouse %s will be used for stock decrease WarehouseForStockIncrease=The warehouse %s will be used for stock increase -ForThisWarehouse=For this warehouse \ No newline at end of file +ForThisWarehouse=For this warehouse +ReplenishmentStatusDesc=This is list of all product with a physical stock lower than desired stock and suggest you to create supplier orders to fill the difference. +ReplenishmentOrdersDesc=This is list of all opened supplier orders \ No newline at end of file diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 934e0b59b99..d1ce8931a1a 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -95,8 +95,10 @@ Replenishment=Réapprovisionnement ReplenishmentOrders=Commandes de réapprovisionnement UseVirtualStock=Utiliser le stock théorique à la place du stock physique RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks -SelectProduct=Sélectionnez au moins un produit +SelectProductWithNotNullQty=Sélectionnez au moins un produit avec une quantité non nulle et un fournisseur AlertOnly = Alertes seulement WarehouseForStockDecrease=L'entrepôt %s sera utilisé pour la décrémentation du stock WarehouseForStockIncrease=L'entrepôt %s sera utilisé pour l'incrémentation du stock -ForThisWarehouse=Pour cet entrepôt \ No newline at end of file +ForThisWarehouse=Pour cet entrepôt +ReplenishmentStatusDesc=Cet écran permet de voir les produits avec un stock physique inférieure à la quantité minimale désirée et propose de créer des commandes fournisseurs pour compléter la différence +ReplenishmentOrdersDesc=Voici la liste des commandes fournisseurs en cours \ No newline at end of file diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 30941ec0cc2..650891bb6bd 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -67,7 +67,8 @@ $offset = $limit * $page ; * Actions */ -if (isset($_POST['button_removefilter']) || isset($_POST['valid'])) { +if (isset($_POST['button_removefilter']) || isset($_POST['valid'])) +{ $sref = ''; $snom = ''; $sal = ''; @@ -75,16 +76,19 @@ if (isset($_POST['button_removefilter']) || isset($_POST['valid'])) { } //orders creation -//FIXME: could go in the lib -if ($action == 'order' && isset($_POST['valid'])) { +//TODO: could go in the lib +if ($action == 'order' && isset($_POST['valid'])) +{ $linecount = GETPOST('linecount', 'int'); $box = 0; unset($_POST['linecount']); if ($linecount > 0) { $suppliers = array(); - for ($i = 0; $i < $linecount; $i++) { - if(GETPOST($i, 'alpha') === 'on' - && GETPOST('fourn' . $i, 'int') > 0) { //one line + for ($i = 0; $i < $linecount; $i++) + { + if (GETPOST($i, 'alpha') === 'on' && GETPOST('fourn' . $i, 'int') > 0) + { + //one line $box = $i; $supplierpriceid = GETPOST('fourn'.$i, 'int'); //get all the parameters needed to create a line @@ -95,22 +99,28 @@ if ($action == 'order' && isset($_POST['valid'])) { $sql .= MAIN_DB_PREFIX . 'product_fournisseur_price'; $sql .= ' WHERE rowid = ' . $supplierpriceid; $resql = $db->query($sql); - if ($resql && $db->num_rows($resql) > 0) { - //might need some value checks - $obj = $db->fetch_object($resql); - $line = new CommandeFournisseurLigne($db); - $line->qty = $qty; - $line->desc = $desc; - $line->fk_product = $obj->fk_product; - $line->tva_tx = $obj->tva_tx; - $line->subprice = $obj->unitprice; - $line->total_ht = $obj->unitprice * $qty; - $tva = $line->tva_tx / 100; - $line->total_tva = $line->total_ht * $tva; - $line->total_ttc = $line->total_ht + $line->total_tva; - $line->ref_fourn = $obj->ref_fourn; - $suppliers[$obj->fk_soc]['lines'][] = $line; - } else { + if ($resql && $db->num_rows($resql) > 0) + { + if ($qty) + { + //might need some value checks + $obj = $db->fetch_object($resql); + $line = new CommandeFournisseurLigne($db); + $line->qty = $qty; + $line->desc = $desc; + $line->fk_product = $obj->fk_product; + $line->tva_tx = $obj->tva_tx; + $line->subprice = $obj->unitprice; + $line->total_ht = $obj->unitprice * $qty; + $tva = $line->tva_tx / 100; + $line->total_tva = $line->total_ht * $tva; + $line->total_ttc = $line->total_ht + $line->total_tva; + $line->ref_fourn = $obj->ref_fourn; + $suppliers[$obj->fk_soc]['lines'][] = $line; + } + } + else + { $error=$db->lasterror(); dol_print_error($db); dol_syslog('replenish.php: '.$error, LOG_ERR); @@ -120,11 +130,13 @@ if ($action == 'order' && isset($_POST['valid'])) { } unset($_POST[$i]); } + //we now know how many orders we need and what lines they have $i = 0; $orders = array(); $suppliersid = array_keys($suppliers); - foreach ($suppliers as $supplier) { + foreach ($suppliers as $supplier) + { $order = new CommandeFournisseur($db); $order->socid = $suppliersid[$i]; //trick to know which orders have been generated this way @@ -150,13 +162,15 @@ if ($action == 'order' && isset($_POST['valid'])) { } } if ($box == 0) { - setEventMessage($langs->trans('SelectProduct'), 'warnings'); + setEventMessage($langs->trans('SelectProductWithNotNullQty'), 'warnings'); } } + /* * View */ + $title = $langs->trans('Status'); $sql = 'SELECT p.rowid, p.ref, p.label, p.price'; @@ -196,385 +210,399 @@ if ($snom) { $sql .= ' AND p.label LIKE "%' . $db->escape($crit) . '%"'; } } - $sql .= ' AND p.tobuy = 1'; - -if (!empty($canvas)) { - $sql .= ' AND p.canvas = "' . $db->escape($canvas) . '"'; -} +if (!empty($canvas)) $sql .= ' AND p.canvas = "' . $db->escape($canvas) . '"'; $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.price'; $sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql .= ', p.duration, p.tobuy, p.seuil_stock_alerte'; $sql .= ', p.desiredstock, s.fk_product'; $sql .= ' HAVING p.desiredstock > SUM(COALESCE(s.reel, 0))'; $sql .= ' AND p.desiredstock > 0'; -if ($salert == 'on') { +if ($salert == 'on') +{ $sql .= ' AND SUM(COALESCE(s.reel, 0)) < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; $alertchecked = 'checked="checked"'; } $sql .= $db->order($sortfield,$sortorder); $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); - -if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - - $helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|'; - $helpurl .= 'ES:Módulo_Stocks'; - llxHeader('', $title, $helpurl, $title); - $head = array(); - $head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php'; - $head[0][1] = $title; - $head[0][2] = 'replenish'; - $head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php'; - $head[1][1] = $langs->trans("ReplenishmentOrders"); - $head[1][2] = 'replenishorders'; - dol_fiche_head($head, 'replenish', $langs->trans('Replenishment'), 0, 'stock'); - if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) { - $filters = '&sref=' . $sref . '&snom=' . $snom; - $filters .= '&sall=' . $sall; - $filters .= '&salert=' . $salert; - print_barre_liste( - $texte, - $page, - 'replenish.php', - $filters, - $sortfield, - $sortorder, - '', - $num - ); - } else { - $filters = '&sref=' . $sref . '&snom=' . $snom; - $filters .= '&fourn_id=' . $fourn_id; - $filters .= (isset($type)?'&type=' . $type:''); - $filters .= '&salert=' . $salert; - print_barre_liste( - $texte, - $page, - 'replenish.php', - $filters, - $sortfield, - $sortorder, - '', - $num - ); - } - - print '
'. - ''. - ''. - ''. - ''. - ''. - ''. - - ''; - - $param = (isset($type)? '&type=' . $type : ''); - $param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert; - $param .= '&sref=' . $sref; - - // Lignes des titres - print ''. - ''; - print_liste_field_titre( - $langs->trans('Ref'), - 'replenish.php', - 'p.ref', - $param, - '', - '', - $sortfield, - $sortorder - ); - print_liste_field_titre( - $langs->trans('Label'), - 'replenish.php', - 'p.label', - $param, - '', - '', - $sortfield, - $sortorder - ); - if (!empty($conf->service->enabled) && $type == 1) - { - print_liste_field_titre( - $langs->trans('Duration'), - 'replenish.php', - 'p.duration', - $param, - '', - 'align="center"', - $sortfield, - $sortorder - ); - } - print_liste_field_titre( - $langs->trans('DesiredStock'), - 'replenish.php', - 'p.desiredstock', - $param, - '', - 'align="right"', - $sortfield, - $sortorder - ); - if ($conf->global->USE_VIRTUAL_STOCK) - { - $stocklabel = $langs->trans('VirtualStock'); - } - else - { - $stocklabel = $langs->trans('PhysicalStock'); - } - print_liste_field_titre( - $stocklabel, - 'replenish.php', - 'stock_physique', - $param, - '', - 'align="right"', - $sortfield, - $sortorder - ); - print_liste_field_titre( - $langs->trans('Ordered'), - 'replenish.php', - '', - $param, - '', - 'align="right"', - $sortfield, - $sortorder - ); - print_liste_field_titre( - $langs->trans('StockToBuy'), - 'replenish.php', - '', - $param, - '', - 'align="right"', - $sortfield, - $sortorder - ); - print_liste_field_titre( - $langs->trans('Supplier'), - 'replenish.php', - '', - $param, - '', - 'align="right"', - $sortfield, - $sortorder - ); - print ''. - ''. - - // Lignes des champs de filtre - ''. - ''. - ''. - ''; - if (!empty($conf->service->enabled) && $type == 1) - { - print ''; - } - print ''. - ''. - ''. - ''. - ''. - ''. - ''; - - $prod = new Product($db); - - $var = True; - while ($i < min($num, $limit)) { - $objp = $db->fetch_object($resql); - if ($conf->global->STOCK_SUPPORTS_SERVICES - || $objp->fk_product_type == 0) { - // Multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) { - $sql = 'SELECT label'; - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'product_lang'; - $sql .= ' WHERE fk_product = ' . $objp->rowid; - $sql .= ' AND lang = "' . $langs->getDefaultLang() . '"'; - $sql .= ' LIMIT 1'; - - $result = $db->query($sql); - if ($result) { - $objtp = $db->fetch_object($result); - if (!empty($objtp->label)) { - $objp->label = $objtp->label; - } - } - } - $form = new Form($db); - $var =! $var; - $prod->ref = $objp->ref; - $prod->id = $objp->rowid; - $prod->type = $objp->fk_product_type; - $ordered = ordered($prod->id); - - if ($conf->global->USE_VIRTUAL_STOCK) { - //compute virtual stock - $prod->fetch($prod->id); - $result=$prod->load_stats_commande(0, '1,2'); - if ($result < 0) { - dol_print_error($db, $prod->error); - } - $stock_commande_client = $prod->stats_commande['qty']; - $result=$prod->load_stats_commande_fournisseur(0, '3'); - if ($result < 0) { - dol_print_error($db,$prod->error); - } - $stock_commande_fournisseur = $prod->stats_commande_fournisseur['qty']; - $stock = $objp->stock_physique - $stock_commande_client + $stock_commande_fournisseur; - } else { - $stock = $objp->stock_physique; - } - $warning=''; - if ($objp->seuil_stock_alerte - && ($stock < $objp->seuil_stock_alerte)) { - $warning = img_warning($langs->trans('StockTooLow')) . ' '; - } - //depending on conf, use either physical stock or - //virtual stock to compute the stock to buy value - $stocktobuy = max($objp->desiredstock - $stock - $ordered, 0); - $disabled = ''; - if($ordered > 0) { - if($ordered + $stock >= $objp->desiredstock) { - $picto = img_picto('', './img/yes', '', 1); - $disabled = 'disabled="disabled"'; - } - else { - $picto = img_picto('', './img/no', '', 1); - } - } else { - $picto = img_picto('', './img/no', '', 1); - } - print ''. - ''. - ''. - ''. - ''; - - if (!empty($conf->service->enabled) && $type == 1) { - if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) { - $duration = $regs[1] . ' ' . $langs->trans('DurationYear'); - } elseif (preg_match('/([0-9]+)m/i', $objp->duration, $regs)) { - $duration = $regs[1] . ' ' . $langs->trans('DurationMonth'); - } elseif (preg_match('/([0-9]+)d/i', $objp->duration, $regs)) { - $duration = $regs[1] . ' ' . $langs->trans('DurationDay'); - } else { - $duration = $objp->duration; - } - print ''; - } - - print ''. - ''. - ''. - ''. - ''. - ''. - ''; - } - $i++; - } - $value = $langs->trans("CreateOrders"); - print '
 
 '. - ''. - ''. - ''. - ''. - ' '. - ' ' . $langs->trans('AlertOnly') . '    '. - ''. - ''. - '
'. - $prod->getNomUrl(1, '', 16). - '' . $objp->label . ''. - $duration. - '' . $objp->desiredstock . ''. - $warning . $stock. - ''. - ''. - $ordered . ' ' . $picto. - ''. - ''. - ''. - $form->select_product_fourn_price($prod->id, 'fourn'.$i, 1). - ' 
'. - ''. - ''. - '
'. - ''. - '
'. - '
'; - - if ($num > $conf->liste_limit) - { - if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) - { - $filters = '&sref=' . $sref . '&snom=' . $snom; - $filters .= '&sall=' . $sall; - $filters .= '&salert=' . $salert; - print_barre_liste( - '', - $page, - 'replenish.php', - $filters, - $sortfield, - $sortorder, - '', - $num, - 0, - '' - ); - } else { - $filters = '&sref=' . $sref . '&snom=' . $snom; - $filters .= '&fourn_id=' . $fourn_id; - $filters .= (isset($type)? '&type=' . $type : ''); - $filters .= '&salert=' . $salert; - print_barre_liste( - '', - $page, - 'replenish.php', - $filters, - $sortfield, - $sortorder, - '', - $num, - 0, - '' - ); - } - } - - $db->free($resql); -print ' '; -} else { +if (empty($resql)) +{ dol_print_error($db); + exit; } +$num = $db->num_rows($resql); +$i = 0; + +$helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|'; +$helpurl .= 'ES:Módulo_Stocks'; + +llxHeader('', $title, $helpurl, $title); + +$head = array(); +$head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php'; +$head[0][1] = $title; +$head[0][2] = 'replenish'; +$head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php'; +$head[1][1] = $langs->trans("ReplenishmentOrders"); +$head[1][2] = 'replenishorders'; + +dol_fiche_head($head, 'replenish', $langs->trans('Replenishment'), 0, 'stock'); + +print $langs->trans("ReplenishmentStatusDesc").'

'; + +if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&sall=' . $sall; + $filters .= '&salert=' . $salert; + print_barre_liste( + $texte, + $page, + 'replenish.php', + $filters, + $sortfield, + $sortorder, + '', + $num + ); +} else { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&fourn_id=' . $fourn_id; + $filters .= (isset($type)?'&type=' . $type:''); + $filters .= '&salert=' . $salert; + print_barre_liste( + $texte, + $page, + 'replenish.php', + $filters, + $sortfield, + $sortorder, + '', + $num + ); +} + +print '
'. + ''. + ''. + ''. + ''. + ''. + ''. + + ''; + +$param = (isset($type)? '&type=' . $type : ''); +$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert; +$param .= '&sref=' . $sref; + +// Lignes des titres +print ''. + ''; +print_liste_field_titre( + $langs->trans('Ref'), + 'replenish.php', + 'p.ref', + $param, + '', + '', + $sortfield, + $sortorder +); +print_liste_field_titre( + $langs->trans('Label'), + 'replenish.php', + 'p.label', + $param, + '', + '', + $sortfield, + $sortorder +); +if (!empty($conf->service->enabled) && $type == 1) +{ + print_liste_field_titre( + $langs->trans('Duration'), + 'replenish.php', + 'p.duration', + $param, + '', + 'align="center"', + $sortfield, + $sortorder + ); +} +print_liste_field_titre( + $langs->trans('DesiredStock'), + 'replenish.php', + 'p.desiredstock', + $param, + '', + 'align="right"', + $sortfield, + $sortorder +); +if ($conf->global->USE_VIRTUAL_STOCK) +{ + $stocklabel = $langs->trans('VirtualStock'); +} +else +{ + $stocklabel = $langs->trans('PhysicalStock'); +} +print_liste_field_titre( + $stocklabel, + 'replenish.php', + 'stock_physique', + $param, + '', + 'align="right"', + $sortfield, + $sortorder +); +print_liste_field_titre( + $langs->trans('Ordered'), + 'replenish.php', + '', + $param, + '', + 'align="right"', + $sortfield, + $sortorder +); +print_liste_field_titre( + $langs->trans('StockToBuy'), + 'replenish.php', + '', + $param, + '', + 'align="right"', + $sortfield, + $sortorder +); +print_liste_field_titre( + $langs->trans('Supplier'), + 'replenish.php', + '', + $param, + '', + 'align="right"', + $sortfield, + $sortorder +); +print ''; + +// Lignes des champs de filtre +print ''. +''. +''. +''; +if (!empty($conf->service->enabled) && $type == 1) +{ + print ''; +} +print ''. + ''. + ''. + ''. + ''. + ''; + +$prod = new Product($db); + +$var = True; +while ($i < min($num, $limit)) +{ + $objp = $db->fetch_object($resql); + + if ($conf->global->STOCK_SUPPORTS_SERVICES || $objp->fk_product_type == 0) + { + // Multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $sql = 'SELECT label'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'product_lang'; + $sql .= ' WHERE fk_product = ' . $objp->rowid; + $sql .= ' AND lang = "' . $langs->getDefaultLang() . '"'; + $sql .= ' LIMIT 1'; + + $resqlm = $db->query($sql); + if ($resqlm) + { + $objtp = $db->fetch_object($resqlm); + if (!empty($objtp->label)) $objp->label = $objtp->label; + } + } + $form = new Form($db); + $var =! $var; + $prod->ref = $objp->ref; + $prod->id = $objp->rowid; + $prod->type = $objp->fk_product_type; + $ordered = ordered($prod->id); + + if ($conf->global->USE_VIRTUAL_STOCK) + { + //compute virtual stock + $prod->fetch($prod->id); + $result=$prod->load_stats_commande(0, '1,2'); + if ($result < 0) { + dol_print_error($db, $prod->error); + } + $stock_commande_client = $prod->stats_commande['qty']; + $result=$prod->load_stats_commande_fournisseur(0, '3'); + if ($result < 0) { + dol_print_error($db,$prod->error); + } + $stock_commande_fournisseur = $prod->stats_commande_fournisseur['qty']; + $stock = $objp->stock_physique - $stock_commande_client + $stock_commande_fournisseur; + } + else + { + $stock = $objp->stock_physique; + } + $warning=''; + + if ($objp->seuil_stock_alerte && ($stock < $objp->seuil_stock_alerte)) + { + $warning = img_warning($langs->trans('StockTooLow')) . ' '; + } + //depending on conf, use either physical stock or + //virtual stock to compute the stock to buy value + $stocktobuy = max($objp->desiredstock - $stock - $ordered, 0); + $disabled = ''; + if($ordered > 0) { + if($ordered + $stock >= $objp->desiredstock) { + $picto = img_picto('', './img/yes', '', 1); + $disabled = 'disabled="disabled"'; + } + else { + $picto = img_picto('', './img/no', '', 1); + } + } else { + $picto = img_picto('', './img/no', '', 1); + } + print ''; + + // Select field + //print ''; + print ''; + + print ''. + ''. + ''; + + if (!empty($conf->service->enabled) && $type == 1) { + if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) { + $duration = $regs[1] . ' ' . $langs->trans('DurationYear'); + } elseif (preg_match('/([0-9]+)m/i', $objp->duration, $regs)) { + $duration = $regs[1] . ' ' . $langs->trans('DurationMonth'); + } elseif (preg_match('/([0-9]+)d/i', $objp->duration, $regs)) { + $duration = $regs[1] . ' ' . $langs->trans('DurationDay'); + } else { + $duration = $objp->duration; + } + print ''; + } + + print ''. + ''. + ''; + + // To order + //print ''; + print ''; + + // Supplier + print ''; + + print ''; + } + $i++; +} +$value = $langs->trans("CreateOrders"); +print '
 '. +''. +''. +''. +'  ' . $langs->trans('AlertOnly') . '   '. + ''. + ''. + '
'. + $prod->getNomUrl(1, '', 16). + '' . $objp->label . ''. + $duration. + '' . $objp->desiredstock . ''. + $warning . $stock. + ''. + ''. + $ordered . ' ' . $picto. + ''. $form->select_product_fourn_price($prod->id, 'fourn'.$i, 1).'
'. + ''. + ''. + '
'. + ''. + '
'. + '
'; + +if ($num > $conf->liste_limit) +{ + if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) + { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&sall=' . $sall; + $filters .= '&salert=' . $salert; + print_barre_liste( + '', + $page, + 'replenish.php', + $filters, + $sortfield, + $sortorder, + '', + $num, + 0, + '' + ); + } else { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&fourn_id=' . $fourn_id; + $filters .= (isset($type)? '&type=' . $type : ''); + $filters .= '&salert=' . $salert; + print_barre_liste( + '', + $page, + 'replenish.php', + $filters, + $sortfield, + $sortorder, + '', + $num, + 0, + '' + ); + } +} + +$db->free($resql); + +print ' +'; + + llxFooter(); $db->close(); -?> +?> \ No newline at end of file diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index e5e4379baa8..be7a0ed0821 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -48,7 +48,9 @@ $head[0][2] = 'replenish'; $head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php'; $head[1][1] = $texte; $head[1][2] = 'replenishorders'; + dol_fiche_head($head, 'replenishorders', $langs->trans('Replenishment'), 0, 'stock'); + $commandestatic = new CommandeFournisseur($db); $sref = GETPOST('search_ref', 'alpha'); $snom = GETPOST('search_nom', 'alpha'); @@ -72,21 +74,15 @@ if (!$sortfield) { $offset = $conf->liste_limit * $page ; $sql = 'SELECT s.rowid as socid, s.nom, cf.date_creation as dc,'; -$sql .= ' cf.rowid, cf.ref, cf.fk_statut, cf.total_ttc'; -$sql .= ", cf.fk_user_author, u.login"; -$sql .= ' FROM (' . MAIN_DB_PREFIX . 'societe as s,'; -$sql .= ' ' . MAIN_DB_PREFIX . 'commande_fournisseur as cf'; - +$sql.= ' cf.rowid, cf.ref, cf.fk_statut, cf.total_ttc, cf.fk_user_author,'; +$sql.= ' u.login'; +$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'commande_fournisseur as cf'; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON cf.fk_user_author = u.rowid'; if (!$user->rights->societe->client->voir && !$socid) { $sql.= ', ' . MAIN_DB_PREFIX . 'societe_commerciaux as sc'; - } - -$sql .= ') LEFT JOIN ' . MAIN_DB_PREFIX . 'user as u '; -$sql .= 'ON cf.fk_user_author = u.rowid'; -$sql .= ' WHERE cf.fk_soc = s.rowid '; -$sql .= ' AND cf.entity = ' . $conf->entity; - +$sql.= ' WHERE cf.fk_soc = s.rowid '; +$sql.= ' AND cf.entity = ' . $conf->entity; if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { $sql .= ' AND cf.fk_statut < 3'; } elseif ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) { @@ -94,7 +90,6 @@ if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { } else { $sql .= ' AND cf.fk_statut < 5'; } - if (!$user->rights->societe->client->voir && !$socid) { $sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = ' . $user->id; } @@ -117,13 +112,13 @@ if ($suser) { if ($sttc) { $sql .= ' AND cf.total_ttc = ' . price2num($sttc); } -if ($sdate) +if ($sdate) { - if (GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') && GETPOST('search_dateyear', 'int')) + if (GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') && GETPOST('search_dateyear', 'int')) { $date = dol_mktime(0, 0, 0, GETPOST('search_datemonth', 'int'), GETPOST('search_dateday', 'int'), GETPOST('search_dateyear', 'int')); } - else + else { $date = dol_stringtotime($sdate); } @@ -145,20 +140,24 @@ $sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom'; $sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder . ' '; $sql .= $db->plimit($conf->liste_limit+1, $offset); $resql = $db->query($sql); -if ($resql) +if ($resql) { $num = $db->num_rows($resql); $i = 0; + print $langs->trans("ReplenishmentOrdersDesc").'

'; + print_barre_liste( - $langs->trans('ReplenishmentOrders'), + '', $page, 'replenishorders.php', '', $sortfield, $sortorder, '', - $num + $num, + 0, + '' ); print '
'. ''. @@ -255,8 +254,7 @@ if ($resql) { $obj = $db->fetch_object($resql); $var = !$var; - if (!dispatched($obj->rowid) && - (!$sproduct || in_array($sproduct, getProducts($obj->rowid)))) + if (!dispatched($obj->rowid) && (!$sproduct || in_array($sproduct, getProducts($obj->rowid)))) { $href = DOL_URL_ROOT . '/fourn/commande/fiche.php?id=' . $obj->rowid; print ''. @@ -288,9 +286,10 @@ if ($resql) ''; + // Date if ($obj->dc) { - $date = dol_print_date($db->jdate($obj->dc), 'day'); + $date = dol_print_date($db->jdate($obj->dc), 'dayhour'); } else { $date = '-'; } @@ -310,6 +309,10 @@ if ($resql) $db->free($resql); } +else +{ + dol_print_error($db); +} llxFooter(); $db->close(); From 661faa63dd59d09ac0141dadd800a7c6f4895678 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 20:42:46 +0200 Subject: [PATCH 12/28] Fix: filter on warehouse --- htdocs/product/stock/mouvement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 321e9d0ff95..05c38ad1d6e 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -432,7 +432,7 @@ if ($resql) print ''; print ''; print ''; print ''; print ''; print ''; print ''. ''. ''. ''; if (!empty($conf->service->enabled) && $type == 1) { @@ -491,11 +493,12 @@ while ($i < min($num, $limit)) } else { $picto = img_picto('', './img/no', '', 1); } - print ''; + + print ''; // Select field //print ''; - print ''; + print ''; print ''; - print ''; + print ''; // Supplier print ''; From a11a0d6491270e5e59d6b34d39d5ad6d781fc1db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 21:09:15 +0200 Subject: [PATCH 15/28] Fix: debug replanishment feature --- htdocs/compta/bank/search.php | 16 ++++----- htdocs/langs/en_US/stocks.lang | 5 +-- htdocs/langs/fr_FR/stocks.lang | 5 +-- htdocs/product/stock/replenish.php | 57 ++++++++++++++++-------------- 4 files changed, 44 insertions(+), 39 deletions(-) diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index cc3f0cd548d..650733dbb9c 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -42,7 +42,7 @@ $debit=GETPOST("debit"); $credit=GETPOST("credit"); $type=GETPOST("type"); $account=GETPOST("account"); -$bid=GETPOST("bid"); +$bid=GETPOST("bid","int"); $param=''; if ($description) $param.='&description='.$description; @@ -83,7 +83,7 @@ $sql.= " b.fk_account, b.fk_type,"; $sql.= " ba.rowid as bankid, ba.ref as bankref,"; $sql.= " bu.label as labelurl, bu.url_id"; $sql.= " FROM "; -if (! empty($_REQUEST["bid"])) $sql.= MAIN_DB_PREFIX."bank_class as l,"; +if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,"; $sql.= " ".MAIN_DB_PREFIX."bank_account as ba,"; $sql.= " ".MAIN_DB_PREFIX."bank as b"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND type = 'company'"; @@ -92,21 +92,21 @@ $sql.= " WHERE b.fk_account = ba.rowid"; $sql.= " AND ba.entity = ".$conf->entity; if (GETPOST("req_nb")) { - $sql.= " AND b.num_chq like '%".$db->escape(GETPOST("req_nb"))."%'"; + $sql.= " AND b.num_chq LIKE '%".$db->escape(GETPOST("req_nb"))."%'"; $param.='&req_nb='.urlencode(GETPOST("req_nb")); } if (GETPOST("thirdparty")) { - $sql.=" AND (COALESCE(s.nom,'') LIKE '%".$db->escape(GETPOST("thirdparty"))."%')"; + $sql.=" AND s.nom LIKE '%".$db->escape(GETPOST("thirdparty"))."%'"; $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); } -if (! empty($_REQUEST["bid"])) +if ($bid) { - $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$_REQUEST["bid"]; + $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid; } -if(! empty($type)) +if (! empty($type)) { - $sql .= " AND b.fk_type = '" . $type ."' "; + $sql.= " AND b.fk_type = '".$db->escape($type)."' "; } // Search criteria amount $si=0; diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index b26970e110d..c2f4ace565d 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -100,5 +100,6 @@ AlertOnly= Alerts only WarehouseForStockDecrease=The warehouse %s will be used for stock decrease WarehouseForStockIncrease=The warehouse %s will be used for stock increase ForThisWarehouse=For this warehouse -ReplenishmentStatusDesc=This is list of all product with a physical stock lower than desired stock and suggest you to create supplier orders to fill the difference. -ReplenishmentOrdersDesc=This is list of all opened supplier orders \ No newline at end of file +ReplenishmentStatusDesc=This is list of all product with a physical stock lower than desired stock (or alert value if checkbox "alert only" is checked) and suggest you to create supplier orders to fill the difference. +ReplenishmentOrdersDesc=This is list of all opened supplier orders +Replenishments=Replenishments \ No newline at end of file diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index d1ce8931a1a..02d2e9d417e 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -100,5 +100,6 @@ AlertOnly = Alertes seulement WarehouseForStockDecrease=L'entrepôt %s sera utilisé pour la décrémentation du stock WarehouseForStockIncrease=L'entrepôt %s sera utilisé pour l'incrémentation du stock ForThisWarehouse=Pour cet entrepôt -ReplenishmentStatusDesc=Cet écran permet de voir les produits avec un stock physique inférieure à la quantité minimale désirée et propose de créer des commandes fournisseurs pour compléter la différence -ReplenishmentOrdersDesc=Voici la liste des commandes fournisseurs en cours \ No newline at end of file +ReplenishmentStatusDesc=Cet écran permet de voir les produits avec un stock physique inférieure à la quantité minimale désirée (ou à la quantité du seuil d'alerte si la case "Alertes seulement" est cochée) et propose de créer des commandes fournisseurs pour compléter la différence +ReplenishmentOrdersDesc=Voici la liste des commandes fournisseurs en cours +Replenishments=Réapprovisionnement \ No newline at end of file diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 650891bb6bd..25f5a1a112a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013 Laurent Destaileur * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -173,14 +173,14 @@ if ($action == 'order' && isset($_POST['valid'])) $title = $langs->trans('Status'); -$sql = 'SELECT p.rowid, p.ref, p.label, p.price'; -$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type'; -$sql .= ', p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'; -$sql .= ' SUM(COALESCE(s.reel, 0)) as stock_physique'; -$sql .= ', p.desiredstock'; -$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; -$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; -$sql .= ' ON p.rowid = s.fk_product'; +$sql = 'SELECT p.rowid, p.ref, p.label, p.price,'; +$sql.= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; +$sql.= ' p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'; +$sql.= ' p.desiredstock,'; +$sql.= ' SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").') as stock_physique'; +$sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; +$sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; +$sql.= ' ON p.rowid = s.fk_product'; $sql.= ' WHERE p.entity IN (' . getEntity("product", 1) . ')'; if ($sall) { $sql .= ' AND (p.ref LIKE "%'.$db->escape($sall).'%" '; @@ -193,7 +193,7 @@ if (dol_strlen($type)) { if ($type == 1) { $sql .= ' AND p.fk_product_type = 1'; } else { - $sql .= ' AND p.fk_product_type != 1'; + $sql .= ' AND p.fk_product_type <> 1'; } } if ($sref) { @@ -210,21 +210,23 @@ if ($snom) { $sql .= ' AND p.label LIKE "%' . $db->escape($crit) . '%"'; } } -$sql .= ' AND p.tobuy = 1'; +$sql.= ' AND p.tobuy = 1'; if (!empty($canvas)) $sql .= ' AND p.canvas = "' . $db->escape($canvas) . '"'; -$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.price'; -$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; -$sql .= ', p.duration, p.tobuy, p.seuil_stock_alerte'; -$sql .= ', p.desiredstock, s.fk_product'; -$sql .= ' HAVING p.desiredstock > SUM(COALESCE(s.reel, 0))'; -$sql .= ' AND p.desiredstock > 0'; -if ($salert == 'on') +$sql.= ' GROUP BY p.rowid, p.ref, p.label, p.price'; +$sql.= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; +$sql.= ', p.duration, p.tobuy, p.seuil_stock_alerte'; +$sql.= ', p.desiredstock, s.fk_product'; +$sql.= ' HAVING p.desiredstock > SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").')'; +$sql.= ' AND p.desiredstock > 0'; +if ($salert == 'on') // Option to see when stock is lower than alert { - $sql .= ' AND SUM(COALESCE(s.reel, 0)) < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; + $sql .= ' AND SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").') < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; $alertchecked = 'checked="checked"'; } -$sql .= $db->order($sortfield,$sortorder); -$sql .= $db->plimit($limit + 1, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit + 1, $offset); + +dol_syslog('Execute request sql='.$sql); $resql = $db->query($sql); if (empty($resql)) { @@ -397,10 +399,10 @@ print ''; print ''. ''. ''. ''; if (!empty($conf->service->enabled) && $type == 1) { @@ -491,11 +493,12 @@ while ($i < min($num, $limit)) } else { $picto = img_picto('', './img/no', '', 1); } - print ''; + + print ''; // Select field //print ''; - print ''; + print ''; print ''; - print ''; + print ''; // Supplier print ''; From 8aff0e2e1e26b8d26a0bc68c66f8853506172403 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 21:31:17 +0200 Subject: [PATCH 16/28] Trans: Add language file for paraguay. --- htdocs/langs/en_US/companies.lang | 1 + htdocs/langs/en_US/languages.lang | 1 + htdocs/langs/es_ES/companies.lang | 1 + htdocs/langs/es_PY/main.lang | 3 +++ htdocs/langs/fr_FR/companies.lang | 1 + htdocs/langs/fr_FR/languages.lang | 1 + 6 files changed, 8 insertions(+) create mode 100644 htdocs/langs/es_PY/main.lang diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 6942dfea6ee..44c0d2acf1d 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -208,6 +208,7 @@ ProfId3PT=Prof Id 3 (Commercial Record number) ProfId4PT=Prof Id 4 (Conservatory) ProfId5PT=- ProfId6PT=- +ProfId1PY=RUC ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 7b9f97f72eb..f44c0824c2c 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -21,6 +21,7 @@ Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) Language_es_HN=Spanish (Honduras) Language_es_MX=Spanish (Mexico) +Language_es_PY=Spanish (Paraguay) Language_es_PR=Spanish (Puerto Rico) Language_et_EE=Estonian Language_fa_IR=Persian diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index cc53fca73f6..bd891b016fd 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -208,6 +208,7 @@ ProfId3PT=Num reg. comercial ProfId4PT=Conservatorio ProfId5PT=- ProfId6PT=- +ProfId1PY=RUC ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- diff --git a/htdocs/langs/es_PY/main.lang b/htdocs/langs/es_PY/main.lang new file mode 100644 index 00000000000..dc3a1c15180 --- /dev/null +++ b/htdocs/langs/es_PY/main.lang @@ -0,0 +1,3 @@ +Dolibarr language file - es_PY - main +CHARSET=UTF-8 +DIRECTION=ltr diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 2d9d58b3b8f..487979b4ba4 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -208,6 +208,7 @@ ProfId3PT=Id. prof. 3 (Num. enreg. commercial) ProfId4PT=Id. prof. 4 (Conservatory) ProfId5PT=- ProfId6PT=- +ProfId1PY=RUC ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index 6dd255f47c8..e603c355b37 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -21,6 +21,7 @@ Language_es_ES=Espagnol Language_es_AR=Espagnol (Argentine) Language_es_HN=Espagnol (Honduras) Language_es_MX=Espagnol (Mexique) +Language_es_PY=Espagnol (Paraguay) Language_es_PR=Espagnol (Puerto Rico) Language_et_EE=Estonien Language_fa_IR=Perse From 3e91a4d982ea9dc0578b89453f6f2e2203f35283 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 21:43:31 +0200 Subject: [PATCH 17/28] Fix translation for paraguay --- htdocs/langs/en_US/companies.lang | 1 - htdocs/langs/es_ES/companies.lang | 1 - htdocs/langs/es_PY/companies.lang | 5 +++++ htdocs/langs/fr_FR/companies.lang | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 htdocs/langs/es_PY/companies.lang diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 44c0d2acf1d..6942dfea6ee 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -208,7 +208,6 @@ ProfId3PT=Prof Id 3 (Commercial Record number) ProfId4PT=Prof Id 4 (Conservatory) ProfId5PT=- ProfId6PT=- -ProfId1PY=RUC ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index bd891b016fd..cc53fca73f6 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -208,7 +208,6 @@ ProfId3PT=Num reg. comercial ProfId4PT=Conservatorio ProfId5PT=- ProfId6PT=- -ProfId1PY=RUC ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- diff --git a/htdocs/langs/es_PY/companies.lang b/htdocs/langs/es_PY/companies.lang new file mode 100644 index 00000000000..25ac91c98f7 --- /dev/null +++ b/htdocs/langs/es_PY/companies.lang @@ -0,0 +1,5 @@ +# Dolibarr language file - Source file is en_US - companies +CHARSET=UTF-8 +VATIntra=RUC +VATIntraShort=RUC +VATIntraVeryShort=RUC diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 487979b4ba4..2d9d58b3b8f 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -208,7 +208,6 @@ ProfId3PT=Id. prof. 3 (Num. enreg. commercial) ProfId4PT=Id. prof. 4 (Conservatory) ProfId5PT=- ProfId6PT=- -ProfId1PY=RUC ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- From bb492d6d1f09d3ddd3b002aea696d06d03f032df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 15:45:03 +0200 Subject: [PATCH 18/28] Fix: filter on warehouse --- htdocs/product/stock/mouvement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 05c38ad1d6e..48d85b0a67b 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -42,7 +42,7 @@ $id=GETPOST('id','int'); $product_id=GETPOST("product_id"); $action=GETPOST('action'); $cancel=GETPOST('cancel'); -$idproduct = isset($_GET["idproduct"])?$_GET["idproduct"]:$_PRODUCT["idproduct"]; +$idproduct = GETPOST('idproduct','int'); $year = isset($_GET["year"])?$_GET["year"]:$_POST["year"]; $month = isset($_GET["month"])?$_GET["month"]:$_POST["month"]; $search_movement = isset($_REQUEST["search_movement"])?$_REQUEST["search_movement"]:''; @@ -190,7 +190,7 @@ if ($resql) $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; $texte = $langs->trans("ListOfStockMovements"); - $texte.=' ('.$langs->trans("ForThisWarehouse").')'; + if ($id) $texte.=' ('.$langs->trans("ForThisWarehouse").')'; llxHeader("",$texte,$help_url); /* From 22fd5dfb8a22560ddb0ea3ccf1d88d6a1e09f410 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 15:49:41 +0200 Subject: [PATCH 19/28] Fix: Error when no id provided --- htdocs/expedition/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index c586329d4c9..9636c632d12 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -898,7 +898,7 @@ if ($action == 'create') } } } -else +else if ($id || $ref) /* *************************************************************************** */ /* */ /* Edit and view mode */ From f225b35a909e78e461cbad2cb9e97ce603e7610e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 15:51:59 +0200 Subject: [PATCH 20/28] Fix: filter on warehouse Conflicts: htdocs/product/stock/mouvement.php --- 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 4b879e2dd59..330fae32f3d 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -42,7 +42,7 @@ $id=GETPOST('id','int'); $product_id=GETPOST("product_id"); $action=GETPOST('action'); $cancel=GETPOST('cancel'); -$idproduct = isset($_GET["idproduct"])?$_GET["idproduct"]:$_PRODUCT["idproduct"]; +$idproduct = GETPOST('idproduct','int'); $year = isset($_GET["year"])?$_GET["year"]:$_POST["year"]; $month = isset($_GET["month"])?$_GET["month"]:$_POST["month"]; $search_movement = isset($_REQUEST["search_movement"])?$_REQUEST["search_movement"]:''; From ae8f0c3efd4175a6e5fb3dbe8217b8888a50df50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 17:16:15 +0200 Subject: [PATCH 21/28] New: Add number of product in stock before and after selected period when a filter is done on a period + a specific product. --- htdocs/langs/en_US/stocks.lang | 4 +- htdocs/langs/fr_FR/stocks.lang | 2 + .../stock/class/mouvementstock.class.php | 34 +++++++- htdocs/product/stock/mouvement.php | 87 +++++++++++++++---- 4 files changed, 109 insertions(+), 18 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index c2f4ace565d..78b4f9d916e 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -102,4 +102,6 @@ WarehouseForStockIncrease=The warehouse %s will be used for stock increas ForThisWarehouse=For this warehouse ReplenishmentStatusDesc=This is list of all product with a physical stock lower than desired stock (or alert value if checkbox "alert only" is checked) and suggest you to create supplier orders to fill the difference. ReplenishmentOrdersDesc=This is list of all opened supplier orders -Replenishments=Replenishments \ No newline at end of file +Replenishments=Replenishments +NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s) +NbOfProductAfterPeriod=Quantity of product %s in stock after selected period (> %s) diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 61d4a4451b4..d9ffd5d5574 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -103,3 +103,5 @@ ForThisWarehouse=Pour cet entrepôt ReplenishmentStatusDesc=Cet écran permet de voir les produits avec un stock physique inférieure à la quantité minimale désirée (ou à la quantité du seuil d'alerte si la case "Alertes seulement" est cochée) et propose de créer des commandes fournisseurs pour compléter la différence ReplenishmentOrdersDesc=Voici la liste des commandes fournisseurs en cours Replenishments=Réapprovisionnement +NbOfProductBeforePeriod=Quantité du produit %s en stock avant la période sélectionnée (< %s) +NbOfProductAfterPeriod=Quantité du produit %s en stock après la période sélectionnée (> %s) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 3297b078fea..584f5773ede 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2005-2009 Laurent Destailleur - * Copyright (C) 2011 Jean Heimburger + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2011 Jean Heimburger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -353,5 +353,35 @@ class MouvementStock return $nbSP; } + /** + * Count number of product in stock before a specific date + * + * @param int $productidselected Id of product to count + * @param timestamp $datebefore Date limit + * @return int Number + */ + function calculateBalanceForProductBefore($productidselected, $datebefore) + { + $nb=0; + + $sql = 'SELECT SUM(value) as nb from '.MAIN_DB_PREFIX.'stock_mouvement'; + $sql.= ' WHERE fk_product = '.$productidselected; + $sql.= " AND datem < '".$this->db->idate($datebefore)."'"; + + dol_syslog(get_class($this).__METHOD__.' sql='.$sql); + $resql=$this->db->query($sql); + if ($resql) + { + $obj=$this->db->fetch_object($resql); + if ($obj) $nb = $obj->nb; + return (empty($nb)?0:$nb); + } + else + { + dol_print_error($this->db); + return -1; + } + } + } ?> diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 48d85b0a67b..02c7b617021 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -25,6 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; @@ -43,12 +44,13 @@ $product_id=GETPOST("product_id"); $action=GETPOST('action'); $cancel=GETPOST('cancel'); $idproduct = GETPOST('idproduct','int'); -$year = isset($_GET["year"])?$_GET["year"]:$_POST["year"]; -$month = isset($_GET["month"])?$_GET["month"]:$_POST["month"]; -$search_movement = isset($_REQUEST["search_movement"])?$_REQUEST["search_movement"]:''; -$search_product = isset($_REQUEST["search_product"])?$_REQUEST["search_product"]:''; -$search_warehouse = isset($_REQUEST["search_warehouse"])?$_REQUEST["search_warehouse"]:''; -$search_user = isset($_REQUEST["search_user"])?$_REQUEST["search_user"]:''; +$year = GETPOST("year"); +$month = GETPOST("month"); +$search_movement = GETPOST("search_movement"); +$search_product_ref = trim(GETPOST("search_product_ref")); +$search_product = trim(GETPOST("search_product")); +$search_warehouse = trim(GETPOST("search_warehouse")); +$search_user = trim(GETPOST("search_user")); $page = GETPOST("page",'int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -63,6 +65,7 @@ if (GETPOST("button_removefilter")) $year=''; $month=''; $search_movement=""; + $search_product_ref=""; $search_product=""; $search_warehouse=""; $search_user=""; @@ -109,12 +112,13 @@ if ($action == "correct_stock" && ! $_POST["cancel"]) $productstatic=new Product($db); $warehousestatic=new Entrepot($db); +$movement=new MouvementStock($db); $userstatic=new User($db); $form=new Form($db); $formother=new FormOther($db); $formproduct=new FormProduct($db); -$sql = "SELECT p.rowid, p.label as produit, p.fk_product_type as type,"; +$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type,"; $sql.= " e.label as stock, e.rowid as entrepot_id,"; $sql.= " m.rowid as mid, m.value, m.datem, m.fk_user_author, m.label,"; $sql.= " u.login"; @@ -145,6 +149,10 @@ if (! empty($search_movement)) { $sql.= " AND m.label LIKE '%".$db->escape($search_movement)."%'"; } +if (! empty($search_product_ref)) +{ + $sql.= " AND p.ref LIKE '%".$db->escape($search_product_ref)."%'"; +} if (! empty($search_product)) { $sql.= " AND p.label LIKE '%".$db->escape($search_product)."%'"; @@ -157,7 +165,7 @@ if (! empty($search_user)) { $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'"; } -if (! empty($_GET['idproduct'])) +if ($idproduct > 0) { $sql.= " AND p.rowid = '".$idproduct."'"; } @@ -176,7 +184,7 @@ if ($resql) $product->fetch($idproduct); } - if ($_GET["id"]) + if ($id > 0) { $entrepot = new Entrepot($db); $result = $entrepot->fetch($id); @@ -392,6 +400,7 @@ if ($resql) $param=''; if ($id) $param.='&id='.$id; if ($search_movement) $param.='&search_movement='.urlencode($search_movement); + if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref); if ($search_product) $param.='&search_product='.urlencode($search_product); if ($search_warehouse) $param.='&search_warehouse='.urlencode($search_warehouse); if ($sref) $param.='&sref='.urlencode($sref); @@ -406,7 +415,8 @@ if ($resql) //print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"], "m.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"], "m.datem","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Product"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ProductRef"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ProductLabel"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Warehouse"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Units"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); @@ -425,11 +435,15 @@ if ($resql) print ''; // Label of movement print ''; - // Product + // Product Ref print ''; + // Product label + print ''; print '\n"; print ''; + $arrayofuniqueproduct=array(); + $var=True; while ($i < min($num,$conf->liste_limit)) { $objp = $db->fetch_object($resql); + + $arrayofuniqueproduct[$objp->rowid]=$objp->produit; + $var=!$var; print ""; // Id movement @@ -457,7 +476,14 @@ if ($resql) print ''; // Label of movement print ''; - // Product + // Product ref + print '\n"; + // Product label print '
'. price($obj->total_ttc). ''; - //print ''; // We are on a specific warehouse card, no filter on other should be possible + if (empty($idproduct) || $idproduct < 0) print ''; // We are on a specific warehouse card, no filter on other should be possible print ''; print ''; From 41bf4d53a84d614d150c4fa12e1667b7f3d312d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 20:44:42 +0200 Subject: [PATCH 13/28] Fix: filter on warehouse Conflicts: htdocs/product/stock/mouvement.php --- htdocs/product/stock/mouvement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index a5de7d9bb3d..4b879e2dd59 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -426,7 +426,7 @@ if ($resql) print ''; print ''; - print ''; + if (empty($idproduct) || $idproduct < 0) print ''; // We are on a specific warehouse card, no filter on other should be possible print ''; print ''; From 864315d018fc63c27f81b6ffb4f9b4f0a4f1a9c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Oct 2013 21:07:00 +0200 Subject: [PATCH 14/28] Fix: debug replanishment feature --- htdocs/compta/bank/search.php | 16 ++++----- htdocs/langs/en_US/stocks.lang | 2 +- htdocs/langs/fr_FR/stocks.lang | 2 +- htdocs/product/stock/replenish.php | 57 ++++++++++++++++-------------- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index cc3f0cd548d..650733dbb9c 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -42,7 +42,7 @@ $debit=GETPOST("debit"); $credit=GETPOST("credit"); $type=GETPOST("type"); $account=GETPOST("account"); -$bid=GETPOST("bid"); +$bid=GETPOST("bid","int"); $param=''; if ($description) $param.='&description='.$description; @@ -83,7 +83,7 @@ $sql.= " b.fk_account, b.fk_type,"; $sql.= " ba.rowid as bankid, ba.ref as bankref,"; $sql.= " bu.label as labelurl, bu.url_id"; $sql.= " FROM "; -if (! empty($_REQUEST["bid"])) $sql.= MAIN_DB_PREFIX."bank_class as l,"; +if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,"; $sql.= " ".MAIN_DB_PREFIX."bank_account as ba,"; $sql.= " ".MAIN_DB_PREFIX."bank as b"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND type = 'company'"; @@ -92,21 +92,21 @@ $sql.= " WHERE b.fk_account = ba.rowid"; $sql.= " AND ba.entity = ".$conf->entity; if (GETPOST("req_nb")) { - $sql.= " AND b.num_chq like '%".$db->escape(GETPOST("req_nb"))."%'"; + $sql.= " AND b.num_chq LIKE '%".$db->escape(GETPOST("req_nb"))."%'"; $param.='&req_nb='.urlencode(GETPOST("req_nb")); } if (GETPOST("thirdparty")) { - $sql.=" AND (COALESCE(s.nom,'') LIKE '%".$db->escape(GETPOST("thirdparty"))."%')"; + $sql.=" AND s.nom LIKE '%".$db->escape(GETPOST("thirdparty"))."%'"; $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); } -if (! empty($_REQUEST["bid"])) +if ($bid) { - $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$_REQUEST["bid"]; + $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid; } -if(! empty($type)) +if (! empty($type)) { - $sql .= " AND b.fk_type = '" . $type ."' "; + $sql.= " AND b.fk_type = '".$db->escape($type)."' "; } // Search criteria amount $si=0; diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index b26970e110d..9ce96801636 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -100,5 +100,5 @@ AlertOnly= Alerts only WarehouseForStockDecrease=The warehouse %s will be used for stock decrease WarehouseForStockIncrease=The warehouse %s will be used for stock increase ForThisWarehouse=For this warehouse -ReplenishmentStatusDesc=This is list of all product with a physical stock lower than desired stock and suggest you to create supplier orders to fill the difference. +ReplenishmentStatusDesc=This is list of all product with a physical stock lower than desired stock (or alert value if checkbox "alert only" is checked) and suggest you to create supplier orders to fill the difference. ReplenishmentOrdersDesc=This is list of all opened supplier orders \ No newline at end of file diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index d1ce8931a1a..9cf0ac703a7 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -100,5 +100,5 @@ AlertOnly = Alertes seulement WarehouseForStockDecrease=L'entrepôt %s sera utilisé pour la décrémentation du stock WarehouseForStockIncrease=L'entrepôt %s sera utilisé pour l'incrémentation du stock ForThisWarehouse=Pour cet entrepôt -ReplenishmentStatusDesc=Cet écran permet de voir les produits avec un stock physique inférieure à la quantité minimale désirée et propose de créer des commandes fournisseurs pour compléter la différence +ReplenishmentStatusDesc=Cet écran permet de voir les produits avec un stock physique inférieure à la quantité minimale désirée (ou à la quantité du seuil d'alerte si la case "alerte seulement" est cochée) et propose de créer des commandes fournisseurs pour compléter la différence ReplenishmentOrdersDesc=Voici la liste des commandes fournisseurs en cours \ No newline at end of file diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 650891bb6bd..25f5a1a112a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013 Laurent Destaileur * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -173,14 +173,14 @@ if ($action == 'order' && isset($_POST['valid'])) $title = $langs->trans('Status'); -$sql = 'SELECT p.rowid, p.ref, p.label, p.price'; -$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type'; -$sql .= ', p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'; -$sql .= ' SUM(COALESCE(s.reel, 0)) as stock_physique'; -$sql .= ', p.desiredstock'; -$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; -$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; -$sql .= ' ON p.rowid = s.fk_product'; +$sql = 'SELECT p.rowid, p.ref, p.label, p.price,'; +$sql.= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; +$sql.= ' p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'; +$sql.= ' p.desiredstock,'; +$sql.= ' SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").') as stock_physique'; +$sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; +$sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; +$sql.= ' ON p.rowid = s.fk_product'; $sql.= ' WHERE p.entity IN (' . getEntity("product", 1) . ')'; if ($sall) { $sql .= ' AND (p.ref LIKE "%'.$db->escape($sall).'%" '; @@ -193,7 +193,7 @@ if (dol_strlen($type)) { if ($type == 1) { $sql .= ' AND p.fk_product_type = 1'; } else { - $sql .= ' AND p.fk_product_type != 1'; + $sql .= ' AND p.fk_product_type <> 1'; } } if ($sref) { @@ -210,21 +210,23 @@ if ($snom) { $sql .= ' AND p.label LIKE "%' . $db->escape($crit) . '%"'; } } -$sql .= ' AND p.tobuy = 1'; +$sql.= ' AND p.tobuy = 1'; if (!empty($canvas)) $sql .= ' AND p.canvas = "' . $db->escape($canvas) . '"'; -$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.price'; -$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; -$sql .= ', p.duration, p.tobuy, p.seuil_stock_alerte'; -$sql .= ', p.desiredstock, s.fk_product'; -$sql .= ' HAVING p.desiredstock > SUM(COALESCE(s.reel, 0))'; -$sql .= ' AND p.desiredstock > 0'; -if ($salert == 'on') +$sql.= ' GROUP BY p.rowid, p.ref, p.label, p.price'; +$sql.= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; +$sql.= ', p.duration, p.tobuy, p.seuil_stock_alerte'; +$sql.= ', p.desiredstock, s.fk_product'; +$sql.= ' HAVING p.desiredstock > SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").')'; +$sql.= ' AND p.desiredstock > 0'; +if ($salert == 'on') // Option to see when stock is lower than alert { - $sql .= ' AND SUM(COALESCE(s.reel, 0)) < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; + $sql .= ' AND SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").') < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL'; $alertchecked = 'checked="checked"'; } -$sql .= $db->order($sortfield,$sortorder); -$sql .= $db->plimit($limit + 1, $offset); +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit + 1, $offset); + +dol_syslog('Execute request sql='.$sql); $resql = $db->query($sql); if (empty($resql)) { @@ -397,10 +399,10 @@ print '
 '. -''. +''. ''. -''. +''. '
'. $prod->getNomUrl(1, '', 16). @@ -529,7 +532,7 @@ while ($i < min($num, $limit)) // To order //print ''. $form->select_product_fourn_price($prod->id, 'fourn'.$i, 1).'
 '. -''. +''. ''. -''. +''. '
'. $prod->getNomUrl(1, '', 16). @@ -529,7 +532,7 @@ while ($i < min($num, $limit)) // To order //print ''. $form->select_product_fourn_price($prod->id, 'fourn'.$i, 1).''; - print ''; + print ''; print ''; - print ''; + print ''; + print ''; + print ''; print ''; if (empty($idproduct) || $idproduct < 0) print ''; // We are on a specific warehouse card, no filter on other should be possible @@ -445,10 +459,15 @@ if ($resql) print "
'.dol_print_date($db->jdate($objp->datem),'dayhour').''.$objp->label.''; + $productstatic->id=$objp->rowid; + $productstatic->ref=$objp->product_ref; + $productstatic->type=$objp->type; + print $productstatic->getNomUrl(1,'',16); + print "'; $productstatic->id=$objp->rowid; $productstatic->ref=$objp->produit; @@ -485,7 +511,38 @@ if ($resql) } $db->free($resql); - print "
"; + print "
"; + + // Add number of product when there is a filter on period + if (count($arrayofuniqueproduct) == 1) + { + $productidselected=0; + foreach ($arrayofuniqueproduct as $key => $val) + { + $productidselected=$key; + $productlabelselected=$val; + } + $datebefore=dol_get_first_day($year, $month?$month:1, true); + $dateafter=dol_get_last_day($year, $month?$month:12, true); + $balancebefore=$movement->calculateBalanceForProductBefore($productidselected, $datebefore); + $balanceafter=$movement->calculateBalanceForProductBefore($productidselected, $dateafter); + + //print ''; + print $langs->trans("NbOfProductBeforePeriod", $productlabelselected, dol_print_date($datebefore,'day','gmt')); + //print ''; + //print ''; + print ': '.$balancebefore; + print "
\n"; + //print ''; + //print ''; + print $langs->trans("NbOfProductAfterPeriod", $productlabelselected, dol_print_date($dateafter,'day','gmt')); + //print ''; + //print ''; + print ': '.$balanceafter; + print "
\n"; + //print ''; + } + } else From 383ead92345b15e9d5e01b36caa7a87854415822 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 17:30:28 +0200 Subject: [PATCH 22/28] Fix: remove a test output --- htdocs/compta/stats/casoc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 214ce25e625..709cf7727ea 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -227,7 +227,7 @@ $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; -echo $sql; +//echo $sql; $result = $db->query($sql); if ($result) { From e12d31766a413ebaa4259448998bba927805f141 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 17:34:26 +0200 Subject: [PATCH 23/28] Fix: Hide a report at wrong place and add a comment to explain where to put it and to fix the calculation method. --- htdocs/product/index.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 6104702f6cd..7dc9d4917a6 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -259,12 +259,16 @@ else dol_print_error($db); } -// ici le récap des ventes par trimestre de service et de produit -if (! empty($conf->product->enabled)) - activitytrim(0); -if (! empty($conf->service->enabled)) - activitytrim(1); +// TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter" +// Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover": +// "commitment engagment" method and "cash accounting" method +if ($conf->global->MAIN_FEATURES_LEVEL) +{ + if (! empty($conf->product->enabled)) activitytrim(0); + if (! empty($conf->service->enabled)) activitytrim(1); +} + //print ''; print ''; @@ -273,6 +277,9 @@ llxFooter(); $db->close(); + + + function activitytrim($product_type) { global $conf,$langs,$db; @@ -281,7 +288,7 @@ function activitytrim($product_type) $yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y")); // ventilation par trimestre - $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, sum(fd.total_ht) as Mnttot"; + $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= " WHERE f.fk_soc = s.rowid"; From 303cad162bb8876aaf7e5f92c1989ad4c17be795 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 19:26:07 +0200 Subject: [PATCH 24/28] Qual: Show the rule name used to make calculation and link to change rule. --- htdocs/compta/resultat/clientfourn.php | 8 ++++--- htdocs/compta/resultat/index.php | 8 ++++--- htdocs/compta/stats/cabyprodserv.php | 11 +++++---- htdocs/compta/stats/cabyuser.php | 8 ++++--- htdocs/compta/stats/casoc.php | 8 ++++--- htdocs/compta/stats/index.php | 8 ++++--- htdocs/compta/tva/clients.php | 10 ++++---- htdocs/compta/tva/quadri_detail.php | 11 +++++---- htdocs/core/lib/report.lib.php | 20 +++++++++++++--- htdocs/langs/en_US/compta.lang | 23 +++++++++++------- htdocs/langs/fr_FR/admin.lang | 4 ++-- htdocs/langs/fr_FR/compta.lang | 33 +++++++++++++++----------- 12 files changed, 96 insertions(+), 56 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index d8c134c12ef..d28f457fb2b 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -116,7 +116,8 @@ $total_ttc=0; if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("AnnualByCompaniesDueDebtMode"); - $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().' '.img_next().''; $description=$langs->trans("RulesResultDue"); @@ -127,7 +128,8 @@ if ($modecompta=="CREANCES-DETTES") } else { $nom=$langs->trans("AnnualByCompaniesInputOutputMode"); - $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().' '.img_next().''; @@ -135,7 +137,7 @@ else { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta)); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); // Show report array print ''; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 4279490d801..e4ead871b42 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -63,7 +63,8 @@ $exportlink=''; if ($modecompta == 'CREANCES-DETTES') { $nom=$langs->trans("AnnualSummaryDueDebtMode"); - $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); @@ -75,7 +76,8 @@ if ($modecompta == 'CREANCES-DETTES') } else { $nom=$langs->trans("AnnualSummaryInputOutputMode"); - $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); @@ -83,7 +85,7 @@ else { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta)); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); /* diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ec9e0ea0a58..95ca831c37c 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -142,7 +142,8 @@ $formother = new FormOther($db); $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); if ($modecompta=="CREANCES-DETTES") { - $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -155,7 +156,8 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=time(); } else { - $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -165,7 +167,7 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=time(); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); // SQL request @@ -382,8 +384,7 @@ if ($modecompta == 'CREANCES-DETTES') { print ''; } else { // $modecompta != 'CREANCES-DETTES' - // TODO: better message - print '
' . $langs->trans("WarningNotRelevant") . '
'; + print '
'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '
'; } llxFooter(); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 82bbff465eb..7473f71eaf1 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -137,7 +137,8 @@ $form=new Form($db); // Show report header if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); - $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink="".img_previous()."".img_next().""; $description=$langs->trans("RulesCADue"); @@ -147,7 +148,8 @@ if ($modecompta=="CREANCES-DETTES") { //$exportlink=$langs->trans("NotYetAvailable"); } else { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); - $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink="".img_previous()."".img_next().""; $description=$langs->trans("RulesCAIn"); @@ -158,7 +160,7 @@ if ($modecompta=="CREANCES-DETTES") { $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); // Show array diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 709cf7727ea..f154b2a69f6 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -151,7 +151,8 @@ $formother = new FormOther($db); if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); - $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().''.img_next().''; $description=$langs->trans("RulesCADue"); @@ -161,7 +162,8 @@ if ($modecompta=="CREANCES-DETTES") //$exportlink=$langs->trans("NotYetAvailable"); } else { $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); - $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().''.img_next().''; $description=$langs->trans("RulesCAIn"); @@ -170,7 +172,7 @@ if ($modecompta=="CREANCES-DETTES") //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); // Show Array diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index bf31220ddaf..8cdbb8ddad4 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -60,7 +60,8 @@ $form=new Form($db); if ($modecompta=="CREANCES-DETTES") { $nom=$langs->trans("SalesTurnover"); - $nom.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesCADue"); @@ -71,7 +72,8 @@ if ($modecompta=="CREANCES-DETTES") } else { $nom=$langs->trans("SalesTurnover"); - $nom.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesCAIn"); @@ -81,7 +83,7 @@ else { } $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); if ($modecompta == 'CREANCES-DETTES') diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 871e8a583ef..fbde1584541 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006 Yannick Warnier * * This program is free software; you can redistribute it and/or modify @@ -110,6 +110,8 @@ $fsearch.=' '; if ($modetax==1) // Calculate on invoice for goods and services { $nom=$langs->trans("VATReportByCustomersInDueDebtMode"); + $calcmode=$langs->trans("CalcModeVATDebt"); + $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; //$nom.='
('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); @@ -121,7 +123,6 @@ if ($modetax==1) // Calculate on invoice for goods and services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; - $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -137,6 +138,8 @@ if ($modetax==1) // Calculate on invoice for goods and services if ($modetax==0) // Invoice for goods, payment for services { $nom=$langs->trans("VATReportByCustomersInInputOutputMode"); + $calcmode=$langs->trans("CalcModeVATEngagement"); + $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; //$nom.='
('.$langs->trans("SeeVATReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); @@ -149,7 +152,6 @@ if ($modetax==0) // Invoice for goods, payment for services //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; - $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -162,7 +164,7 @@ if ($modetax==0) // Invoice for goods, payment for services $amountsup=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 0d859d96c06..cc084655bf0 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier * * This program is free software; you can redistribute it and/or modify @@ -121,10 +121,13 @@ $fsearch.=' '; //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; //$fsearch.=' '; + // Affiche en-tete du rapport if ($modetax==1) // Calculate on invoice for goods and services { $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); + $calcmode=$langs->trans("CalcModeVATDebt"); + $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) $prevquarter--; @@ -140,7 +143,6 @@ if ($modetax==1) // Calculate on invoice for goods and services //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); - $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.=$fsearch; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -159,6 +161,8 @@ if ($modetax==1) // Calculate on invoice for goods and services if ($modetax==0) // Invoice for goods, payment for services { $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); + $calcmode=$langs->trans("CalcModeVATEngagement"); + $calcmode.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) $prevquarter--; @@ -176,7 +180,6 @@ if ($modetax==0) // Invoice for goods, payment for services //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; - $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); @@ -191,7 +194,7 @@ if ($modetax==0) // Invoice for goods, payment for services $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 478e3bed379..13c30976a98 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -34,9 +34,10 @@ * @param date $builddate Date generation * @param string $exportlink Link for export or '' * @param array $moreparam Array with list of params to add into form +* @param string $calcmode Calculation mode * @return void */ -function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array()) +function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='') { global $langs, $hselected; @@ -59,13 +60,26 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat // Ligne de titre print '
'; print ''; - if (! $variante) print ''; print ''; + // Calculation mode + if ($calcmode) + { + print ''; + print ''; + if (! $variante) print ''; + print ''; + } + // Ligne de la periode d'analyse du rapport print ''; print ''; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index d7157286902..f111648f0e9 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -4,7 +4,7 @@ Accountancy=Accountancy AccountancyCard=Accountancy card Treasury=Treasury MenuFinancial=Financial -TaxModuleSetupToModifyRules=Go to module setup to modify rules for calculation +TaxModuleSetupToModifyRules=Go to Taxes module setup to modify rules for calculation OptionMode=Option for accountancy OptionModeTrue=Option Incomes-Expenses OptionModeVirtual=Option Claims-Debts @@ -103,8 +103,12 @@ ConfirmPaySocialContribution=Are you sure you want to classify this social contr DeleteSocialContribution=Delete a social contribution ConfirmDeleteSocialContribution=Are you sure you want to delete this social contribution? ExportDataset_tax_1=Social contributions and payments -AnnualSummaryDueDebtMode=Balance of income and expenses, annual summary, mode %sClaims-Debts%s said Commitment accounting. -AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary, mode %sIncomes-Expenses%s said cash accounting. +CalcModeVATDebt=Mode %sVAT on commitment accounting%s. +CalcModeVATEngagement=Mode %sVAT on incomes-expenses%s. +CalcModeDebt=Mode %sClaims-Debts%s said Commitment accounting. +CalcModeEngagement=Mode %sIncomes-Expenses%s said cash accounting +AnnualSummaryDueDebtMode=Balance of income and expenses, annual summary +AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by third parties, mode %sClaims-Debts%s said Commitment accounting. AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third parties, mode %sIncomes-Expenses%s said cash accounting. SeeReportInInputOutputMode=See report %sIncomes-Expenses%s said cash accounting for a calculation on actual payments made @@ -117,13 +121,13 @@ RulesCAIn=- It includes all the effective payments of invoices received from cli DepositsAreNotIncluded=- Deposit invoices are nor included DepositsAreIncluded=- Deposit invoices are included LT2ReportByCustomersInInputOutputModeES=Report by third party IRPF -VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid (VAT receipt) -VATReportByCustomersInDueDebtMode=Report by the customer VAT collected and paid (VAT rate) -VATReportByQuartersInInputOutputMode=Report by rate of the VAT collected and paid (VAT receipt) -VATReportByQuartersInDueDebtMode=Report by rate of the VAT collected and paid (VAT rate) +VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid +VATReportByCustomersInDueDebtMode=Report by the customer VAT collected and paid +VATReportByQuartersInInputOutputMode=Report by rate of the VAT collected and paid +VATReportByQuartersInDueDebtMode=Report by rate of the VAT collected and paid SeeVATReportInInputOutputMode=See report %sVAT encasement%s for a standard calculation SeeVATReportInDueDebtMode=See report %sVAT on flow%s for a calculation with an option on the flow -RulesVATInServices=- For services, the report includes the VAT regulations actually received or issued on the basis of the date of payment.
- For material assets, it includes the VAT invoices on the basis of the invoice date. +RulesVATInServices=- For services, the report includes the VAT regulations actually received or issued on the basis of the date of payment. RulesVATInProducts=- For material assets, it includes the VAT invoices on the basis of the invoice date. RulesVATDueServices=- For services, the report includes VAT invoices due, paid or not, based on the invoice date. RulesVATDueProducts=- For material assets, it includes the VAT invoices, based on the invoice date. @@ -162,4 +166,5 @@ Mode1=Methode 1 Mode2=Method 2 CalculationRuleDesc=To calculate total VAT, there is two methods:
Method 1 is rounding vat on each line, then summing them.
Method 2 is summing all vat on each line, then rounding result.
Final result may differs from few cents. Default mode is mode %s. CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier. - +TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a cash accountancy mode is not relevant. This report is only available when using engagement accountancy mode (see setup of accountancy module). +CalculationMode=Calculation mode diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 4341d453fba..7e6d32c70a1 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1405,8 +1405,8 @@ TaxSetup=Configuration du module Taxes, charges sociales et dividendes OptionVatMode=Option d'exigibilité de TVA par défaut OptionVATDefault=Standard OptionVATDebitOption=Option services sur Débit -OptionVatDefaultDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens (en pratique on utilise la date de facturation)
- sur paiement pour les services -OptionVatDebitOptionDesc=L'exigibilité de la TVA est:
- sur livraison pour les biens (en pratique on utilise la date de facturation)
- sur facturation (débit) pour les services +OptionVatDefaultDesc=TVA sur encaissement, l'exigibilité de la TVA est:
- sur livraison pour les biens (en pratique on utilise la date de facturation)
- sur paiement pour les services +OptionVatDebitOptionDesc=TVA sur débit, l'exigibilité de la TVA est:
- sur livraison pour les biens (en pratique on utilise la date de facturation)
- sur facturation (débit) pour les services SummaryOfVatExigibilityUsedByDefault=Moment d'exigibilité par défaut de la TVA pour l'option choisie : OnDelivery=Sur livraison OnPayment=Sur paiement diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 109c38145d2..f08f2ea5634 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -4,7 +4,7 @@ Accountancy=Compta AccountancyCard=Fiche Compta Treasury=Tréso MenuFinancial=Compta/Tréso -TaxModuleSetupToModifyRules=Aller dans la configuration du module pour modifier les règles de calcul +TaxModuleSetupToModifyRules=Aller dans la configuration du module Taxes pour modifier les règles de calcul OptionMode=Option de tenue de comptabilité OptionModeTrue=Option Recettes-Dépenses OptionModeVirtual=Option Créances-Dettes @@ -103,12 +103,16 @@ ConfirmPaySocialContribution=Êtes-vous sûr de vouloir classer cette charge soc DeleteSocialContribution=Effacer charge sociale ConfirmDeleteSocialContribution=Êtes-vous sûr de vouloir supprimer cette charge sociale ? ExportDataset_tax_1=Charges sociales et paiements -AnnualSummaryDueDebtMode=Bilan des recettes et dépenses, résumé annuel, en mode %sCréances-Dettes%s dit comptabilité d'engagement. -AnnualSummaryInputOutputMode=Bilan des recettes et dépenses, résumé annuel, en mode %sRecettes-Dépenses%s dit comptabilité de caisse. -AnnualByCompaniesDueDebtMode=Bilan des recettes et dépenses, détail par tiers, en mode %sCréances-Dettes%s dit comptabilité d'engagement. -AnnualByCompaniesInputOutputMode=Bilan des recettes et dépenses, détail par tiers, en mode %sRecettes-Dépenses%s dit comptabilité de caisse. -SeeReportInInputOutputMode=Voir le rapport %sRecettes-Dépenses%s dit comptabilité de caisse pour un calcul sur les paiements effectivement réalisés -SeeReportInDueDebtMode=Voir le rapport %sCréances-Dettes%s dit comptabilité d'engagement pour un calcul sur les factures émises +CalcModeVATDebt=Mode %sTVA sur débit%s. +CalcModeVATEngagement=Mode %sTVA sur encaissement%s. +CalcModeDebt=Mode %sCréances-Dettes%s dit comptabilité d'engagement. +CalcModeEngagement=Mode %sRecettes-Dépenses%s dit comptabilité de caisse. +AnnualSummaryDueDebtMode=Bilan des recettes et dépenses, résumé annuel +AnnualSummaryInputOutputMode=Bilan des recettes et dépenses, résumé annuel +AnnualByCompaniesDueDebtMode=Bilan des recettes et dépenses, détail par tiers +AnnualByCompaniesInputOutputMode=Bilan des recettes et dépenses, détail par tiers +SeeReportInInputOutputMode=Cliquer sur %sRecettes-Dépenses%s dit comptabilité de caisse pour un calcul sur les paiements effectivement réalisés +SeeReportInDueDebtMode=Cliquer sur %sCréances-Dettes%s dit comptabilité d'engagement pour un calcul sur les factures émises RulesAmountWithTaxIncluded=- Les montants affichés sont les montants taxe incluse RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.
- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges. RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TVA.
- Il se base sur la date de règlement de ces factures, charges et TVA. @@ -117,12 +121,12 @@ RulesCAIn=- Il inclut les règlements effectivement reçus des factures clients. DepositsAreNotIncluded=- Les factures d'acomptes ne sont pas incluses DepositsAreIncluded=- Les factures d'acomptes sont incluses LT2ReportByCustomersInInputOutputModeES=Rapport par client des IRPF -VATReportByCustomersInInputOutputMode=Rapport par client des TVA collectées et payées (TVA sur encaissement) -VATReportByCustomersInDueDebtMode=Rapport par client des TVA collectées et payées (TVA sur débit) -VATReportByQuartersInInputOutputMode=Rapport par taux des TVA collectées et payées (TVA sur encaissement) -VATReportByQuartersInDueDebtMode=Rapport par taux des TVA collectées et payées (TVA sur débit) -SeeVATReportInInputOutputMode=Voir le rapport %sTVA encaissement%s pour mode de calcul standard -SeeVATReportInDueDebtMode=Voir le rapport %sTVA sur débit%s pour mode de calcul avec option sur les débits +VATReportByCustomersInInputOutputMode=Rapport par client des TVA collectées et payées +VATReportByCustomersInDueDebtMode=Rapport par client des TVA collectées et payées +VATReportByQuartersInInputOutputMode=Rapport par taux des TVA collectées et payées +VATReportByQuartersInDueDebtMode=Rapport par taux des TVA collectées et payées +SeeVATReportInInputOutputMode=Cliquer sur %sTVA encaissement%s pour mode de calcul standard +SeeVATReportInDueDebtMode=Cliquer sur %sTVA sur débit%s pour mode de calcul avec option sur les débits RulesVATInServices=- Pour les services, le rapport inclut les TVA des règlements effectivement reçus ou émis en se basant sur la date du règlement. RulesVATInProducts=- Pour les biens matériels, il inclut les TVA des factures en se basant sur la date de facture. RulesVATDueServices=- Pour les services, le rapport inclut les TVA des factures dues, payées ou non en se basant sur la date de facture. @@ -162,4 +166,5 @@ Mode1=Mode 1 Mode2=Mode 2 CalculationRuleDesc=Pour calculer le total de TVA, il existe 2 modes:
Le mode 1 consiste à arrondir la tva de chaque ligne et à sommer cet arrondi.
Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.
Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode %s. CalculationRuleDescSupplier=Selon le mode utilisé par le fournisseur, choisissez le mode adéquant afin d'appliquer la même règle et obtenir un résultat identique au mode appliqué par votre fournisseur. - +TurnoverPerProductInCommitmentAccountingNotRelevant=Le chiffre d'affaire par produit, dans une comptabilité en mode comptabilité de caisse n'est pas définissable. Ce rapport n'est disponible qu'en mode de comptabilité dit comptabilité d'engagement (voir la configuration du module de comptabilité). +CalculationMode=Mode de calcul \ No newline at end of file From d12240e0877dab7c0b4faf926874709823efd952 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 22:37:07 +0200 Subject: [PATCH 25/28] Add doc --- dev/iso-normes/vat_number_names.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 dev/iso-normes/vat_number_names.txt diff --git a/dev/iso-normes/vat_number_names.txt b/dev/iso-normes/vat_number_names.txt new file mode 100644 index 00000000000..23fce59ed3b --- /dev/null +++ b/dev/iso-normes/vat_number_names.txt @@ -0,0 +1 @@ +http://en.wikipedia.org/wiki/VAT_identification_number \ No newline at end of file From 053d5eeff77829047446915fd65446b2d1845d3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Oct 2013 22:50:22 +0200 Subject: [PATCH 26/28] Set name of vat number for some countries according to http://en.wikipedia.org/wiki/VAT_identification_number --- htdocs/langs/bg_BG/companies.lang | 2 +- htdocs/langs/da_DK/companies.lang | 2 +- htdocs/langs/de_AT/companies.lang | 2 +- htdocs/langs/de_DE/companies.lang | 2 +- htdocs/langs/es_AR/companies.lang | 3 +++ htdocs/langs/es_HN/companies.lang | 5 ++++- htdocs/langs/es_MX/companies.lang | 5 ++++- htdocs/langs/es_PE/companies.lang | 5 ++++- htdocs/langs/et_EE/companies.lang | 2 +- htdocs/langs/fi_FI/companies.lang | 2 +- htdocs/langs/hu_HU/companies.lang | 2 +- htdocs/langs/is_IS/companies.lang | 2 +- htdocs/langs/nb_NO/companies.lang | 2 +- htdocs/langs/nl_NL/companies.lang | 2 +- htdocs/langs/pl_PL/companies.lang | 2 +- htdocs/langs/pt_PT/companies.lang | 8 ++++---- htdocs/langs/ro_RO/companies.lang | 2 +- htdocs/langs/ru_RU/companies.lang | 2 +- htdocs/langs/sv_SE/companies.lang | 2 +- htdocs/langs/tr_TR/companies.lang | 2 +- 20 files changed, 34 insertions(+), 22 deletions(-) diff --git a/htdocs/langs/bg_BG/companies.lang b/htdocs/langs/bg_BG/companies.lang index 5d1d8adf60e..e2daf7c53bc 100644 --- a/htdocs/langs/bg_BG/companies.lang +++ b/htdocs/langs/bg_BG/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Professional ID 5 ProfId6=Professional ID 6 -ProfId1AR=Проф. Id едно (CUIT / Cuil) +ProfId1AR=Проф. Id едно (CUIL) ProfId2AR=Проф. Id 2 (Revenu зверове) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/da_DK/companies.lang b/htdocs/langs/da_DK/companies.lang index a10474280f6..abaf28da9d6 100644 --- a/htdocs/langs/da_DK/companies.lang +++ b/htdocs/langs/da_DK/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Professionel ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (revenu Bestier) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/de_AT/companies.lang b/htdocs/langs/de_AT/companies.lang index a885eb31aa9..70a7d5b1c30 100644 --- a/htdocs/langs/de_AT/companies.lang +++ b/htdocs/langs/de_AT/companies.lang @@ -301,7 +301,7 @@ ProfId1NL=KVK nummer ProfId2NL=- ProfId3NL=- ProfId4NL=- -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (Revenu Bestien) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/de_DE/companies.lang b/htdocs/langs/de_DE/companies.lang index 0bc933d8487..e362c554287 100644 --- a/htdocs/langs/de_DE/companies.lang +++ b/htdocs/langs/de_DE/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Professional ID 5 ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (Revenu Bestien) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/es_AR/companies.lang b/htdocs/langs/es_AR/companies.lang index 81f8cda5161..22a314d088a 100644 --- a/htdocs/langs/es_AR/companies.lang +++ b/htdocs/langs/es_AR/companies.lang @@ -1,3 +1,6 @@ # Dolibarr language file - es_AR - companies CHARSET=UTF-8 CompanyHasCreditNote=Este cliente tiene %s %s notas de crédito/anticipos disponibles +VATIntra=CUIT +VATIntraShort=CUIT +VATIntraVeryShort=CUIT \ No newline at end of file diff --git a/htdocs/langs/es_HN/companies.lang b/htdocs/langs/es_HN/companies.lang index c0f5dce747f..58896f39eaf 100644 --- a/htdocs/langs/es_HN/companies.lang +++ b/htdocs/langs/es_HN/companies.lang @@ -1,4 +1,7 @@ # Dolibarr language file - es_HN - companies CHARSET=UTF-8 VATIsUsed=Sujeto a ISV -VATIsNotUsed=No sujeto a ISV \ No newline at end of file +VATIsNotUsed=No sujeto a ISV +VATIntra=RTN +VATIntraShort=RTN +VATIntraVeryShort=RTN \ No newline at end of file diff --git a/htdocs/langs/es_MX/companies.lang b/htdocs/langs/es_MX/companies.lang index 6c7e95b8796..8a13efbdb55 100644 --- a/htdocs/langs/es_MX/companies.lang +++ b/htdocs/langs/es_MX/companies.lang @@ -2,4 +2,7 @@ CHARSET=UTF-8 State=Estado Town=Municipio -CompanyHasCreditNote=Este cliente tiene %s %s notas de crédito/anticipos disponibles \ No newline at end of file +CompanyHasCreditNote=Este cliente tiene %s %s notas de crédito/anticipos disponibles +VATIntra=RFC +VATIntraShort=RFC +VATIntraVeryShort=RFC \ No newline at end of file diff --git a/htdocs/langs/es_PE/companies.lang b/htdocs/langs/es_PE/companies.lang index 81d0eff2c55..7b11f590caa 100644 --- a/htdocs/langs/es_PE/companies.lang +++ b/htdocs/langs/es_PE/companies.lang @@ -1,4 +1,7 @@ # Dolibarr language file - es_PU - companies CHARSET=UTF-8 VATIsUsed=Sujeto a IGV -VATIsNotUsed=No sujeto a IGV \ No newline at end of file +VATIsNotUsed=No sujeto a IGV +VATIntra=RUC +VATIntraShort=RUC +VATIntraVeryShort=RUC \ No newline at end of file diff --git a/htdocs/langs/et_EE/companies.lang b/htdocs/langs/et_EE/companies.lang index 558ab85399f..06eb8aa93aa 100644 --- a/htdocs/langs/et_EE/companies.lang +++ b/htdocs/langs/et_EE/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Professional ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (Revenu brutes) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/fi_FI/companies.lang b/htdocs/langs/fi_FI/companies.lang index d6f3cd6652f..4223cc9a7b3 100644 --- a/htdocs/langs/fi_FI/companies.lang +++ b/htdocs/langs/fi_FI/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional-tunnuksen 3 ProfId4=Professional-tunnuksen 4 ProfId5=Ammatillinen tunnus 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (revenu brutes) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/hu_HU/companies.lang b/htdocs/langs/hu_HU/companies.lang index 8634faed477..133f32f706f 100644 --- a/htdocs/langs/hu_HU/companies.lang +++ b/htdocs/langs/hu_HU/companies.lang @@ -104,7 +104,7 @@ ProfId3=Szakmai ID 3 ProfId4=Szakmai ID 4 ProfId5=Szakmai ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof ID 1 (CUIT / CUIL) +ProfId1AR=Prof ID 1 (CUIL) ProfId2AR=Prof ID 2 (revenu barmok) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/is_IS/companies.lang b/htdocs/langs/is_IS/companies.lang index 79078841816..242815d9afb 100644 --- a/htdocs/langs/is_IS/companies.lang +++ b/htdocs/langs/is_IS/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Professional ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / CUIL) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (Revenu brutes) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/nb_NO/companies.lang b/htdocs/langs/nb_NO/companies.lang index a69b4865fe8..9b5fd5d7ed4 100644 --- a/htdocs/langs/nb_NO/companies.lang +++ b/htdocs/langs/nb_NO/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Profesjonell ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof ID 2 (inntekter på brutes) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/nl_NL/companies.lang b/htdocs/langs/nl_NL/companies.lang index b596a1e39a8..6f69c2d1963 100644 --- a/htdocs/langs/nl_NL/companies.lang +++ b/htdocs/langs/nl_NL/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professioneel ID 3 ProfId4=Professioneel ID 4 ProfId5=Professionele ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (Cuit / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (Revenu woestelingen) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/pl_PL/companies.lang b/htdocs/langs/pl_PL/companies.lang index 29795a956e4..b1fa2967cf0 100644 --- a/htdocs/langs/pl_PL/companies.lang +++ b/htdocs/langs/pl_PL/companies.lang @@ -104,7 +104,7 @@ ProfId3=Profesjonalne ID 3 ProfId4=Profesjonalne ID 4 ProfId5=Profesjonalny ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Id Prof 2 (bydlęta Revenu) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/pt_PT/companies.lang b/htdocs/langs/pt_PT/companies.lang index 2d0ca3f7e2f..734091edac9 100644 --- a/htdocs/langs/pt_PT/companies.lang +++ b/htdocs/langs/pt_PT/companies.lang @@ -104,7 +104,7 @@ ProfId3=ID profesional 3 ProfId4=ID profesional 4 ProfId5=Professional ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / CUIL) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Id Prof 2 (brutos Revenu) ProfId3AR=- ProfId4AR=- @@ -224,9 +224,9 @@ ProfId3RU=Prof Id 3 (KPP) ProfId4RU=Prof Id 4 (OKPO) ProfId5RU=- # ProfId6RU=- -VATIntra=IVA Intracomunitário -VATIntraShort=IVA Intracomunitário Mínimo -VATIntraVeryShort=IVA Intracomunitário Nulo +VATIntra=CNPJ +VATIntraShort=CNPJ +VATIntraVeryShort=CNPJ VATIntraSyntaxIsValid=Sintaxe Válida VATIntraValueIsValid=Valor Válido ProspectCustomer=Cliente Potencial/Cliente diff --git a/htdocs/langs/ro_RO/companies.lang b/htdocs/langs/ro_RO/companies.lang index 03cb37af0bb..70f40c8d953 100644 --- a/htdocs/langs/ro_RO/companies.lang +++ b/htdocs/langs/ro_RO/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professional ID 3 ProfId4=Professional ID 4 ProfId5=Professional ID 5 ProfId6=Profesional ID 6 -ProfId1AR=Id-ul prof. 1 (CUIT / Cuil) +ProfId1AR=Id-ul prof. 1 (CUIL) ProfId2AR=Id-ul prof. 2 (Venituri brute) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/ru_RU/companies.lang b/htdocs/langs/ru_RU/companies.lang index 7a2a1121579..ff02d5393b5 100644 --- a/htdocs/langs/ru_RU/companies.lang +++ b/htdocs/langs/ru_RU/companies.lang @@ -104,7 +104,7 @@ ProfId3=Профессиональный ID 3 ProfId4=Профессиональный ID 4 ProfId5=Профессиональный ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Проф Id 1 (CUIT / Cuil) +ProfId1AR=Проф Id 1 (CUIL) ProfId2AR=Проф Id 2 (Revenu скоты) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/sv_SE/companies.lang b/htdocs/langs/sv_SE/companies.lang index 59bdbe1afb8..f26d98531dc 100644 --- a/htdocs/langs/sv_SE/companies.lang +++ b/htdocs/langs/sv_SE/companies.lang @@ -104,7 +104,7 @@ ProfId3=Professionella ID 3 ProfId4=Professionella ID 4 ProfId5=Professionell ID 5 # ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (Revenu sällar) ProfId3AR=- ProfId4AR=- diff --git a/htdocs/langs/tr_TR/companies.lang b/htdocs/langs/tr_TR/companies.lang index ab4d21a2ab0..f35b6ae79de 100644 --- a/htdocs/langs/tr_TR/companies.lang +++ b/htdocs/langs/tr_TR/companies.lang @@ -104,7 +104,7 @@ ProfId3=Profesyonel ID 3 ProfId4=Profesyonel ID 4 ProfId5=Profesyonel ID 5 ProfId6=Professional ID 6 -ProfId1AR=Prof Id 1 (CUIT / Cuil) +ProfId1AR=Prof Id 1 (CUIL) ProfId2AR=Prof Id 2 (revenu canavarlar) ProfId3AR=- ProfId4AR=- From b0e38f7619fdea6fc73a35e03d671cdadda1b1ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2013 10:01:47 +0200 Subject: [PATCH 27/28] Fix: Manage strange language code reported bu chrome browsers. --- htdocs/core/class/translate.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index a4830ebe0a9..7a855eb9325 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -106,11 +106,12 @@ class Translate // Array force long code from first part, even if long code is defined $longforshort=array('ar'=>'ar_SA'); if (isset($longforshort[strtolower($langpart[0])])) $srclang=$longforshort[strtolower($langpart[0])]; - else { + else if (! is_numeric($langpart[1])) { // Second part YY may be a numeric with some Chrome browser $srclang=strtolower($langpart[0])."_".strtoupper($langpart[1]); $longforlong=array('no_nb'=>'nb_NO'); if (isset($longforlong[strtolower($srclang)])) $srclang=$longforlong[strtolower($srclang)]; } + else $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]); } else { // If it's for a codetouse that is a short code xx // Array to convert short lang code into long code. @@ -787,11 +788,11 @@ class Translate function get_translations_for_substitutions() { $substitutionarray = array(); - + foreach($this->tab_translate as $code => $label) { $substitutionarray['lang_'.$code] = $label; } - + return $substitutionarray; } } From 5ee05836b669248b97fa5c86ff21b69c2133359e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2013 10:06:30 +0200 Subject: [PATCH 28/28] Missing translation languages --- htdocs/langs/en_US/languages.lang | 1 + htdocs/langs/es_ES/languages.lang | 3 +++ htdocs/langs/fr_FR/languages.lang | 1 + 3 files changed, 5 insertions(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index f44c0824c2c..eb082e1f155 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -22,6 +22,7 @@ Language_es_AR=Spanish (Argentina) Language_es_HN=Spanish (Honduras) Language_es_MX=Spanish (Mexico) Language_es_PY=Spanish (Paraguay) +Language_es_PE=Spanish (Peru) Language_es_PR=Spanish (Puerto Rico) Language_et_EE=Estonian Language_fa_IR=Persian diff --git a/htdocs/langs/es_ES/languages.lang b/htdocs/langs/es_ES/languages.lang index 1ca07e971a1..0f9d565f3a5 100644 --- a/htdocs/langs/es_ES/languages.lang +++ b/htdocs/langs/es_ES/languages.lang @@ -21,6 +21,8 @@ Language_es_ES=Español Language_es_AR=Español (Argentina) Language_es_HN=Español (Honduras) Language_es_MX=Español (México) +Language_es_PY=Español (Paraguay) +Language_es_PE=Español (Perú) Language_es_PR=Español (Puerto Rico) Language_et_EE=Estonio Language_fa_IR=Persa @@ -29,6 +31,7 @@ Language_fr_BE=Francés (Bélgica) Language_fr_CA=Francés (Canadá) Language_fr_CH=Francés (Suiza) Language_fr_FR=Francés +Language_fr_NC=Francés (Nueva Caledonia) Language_he_IL=Hebreo Language_hu_HU=Húngaro Language_is_IS=Islandés diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index e603c355b37..965f3b2f4b7 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -22,6 +22,7 @@ Language_es_AR=Espagnol (Argentine) Language_es_HN=Espagnol (Honduras) Language_es_MX=Espagnol (Mexique) Language_es_PY=Espagnol (Paraguay) +Language_es_PE=Espagnol (Peru) Language_es_PR=Espagnol (Puerto Rico) Language_et_EE=Estonien Language_fa_IR=Perse
'.$langs->trans("ReportName").''; + if (! $variantexxx) print ''; else print ''; print $nom; - if ($variante) print ''.$variante; + if ($variantexxx) print ''.$variantexxx; print '
'.$langs->trans("CalculationMode").''; + else print ''; + print $calcmode; + if ($variante) print ''.$variante; + print '
'.$langs->trans("ReportPeriod").'