From fd18aa8717920b4e657fe6f2da630c7309586139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Feb 2015 10:17:02 +0100 Subject: [PATCH 01/11] Better fix for Bug #1825 --- htdocs/core/lib/agenda.lib.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index c9773372e93..5bd0bc5ee95 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -140,26 +140,28 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { if (count($showextcals) > 0) { - print ' ' . $langs->trans("LocalAgenda") . ''; + print ''; + //jQuery Learning "How do I select an element by an ID that has characters used in CSS notation?" + //http://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/ + print ''; + print ' ' . $langs->trans("LocalAgenda") . ''; foreach ($showextcals as $val) { $htmlname = dol_string_nospecial($val['name']); print ''; - print '' . "\n"; print ' ' . $val ['name']; print ''; } From bfe9bf7a478c4eefe66af7c10d1e5c63c79183c3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Feb 2015 17:55:15 +0100 Subject: [PATCH 02/11] Fix: Bad SEPA xml file creation --- ChangeLog | 1 + .../class/bonprelevement.class.php | 41 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index c50c42acb21..927ed0e7a24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1830 ] Salaries payment only allows checking accounts - Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work - Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key +- Fix: Bad SEPA xml file creation ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7f0b693391e..0a9884bbcd3 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1326,12 +1326,26 @@ class BonPrelevement extends CommonObject $dateTime_ECMA = dol_print_date($date_actu, '%Y-%m-%dT%H:%M:%S'); $fileDebiteurSection = ''; $fileEmetteurSection = ''; - $i = 0; + $i = $j = 0; $this->total = 0; /* * section Debiteur (sepa Debiteurs bloc lines) */ + + $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_pays as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + while ($j < $num) + { + $objfac = $this->db->fetch_object($resql); + $ListOfFactures = $ListOfFactures . $objfac->fac . ","; + $j++; + } + } + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, p.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; @@ -1357,7 +1371,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures , $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $this->total = $this->total + $obj->somme; $i++; } @@ -1394,13 +1408,14 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$this->raison_sociale.''.$CrLf); -/* fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.$CrLf); - fputs($this->file, ' 0533883248'.$CrLf); - fputs($this->file, ' KBO-BCE'.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$conf->global->PRELEVEMENT_ICS.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); -*/ fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); // SEPA File Emetteur if ($result != -2) @@ -1583,6 +1598,7 @@ class BonPrelevement extends CommonObject $CrLf = "\n"; $Rowing = sprintf("%06d", $row_idfac); $Date_Rum = strtotime($row_datec); + $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); $pre = ($date_Rum > 1359673200) ? 'Rum' : '++R'; $Rum = $pre.$row_code_client.$row_drum.'-0'.date('U', $Date_Rum); $XML_DEBITOR =''; @@ -1590,11 +1606,11 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.('AS-'.$row_facnumber.'-'.$Rowing).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; + $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$Rum.''.$CrLf; - $XML_DEBITOR .=' '.$row_datec.''.$CrLf; + $XML_DEBITOR .=' '.$DtOfSgntr.''.$CrLf; $XML_DEBITOR .=' false'.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1607,17 +1623,18 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.strtoupper(dol_string_unaccent($row_nom)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; - $XML_DEBITOR .=' '.strtr($row_adr, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; + $XML_DEBITOR .=' '.strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; $XML_DEBITOR .=' '.dol_string_unaccent($row_zip.' '.$row_town).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.$row_iban.''.$CrLf; + $XML_DEBITOR .=' '.preg_replace('/\s/', '', $row_iban).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; + // $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; + $XML_DEBITOR .=' '.$row_facnumber.''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; return $XML_DEBITOR; From 7ca8fdb20cd833d11ed1b693cadd36ffe521bca3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Feb 2015 17:58:19 +0100 Subject: [PATCH 03/11] PHP norms --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0a9884bbcd3..b90b0dc6c25 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1326,7 +1326,8 @@ class BonPrelevement extends CommonObject $dateTime_ECMA = dol_print_date($date_actu, '%Y-%m-%dT%H:%M:%S'); $fileDebiteurSection = ''; $fileEmetteurSection = ''; - $i = $j = 0; + $i = 0; + $j = 0; $this->total = 0; /* From 88d1d203d858f3083dcf1ee0eb8b8084fa5d3928 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Feb 2015 18:13:24 +0100 Subject: [PATCH 04/11] Fix: Bad SEPA xml file creation Conflicts: htdocs/compta/prelevement/class/bonprelevement.class.php --- ChangeLog | 1 + .../class/bonprelevement.class.php | 51 ++++++++++++------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index a14c6830947..d4999c867c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -198,6 +198,7 @@ Dolibarr better: - Fix: [ bug #1830 ] Salaries payment only allows checking accounts - Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work - Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key +- Fix: Bad SEPA xml file creation ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a43423c0d78..e8a34d6e22f 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1255,14 +1255,29 @@ class BonPrelevement extends CommonObject $fileDebiteurSection = ''; $fileEmetteurSection = ''; $i = 0; + $j = 0; $this->total = 0; /* * section Debiteur (sepa Debiteurs bloc lines) */ - $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; - $sql.= " pl.client_nom as name, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.datec, rib.rowid as drum"; + + $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + while ($j < $num) + { + $objfac = $this->db->fetch_object($resql); + $ListOfFactures = $ListOfFactures . $objfac->fac . ","; + $j++; + } + } + + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, p.code as country_code,"; + $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; + $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; $sql.= " FROM"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,"; @@ -1285,7 +1300,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->name, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures , $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $this->total = $this->total + $obj->somme; $i++; } @@ -1320,13 +1335,14 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$this->raison_sociale.''.$CrLf); -/* fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.$CrLf); - fputs($this->file, ' 0533883248'.$CrLf); - fputs($this->file, ' KBO-BCE'.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$conf->global->PRELEVEMENT_ICS.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); -*/ fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); // SEPA File Emetteur if ($result != -2) @@ -1515,19 +1531,19 @@ class BonPrelevement extends CommonObject // Define value for RUM // Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId) $Date_Rum = strtotime($row_datec); - $pre = ($date_Rum > 1359673200) ? 'RUM' : '++R'; - $Rum = dol_trunc($pre.$row_code_client.'-'.$row_drum.'-0'.date('U', $Date_Rum), 35, 'right', 'UTF-8', 1); - + $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); + $pre = ($date_Rum > 1359673200) ? 'Rum' : '++R'; + $Rum = $pre.$row_code_client.$row_drum.'-0'.date('U', $Date_Rum); $XML_DEBITOR =''; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.('AS-'.$row_facnumber.'-'.$Rowing).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; + $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$Rum.''.$CrLf; - $XML_DEBITOR .=' '.$row_datec.''.$CrLf; + $XML_DEBITOR .=' '.$DtOfSgntr.''.$CrLf; $XML_DEBITOR .=' false'.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1540,17 +1556,18 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.strtoupper(dol_string_unaccent($row_nom)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; - $XML_DEBITOR .=' '.strtr($row_adr, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; + $XML_DEBITOR .=' '.strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; $XML_DEBITOR .=' '.dol_string_unaccent($row_zip.' '.$row_town).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.$row_iban.''.$CrLf; + $XML_DEBITOR .=' '.preg_replace('/\s/', '', $row_iban).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; + // $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; + $XML_DEBITOR .=' '.$row_facnumber.''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; return $XML_DEBITOR; From 8c6ee6b7a8104a7e26eeefabd8318fa96b3029d3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Feb 2015 18:20:35 +0100 Subject: [PATCH 05/11] Trad: Syncro from transifex --- htdocs/langs/es_ES/accountancy.lang | 6 +++--- htdocs/langs/es_ES/admin.lang | 2 +- htdocs/langs/es_ES/agenda.lang | 2 +- htdocs/langs/es_ES/compta.lang | 2 +- htdocs/langs/es_ES/cron.lang | 4 ++-- htdocs/langs/es_ES/errors.lang | 4 ++-- htdocs/langs/es_ES/orders.lang | 8 ++++---- htdocs/langs/es_ES/productbatch.lang | 10 +++++----- htdocs/langs/es_ES/products.lang | 6 +++--- htdocs/langs/es_ES/projects.lang | 4 ++-- htdocs/langs/es_ES/sendings.lang | 22 +++++++++++----------- htdocs/langs/es_ES/stocks.lang | 20 ++++++++++---------- htdocs/langs/es_ES/suppliers.lang | 4 ++-- htdocs/langs/es_ES/withdrawals.lang | 2 +- htdocs/langs/es_ES/workflow.lang | 2 +- 15 files changed, 49 insertions(+), 49 deletions(-) diff --git a/htdocs/langs/es_ES/accountancy.lang b/htdocs/langs/es_ES/accountancy.lang index 67b6e7e7f4c..487078605dc 100644 --- a/htdocs/langs/es_ES/accountancy.lang +++ b/htdocs/langs/es_ES/accountancy.lang @@ -13,9 +13,9 @@ ConfigAccountingExpert=Configuración del módulo contable Journaux=Diarios JournalFinancial=Diarios financieros Exports=Exportaciones -Export=Export +Export=Exportar Modelcsv=Modelo de exportación -OptionsDeactivatedForThisExportModel=For this export model, options are deactivated +OptionsDeactivatedForThisExportModel=Las opciones están desactivadas para este modelo de exportación Selectmodelcsv=Seleccione un modelo de exportación Modelcsv_normal=Exportación clásica Modelcsv_CEGID=Exportar a Cegid Expert @@ -68,7 +68,7 @@ Lineofinvoice=Línea de la factura VentilatedinAccount=Contabilizada con éxito en la cuenta contable NotVentilatedinAccount=Cuenta sin contabilización en la contabilidad -ACCOUNTING_SEPARATORCSV=Column separator in export file +ACCOUNTING_SEPARATORCSV=Separador de columnas en el archivo de exportación ACCOUNTING_LIMIT_LIST_VENTILATION=Número de elementos a contabilizar que se muestran por página (máximo recomendado: 50) ACCOUNTING_LIST_SORT_VENTILATION_TODO=Ordenar las páginas de contabilización "A contabilizar" por los elementos más recientes diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index e07f8194142..78ce8878190 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1568,4 +1568,4 @@ SalariesSetup=Configuración del módulo salarios SortOrder=Ordenación Format=Formatear TypePaymentDesc=0:Pago cliente,1:Pago proveedor,2:Tanto pago de cliente como de proveedor -IncludePath=Include path (defined into variable %s) +IncludePath=Include path (definida en la variable %s) diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index ad9ebcba1b2..64836535194 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -60,7 +60,7 @@ SupplierOrderSentByEMail=Pedido a proveedor %s enviada por e-mail SupplierInvoiceSentByEMail=Factura de proveedor %s enviada por e-mail ShippingSentByEMail=Expedición %s enviada por email ShippingValidated= Expedición %s validada -InterventionSentByEMail=Intervention %s sent by EMail +InterventionSentByEMail=Intervención %s enviada por e-mail NewCompanyToDolibarr= Tercero creado DateActionPlannedStart= Fecha de inicio prevista DateActionPlannedEnd= Fecha de fin prevista diff --git a/htdocs/langs/es_ES/compta.lang b/htdocs/langs/es_ES/compta.lang index 83e1dc18b6e..45438f35375 100644 --- a/htdocs/langs/es_ES/compta.lang +++ b/htdocs/langs/es_ES/compta.lang @@ -29,7 +29,7 @@ ReportTurnover=Volumen de ventas PaymentsNotLinkedToInvoice=Pagos vinculados a ninguna factura, por lo que ninguún tercero PaymentsNotLinkedToUser=Pagos no vinculados a un usuario Profit=Beneficio -AccountingResult=Accounting result +AccountingResult=Resultado contable Balance=Saldo Debit=Debe Credit=Haber diff --git a/htdocs/langs/es_ES/cron.lang b/htdocs/langs/es_ES/cron.lang index 477deb2e57a..d8d9065c901 100644 --- a/htdocs/langs/es_ES/cron.lang +++ b/htdocs/langs/es_ES/cron.lang @@ -14,8 +14,8 @@ URLToLaunchCronJobs=URL para ejecutar tareas Cron OrToLaunchASpecificJob=O para ejecutar una tarea en concreto KeyForCronAccess=Clave para la URL para ejecutar tareas Cron FileToLaunchCronJobs=Comando para ejecutar tareas Cron -CronExplainHowToRunUnix=On Unix environment you should use the following crontab entry to run the command line each 5 minutes -CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run the command line each 5 minutes +CronExplainHowToRunUnix=En entornos Unix se debe utilizar la siguiente entrada crontab para ejecutar el comando cada 5 minutos +CronExplainHowToRunWin=En entornos Microsoft (tm) Windows, puede utilizar las herramienta tareas programadas para ejecutar el comando cada 5 minutos # Menu CronJobs=Tareas programadas CronListActive=Listado de tareas activas/programadas diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 16715819b76..18ee8a8a9ee 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -158,8 +158,8 @@ ErrorPriceExpression21=Resultado '%s' vacío ErrorPriceExpression22=Resultado '%s' negativo ErrorPriceExpressionInternal=Error interno '%s' ErrorPriceExpressionUnknown=Error desconocido '%s' -ErrorSrcAndTargetWarehouseMustDiffers=Source and target warehouses must differs -ErrorTryToMakeMoveOnProductRequiringBatchData=Error, trying to make a stock movement without batch/serial information, on a product requiring batch/serial information +ErrorSrcAndTargetWarehouseMustDiffers=Los almacenes de origen y destino deben de ser diferentes +ErrorTryToMakeMoveOnProductRequiringBatchData=Error, intenta hacer un movimiento de stock sin indicar lote/serie, en un producto que requiere de lote/serie # Warnings WarningMandatorySetupNotComplete=Los parámetros obligatorios de configuración no están todavía definidos diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index ce5b62a9033..895a5c32915 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -29,7 +29,7 @@ StatusOrderDraftShort=Borrador StatusOrderValidatedShort=Validado StatusOrderSentShort=Expedición en curso StatusOrderSent=Envío en curso -StatusOrderOnProcessShort=Ordered +StatusOrderOnProcessShort=Pedido StatusOrderProcessedShort=Procesado StatusOrderToBillShort=Emitido StatusOrderToBill2Short=A facturar @@ -41,7 +41,7 @@ StatusOrderReceivedAllShort=Recibido StatusOrderCanceled=Anulado StatusOrderDraft=Borrador (a validar) StatusOrderValidated=Validado -StatusOrderOnProcess=Ordered - Standby reception +StatusOrderOnProcess=Pedido - En espera de recibir StatusOrderProcessed=Procesado StatusOrderToBill=Emitido StatusOrderToBill2=A facturar @@ -50,8 +50,8 @@ StatusOrderRefused=Rechazado StatusOrderReceivedPartially=Recibido parcialmente StatusOrderReceivedAll=Recibido ShippingExist=Existe una expedición -ProductQtyInDraft=Product quantity into draft orders -ProductQtyInDraftOrWaitingApproved=Product quantity into draft or approved orders, not yet ordered +ProductQtyInDraft=Cantidades en pedidos borrador +ProductQtyInDraftOrWaitingApproved=Cantidades en pedidos borrador o aprobados, pero no realizados DraftOrWaitingApproved=Borrador o aprobado aún no controlado DraftOrWaitingShipped=Borrador o validado aún no expedido MenuOrdersToBill=Pedidos a facturar diff --git a/htdocs/langs/es_ES/productbatch.lang b/htdocs/langs/es_ES/productbatch.lang index 194a1ab5a5b..6fa46be9db5 100644 --- a/htdocs/langs/es_ES/productbatch.lang +++ b/htdocs/langs/es_ES/productbatch.lang @@ -1,8 +1,8 @@ # ProductBATCH language file - en_US - ProductBATCH -ManageLotSerial=Use batch/serial number -ProductStatusOnBatch=Yes (Batch/serial required) -ProductStatusNotOnBatch=No (Batch/serial not used) -ProductStatusOnBatchShort=Yes +ManageLotSerial=Usar numeración por lotes/series +ProductStatusOnBatch=Sí (se necesita lote/serie) +ProductStatusNotOnBatch=No (no se usa lote/serie) +ProductStatusOnBatchShort=Sí ProductStatusNotOnBatchShort=No Batch=Lote/Serie atleast1batchfield=Fecha de caducidad o Fecha de venta o Lote @@ -18,4 +18,4 @@ printQty=Cant.: %d AddDispatchBatchLine=Añada una línea para despacho por caducidad BatchDefaultNumber=Indefinido WhenProductBatchModuleOnOptionAreForced=Si el módulo de Lotes/Series está activado, el incremento/decremento de stock es forzado a lo último escogido y no puede editarse. Otras opciones pueden definirse si se necesita -ProductDoesNotUseBatchSerial=This product does not use batch/serial number +ProductDoesNotUseBatchSerial=Este producto no usa numeración por lotes/series diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 97ad12c901b..e07e882a1ee 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -22,14 +22,14 @@ ProductAccountancySellCode=Código contable ventas ProductOrService=Producto o servicio ProductsAndServices=Productos y servicios ProductsOrServices=Productos o servicios -ProductsAndServicesOnSell=Products and Services for sale or for purchase -ProductsAndServicesNotOnSell=Products and Services out of sale +ProductsAndServicesOnSell=Productos y Servicios a la venta o en compra +ProductsAndServicesNotOnSell=Productos y Servicios fuera de venta ProductsAndServicesStatistics=Estadísticas productos y servicios ProductsStatistics=Estadísticas productos ProductsOnSell=Producto en venta o en compra ProductsNotOnSell=Producto fuera de venta y fuera de compra ProductsOnSellAndOnBuy=Productos en venta o en compra -ServicesOnSell=Services for sale or for purchase +ServicesOnSell=Servicios a la venta o en compra ServicesNotOnSell=Servicios fuera de venta ServicesOnSellAndOnBuy=Servicios a la venta o en compra InternalRef=Referencia interna diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index ce1af52a955..b17e8892198 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -3,7 +3,7 @@ RefProject=Ref. proyecto ProjectId=Id proyecto Project=Proyecto Projects=Proyectos -ProjectStatus=Project status +ProjectStatus=Estado del proyecto SharedProject=Proyecto compartido PrivateProject=Contactos del proyecto MyProjectsDesc=Esta vista muestra aquellos proyectos en los que usted es un contacto afectado (cualquier tipo). @@ -103,7 +103,7 @@ CloneContacts=Clonar los contactos CloneNotes=Clonar las notas CloneProjectFiles=Clonar los archivos adjuntos del proyecto CloneTaskFiles=Clonar los archivos adjuntos de la(s) tarea(s) (si se clonan la(s) tarea(s)) -CloneMoveDate=Update project/tasks dates from now ? +CloneMoveDate=¿Actualizar las fechas de los proyectos/tareas? ConfirmCloneProject=¿Está seguro de querer clonar este proyecto? ProjectReportDate=Cambiar las fechas de las tareas en función de la fecha de inicio del proyecto ErrorShiftTaskDate=Se ha producido un error en el cambio de las fechas de las tareas diff --git a/htdocs/langs/es_ES/sendings.lang b/htdocs/langs/es_ES/sendings.lang index d9e67d7c0e4..cf377a641db 100644 --- a/htdocs/langs/es_ES/sendings.lang +++ b/htdocs/langs/es_ES/sendings.lang @@ -4,8 +4,8 @@ Sending=Envío Sendings=Envíos Shipment=Envío Shipments=Envíos -ShowSending=Show Sending -Receivings=Receipts +ShowSending=Mostrar envío +Receivings=Recepciones SendingsArea=Área envíos ListOfSendings=Listado de envíos SendingMethod=Método de envío @@ -15,7 +15,7 @@ SearchASending=Buscar envío StatisticsOfSendings=Estadísticas de envíos NbOfSendings=Número de envíos NumberOfShipmentsByMonth=Número de envíos por mes -SendingCard=Shipment card +SendingCard=Ficha envío NewSending=Nuevo envío CreateASending=Crear un envío CreateSending=Crear envío @@ -38,7 +38,7 @@ StatusSendingCanceledShort=Anulado StatusSendingDraftShort=Borrador StatusSendingValidatedShort=Validado StatusSendingProcessedShort=Procesado -SendingSheet=Shipment sheet +SendingSheet=Nota de entrega Carriers=Transportistas Carrier=Transportista CarriersArea=Área transportistas @@ -59,15 +59,15 @@ SendShippingRef=Envío de la expedición %s ActionsOnShipping=Eventos sobre la expedición LinkToTrackYourPackage=Enlace para el seguimento de su paquete ShipmentCreationIsDoneFromOrder=De momento, la creación de una nueva expedición se realiza desde la ficha de pedido. -RelatedShippings=Related shipments +RelatedShippings=Expediciones asociadas ShipmentLine=Línea de expedición CarrierList=Listado de transportistas -SendingRunning=Product from ordered customer orders -SuppliersReceiptRunning=Product from ordered supplier orders -ProductQtyInCustomersOrdersRunning=Product quantity into opened customers orders -ProductQtyInSuppliersOrdersRunning=Product quantity into opened suppliers orders -ProductQtyInShipmentAlreadySent=Product quantity from opended customer order already sent -ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from opened supplier order already received +SendingRunning=Producto de pedidos de clientes +SuppliersReceiptRunning=Producto de pedidos a proveedores +ProductQtyInCustomersOrdersRunning=Cantidad en pedidos de clientes abiertos +ProductQtyInSuppliersOrdersRunning=Cantidad en pedidos a proveedores abiertos +ProductQtyInShipmentAlreadySent=Cantidad en pedidos de clientes ya enviados +ProductQtyInSuppliersShipmentAlreadyRecevied=Cantidad en pedidos a proveedores ya recibidos # Sending methods SendingMethodCATCH=Recogido por el cliente diff --git a/htdocs/langs/es_ES/stocks.lang b/htdocs/langs/es_ES/stocks.lang index 652c750edb2..c45945ede6e 100644 --- a/htdocs/langs/es_ES/stocks.lang +++ b/htdocs/langs/es_ES/stocks.lang @@ -48,8 +48,8 @@ PMPValueShort=PMP EnhancedValueOfWarehouses=Valor de stocks UserWarehouseAutoCreate=Crear automáticamente existencias/almacén propio del usuario en la creación del usuario QtyDispatched=Cantidad recibida -QtyDispatchedShort=Qty dispatched -QtyToDispatchShort=Qty to dispatch +QtyDispatchedShort=Cant. recibida +QtyToDispatchShort=Cant. a enviar OrderDispatch=Recepción de stocks RuleForStockManagementDecrease=Regla de gestión de decrementos de stock RuleForStockManagementIncrease=Regla de gestión de incrementos de stock @@ -61,7 +61,7 @@ ReStockOnValidateOrder=Incrementar los stocks físicos sobre los pedidos a prove ReStockOnDispatchOrder=Incrementa los stocks físicos en el desglose manual de la recepción de los pedidos a proveedores en los almacenes ReStockOnDeleteInvoice=Incrementa los stocks físicos en la eliminación de facturas OrderStatusNotReadyToDispatch=El pedido aún no está o no tiene un estado que permita un desglose de stock. -StockDiffPhysicTeoric=Explanation for difference between physical and theoretical stock +StockDiffPhysicTeoric=Motivo de la diferencia entre valores físicos y teóricos NoPredefinedProductToDispatch=No hay productos predefinidos en este objeto. Por lo tanto no se puede realizar un desglose de stock. DispatchVerb=Validar recepción StockLimitShort=Límite para alerta @@ -118,15 +118,15 @@ MassMovement=Movimientos en masa MassStockMovement=Movimientos de stock en masa SelectProductInAndOutWareHouse=Selecccione un producto, una cantidad, un almacén origen y un almacén destino, seguidamente haga clic "%s". Una vez seleccionados todos los movimientos, haga clic en "%s". RecordMovement=Registrar transferencias -ReceivingForSameOrder=Receipts for this order +ReceivingForSameOrder=Recepciones de este pedido StockMovementRecorded=Movimiento de stock registrado RuleForStockAvailability=Reglas de requerimiento de stock StockMustBeEnoughForInvoice=El nivel de existencias debe ser suficiente para añadir productos/servicios en facturas StockMustBeEnoughForOrder=El nivel de existencias debe ser suficiente para añadir productos/servicios en pedidos StockMustBeEnoughForShipment= El nivel de existencias debe ser suficiente para añadir productos/servicios en envíos -MovementLabel=Label of movement -InventoryCode=Movement or inventory code -IsInPackage=Contained into package -ShowWarehouse=Show warehouse -MovementCorrectStock=Stock content correction for product %s -MovementTransferStock=Stock transfer of product %s into another warehouse +MovementLabel=Etiqueta del movimiento +InventoryCode=Movimiento o código de inventario +IsInPackage=Contenido en el paquete +ShowWarehouse=Mostrar almacén +MovementCorrectStock=Corrección de stock del producto %s +MovementTransferStock=Transferencia de stock del producto %s a otro almacén diff --git a/htdocs/langs/es_ES/suppliers.lang b/htdocs/langs/es_ES/suppliers.lang index 88db48b131a..a7d37289ca7 100644 --- a/htdocs/langs/es_ES/suppliers.lang +++ b/htdocs/langs/es_ES/suppliers.lang @@ -42,5 +42,5 @@ NoneOrBatchFileNeverRan=Ninguno o lote %s no se ha ejecutado recientement SentToSuppliers=Enviado a proveedores ListOfSupplierOrders=Listado de pedidos a proveedor MenuOrdersSupplierToBill=Pedidos a proveedor a facturar -NbDaysToDelivery=Delivery delay in days -DescNbDaysToDelivery=The biggest delay is display among order product list +NbDaysToDelivery=Tiempo de entrega en días +DescNbDaysToDelivery=El plazo mayor se visualiza el el listado de pedidos de productos diff --git a/htdocs/langs/es_ES/withdrawals.lang b/htdocs/langs/es_ES/withdrawals.lang index b1a5531479e..b5e6bd3cdee 100644 --- a/htdocs/langs/es_ES/withdrawals.lang +++ b/htdocs/langs/es_ES/withdrawals.lang @@ -79,7 +79,7 @@ CreditDate=Abonada el WithdrawalFileNotCapable=No es posible generar el fichero bancario de domiciliación para el país %s (El país no está soportado) ShowWithdraw=Ver domiciliación IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Sin embargo, si la factura tiene pendiente algún pago por domiciliación, no será cerrada para permitir la gestión de la domiciliación. -DoStandingOrdersBeforePayments=This tab allows you to request a standing order. Once done, go into menu Bank->Withdrawal to manage the standing order. When standing order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null. +DoStandingOrdersBeforePayments=Esta pestaña le permite realizar una petición de domiciliación. Una vez realizadas las peticiones, vaya al menú Bancos->Domiciliaciones para gestionar la domiciliación. Al cerrar una domiciliación, los pagos de las facturas se registrarán automáticamente, y las facturas completamente pagadas serán cerradas. WithdrawalFile=Archivo de la domiciliación SetToStatusSent=Clasificar como "Archivo enviado" ThisWillAlsoAddPaymentOnInvoice=Se crearán los pagos de las facturas y las clasificará como pagadas diff --git a/htdocs/langs/es_ES/workflow.lang b/htdocs/langs/es_ES/workflow.lang index 826ad1eb61e..8f97c568178 100644 --- a/htdocs/langs/es_ES/workflow.lang +++ b/htdocs/langs/es_ES/workflow.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - admin WorkflowSetup=Configuración del módulo Flujo de trabajo -WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can activate the automatic actions that you are interesting in. +WorkflowDesc=Este módulo le permite cambiar el comportamiento de las acciones automáticas en la aplicación. De forma predeterminada, el workflow está abierto (configure según sus necesidades). Active las acciones automáticas que le interesen. ThereIsNoWorkflowToModify=No hay workflow modificable para los módulos que tiene activados. descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de un presupuesto descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de un presupuesto From 1cdd77a6716c956f994f0af2bb4c2f615b1ad163 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Feb 2015 18:18:41 +0100 Subject: [PATCH 06/11] Fix: use bad var --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0257b51c946..7750250b00b 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -334,7 +334,7 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) else { $ttc = price2num($_POST['price_ttc']); - $ht = $ttc / (1 + ($tauxtva / 100)); + $ht = $ttc / (1 + ($tva_tx / 100)); $price_base_type = 'HT'; $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end); } From 7baaf18ad1f157767d6d645631cbc50ad3d86f98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Feb 2015 18:44:06 +0100 Subject: [PATCH 07/11] Fix can be null --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 3 +++ htdocs/install/mysql/tables/llx_projet_task.sql | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 2efb6996993..d9d972cc25c 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1095,6 +1095,9 @@ ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour); +ALTER TABLE llx_projet_task CHANGE COLUMN duration_effective real DEFAULT 0 NULL; +ALTER TABLE llx_projet_task CHANGE COLUMN planned_workload real DEFAULT 0 NULL; + -- add extrafield on ficheinter lines CREATE TABLE llx_fichinterdet_extrafields diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql index 98c8845974e..5b9decd23ef 100644 --- a/htdocs/install/mysql/tables/llx_projet_task.sql +++ b/htdocs/install/mysql/tables/llx_projet_task.sql @@ -31,10 +31,10 @@ create table llx_projet_task datev datetime, -- date validation label varchar(255) NOT NULL, description text, - duration_effective real DEFAULT 0 NOT NULL, - planned_workload real DEFAULT 0 NOT NULL, - progress integer DEFAULT 0, -- percentage increase - priority integer DEFAULT 0, -- priority + duration_effective real DEFAULT 0, + planned_workload real DEFAULT 0, + progress integer DEFAULT 0, -- percentage increase + priority integer DEFAULT 0, -- priority fk_user_creat integer, -- user who created the task fk_user_valid integer, -- user who validated the task fk_statut smallint DEFAULT 0 NOT NULL, From f8e9a38e5cecddc7ebef63cc66a4cdc731592681 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Feb 2015 19:37:44 +0100 Subject: [PATCH 08/11] Fix: Avoid empty table into setup when module are missing. --- htdocs/admin/stock.php | 131 +++++++++++++++++++++------------- htdocs/langs/en_US/admin.lang | 2 + 2 files changed, 82 insertions(+), 51 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 6b2c626da39..87ed5fe64c6 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -136,6 +136,8 @@ print "  \n"; print ''."\n"; $var=true; +$found=0; + if (! empty($conf->facture->enabled)) { $var=!$var; @@ -148,6 +150,7 @@ if (! empty($conf->facture->enabled)) print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled); print ''; print "\n\n\n"; + $found++; } if (! empty($conf->commande->enabled)) @@ -162,6 +165,7 @@ if (! empty($conf->commande->enabled)) print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled); print ''; print "\n\n\n"; + $found++; } if (! empty($conf->expedition->enabled)) @@ -176,7 +180,17 @@ if (! empty($conf->expedition->enabled)) print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled); print ''; print "\n\n\n"; + $found++; } + +if (! $found) +{ + $var=!$var; + print ""; + print ''.$langs->trans("NoModueToManageStockDecrease").''; + print "\n"; +} + print ''; print '
'; @@ -189,6 +203,8 @@ print "  \n"; print ''."\n"; $var=true; +$found=0; + if (! empty($conf->fournisseur->enabled)) { $var=!$var; @@ -201,6 +217,7 @@ if (! empty($conf->fournisseur->enabled)) print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled); print ''; print "\n\n\n"; + $found++; } if (! empty($conf->fournisseur->enabled)) @@ -215,6 +232,7 @@ if (! empty($conf->fournisseur->enabled)) print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled); print ''; print "\n\n\n"; + $found++; } if (! empty($conf->fournisseur->enabled)) { @@ -228,65 +246,76 @@ if (! empty($conf->fournisseur->enabled)) print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled); print ''; print "\n\n\n"; + $found++; +} + +if (! $found) +{ + $var=!$var; + print ""; + print ''.$langs->trans("NoModueToManageStockIncrease").''; + print "\n"; } print ''; // Optio to force stock to be enough before adding a line into document -print '
'; -print ''; -print ''; -print " \n"; -print " \n"; -print ''."\n"; +if ($conf->invoice->enabled || $conf->order->enabled || $conf->expedition->enabled) +{ + print '
'; + print '
".$langs->trans("RuleForStockAvailability")." 
'; + print ''; + print " \n"; + print " \n"; + print ''."\n"; -if($conf->invoice->enabled) { - $var = !$var; - print ""; - print ''; - print '\n"; - print "\n"; + if($conf->invoice->enabled) { + $var = !$var; + print ""; + print ''; + print '\n"; + print "\n"; + } + + if($conf->order->enabled) { + $var = !$var; + print ""; + print ''; + print '\n"; + print "\n"; + } + + if($conf->expedition->enabled) { + $var = !$var; + print ""; + print ''; + print '\n"; + print "\n"; + } + print '
".$langs->trans("RuleForStockAvailability")." 
'.$langs->trans("StockMustBeEnoughForInvoice").''; - print "
"; - print ''; - print ""; - print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_INVOICE",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE,1); - print ''; - print '
'; - print "
'.$langs->trans("StockMustBeEnoughForInvoice").''; + print "
"; + print ''; + print ""; + print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_INVOICE",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE,1); + print ''; + print '
'; + print "
'.$langs->trans("StockMustBeEnoughForOrder").''; + print "
"; + print ''; + print ""; + print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_ORDER",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER,1); + print ''; + print '
'; + print "
'.$langs->trans("StockMustBeEnoughForShipment").''; + print "
"; + print ''; + print ""; + print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT,1); + print ''; + print '
'; + print "
'; } -if($conf->order->enabled) { - $var = !$var; - print ""; - print ''.$langs->trans("StockMustBeEnoughForOrder").''; - print ''; - print "
"; - print ''; - print ""; - print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_ORDER",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER,1); - print ''; - print '
'; - print "\n"; - print "\n"; -} - -if($conf->expedition->enabled) { - $var = !$var; - print ""; - print ''.$langs->trans("StockMustBeEnoughForShipment").''; - print ''; - print "
"; - print ''; - print ""; - print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT,1); - print ''; - print '
'; - print "\n"; - print "\n"; -} -print ''; - - $virtualdiffersfromphysical=0; if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8768983ce73..e39486e242a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1560,3 +1560,5 @@ SortOrder=Sort order Format=Format TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type IncludePath=Include path (defined into variable %s) +NoModueToManageStockDecrease=No module able to manage automatic stock decrease has been activated. Stock decrease will be done on manual input only. +NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only. From be033c1947798b59d1de39ec915b9ee45f704c04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Mar 2015 13:54:24 +0100 Subject: [PATCH 09/11] Fix bad position of html tags Conflicts: htdocs/opensurvey/card.php --- htdocs/opensurvey/card.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 396fdf050ec..70e1b49ad48 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -157,12 +157,14 @@ if ($action == 'edit') { * View */ -if ($object->fk_user_creat) { +$form=new Form($db); + +if ($object->fk_user_creat) +{ $userstatic = new User($db); $userstatic->fetch($object->fk_user_creat); } -$form=new Form($db); $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); @@ -186,8 +188,8 @@ print ''; $head = opensurvey_prepare_head($object); -print dol_get_fiche_head($head,'general',$langs->trans("Survey"),0,dol_buildpath('/opensurvey/img/object_opensurvey.png',1),1); +dol_fiche_head($head,'general',$langs->trans("Survey"),0,dol_buildpath('/opensurvey/img/object_opensurvey.png',1),1); print ''; @@ -313,11 +315,12 @@ print $urllink; print '
'; -if ($action == 'edit') print '

