From d1940be71b8e458e0dd8b45aa117f4b1aff46ba2 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 10 Nov 2011 15:51:36 +0100 Subject: [PATCH 1/5] Trad: Fix missing translation --- htdocs/langs/ca_ES/stocks.lang | 1 + htdocs/langs/es_ES/stocks.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/langs/ca_ES/stocks.lang b/htdocs/langs/ca_ES/stocks.lang index d589f6226c8..b973f34d205 100644 --- a/htdocs/langs/ca_ES/stocks.lang +++ b/htdocs/langs/ca_ES/stocks.lang @@ -3,6 +3,7 @@ CHARSET=UTF-8 WarehouseCard=Fitxa magatzem Warehouse=Magatzem NewWarehouse=Nou magatzem o zona d'emmagatzematge +WarehouseEdit=Edició magatzem MenuNewWarehouse=Nou magatzem WarehouseOpened=Magatzem obert WarehouseClosed=Magatzem tancat diff --git a/htdocs/langs/es_ES/stocks.lang b/htdocs/langs/es_ES/stocks.lang index 08d9869c544..cfa4255d61a 100644 --- a/htdocs/langs/es_ES/stocks.lang +++ b/htdocs/langs/es_ES/stocks.lang @@ -3,6 +3,7 @@ CHARSET=UTF-8 WarehouseCard=Ficha almacén Warehouse=Almacén NewWarehouse=Nuevo almacén o zona de almacenaje +WarehouseEdit=Edición almacén MenuNewWarehouse=Nuevo almacén WarehouseOpened=almacén abierto WarehouseClosed=almacén cerrado From a35dcfeb07fa909bce855af41a007948d6d8269f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 17 Nov 2011 09:21:30 +0100 Subject: [PATCH 2/5] Fix: [bug 235] Bad local tax control --- htdocs/fourn/commande/fiche.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index cd489412845..09935f1fe47 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -133,6 +133,12 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) dol_print_error($db,$object->error); exit; } + + if ($object->socid) + { + $societe=new Societe($db); + $societe->fetch($object->socid); + } // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit @@ -145,11 +151,11 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $idprod=$product->get_buyprice($_POST['idprodfournprice'], $qty); //$societe=''; - if ($object->socid) + /*if ($object->socid) { $societe=new Societe($db); $societe->fetch($object->socid); - } + }*/ if ($idprod > 0) { From 69f4fb81125886510f83889ed17efe9378f1cf54 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 17 Nov 2011 17:45:23 +0100 Subject: [PATCH 3/5] Fix: load file other.lang solve missing translations --- htdocs/core/photos_resize.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index acce82ee3d7..8ac5f1fd484 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -33,6 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/images.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); $langs->load("products"); +$langs->load("other"); $modulepart=$_REQUEST['modulepart']?$_REQUEST['modulepart']:'produit|service'; if (isset($_GET["id"])) From 5492f4ff75eb2f815e17bcdec206c11136d5ca0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Nov 2011 12:35:16 +0100 Subject: [PATCH 4/5] Fix: correct sign --- htdocs/compta/facture/class/facture.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 82a550ecef1..d4731e8888c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1881,25 +1881,25 @@ class Facture extends CommonObject $this->line=new FactureLigne($this->db); $this->line->fk_facture=$facid; $this->line->desc=$desc; - $this->line->qty=$qty; + $this->line->qty= ($this->type==2?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative $this->line->tva_tx=$txtva; $this->line->localtax1_tx=$txlocaltax1; $this->line->localtax2_tx=$txlocaltax2; $this->line->fk_product=$fk_product; $this->line->product_type=$product_type; $this->line->remise_percent=$remise_percent; - $this->line->subprice= ($this->type==2?-1:1)*abs($pu_ht); + $this->line->subprice= ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise $this->line->date_start=$date_start; $this->line->date_end=$date_end; $this->line->ventil=$ventil; $this->line->rang=$rangtouse; $this->line->info_bits=$info_bits; $this->line->fk_remise_except=$fk_remise_except; - $this->line->total_ht= ($this->type==2?-1:1)*abs($total_ht); - $this->line->total_tva= ($this->type==2?-1:1)*abs($total_tva); - $this->line->total_localtax1=($this->type==2?-1:1)*abs($total_localtax1); - $this->line->total_localtax2=($this->type==2?-1:1)*abs($total_localtax2); - $this->line->total_ttc= ($this->type==2?-1:1)*abs($total_ttc); + $this->line->total_ht= (($this->type==2||$qty<0)?-1:1)*abs($total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva= (($this->type==2||$qty<0)?-1:1)*abs($total_tva); + $this->line->total_localtax1=(($this->type==2||$qty<0)?-1:1)*abs($total_localtax1); + $this->line->total_localtax2=(($this->type==2||$qty<0)?-1:1)*abs($total_localtax2); + $this->line->total_ttc= (($this->type==2||$qty<0)?-1:1)*abs($total_ttc); $this->line->special_code=$special_code; $this->line->fk_parent_line=$fk_parent_line; $this->line->origin=$origin; From 5699127b66301272e68f277f5d90a03e423fc785 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 18 Nov 2011 13:08:20 +0100 Subject: [PATCH 5/5] Fix: Correct sign --- htdocs/compta/facture/class/facture.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d4731e8888c..0d8ea014d6d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1895,11 +1895,11 @@ class Facture extends CommonObject $this->line->rang=$rangtouse; $this->line->info_bits=$info_bits; $this->line->fk_remise_except=$fk_remise_except; - $this->line->total_ht= (($this->type==2||$qty<0)?-1:1)*abs($total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva= (($this->type==2||$qty<0)?-1:1)*abs($total_tva); - $this->line->total_localtax1=(($this->type==2||$qty<0)?-1:1)*abs($total_localtax1); - $this->line->total_localtax2=(($this->type==2||$qty<0)?-1:1)*abs($total_localtax2); - $this->line->total_ttc= (($this->type==2||$qty<0)?-1:1)*abs($total_ttc); + $this->line->total_ht= (($this->type==2||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva= (($this->type==2||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1=(($this->type==2||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2=(($this->type==2||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->total_ttc= (($this->type==2||$qty<0)?-abs($total_ttc):$total_ttc); $this->line->special_code=$special_code; $this->line->fk_parent_line=$fk_parent_line; $this->line->origin=$origin; @@ -2011,19 +2011,19 @@ class Facture extends CommonObject $this->line->rowid = $rowid; $this->line->desc = $desc; - $this->line->qty = $qty; + $this->line->qty= ($this->type==2?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; $this->line->remise_percent = $remise_percent; - $this->line->subprice = ($this->type==2?-1:1)*abs($pu); + $this->line->subprice= ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise $this->line->date_start = $date_start; $this->line->date_end = $date_end; - $this->line->total_ht = ($this->type==2?-1:1)*abs($total_ht); - $this->line->total_tva = ($this->type==2?-1:1)*abs($total_tva); - $this->line->total_localtax1 = ($this->type==2?-1:1)*abs($total_localtax1); - $this->line->total_localtax2 = ($this->type==2?-1:1)*abs($total_localtax2); - $this->line->total_ttc = ($this->type==2?-1:1)*abs($total_ttc); + $this->line->total_ht= (($this->type==2||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva= (($this->type==2||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1=(($this->type==2||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2=(($this->type==2||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->total_ttc= (($this->type==2||$qty<0)?-abs($total_ttc):$total_ttc); $this->line->info_bits = $info_bits; $this->line->product_type = $type; $this->line->fk_parent_line = $fk_parent_line;