From b65c23576a0d216db17d22511b262d12272160fe Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 15:28:38 +0200 Subject: [PATCH 1/8] Trad: Add ca_ES and es_ES translations --- htdocs/langs/ca_ES/admin.lang | 14 ++++++++++++-- htdocs/langs/ca_ES/commissions.lang | 1 + htdocs/langs/ca_ES/main.lang | 2 ++ htdocs/langs/ca_ES/margins.lang | 2 ++ htdocs/langs/ca_ES/products.lang | 3 +++ htdocs/langs/ca_ES/stocks.lang | 2 ++ htdocs/langs/es_ES/admin.lang | 14 ++++++++++++-- htdocs/langs/es_ES/commissions.lang | 1 + htdocs/langs/es_ES/main.lang | 2 ++ htdocs/langs/es_ES/margins.lang | 2 ++ htdocs/langs/es_ES/products.lang | 3 +++ htdocs/langs/es_ES/stocks.lang | 2 ++ 12 files changed, 44 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 8e61f05950f..791367b82f6 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -345,7 +345,13 @@ OldVATRates=Taxa d'IVA antiga NewVATRates=Taxa d'IVA nova PriceBaseTypeToChange=Canviar el preu on la referència de base és MassConvert=Convertir massivament -# Modules= undefined== +String=Cadena +TextLong=Text llarg +Int=numèric enter +Float=Decimal +DateAndTime=Data i hora + +# Modules Module0Name=Usuaris y grups Module0Desc=Gestió d'usuaris i grups Module1Name=Tercers @@ -455,6 +461,8 @@ Module2900Name=GeoIPMaxmind Module2900Desc=Capacitats de conversió GeoIP Maxmind Module5000Name=Multi-empresa Module5000Desc=Permet gestionar diverses empreses +Module20000Name=Dies lliures +Module20000Desc=Gestió dels dies lliures dels empleats Module50000Name=PayBox Module50000Desc=Mòdul per a proporcionar un pagament en línia amb targeta de crèdit mitjançant Paybox Module50100Name=TPV @@ -899,6 +907,8 @@ MAIN_PROXY_USER=Login del servidor proxy MAIN_PROXY_PASS=Contrasenya del servidor proxy DefineHereComplementaryAttributes=Definiu aquí la llista d'atributs addicionals, no disponibles a estàndard, i que vol gestionar per %s. ExtraFields=Atributs addicionals +ExtraFieldsThirdParties=Atributs adicionals (tercers) +ExtraFieldsContacts=Atributs adicionals (contactes/adreçes) ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte. AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais SendingMailSetup=Configuració de l'enviament per mail @@ -908,7 +918,7 @@ PathDirectory=Catàleg SendmailOptionMayHurtBuggedMTA=La funcionalitat d'enviar correu electrònic a través del "correu directe PHP" genera una sol·licitud que pot ser mal interpretada per alguns servidors de correu. Això es tradueix en missatges de correu electrònic il·legibles per a les persones allotjades en aquestes plataformes. Aquest és el cas de clients en certs proveïdors de serveis d'Internet (Ex: Orange). Això no és un problema ni de Dolibarr ni de PHP, però sí del servidor de correu. No obstant això, podeu afegir l'opció MAIN_FIX_FOR_BUGGED_MTA amb valor 1 en configuració-varis per tractar que Dolibarr eviti l'error. Una altra solució (recomanada) és utilitzar el mètode d'enviament per SMTP que no té aquest inconvenient. TranslationSetup=Configuració traducció TranslationDesc=L'elecció de l'idioma mostrat en pantalla es modifica:
* A nivell global des del menú Inici - Configuració - Entorn
* De manera específica a l'usuari des de la pestanya interface usuari de la seva fitxa d'usuari (fer clic al seu login a la part superior esquerra de la pantalla). -##### Module password generation= undefined== +##### Module password generation PasswordGenerationStandard=Retorna una contrasenya generada per l'algoritme intern Dolibarr: 8 caràcters, números i caràcters en minúscules barrejades. PasswordGenerationNone=No ofereix contrasenyes. La contrasenya s'introdueix manualment. ##### Users setup ##### diff --git a/htdocs/langs/ca_ES/commissions.lang b/htdocs/langs/ca_ES/commissions.lang index 1335c7a1f9c..da97a4066f2 100644 --- a/htdocs/langs/ca_ES/commissions.lang +++ b/htdocs/langs/ca_ES/commissions.lang @@ -1,6 +1,7 @@ # Dolibarr language file - ca_ES - commissions CHARSET=UTF-8 +Module60000Desc=Gestió de comissions commissionsSetup=Configuració de la gestió de comissions ProductCommissionRate=Taxa de comissió sobre els productes diff --git a/htdocs/langs/ca_ES/main.lang b/htdocs/langs/ca_ES/main.lang index b016d67f6af..97683be8657 100644 --- a/htdocs/langs/ca_ES/main.lang +++ b/htdocs/langs/ca_ES/main.lang @@ -250,6 +250,8 @@ Quadri=Trimistre MonthOfDay=Mes del dia HourShort=H Rate=Tipus +UseLocalTax=Incloure taxes +LocalTaxDesc=Alguns països apliquen 2 o 3 taxes a cada línia de factura. Si és el cas, escolliu el tipus de la segona i tercera taxa i el seu valor. Els possibles tipus són:
1: taxa local aplicable a productes i serveis sense IVA (IVA no s'aplica a la taxa local)
2: taxa local s'aplica a productes i serveis abans de l'IVA (IVA es calcula sobre import + taxa local)
3: taxa local s'aplica a productes sense IVA (IVA no s'aplica a la taxa local)
4: taxa local s'aplica a productes abans de l'IVA (IVA es calcula sobre l'import + taxa local)
5: taxa local s'aplica a serveis sense IVA (IVA no s'aplica a la taxa local)
6: taxa local s'aplica a serveis abans de l'IVA (IVA es calcula sobre import + taxa local)
7: la taxa local és un import fix aplicat al total de la factura Bytes=Bytes KiloBytes=Kilobytes MegaBytes=Megabytes diff --git a/htdocs/langs/ca_ES/margins.lang b/htdocs/langs/ca_ES/margins.lang index 55d5374963a..f502a3274bf 100644 --- a/htdocs/langs/ca_ES/margins.lang +++ b/htdocs/langs/ca_ES/margins.lang @@ -1,6 +1,8 @@ # Dolibarr language file - ca_ES - margins CHARSET=UTF-8 +Module59000Name=Marges +Module59000Desc=Gestió de marges comercials Margin=Marge Margins=Marges TotalMargin=Marge total diff --git a/htdocs/langs/ca_ES/products.lang b/htdocs/langs/ca_ES/products.lang index 12b98a54c44..f1c0fbb0616 100644 --- a/htdocs/langs/ca_ES/products.lang +++ b/htdocs/langs/ca_ES/products.lang @@ -176,3 +176,6 @@ AddThisProductCard=Crear fitxa producte HelpAddThisProductCard=Aquesta opció permet crear o clonar una fitxa de producte en cas que no hi hagi AddThisServiceCard=Crear fitxa servei HelpAddThisServiceCard=Aquesta opció permet crear o clonar una fitxa de servei en cas que no hi hagi +CurrentProductPrice=Preu actual +AlwaysUseNewPrice=Utilitzar sempre el preu actual +AlwaysUseFixedPrice=Utilitzar el preu fixat \ No newline at end of file diff --git a/htdocs/langs/ca_ES/stocks.lang b/htdocs/langs/ca_ES/stocks.lang index 63365eb4c83..e4bd2affa13 100644 --- a/htdocs/langs/ca_ES/stocks.lang +++ b/htdocs/langs/ca_ES/stocks.lang @@ -8,6 +8,8 @@ MenuNewWarehouse=Nou magatzem WarehouseOpened=Magatzem obert WarehouseClosed=Magatzem tancat WarehouseSource=Magatzem origen +WarehouseSourceNotDefined=Sense magatzems definits, +AddOne=Afegir un WarehouseTarget=Magatzem destinació ValidateSending=Validar enviament CancelSending=Anul·lar enviament diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index dc0af998df7..58005491211 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -346,7 +346,13 @@ OldVATRates=Tasa de IVA antigua NewVATRates=Tasa de IVA nueva PriceBaseTypeToChange=Cambiar el precio cuya referencia de base es MassConvert=Convertir masivamente -# Modules= undefined= +String=Cadena +TextLong=Texto largo +Int=Numérico entero +Float=Decimal +DateAndTime=Fecha y hora + +# Modules Module0Name=Usuarios y grupos Module0Desc=Gestión de usuarios y grupos Module1Name=Terceros @@ -455,7 +461,9 @@ Module2800Desc=Cliente FTP Module2900Name=GeoIPMaxmind Module2900Desc=Capacidades de conversión GeoIP Maxmind Module5000Name=Multi-empresa -Module5000Desc=Permite gestionar varias empresas +Module5000Desc=Permite gestionar varias empresas +Module20000Name=Días libres +Module20000Desc=Gestión de los días libres de los empleados Module50000Name=PayBox Module50000Desc=Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paybox Module50100Name=TPV @@ -901,6 +909,8 @@ MAIN_PROXY_USER=Login del servidor proxy MAIN_PROXY_PASS=Contraseña del servidor proxy DefineHereComplementaryAttributes=Defina aquí la lista de atributos adicionales, no disponibles por defecto, y que desea gestionar para %s. ExtraFields=Atributos adicionales +ExtraFieldsThirdParties=Atributos adicionales (terceros) +ExtraFieldsContacts=Atributos adicionales (contactos/direcciones) ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto. AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios SendingMailSetup=Configuración del envío por mail diff --git a/htdocs/langs/es_ES/commissions.lang b/htdocs/langs/es_ES/commissions.lang index f771cad3185..2077ca5990c 100644 --- a/htdocs/langs/es_ES/commissions.lang +++ b/htdocs/langs/es_ES/commissions.lang @@ -1,6 +1,7 @@ # Dolibarr language file - es_ES - commissions CHARSET=UTF-8 +Module60000Desc=Gestión de comisiones commissionsSetup=Configuración de la gestión de comisiones ProductCommissionRate=Tasa de comisión sobre los productos diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 140b25c161e..102624c20dc 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -250,6 +250,8 @@ Quadri=Trimestre MonthOfDay=Mes del día HourShort=H Rate=Tipo +UseLocalTax=Incluir tasas +LocalTaxDesc=Algunos países aplican 2 o 3 tasas a cada línea de factura. Si es el caso, escoja el tipo de la segunda y tercera tasa y su valor. Los posibles tipos son:
1 : tasa local aplicable a productos y servicios sin IVA (IVA no se aplica en la tasa local)
2 : tasa local se aplica a productos y servicios antes del IVA (IVA se calcula sobre importe+tasa local)
3 : tasa local se aplica a productos sin IVA (IVA no se aplica en la tasa local)
4 : tasa local se aplica a productos antes del IVA (IVA se calcula sobre el importe+tasa local)
5 : tasa local se aplica a servicios sin IVA (IVA no se aplica a la tasa local)
6 : tasa local se aplica a servicios antes del IVA (IVA se calcula sobre importe + tasa local)
7 : la tasa local es un importe fijo aplicado al total de la factura Bytes=Bytes KiloBytes=Kilobytes MegaBytes=Megabytes diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index 213b672aafb..5ff7b74b7d4 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -1,6 +1,8 @@ # Dolibarr language file - es_ES - margins CHARSET=UTF-8 +Module59000Name=Márgenes +Module59000Desc=Gestión de márgenes comerciales Margin=Margen Margins=Márgenes TotalMargin=Margen total diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 81eb557fc53..97d4586bae6 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -176,3 +176,6 @@ AddThisProductCard=Crear ficha producto HelpAddThisProductCard=Esta opción permite crear o clonar una ficha de producto en caso de que no exista AddThisServiceCard=Crear ficha servicio HelpAddThisServiceCard=Esta opción permite crear o clonar una ficha de servicio en caso de que no exista +CurrentProductPrice=Precio actual +AlwaysUseNewPrice=Usar siempre el precio actual +AlwaysUseFixedPrice=Usar el precio fijado \ No newline at end of file diff --git a/htdocs/langs/es_ES/stocks.lang b/htdocs/langs/es_ES/stocks.lang index 919564f7100..55a440302a7 100644 --- a/htdocs/langs/es_ES/stocks.lang +++ b/htdocs/langs/es_ES/stocks.lang @@ -8,6 +8,8 @@ MenuNewWarehouse=Nuevo almacén WarehouseOpened=Almacén abierto WarehouseClosed=Almacén cerrado WarehouseSource=Almacén origen +WarehouseSourceNotDefined=Sin almacenes definidos, +AddOne=Añadir uno WarehouseTarget=Almacén destino ValidateSending=Validar envío CancelSending=Anular envío From fab101d2e8635a878ce7e6f0abf209cd26a8ce3d Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 15:38:08 +0200 Subject: [PATCH 2/8] Fix: Spanish localtax1 must be only applicable to products Add localtax2_type --- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 953ec46f91e..eeb7c4d13e3 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -238,7 +238,12 @@ create table llx_socpeople_extrafields ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object); --- update type of localtax for spain -UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 41 AND fk_pays = 4 AND localtax1_type = '0'; -UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 42 AND fk_pays = 4 AND localtax1_type = '0'; -UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 43 AND fk_pays = 4 AND localtax1_type = '0'; +-- update type of localtax1 for spain +UPDATE llx_c_tva SET localtax1_type = '3' WHERE rowid = 41 AND fk_pays = 4 AND (localtax1_type = '0' OR localtax1_type='1'); +UPDATE llx_c_tva SET localtax1_type = '3' WHERE rowid = 42 AND fk_pays = 4 AND (localtax1_type = '0' OR localtax1_type='1'); +UPDATE llx_c_tva SET localtax1_type = '3' WHERE rowid = 43 AND fk_pays = 4 AND (localtax1_type = '0' OR localtax1_type='1'); + +-- update type of localtax2 for spain +UPDATE llx_c_tva SET localtax2_type = '1' WHERE rowid = 41 AND fk_pays = 4 AND localtax2_type = '0'; +UPDATE llx_c_tva SET localtax2_type = '1' WHERE rowid = 42 AND fk_pays = 4 AND localtax2_type = '0'; +UPDATE llx_c_tva SET localtax2_type = '1' WHERE rowid = 43 AND fk_pays = 4 AND localtax2_type = '0'; From 76f3fb56ea705c9342e2288d992e70809408262a Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 16:06:45 +0200 Subject: [PATCH 3/8] Fix: Add type of product/service into propals for a correct localtaxes calculation Fix: Localtax2_type for Spain must be 3 --- htdocs/comm/propal.php | 6 ++++-- htdocs/comm/propal/class/propal.class.php | 12 +++++++----- htdocs/core/lib/price.lib.php | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 7dd553b0046..5b64c4ab59b 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -790,7 +790,8 @@ else if ($action == "addline" && $user->rights->propal->creer) GETPOST('fk_parent_line'), $fournprice, $buyingprice, - $label + $label, + $type ); if ($result > 0) @@ -912,7 +913,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa 0, $fournprice, $buying_price, - $label + $label, + $type ); if ($result >= 0) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a548153f91d..78f49394b5e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand * Copyright (C) 2012 Christophe Battarel * @@ -306,11 +306,12 @@ class Propal extends CommonObject * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price without tax * @param string $label ??? + * @param int $type 0/1=Product/service * @return int >0 if OK, <0 if KO * * @see add_product */ - function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') + function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$type=0) { global $conf; @@ -352,7 +353,7 @@ class Propal extends CommonObject // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits); + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -463,9 +464,10 @@ class Propal extends CommonObject * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price without tax * @param string $label ??? + * @param int $type 0/1=Product/service * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='') + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='',$type=0) { global $conf,$user,$langs; @@ -491,7 +493,7 @@ class Propal extends CommonObject // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits); + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 78a357cd71b..d6188ec75a0 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2006-2008 Laurent Destailleur - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -58,7 +58,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 // TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller. if ($localtax1_type == '?') { - if ($mysoc->country_code=='ES') $localtax1_type='1'; + if ($mysoc->country_code=='ES') $localtax1_type='3'; else $localtax1_type='0'; } if ($localtax2_type == '?') From 0bf29edb60c3bebe5e973d8b12f87e99ef59d68b Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 17:41:59 +0200 Subject: [PATCH 4/8] Fix: Add type of product/service into commandes for a correct localtaxes calculation --- htdocs/commande/class/commande.class.php | 12 ++++++++---- htdocs/commande/fiche.php | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6d6181ad75c..c79930b6cd0 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -999,6 +999,8 @@ class Commande extends CommonOrder * @param int $fk_parent_line Parent line * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) + * @param string $label Label + * @param int $type 0/1=Product/service * @return int >0 if OK, <0 if KO * * @see add_product @@ -1008,7 +1010,7 @@ class Commande extends CommonOrder * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) */ - function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') + function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$type=0) { dol_syslog(get_class($this)."::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG); @@ -1054,7 +1056,7 @@ class Commande extends CommonOrder // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits); + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -2159,9 +2161,11 @@ class Commande extends CommonOrder * @param int $skip_update_total Skip update of total * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) + * @param string $label Label + * @param int $type 0/1=Product/service * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='') + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0) { global $conf; @@ -2192,7 +2196,7 @@ class Commande extends CommonOrder // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits); + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2d348b131e8..0afb711076e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -699,7 +699,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) GETPOST('fk_parent_line'), $fournprice, $buyingprice, - $label + $label, + $type ); if ($result > 0) @@ -825,7 +826,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' 0, $fournprice, $buyingprice, - $label + $label, + $type ); if ($result >= 0) From dd9d3c8ba4b7e147d6fd6b7cf15f3b4c0d6b06b5 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 17:57:52 +0200 Subject: [PATCH 5/8] Fix: localtaxes must display in pdf even if they are in negative --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++--- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d1beb882588..b426c0caaa4 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2012 Juanjo Menent * * 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 @@ -695,7 +695,7 @@ class pdf_einstein extends ModelePDFCommandes //Local tax 1 foreach($this->localtax1 as $tvakey => $tvaval) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey!=0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -723,7 +723,7 @@ class pdf_einstein extends ModelePDFCommandes //Local tax 2 foreach($this->localtax2 as $tvakey => $tvaval) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey!=0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 44a1987aaf2..5ca79c9a1fd 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2012 Juanjo Menent * * 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 @@ -810,7 +810,7 @@ class pdf_crabe extends ModelePDFFactures //Local tax 1 foreach($this->localtax1 as $tvakey => $tvaval) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey!=0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -838,7 +838,7 @@ class pdf_crabe extends ModelePDFFactures //Local tax 2 foreach($this->localtax2 as $tvakey => $tvaval) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey!=0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 0a2d1484bdd..d48c67b3cf6 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -729,7 +729,7 @@ class pdf_azur extends ModelePDFPropales //Local tax 1 foreach($this->localtax1 as $tvakey => $tvaval) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey!=0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -757,7 +757,7 @@ class pdf_azur extends ModelePDFPropales //Local tax 2 foreach($this->localtax2 as $tvakey => $tvaval) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey!=0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; From b7837f9280c45bdaba66c4a98436e80658d5166e Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 18:18:30 +0200 Subject: [PATCH 6/8] Fix: Localtaxes type only missing in propal update line --- htdocs/comm/propal.php | 3 +-- htdocs/comm/propal/class/propal.class.php | 7 +++---- htdocs/commande/class/commande.class.php | 6 ++---- htdocs/commande/fiche.php | 6 ++---- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 5b64c4ab59b..ff28de54e80 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -790,8 +790,7 @@ else if ($action == "addline" && $user->rights->propal->creer) GETPOST('fk_parent_line'), $fournprice, $buyingprice, - $label, - $type + $label ); if ($result > 0) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 78f49394b5e..65287b23e57 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -306,12 +306,11 @@ class Propal extends CommonObject * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price without tax * @param string $label ??? - * @param int $type 0/1=Product/service * @return int >0 if OK, <0 if KO * * @see add_product */ - function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$type=0) + function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') { global $conf; @@ -467,7 +466,7 @@ class Propal extends CommonObject * @param int $type 0/1=Product/service * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='',$type=0) + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0) { global $conf,$user,$langs; @@ -493,7 +492,7 @@ class Propal extends CommonObject // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type); + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c79930b6cd0..924477e0dd2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1000,7 +1000,6 @@ class Commande extends CommonOrder * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label - * @param int $type 0/1=Product/service * @return int >0 if OK, <0 if KO * * @see add_product @@ -1010,7 +1009,7 @@ class Commande extends CommonOrder * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) */ - function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$type=0) + function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') { dol_syslog(get_class($this)."::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG); @@ -2162,10 +2161,9 @@ class Commande extends CommonOrder * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label - * @param int $type 0/1=Product/service * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='') { global $conf; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 0afb711076e..2d348b131e8 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -699,8 +699,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) GETPOST('fk_parent_line'), $fournprice, $buyingprice, - $label, - $type + $label ); if ($result > 0) @@ -826,8 +825,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' 0, $fournprice, $buyingprice, - $label, - $type + $label ); if ($result >= 0) From 13aeca2ffd0227e47f0b6b9e6a061f664fe84992 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 18:27:28 +0200 Subject: [PATCH 7/8] Fix: Add type of product/service into factures for a correct localtaxes calculation --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6f6c85abd59..bc05717f5fa 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1925,7 +1925,7 @@ class Facture extends CommonInvoice // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits); + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -2063,7 +2063,7 @@ class Facture extends CommonInvoice // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits); + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; From cf72ffd650071fa7b8502f94e82b6310f16fe01c Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 18 Sep 2012 18:50:02 +0200 Subject: [PATCH 8/8] Trad: Improve bank translations for adjust into pdf info size --- htdocs/langs/ca_ES/bills.lang | 4 ++-- htdocs/langs/es_ES/bills.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index 8d21a2700d9..f6ce99e3c04 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -318,9 +318,9 @@ PaymentTypeTRA=Lletra de canvi PaymentTypeShortTRA=Lletra BankDetails=Dades bancàries BankCode=Codi banc -DeskCode=Codi sucursal +DeskCode=Cod. sucursal BankAccountNumber=Número compte -BankAccountNumberKey=Dígit control +BankAccountNumberKey=D. C. Residence=Domiciliació IBANNumber=Codi IBAN IBAN=IBAN diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 18be5b85314..63a33d062b0 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -318,9 +318,9 @@ PaymentTypeTRA=Letra de cambio PaymentTypeShortTRA=Letra BankDetails=Datos bancarios BankCode=Código banco -DeskCode=Código sucursal +DeskCode=Cód. sucursal BankAccountNumber=Número cuenta -BankAccountNumberKey=Dígito Control +BankAccountNumberKey=D. C. Residence=Domiciliación IBANNumber=Código IBAN IBAN=IBAN