'; +dol_fiche_end(); + +if ($action == 'edit') print '
'; print ''."\n"; -dol_fiche_end(); /* From 5f29942257d3bcf96db31e14002738ebadcbf083 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Mar 2015 14:03:14 +0100 Subject: [PATCH 10/11] Fix link missing icon --- htdocs/projet/index.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 36f53b02680..8baa287731e 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -25,6 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -50,6 +51,7 @@ $sortorder = GETPOST("sortorder",'alpha'); $socstatic=new Societe($db); $projectstatic=new Project($db); $userstatic=new User($db); +$tasktmp=new Task($db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1); //var_dump($projectsListId); @@ -224,7 +226,9 @@ if ( $resql ) print ''; if (! empty($obj->taskid)) { - print ''.$obj->label.''; + $tasktmp->id = $obj->taskid; + $tasktmp->ref = $obj->label; + print $tasktmp->getNomUrl(1); } else print $langs->trans("NoTasks"); print ''; @@ -256,13 +260,13 @@ if ( $resql ) } if ($num > $max) - { - print ''.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").''; + { + print ''.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").''; } - + print ""; - + $db->free($resql); } else From 8a00109baf27c38243ee776a411a24f616d3dd15 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Mar 2015 16:04:34 +0100 Subject: [PATCH 11/11] Fix: Several bugs int replenishment feature. --- htdocs/commande/list.php | 13 +-- htdocs/fourn/commande/dispatch.php | 4 +- htdocs/install/mysql/migration/repair.sql | 1 + htdocs/langs/en_US/stocks.lang | 2 +- htdocs/product/class/product.class.php | 15 ++-- .../product/stock/lib/replenishment.lib.php | 80 ++++++++++++------- htdocs/product/stock/replenish.php | 74 +++++++---------- htdocs/product/stock/replenishorders.php | 32 ++++---- 8 files changed, 120 insertions(+), 101 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0de3c54e1ba..59df993b686 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -361,19 +361,22 @@ if ($resql) // stock order and stock order_supplier $stock_order=0; $stock_order_supplier=0; - if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { - if (! empty($conf->commande->enabled)) { + if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) + { + if (! empty($conf->commande->enabled)) + { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { - $generic_product->load_stats_commande(0,'1,2',true); + $generic_product->load_stats_commande(0,'1,2'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; } else { $generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer']; } $stock_order=$generic_product->stats_commande['qty']; } - if (! empty($conf->fournisseur->enabled)) { + if (! empty($conf->fournisseur->enabled)) + { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) { - $generic_product->load_stats_commande_fournisseur(0,'3',true); + $generic_product->load_stats_commande_fournisseur(0,'3'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; } else { $generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier']; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c88886de649..9874f809673 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -387,11 +387,11 @@ if ($id > 0 || ! empty($ref)) print ''; if (count($listwarehouses)>1) { - print $form->selectarray("entrepot".$suffix, $listwarehouses, '', 1, 0, 0, '', 0, 0, $disabled); + print $form->selectarray("entrepot".$suffix, $listwarehouses, GETPOST("entrepot".$suffix), 1, 0, 0, '', 0, 0, $disabled); } elseif (count($listwarehouses)==1) { - print $form->selectarray("entrepot".$suffix, $listwarehouses, '', 0, 0, 0, '', 0, 0, $disabled); + print $form->selectarray("entrepot".$suffix, $listwarehouses, GETPOST("entrepot".$suffix), 0, 0, 0, '', 0, 0, $disabled); } else { diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 9e1ca7bb6f9..c0aeda5b671 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -212,5 +212,6 @@ update llx_facturedet set product_type = 1 where product_type = 2; --update llx_commandedet as d set d.product_type = 1 where d.fk_product = 22 and d.product_type = 0; --update llx_facturedet as d set d.product_type = 1 where d.fk_product = 22 and d.product_type = 0; +delete from llx_commande_fournisseur_dispatch where fk_commandefourndet = 0 or fk_commandefourndet IS NULL; diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 0e3e7dd6c27..fdd6408accb 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -108,7 +108,7 @@ WarehouseForStockDecrease=The warehouse %s will be used for stock decreas WarehouseForStockIncrease=The warehouse %s will be used for stock increase ForThisWarehouse=For this warehouse ReplenishmentStatusDesc=This is list of all product with a stock lower than desired stock (or lower than 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 +ReplenishmentOrdersDesc=This is list of all opened supplier orders including predefined products. Only opened orders with predefined products, so that may affect stocks, are visible here. 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/product/class/product.class.php b/htdocs/product/class/product.class.php index 0778046c431..e26f9102544 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3024,7 +3024,9 @@ class Product extends CommonObject } } $this->db->free($result); - $this->load_virtual_stock(); + + $this->load_virtual_stock(); // This also load stats_commande_fournisseur, ... + return 1; } else @@ -3048,18 +3050,21 @@ class Product extends CommonObject $stock_sending_client=0; $stock_reception_fournisseur=0; - if (! empty($conf->commande->enabled)) { + if (! empty($conf->commande->enabled)) + { $result=$this->load_stats_commande(0,'1,2'); if ($result < 0) dol_print_error($db,$this->error); $stock_commande_client=$this->stats_commande['qty']; } - if (! empty($conf->expedition->enabled)) { + if (! empty($conf->expedition->enabled)) + { $result=$this->load_stats_sending(0,'1,2'); if ($result < 0) dol_print_error($db,$this->error); $stock_sending_client=$this->stats_expedition['qty']; } - if (! empty($conf->fournisseur->enabled)) { - $result=$this->load_stats_commande_fournisseur(0,'3,4'); + if (! empty($conf->fournisseur->enabled)) + { + $result=$this->load_stats_commande_fournisseur(0,'1,2,3,4'); if ($result < 0) dol_print_error($db,$this->error); $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; diff --git a/htdocs/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php index 50a0d85e25c..1ef993c479d 100644 --- a/htdocs/product/stock/lib/replenishment.lib.php +++ b/htdocs/product/stock/lib/replenishment.lib.php @@ -25,56 +25,80 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; /** - * dispatched + * Check if there is still some dispatching of stock to do. * - * @param int $order_id Id of order - * @return boolean + * @param int $order_id Id of order to check + * @return boolean True = There is some dispatching to do, False = All dispatching is done (may be we receive more) or is not required */ -function dispatched($order_id) +function dolDispatchToDo($order_id) { global $db; - $sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'; - $sql .= ' WHERE fk_commande = ' . $order_id . ' GROUP BY fk_product'; - $sql .= ' ORDER by fk_product'; - $resql = $db->query($sql); + $dispatched = array(); $ordered = array(); - if($resql && $db->num_rows($resql)) - { - while($res = $db->fetch_object($resql)) - $dispatched[] = $res; - } - $sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet'; - $sql .= ' WHERE fk_commande = ' . $order_id . ' GROUP BY fk_product'; - $sql .= ' ORDER by fk_product'; + + # Count nb of quantity dispatched per product + $sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch'; + $sql.= ' WHERE fk_commande = ' . $order_id; + $sql.= ' GROUP BY fk_product'; + $sql.= ' ORDER by fk_product'; $resql = $db->query($sql); - if($resql && $db->num_rows($resql)) { - while($res = $db->fetch_object($resql)) - $ordered[] = $res; + if ($resql && $db->num_rows($resql)) + { + while ($obj = $db->fetch_object($resql)) + $dispatched[$obj->fk_product] = $obj; } - return $dispatched == $ordered; + + # Count nb of quantity to dispatch per product + $sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet'; + $sql.= ' WHERE fk_commande = ' . $order_id; + $sql.= ' AND fk_product > 0'; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= ' AND product_type = 0'; + $sql.= ' GROUP BY fk_product'; + $sql.= ' ORDER by fk_product'; + $resql = $db->query($sql); + if ($resql && $db->num_rows($resql)) + { + while ($obj = $db->fetch_object($resql)) + $ordered[$obj->fk_product] = $obj; + } + + $todispatch=0; + foreach ($ordered as $key => $val) + { + if ($ordered[$key] > $dispatched[$key]) $todispatch++; + } + + return ($todispatch ? true : false); + //return true; } /** * dispatchedOrders * - * @return Ambigous + * @return string Array of id of orders wit all dispathing already done or not required */ function dispatchedOrders() { global $db; + $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur'; $resql = $db->query($sql); - $res = array(); - if ($resql && $db->num_rows($resql) > 0) { - while ($obj = $db->fetch_object($resql)) { - if (dispatched($obj->rowid)) { - $res[] = $obj->rowid; + $resarray = array(); + if ($resql && $db->num_rows($resql) > 0) + { + while ($obj = $db->fetch_object($resql)) + { + if (! dolDispatchToDo($obj->rowid)) + { + $resarray[] = $obj->rowid; } } } - if ($res) { - $res = '(' . implode(',', $res) . ')'; + + if (count($resarray)) + { + $res = '(' . implode(',', $resarray) . ')'; } else { //hack to make sure ordered SQL request won't syntax error $res = '(0)'; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 35835709ab8..efb008df4ff 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -336,6 +336,17 @@ $head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php'; $head[1][1] = $langs->trans("ReplenishmentOrders"); $head[1][2] = 'replenishorders'; + + +print '
'. + ''. + ''. + ''. + ''. + ''. + ''. + ''; + dol_fiche_head($head, 'replenish', $langs->trans('Replenishment'), 0, 'stock'); print $langs->trans("ReplenishmentStatusDesc").'
'."\n"; @@ -386,16 +397,7 @@ if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) { ); } -print ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - - ''; +print '
'; $param = (isset($type)? '&type=' . $type : ''); $param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert; @@ -467,7 +469,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) if (!empty($objtp->label)) $objp->label = $objtp->label; } } - $form = new Form($db); $var =! $var; if ($usevirtualstock) @@ -480,7 +481,13 @@ while ($i < ($limit ? min($num, $limit) : $num)) $stock = $prod->stock_reel; } - $ordered = $prod->stats_commande_fournisseur['qty']-$prod->stats_reception['qty']; + // Force call prod->load_stats_xxx to choose status to count (otherwise it is loaded by load_stock function) + $result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4'); + $result=$prod->load_stats_reception(0,'4'); + + //print $prod->stats_commande_fournisseur['qty'].'
'."\n"; + //print $prod->stats_reception['qty']; + $ordered = $prod->stats_commande_fournisseur['qty'] - $prod->stats_reception['qty']; $warning=''; if ($objp->alertstock && ($stock < $objp->alertstock)) @@ -555,12 +562,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) print '
'; -$value=$langs->trans("CreateOrders"); -print '
'; - - -print '
'; - if ($num > $conf->liste_limit) { if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) @@ -569,36 +570,16 @@ if ($num > $conf->liste_limit) $filters .= '&sall=' . $sall; $filters .= '&salert=' . $salert; $filters .= '&mode=' . $mode; - print_barre_liste( - '', - $page, - 'replenish.php', - $filters, - $sortfield, - $sortorder, - '', - $num, - 0, - '' - ); - } else { + 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; $filters .= '&mode=' . $mode; - print_barre_liste( - '', - $page, - 'replenish.php', - $filters, - $sortfield, - $sortorder, - '', - $num, - 0, - '' - ); + print_barre_liste('', $page, 'replenish.php', $filters, $sortfield, $sortorder, '', $num, 0, ''); } } @@ -607,6 +588,13 @@ $db->free($resql); dol_fiche_end(); +$value=$langs->trans("CreateOrders"); +print '
'; + + +print ''; + + // TODO Replace this with jquery print '