From 42c97cf7d54b5953987c489b2b48dcaed470fdb6 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 2 Dec 2018 17:59:11 +0100 Subject: [PATCH 01/16] Fix #6610 --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 5e83ee81fd0..79a85d4ca9c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1169,7 +1169,7 @@ else // Check if user has rights $object->getrights(); - if (empty($object->nb_rights) && $object->statut != 0) setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings'); + if (empty($object->nb_rights) && $object->statut != 0 && empty($object->admin)) setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings'); // Connexion ldap // pour recuperer passDoNotExpire et userChangePassNextLogon From 8fea6338e1b5ba078e64c005ec724228ac54c68c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 2 Dec 2018 18:51:49 +0100 Subject: [PATCH 02/16] Fix #6565 Fix pdf footer height for all documents --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 1 + htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 1 + htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 1 + htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 1 + htdocs/core/modules/contract/doc/pdf_strato.modules.php | 1 + htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 1 + htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 1 + htdocs/core/modules/expensereport/doc/pdf_standard.modules.php | 1 + htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 1 + htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 1 + htdocs/core/modules/livraison/doc/pdf_typhon.modules.php | 1 + htdocs/core/modules/product/doc/pdf_standard.modules.php | 1 + htdocs/core/modules/project/doc/pdf_baleine.modules.php | 1 + htdocs/core/modules/project/doc/pdf_beluga.modules.php | 1 + htdocs/core/modules/propale/doc/pdf_azur.modules.php | 1 + htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 1 + htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 1 + .../core/modules/supplier_payment/doc/pdf_standard.modules.php | 1 + htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 1 + 19 files changed, 19 insertions(+) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 699b186a9d2..9f8d675310a 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -149,6 +149,7 @@ class pdf_ban extends ModeleBankAccountDoc $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 3dc615d9deb..46c7817c271 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -158,6 +158,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index dc8681a85fd..58790f91ca3 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -129,6 +129,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9dc2b770222..8ab3407baa3 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -245,6 +245,7 @@ class pdf_einstein extends ModelePDFCommandes $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 77904beac0b..26417848762 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -175,6 +175,7 @@ class pdf_strato extends ModelePDFContract $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 72b9a7e6def..7cc382531fc 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -163,6 +163,7 @@ class pdf_merou extends ModelePdfExpedition $heightforinfotot = 0; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 8f51e9b9e40..f37418688e7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -225,6 +225,7 @@ class pdf_rouget extends ModelePdfExpedition $heightforinfotot = 8; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index e4ad7b7db36..c4828d32b74 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -205,6 +205,7 @@ class pdf_standard extends ModeleExpenseReport $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 804eb8885db..f14ea701314 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -265,6 +265,7 @@ class pdf_crabe extends ModelePDFFactures $heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index e88e9ad10c5..6f6cbbd6f91 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -166,6 +166,7 @@ class pdf_soleil extends ModelePDFFicheinter $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index bbc74f3b6bb..1ef14478ebc 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -195,6 +195,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $heightforinfotot = 30; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 2ceca5791a8..02ebe610dd7 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -195,6 +195,7 @@ class pdf_standard extends ModelePDFProduct $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 334846ab69b..10a808e263a 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -141,6 +141,7 @@ class pdf_baleine extends ModelePDFProjects $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 15fd0e5f615..0409c0b9472 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -159,6 +159,7 @@ class pdf_beluga extends ModelePDFProjects $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 17b99fb8b36..f9816de1a03 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -328,6 +328,7 @@ class pdf_azur extends ModelePDFPropales $heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0; $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 9cfc1be320b..75a507d0546 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -211,6 +211,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 23a06264778..eabb045df66 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -223,6 +223,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 7d0772f272c..20dcad9c5c4 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -219,6 +219,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index a6457dd7a2e..80152207ac0 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -239,6 +239,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6; $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) From 6eb901343026c6ab58c532cb5e2f49a11b069bf8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 16 Dec 2018 06:36:55 +0100 Subject: [PATCH 03/16] Fix: Accountancy - remove alert on bank account configuration when bank account is closed --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 030140b7f11..434319a2eb9 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -840,7 +840,7 @@ if (empty($action) || $action == 'view') { // Test that setup is complete - $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL'; + $sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0'; $resql = $db->query($sql); if ($resql) { From 6ce0d3e279db42636e230ea93316f7fde20e0a30 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sun, 16 Dec 2018 11:16:12 +0100 Subject: [PATCH 04/16] FIX: Vendor translations are in english --- htdocs/langs/es_ES/companies.lang | 44 +++++++++++------------ htdocs/langs/es_ES/errors.lang | 10 +++--- htdocs/langs/es_ES/margins.lang | 4 +-- htdocs/langs/es_ES/orders.lang | 12 +++---- htdocs/langs/es_ES/supplier_proposal.lang | 26 +++++++------- htdocs/langs/es_ES/suppliers.lang | 30 ++++++++-------- htdocs/langs/es_ES/workflow.lang | 4 +-- 7 files changed, 65 insertions(+), 65 deletions(-) diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 1736c591f63..4ff958a006c 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -8,11 +8,11 @@ ConfirmDeleteContact=¿Está seguro de querer eliminar este contacto y toda la i MenuNewThirdParty=Nuevo tercero MenuNewCustomer=Nuevo cliente MenuNewProspect=Nuevo cliente potencial -MenuNewSupplier=New vendor +MenuNewSupplier=Nuevo proveedor MenuNewPrivateIndividual=Nuevo particular -NewCompany=New company (prospect, customer, vendor) -NewThirdParty=New third party (prospect, customer, vendor) -CreateDolibarrThirdPartySupplier=Create a third party (vendor) +NewCompany=Nueva empresa (cliente potencial, cliente, proveedor) +NewThirdParty=Nuevo tercero (cliente potencial, cliente, proveedor) +CreateDolibarrThirdPartySupplier=Crear tercero (proveedor) CreateThirdPartyOnly=Crear tercero CreateThirdPartyAndContact=Crear un tercero + un contacto ProspectionArea=Área de prospección @@ -37,7 +37,7 @@ ThirdPartyProspectsStats=Clientes potenciales ThirdPartyCustomers=Clientes ThirdPartyCustomersStats=Clientes ThirdPartyCustomersWithIdProf12=Clientes con %s ó %s -ThirdPartySuppliers=Vendors +ThirdPartySuppliers=Proveedores ThirdPartyType=Tipo de tercero Individual=Particular ToCreateContactWithSameName=Creará automáticamente un contacto físico con la misma información. en la mayoría de casos. En la mayoría de los casos, incluso si el tercero es una persona física, la creación de un tercero por sí solo es suficiente. @@ -77,11 +77,11 @@ Web=Web Poste= Puesto DefaultLang=Idioma por defecto VATIsUsed=IVA está siendo usado -VATIsUsedWhenSelling=This define if this third party includes a sale tax or not when it makes an invoice to its own customers +VATIsUsedWhenSelling=Esto define si este tercero incluye IVA o no cuando realiza una factura a sus propios clientes. VATIsNotUsed=IVA no está siendo usado CopyAddressFromSoc=Copiar dirección de la empresa -ThirdpartyNotCustomerNotSupplierSoNoRef=Third party neither customer nor vendor, no available refering objects -ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts=Third party neither customer nor supplier, discounts are not available +ThirdpartyNotCustomerNotSupplierSoNoRef=Tercero ni cliente ni proveedor, no hay objetos de referencia disponibles +ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts=Tercero ni cliente ni proveedor, los descuentos no están disponibles. PaymentBankAccount=Cuenta bancaria de pago OverAllProposals=Presupuestos OverAllOrders=Pedidos @@ -99,9 +99,9 @@ LocalTax2ES=IRPF TypeLocaltax1ES=Tasa RE TypeLocaltax2ES=Tasa IRPF WrongCustomerCode=Código cliente incorrecto -WrongSupplierCode=Vendor code invalid +WrongSupplierCode=Código proveedor incorrecto CustomerCodeModel=Modelo de código cliente -SupplierCodeModel=Vendor code model +SupplierCodeModel=Modelo de código proveedor Gencod=Código de barras ##### Professional ID ##### ProfId1Short=Prof. id 1 @@ -267,7 +267,7 @@ Prospect=Cliente potencial CustomerCard=Ficha cliente Customer=Cliente CustomerRelativeDiscount=Descuento cliente relativo -SupplierRelativeDiscount=Relative vendor discount +SupplierRelativeDiscount=Descuento proveedor relativo CustomerRelativeDiscountShort=Descuento relativo CustomerAbsoluteDiscountShort=Descuento fijo CompanyHasRelativeDiscount=Este cliente tiene un descuento por defecto de %s%% @@ -284,8 +284,8 @@ HasCreditNoteFromSupplier=Tiene abonos para %s %s en este proveedor CompanyHasNoAbsoluteDiscount=Este cliente no tiene más descuentos fijos disponibles CustomerAbsoluteDiscountAllUsers=Descuentos fijos a clientes (acordado por todos los usuarios) CustomerAbsoluteDiscountMy=Descuentos fijos a clientes (acordados personalmente) -SupplierAbsoluteDiscountAllUsers=Absolute vendor discounts (entered by all users) -SupplierAbsoluteDiscountMy=Absolute vendor discounts (entered by yourself) +SupplierAbsoluteDiscountAllUsers=Descuentos fijos de proveedores (acordado por todos los usuarios) +SupplierAbsoluteDiscountMy=Descuentos fijos a proveedores (acordados personalmente) DiscountNone=Ninguna Supplier=Proveedor AddContact=Crear contacto @@ -304,13 +304,13 @@ DeleteACompany=Eliminar una empresa PersonalInformations=Información personal AccountancyCode=Cuenta contable CustomerCode=Código cliente -SupplierCode=Vendor code +SupplierCode=Código proveedor CustomerCodeShort=Código cliente -SupplierCodeShort=Vendor code +SupplierCodeShort=Código proveedor CustomerCodeDesc=Código único cliente para cada cliente -SupplierCodeDesc=Vendor code, unique for all vendors +SupplierCodeDesc=Código único proveedor para cada proveedor RequiredIfCustomer=Requerida si el tercero es un cliente o cliente potencial -RequiredIfSupplier=Required if third party is a vendor +RequiredIfSupplier=Requerida si el tercero es un proveedor ValidityControledByModule=Validación controlada por el módulo ThisIsModuleRules=Esta es la regla para este módulo ProspectToContact=Cliente potencial a contactar @@ -338,7 +338,7 @@ MyContacts=Mis contactos Capital=Capital CapitalOf=Capital de %s EditCompany=Modificar empresa -ThisUserIsNot=This user is not a prospect, customer nor vendor +ThisUserIsNot=Este usuario no es ni cliente potencial ni cliente ni proveedor VATIntraCheck=Verificar VATIntraCheckDesc=El link %s permite consultar al servicio europeo de control de números de IVA intracomunitario. Se requiere acceso a internet para que el servicio funcione VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/vieshome.do @@ -396,7 +396,7 @@ ImportDataset_company_4=Terceros/Comerciales (Asigna usuarios comerciales a terc PriceLevel=Nivel de precios DeliveryAddress=Dirección de envío AddAddress=Añadir dirección -SupplierCategory=Vendor category +SupplierCategory=Categoría proveedor JuridicalStatus200=Independiente DeleteFile=Eliminación de un archivo ConfirmDeleteFile=¿Está seguro de querer eliminar este archivo? @@ -406,7 +406,7 @@ FiscalYearInformation=Información del año fiscal FiscalMonthStart=Mes de inicio de ejercicio YouMustAssignUserMailFirst=Primero debe indicar un e-mail para este usuario para poder añadirlo en e-mails de notificaciones. YouMustCreateContactFirst=Para poder añadir notificaciones por e-mail, primero debe definir contactos con e-mails válidos en el tercero -ListSuppliersShort=List of vendors +ListSuppliersShort=Listado de proveedores ListProspectsShort=Listado de clientes potenciales ListCustomersShort=Listado de clientes ThirdPartiesArea=Área terceros y contactos @@ -420,7 +420,7 @@ CurrentOutstandingBill=Riesgo alcanzado OutstandingBill=Importe máximo para facturas pendientes OutstandingBillReached=Importe máximo para facturas pendientes OrderMinAmount=Importe mínimo para pedido -MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for vendor code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. +MonkeyNumRefModelDesc=Devuelve un número con formato %syymm-nnnn para el código del cliente y %syymm-nnnn para el código del proveedor donde yy es año, mm es mes y nnnn es una secuencia sin interrupción y sin retorno a 0. LeopardNumRefModelDesc=Código de cliente/proveedor libre sin verificación. Puede ser modificado en cualquier momento. ManagingDirectors=Administrador(es) (CEO, director, presidente, etc.) MergeOriginThirdparty=Tercero duplicado (tercero que debe eliminar) @@ -431,4 +431,4 @@ SaleRepresentativeLogin=Inicio de sesión del comercial SaleRepresentativeFirstname=Nombre del comercial SaleRepresentativeLastname=Apellidos del comercial ErrorThirdpartiesMerge=Se produjo un error al eliminar los terceros. Por favor, compruebe el log. Los cambios han sido anulados. -NewCustomerSupplierCodeProposed=New customer or vendor code suggested on duplicate code +NewCustomerSupplierCodeProposed=Nuevo código de cliente o proveedor sugerido duplicado diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 26902fa0858..422ee5c7fc8 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -32,9 +32,9 @@ ErrorBarCodeRequired=Código de barras requerido ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado ErrorBarCodeAlreadyUsed=El código de barras ya está siendo utilizado ErrorPrefixRequired=Prefijo obligatorio -ErrorBadSupplierCodeSyntax=Bad syntax for vendor code -ErrorSupplierCodeRequired=Vendor code required -ErrorSupplierCodeAlreadyUsed=Vendor code already used +ErrorBadSupplierCodeSyntax=La sintaxis del código de proveedor es incorrecta +ErrorSupplierCodeRequired=Código de proveedor obligatorio +ErrorSupplierCodeAlreadyUsed=Código de cliente ya utilizado ErrorBadParameters=Parámetros incorrectos ErrorBadValueForParameter=valor '%s' incorrecto para el parámetro '%s' ErrorBadImageFormat=El archivo de imagen es de un formato no soportado (Su PHP no soporta las funciones de conversión de este formato de imagen) @@ -87,7 +87,7 @@ ErrorsOnXLines=Errores en %s líneas fuente ErrorFileIsInfectedWithAVirus=¡El antivirus no ha podido validar este archivo (es probable que esté infectado por un virus)! ErrorSpecialCharNotAllowedForField=Los caracteres especiales no son admitidos por el campo "%s" ErrorNumRefModel=Hay una referencia en la base de datos (%s) y es incompatible con esta numeración. Elimine la línea o renombre la referencia para activar este módulo. -ErrorQtyTooLowForThisSupplier=Quantity too low for this vendor or no price defined on this product for this supplier +ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorModuleSetupNotComplete=La configuración del módulo parece incompleta. Vaya a Inicio - Configuración - Módulos para completarla. ErrorBadMask=Error en la máscara ErrorBadMaskFailedToLocatePosOfSequence=Error, sin número de secuencia en la máscara @@ -177,7 +177,7 @@ ErrorBadDefinitionOfMenuArrayInModuleDescriptor=Definición incorrecta de la mat ErrorSavingChanges=Ha ocurrido un error al guardar los cambios ErrorWarehouseRequiredIntoShipmentLine=El almacén es obligatorio en la línea a enviar ErrorFileMustHaveFormat=El archivo debe tener el formato %s -ErrorSupplierCountryIsNotDefined=Country for this vendor is not defined. Correct this first. +ErrorSupplierCountryIsNotDefined=El país para este proveedor no está definido. Corrija esto primero. ErrorsThirdpartyMerge=No se han podido fusionar los dos registros. Petición cancelada. ErrorStockIsNotEnoughToAddProductOnOrder=No hay stock suficiente del producto %s para añadirlo a un nuevo pedido. ErrorStockIsNotEnoughToAddProductOnInvoice=No hay stock suficiente del producto %s para añadirlo a una nueva factura. diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index 702b8a1aacc..9a4e450fde5 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -28,10 +28,10 @@ UseDiscountAsService=Como un servicio UseDiscountOnTotal=Sobre el total MARGIN_METHODE_FOR_DISCOUNT_DETAILS=Indica si un descuento global se toma en cuenta como un producto, servicio o sólo en el total a la hora de calcular los márgenes. MARGIN_TYPE=Precio compra/coste sugerido por defecto por el cálculo de márgenes -MargeType1=Margin on Best vendor price +MargeType1=Margen en Mejor Precio Proveedor MargeType2=Margen en Precio Medio Ponderado (PMP) MargeType3=Margen en Precio de coste -MarginTypeDesc=* Margin on best buying price = Selling price - Best vendor price defined on product card
* Margin on Weighted Average Price (WAP) = Selling price - Product Weighted Average Price (WAP) or best supplier price if WAP not yet defined
* Margin on Cost price = Selling price - Cost price defined on product card or WAP if cost price not defined, or best supplier price if WAP not yet defined +MarginTypeDesc=* Margen en mejor precio de compra = Precio de venta - Mejor precio de proveedor definido en la ficha del producto
* Margen en Precio promedio ponderado (PMP) = Precio de venta - Precio Medio Ponderado del producto (PMP), o mejor precio de proveedor si PMP aún no está definido
* Margen en precio de coste = Precio de venta - precio de coste definido en la ficha del producto o PMP si el precio de coste no está definido, o mejor precio de proveedor si PMP aún no está definido CostPrice=Precio de compra UnitCharges=Carga unitaria Charges=Cargas diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 0c56501ab5a..10898b187ad 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -101,8 +101,8 @@ DraftSuppliersOrders=Draft purchase orders OnProcessOrders=Pedidos en proceso RefOrder=Ref. pedido RefCustomerOrder=Ref. pedido para el cliente -RefOrderSupplier=Ref. order for vendor -RefOrderSupplierShort=Ref. order vendor +RefOrderSupplier=Ref. pedido para el proveedor +RefOrderSupplierShort=Ref. ped. prov. SendOrderByMail=Enviar pedido por e-mail ActionsOnOrder=Eventos sobre el pedido NoArticleOfTypeProduct=No hay artículos de tipo 'producto' y por lo tanto enviables en este pedido @@ -125,11 +125,11 @@ TypeContact_commande_internal_SHIPPING=Responsable envío pedido cliente TypeContact_commande_external_BILLING=Contacto cliente facturación pedido TypeContact_commande_external_SHIPPING=Contacto cliente entrega pedido TypeContact_commande_external_CUSTOMER=Contacto cliente seguimiento pedido -TypeContact_order_supplier_internal_SALESREPFOLL=Representative following-up purchase order +TypeContact_order_supplier_internal_SALESREPFOLL=Comercial seguimiento pedido de compra TypeContact_order_supplier_internal_SHIPPING=Responsable recepción pedido a proveedor -TypeContact_order_supplier_external_BILLING=Vendor invoice contact -TypeContact_order_supplier_external_SHIPPING=Vendor shipping contact -TypeContact_order_supplier_external_CUSTOMER=Vendor contact following-up order +TypeContact_order_supplier_external_BILLING=Contacto proveedor factura +TypeContact_order_supplier_external_SHIPPING=Contacto seguimiento proveedor +TypeContact_order_supplier_external_CUSTOMER=Contacto seguimiento pedido a proveedor Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constante COMMANDE_SUPPLIER_ADDON no definida Error_COMMANDE_ADDON_NotDefined=Constante COMMANDE_ADDON no definida Error_OrderNotChecked=No se han seleccionado pedidos a facturar diff --git a/htdocs/langs/es_ES/supplier_proposal.lang b/htdocs/langs/es_ES/supplier_proposal.lang index 07e5cf18b19..2ccfdecade8 100644 --- a/htdocs/langs/es_ES/supplier_proposal.lang +++ b/htdocs/langs/es_ES/supplier_proposal.lang @@ -1,22 +1,22 @@ # Dolibarr language file - Source file is en_US - supplier_proposal -SupplierProposal=Vendor commercial proposals -supplier_proposalDESC=Manage price requests to vendors +SupplierProposal=Presupuestos de proveedor +supplier_proposalDESC=Gestiona presupuestos de proveedor SupplierProposalNew=Nuevo presupuesto CommRequest=Presupuesto CommRequests=Presupuestos SearchRequest=Buscar un presupuesto DraftRequests=Presupuestos borrador -SupplierProposalsDraft=Draft vendor proposals -LastModifiedRequests=Últimos %s consultas de precios modificados +SupplierProposalsDraft=Presupuestos de proveedor borrador +LastModifiedRequests=Últimos %s presupuestos RequestsOpened=Presupuestos abiertos -SupplierProposalArea=Vendor proposals area -SupplierProposalShort=Vendor proposal -SupplierProposals=Vendor proposals -SupplierProposalsShort=Vendor proposals +SupplierProposalArea=Área presupuestos de proveedor +SupplierProposalShort=Presupuesto de proveedor +SupplierProposals=Presupuestos de proveedor +SupplierProposalsShort=Presup. proveedor NewAskPrice=Nuevo presupuesto ShowSupplierProposal=Mostrar presupuesto AddSupplierProposal=Crear un presupuesto -SupplierProposalRefFourn=Vendor ref +SupplierProposalRefFourn=Ref. proveedor SupplierProposalDate=Fecha de entrega SupplierProposalRefFournNotice=Antes de cerrar a "Aceptado", piense en consultar las referencias de proveedores. ConfirmValidateAsk=¿Está seguro de querer validar este presupuesto bajo la referencia %s? @@ -47,9 +47,9 @@ CommercialAsk=Presupuesto DefaultModelSupplierProposalCreate=Modelo por defecto DefaultModelSupplierProposalToBill=Modelo por defecto al cerrar un presupuesto (aceptado) DefaultModelSupplierProposalClosed=Modelo por defecto al cerrar un presupuesto (rechazado) -ListOfSupplierProposals=List of vendor proposal requests -ListSupplierProposalsAssociatedProject=List of vendor proposals associated with project -SupplierProposalsToClose=Vendor proposals to close -SupplierProposalsToProcess=Vendor proposals to process +ListOfSupplierProposals=Listado de presupuestos de proveedor +ListSupplierProposalsAssociatedProject=Listado de presupuestos de proveedor asociados al proyecto +SupplierProposalsToClose=Presupuestos de proveedor a cerrar +SupplierProposalsToProcess=Presupuestos de proveedor a procesar LastSupplierProposals=Últimos %s presupuestos AllPriceRequests=Todos los presupuestos diff --git a/htdocs/langs/es_ES/suppliers.lang b/htdocs/langs/es_ES/suppliers.lang index 4cbcf8788eb..ed58f3cf855 100644 --- a/htdocs/langs/es_ES/suppliers.lang +++ b/htdocs/langs/es_ES/suppliers.lang @@ -1,11 +1,11 @@ # Dolibarr language file - Source file is en_US - suppliers -Suppliers=Vendors -SuppliersInvoice=Vendor invoice -ShowSupplierInvoice=Show Vendor Invoice -NewSupplier=New vendor +Suppliers=Proveedores +SuppliersInvoice=Factura de proveedor +ShowSupplierInvoice=Ver factura de proveedor +NewSupplier=Nuevo proveedor History=Histórico -ListOfSuppliers=List of vendors -ShowSupplier=Show vendor +ListOfSuppliers=Listado de proveedores +ShowSupplier=Ver proveedor OrderDate=Fecha de pedido BuyingPriceMin=Mejor precio de compra BuyingPriceMinShort=Mejor precio de compra @@ -14,12 +14,12 @@ TotalSellingPriceMinShort=Total de los precios de venta de los subproductos SomeSubProductHaveNoPrices=Algunos subproductos no tienen precio definido AddSupplierPrice=Añadir precio de compra ChangeSupplierPrice=Cambiar precio de compra -SupplierPrices=Vendor prices +SupplierPrices=Precios proveedor ReferenceSupplierIsAlreadyAssociatedWithAProduct=Esta referencia de proveedor ya está asociada a la referencia: %s -NoRecordedSuppliers=No vendor recorded -SupplierPayment=Vendor payment -SuppliersArea=Vendor area -RefSupplierShort=Ref. vendor +NoRecordedSuppliers=Sin proveedores registrados +SupplierPayment=Pagos a proveedor +SuppliersArea=Área proveedores +RefSupplierShort=Ref. proveedor Availability=Disponibilidad ExportDataset_fournisseur_1=Facturas de proveedor y líneas de factura ExportDataset_fournisseur_2=Facturas de proveedor y pagos @@ -31,17 +31,17 @@ ConfirmDenyingThisOrder=¿Está seguro de querer denegar el pedido a proveedor < ConfirmCancelThisOrder=¿Está seguro de querer cancelar el pedido a proveedor %s? AddSupplierOrder=Crear pedido a proveedor AddSupplierInvoice=Crear factura de proveedor -ListOfSupplierProductForSupplier=List of products and prices for vendor %s -SentToSuppliers=Sent to vendors +ListOfSupplierProductForSupplier=Listado de productos y precios del proveedor %s +SentToSuppliers=Enviado a proveedores ListOfSupplierOrders=Listado de pedidos a proveedor MenuOrdersSupplierToBill=Pedidos a proveedor a facturar NbDaysToDelivery=Tiempo de entrega en días DescNbDaysToDelivery=El mayor retraso en las entregas de productos de este pedido -SupplierReputation=Vendor reputation +SupplierReputation=Reputación proveedor DoNotOrderThisProductToThisSupplier=No realizar pedidos NotTheGoodQualitySupplier=Mala calidad ReputationForThisProduct=Reputación BuyerName=Nombre del comprador AllProductServicePrices=Todos los precios de producto / servicio AllProductReferencesOfSupplier=Todos las referencias de proveedores de producto / servicio -BuyingPriceNumShort=Vendor prices +BuyingPriceNumShort=Precios proveedor diff --git a/htdocs/langs/es_ES/workflow.lang b/htdocs/langs/es_ES/workflow.lang index 058e6bf75f0..05bfef7aee4 100644 --- a/htdocs/langs/es_ES/workflow.lang +++ b/htdocs/langs/es_ES/workflow.lang @@ -14,7 +14,7 @@ descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Clasificar pedido(s) de client descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Clasificar pedido(s) de cliente origen como facturado cuando la factura a cliente sea marcada como pagada (y si el importe de la factura es la misma que la suma de los importes de los pedidos relacionados) descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Clasificar automáticamente el pedido origen como enviado cuando el envío se valide (y si la cantidad enviada por todos los envíos sea la misma que el pedido) # Autoclassify supplier order -descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal(s) to billed when vendor invoice is validated (and if amount of the invoice is same than total amount of linked proposals) -descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order(s) to billed when vendor invoice is validated (and if amount of the invoice is same than total amount of linked orders) +descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Clasificar los presupuesto(s) de proveedor origen como facturado(s) cuando la factura de proveedor (y si el importe de la factura es igual a la suma de los importes de los presupuestos relacionados) +descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Clasificar pedido(s) a proveedor origen como facturado(s) cuando la factura de proveedor se valide (y si el importe de la factura es igual a la suma de los importes de los pedidos relacionados) AutomaticCreation=Creación automática AutomaticClassification=Clasificación automática From 9b844df3154e19c6eb9bc4d3f07c6600fdfd4d35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Dec 2018 18:44:58 +0100 Subject: [PATCH 05/16] FIX Extrafields on shipment module --- htdocs/expedition/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 14f9eb41f44..95f6dbd616b 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -69,6 +69,8 @@ $pagenext = $page + 1; $viewstatut=GETPOST('viewstatut'); +$object = new Expedition($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('shipmentlist')); $extrafields = new ExtraFields($db); From 003c463ee452ac46f6a3f12251e925a07f9bebe7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Dec 2018 19:23:53 +0100 Subject: [PATCH 06/16] FIX Can't delete a line of minimal stock per warehouse --- .../class/productstockentrepot.class.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index cbca4e5854d..1d4691d5ff3 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -157,13 +157,12 @@ class ProductStockEntrepot extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object - * @param int $fk_product Id product - * @param int $fk_entrepot Id warehouse - * - * @return int <0 if KO, 0 if not found, >0 if OK + * @param int $id Id object + * @param int $fk_product Id product + * @param int $fk_entrepot Id warehouse + * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id, $fk_product, $fk_entrepot) + public function fetch($id, $fk_product=0, $fk_entrepot=0) { if(empty($id) && (empty($fk_product) || empty($fk_entrepot))) return -1; @@ -171,23 +170,22 @@ class ProductStockEntrepot extends CommonObject $sql = 'SELECT'; $sql .= ' t.rowid,'; - $sql .= " t.tms,"; $sql .= " t.fk_product,"; $sql .= " t.fk_entrepot,"; $sql .= " t.seuil_stock_alerte,"; $sql .= " t.desiredstock,"; $sql .= " t.import_key"; - - $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; if(!empty($id)) $sql .= ' WHERE t.rowid = ' . $id; else $sql.= ' WHERE t.fk_product = '.$fk_product.' AND t.fk_entrepot = '.$fk_entrepot; $resql = $this->db->query($sql); - if ($resql) { + if ($resql) + { $numrows = $this->db->num_rows($resql); - if ($numrows) { + if ($numrows) + { $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; @@ -198,8 +196,6 @@ class ProductStockEntrepot extends CommonObject $this->seuil_stock_alerte = $obj->seuil_stock_alerte; $this->desiredstock = $obj->desiredstock; $this->import_key = $obj->import_key; - - } // Retreive all extrafield From efb88292dda9b1632a9af18977cfc586cb5ac66d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Dec 2018 19:30:54 +0100 Subject: [PATCH 07/16] Clean code --- htdocs/product/stock/product.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 7c18dc11281..f93482caf94 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -83,7 +83,7 @@ if ($id > 0 || ! empty($ref)) } -if(empty($id) && !empty($object->id)) $id = $object->id; +if(empty($id) && !empty($object->id)) $id = $object->id; $modulepart='product'; @@ -130,7 +130,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) if($maj_ok) { $pse = new ProductStockEntrepot($db); - if($pse->fetch('', $id, GETPOST('fk_entrepot')) > 0) { + if($pse->fetch(0, $id, GETPOST('fk_entrepot')) > 0) { // Update $pse->seuil_stock_alerte = $seuil_stock_alerte; @@ -159,7 +159,7 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c { $pse = new ProductStockEntrepot($db); - $pse->fetch(GETPOST('fk_productstockwarehouse')); + $pse->fetch(GETPOST('fk_productstockwarehouse','int')); if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted')); $action = ''; @@ -989,8 +989,8 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) print ""; - if (!empty($user->rights->produit->creer)){ - print ''; + if (!empty($user->rights->produit->creer)){ + print ''; } } From d8b5cd4bdfe13c4094bcd3271fb994bc70223ca3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Dec 2018 19:31:59 +0100 Subject: [PATCH 08/16] Remove white lines --- htdocs/product/stock/product.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index f93482caf94..01ca0bb37e6 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -131,23 +131,18 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) $pse = new ProductStockEntrepot($db); if($pse->fetch(0, $id, GETPOST('fk_entrepot')) > 0) { - // Update $pse->seuil_stock_alerte = $seuil_stock_alerte; $pse->desiredstock = $desiredstock; if($pse->update($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseUpdated')); - } else { - // Create $pse->fk_entrepot = GETPOST('fk_entrepot'); $pse->fk_product = $id; $pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $pse->desiredstock = GETPOST('desiredstock'); if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated')); - } - } header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); @@ -161,9 +156,7 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c $pse = new ProductStockEntrepot($db); $pse->fetch(GETPOST('fk_productstockwarehouse','int')); if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted')); - $action = ''; - } // Set stock limit @@ -916,7 +909,6 @@ if ($resql) } } $i++; - } } else dol_print_error($db); From af4405c669043f6a5f3845731fde6aa1ad241eb3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Dec 2018 20:29:08 +0100 Subject: [PATCH 09/16] FIX Replenishment with option STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE --- htdocs/langs/en_US/stocks.lang | 2 ++ htdocs/product/stock/replenish.php | 49 ++++++++++++++++-------------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 0d22a3b3c75..da00add3711 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -29,6 +29,8 @@ MovementId=Movement ID StockMovementForId=Movement ID %d ListMouvementStockProject=List of stock movements associated to project StocksArea=Warehouses area +AllWarehouses=All warehouses +IncludeAlsoDraftOrders=Include also draft orders Location=Location LocationSummary=Short name location NumberOfDifferentProducts=Number of different products diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 3bc2bcdd85c..bb7f5f0539e 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -288,22 +288,20 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre $sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,'; $sql.= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; -$sql.= ' p.tms as datem, p.duration, p.tobuy'; -$sql.= ' ,p.desiredstock,p.seuil_stock_alerte'; -if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { - $sql.= ', pse.desiredstock' ; - $sql.= ', pse.seuil_stock_alerte' ; +$sql.= ' p.tms as datem, p.duration, p.tobuy,'; +$sql.= ' p.desiredstock, p.seuil_stock_alerte,'; +if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { + $sql.= ' pse.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,'; } -$sql.= ' ,'.$sqldesiredtock.' as desiredstock, '.$sqlalertstock.' as alertstock,'; - +$sql.= ' '.$sqldesiredtock.' as desiredstockcombined, '.$sqlalertstock.' as seuil_stock_alertecombined,'; $sql.= ' SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique'; $sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; $sql.= ' ON (p.rowid = s.fk_product AND s.fk_entrepot IN (SELECT ent.rowid FROM '.MAIN_DB_PREFIX.'entrepot AS ent WHERE ent.entity IN('.getEntity('stock').')))'; -if($fk_supplier > 0) { +if ($fk_supplier > 0) { $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid AND pfp.fk_soc = '.$fk_supplier.')'; } -if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { +if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.$fk_entrepot.')'; } $sql.= ' WHERE p.entity IN (' . getEntity('product') . ')'; @@ -325,7 +323,7 @@ $sql.= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql.= ', p.duration, p.tobuy'; $sql.= ', p.desiredstock'; $sql.= ', p.seuil_stock_alerte'; -if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { +if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { $sql.= ', pse.desiredstock' ; $sql.= ', pse.seuil_stock_alerte' ; } @@ -364,7 +362,7 @@ if ($usevirtualstock) $sqlReceptionFourn.= " AND fd.fk_product = p.rowid"; $sqlReceptionFourn.= " AND cf.fk_statut IN (3,4))"; - $sql.= ' HAVING ((('.$db->ifsql($sqldesiredtock." IS NULL", "0", $sqldesiredtock).' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; + $sql.= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))'; $sql.= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.'))))'; @@ -396,7 +394,6 @@ if (empty($resql)) dol_print_error($db); exit; } -//print $sql; $num = $db->num_rows($resql); $i = 0; @@ -505,9 +502,12 @@ $param .= '&fk_supplier=' . $fk_supplier; $param .= '&fk_entrepot=' . $fk_entrepot; $stocklabel = $langs->trans('Stock'); -if ($usevirtualstock == 1) $stocklabel = 'VirtualStock'; -if ($usevirtualstock == 0) $stocklabel = 'PhysicalStock'; - +if ($usevirtualstock == 1) $stocklabel = $langs->trans('VirtualStock'); +if ($usevirtualstock == 0) $stocklabel = $langs->trans('PhysicalStock'); +if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) +{ + $stocklabel.=' ('.$langs->trans("AllWarehouses").')'; +} print '
'. ''. ''. @@ -528,7 +528,7 @@ if (!empty($conf->service->enabled) && $type == 1) print ' '; print ' '; print '' . $langs->trans('AlertOnly') . ' '; -print '' . $langs->trans('Draft') . ' '; +print '' . $langs->trans('IncludeAlsoDraftOrders') . ' '; print ' '; print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -600,20 +600,23 @@ while ($i < ($limit ? min($num, $limit) : $num)) //print $prod->stats_reception['qty']; $ordered = $prod->stats_commande_fournisseur['qty'] - $prod->stats_reception['qty']; + $desiredstock=($objp->desiredstockpse ? $objp->desiredstockpse : $objp->desiredstock); + $alertstock=($objp->seuil_stock_alertepse ? $objp->seuil_stock_alertepse : $objp->seuil_stock_alerte); + $warning=''; - if ($objp->alertstock && ($stock < $objp->alertstock)) + if ($alertstock && ($stock < $alertstock)) { $warning = img_warning($langs->trans('StockTooLow')) . ' '; } //depending on conf, use either physical stock or //virtual stock to compute the stock to buy value - $stocktobuy = max(max($objp->desiredstock, $objp->alertstock) - $stock - $ordered, 0); + $stocktobuy = max(max($desiredstock, $alertstock) - $stock - $ordered, 0); $disabled = ''; if ($ordered > 0) { $stockforcompare = $usevirtualstock ? $stock : $stock + $ordered; - if ($stockforcompare >= $objp->desiredstock) + if ($stockforcompare >= $desiredstock) { $picto = img_picto('', './img/yes', '', 1); $disabled = 'disabled'; @@ -653,12 +656,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) } // Desired stock - print '' . $objp->desiredstock . ''; + print '' . $desiredstock . ''; - // Limit stock for alerr - print '' . $objp->alertstock . ''; + // Limit stock for alert + print '' . $alertstock . ''; - // Current stock + // Current stock (all warehouses) print ''. $warning . $stock. ''; // Already ordered From 1aadcc50f11ae2174264c2a69c604bfdaf4f9b12 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Mon, 17 Dec 2018 15:48:27 +0100 Subject: [PATCH 10/16] Fix attached files from user mail form don't work --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 9d9b73bad09..0df6eb804c4 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -602,7 +602,7 @@ if (empty($reshook)) { $trigger_name='USER_SENTBYMAIL'; $paramname='id'; // Name of param key to open the card $mode='emailfromuser'; - $trackid='use'.$object->id; + $trackid='use'.$id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Actions to build doc From 2e6a41228f799a61d6a0fb1f0e4db37e71b88b65 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 20:49:48 +0100 Subject: [PATCH 11/16] Fix removing constant no more required --- htdocs/core/modules/modAccounting.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 42cd67b9dab..ef152521969 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -80,7 +80,7 @@ class modAccounting extends DolibarrModules "MAIN_COMPANY_CODE_ALWAYS_REQUIRED", "chaine", "1", - "With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 0 + "With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 1 ); $this->const[2] = array( "MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED", From 31d032d5d36c74f1d3a6653832b75dd0cac1b5ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 21:00:06 +0100 Subject: [PATCH 12/16] FIX Can't create a thirdparty from member if customer code is mandatory. --- htdocs/adherents/subscription.php | 10 +++++++++- htdocs/societe/class/societe.class.php | 13 +++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index b0b450b10a1..dcad54e535f 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -120,7 +120,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights { // Creation of thirdparty $company = new Societe($db); - $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha')); + $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'), GETPOST('customercode', 'alpha')); if ($result < 0) { @@ -854,6 +854,14 @@ if ($rowid > 0) array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'), array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"') ); + // If customer code was forced to "required", we ask it at creation to avoid error later + if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) + { + $tmpcompany = new Societe($db); + $tmpcompany->name=$companyname; + $customercode = $tmpcompany->get_codeclient($tmpcompany,0); + $formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'); + } print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a240c83b89f..4b1f9053353 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3244,12 +3244,13 @@ class Societe extends CommonObject /** * Create a third party into database from a member object * - * @param Adherent $member Object member - * @param string $socname Name of third party to force - * @param string $socalias Alias name of third party to force - * @return int <0 if KO, id of created account if OK + * @param Adherent $member Object member + * @param string $socname Name of third party to force + * @param string $socalias Alias name of third party to force + * @param string $customercode Customer code + * @return int <0 if KO, id of created account if OK */ - function create_from_member(Adherent $member, $socname='', $socalias='') + function create_from_member(Adherent $member, $socname='', $socalias='', $customercode='') { global $user,$langs; @@ -3274,7 +3275,7 @@ class Societe extends CommonObject $this->skype=$member->skype; $this->client = 1; // A member is a customer by default - $this->code_client = -1; + $this->code_client = ($customercode?$customercode:-1); $this->code_fournisseur = -1; $this->db->begin(); From f2318716ecc06cb9641f022981d960d6881a90af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 21:27:16 +0100 Subject: [PATCH 13/16] FIX Error reported when creation of thirdparty from member fails --- htdocs/adherents/class/adherent.class.php | 5 +++-- htdocs/adherents/subscription.php | 3 ++- htdocs/core/class/commonobject.class.php | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a5ca1691096..9d61ea07afa 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -586,13 +586,14 @@ class Adherent extends CommonObject $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; - $lthirdparty->country_id=$this->country_id; //$lthirdparty->phone_mobile=$this->phone_mobile; - $result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates + $result=$lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates + if ($result < 0) { $this->error=$lthirdparty->error; + $this->errors=$lthirdparty->errors; dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); $error++; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index dcad54e535f..53d1ff60836 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -359,7 +359,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); - // Get email content fro mtemplae + // Get email content from templae $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; @@ -862,6 +862,7 @@ if ($rowid > 0) $customercode = $tmpcompany->get_codeclient($tmpcompany,0); $formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'); } + // @TODO Add other extrafields mandatory for thirdparty creation print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c9b01a6a49d..676e76fe16a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4848,6 +4848,7 @@ abstract class CommonObject if ($this->array_options[$key] === '') $mandatorypb=true; if ($mandatorypb) { + dol_syslog($this->error); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); return -1; } @@ -6142,7 +6143,7 @@ abstract class CommonObject if (! is_object($form)) $form=new Form($db); $out = ''; - + if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { $out .= "\n"; @@ -6156,7 +6157,7 @@ abstract class CommonObject && empty($extrafields->attributes[$this->table_element]['list'][$key]) && $mode == 'view'){ continue; } - + $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { From 6851232314effbe5cbd3cf44e211547e7e7a26b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 20:49:48 +0100 Subject: [PATCH 14/16] Fix removing constant no more required --- htdocs/core/modules/modAccounting.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 325c504af42..c587ef72cdd 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -80,7 +80,7 @@ class modAccounting extends DolibarrModules "MAIN_COMPANY_CODE_ALWAYS_REQUIRED", "chaine", "1", - "With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 0 + "With this constants on, third party code is always required whatever is numbering module behaviour", 0, 'current', 1 ); $this->const[2] = array( "MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED", From b8429c607ed6a66bf42be81189a07ffac4766994 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 21:00:06 +0100 Subject: [PATCH 15/16] FIX Can't create a thirdparty from member if customer code is mandatory. --- htdocs/adherents/subscription.php | 10 +++++++++- htdocs/societe/class/societe.class.php | 13 +++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 5a50c92f3e9..94b101b4de5 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -120,7 +120,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights { // Creation user $company = new Societe($db); - $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha')); + $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'), GETPOST('customercode', 'alpha')); if ($result < 0) { @@ -1011,6 +1011,14 @@ if ($rowid > 0) array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'), array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"') ); + // If customer code was forced to "required", we ask it at creation to avoid error later + if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) + { + $tmpcompany = new Societe($db); + $tmpcompany->name=$companyname; + $customercode = $tmpcompany->get_codeclient($tmpcompany,0); + $formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'); + } print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index eaf62bc89ca..1cf8b211d48 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3079,12 +3079,13 @@ class Societe extends CommonObject /** * Create a third party into database from a member object * - * @param Adherent $member Object member - * @param string $socname Name of third party to force - * @param string $socalias Alias name of third party to force - * @return int <0 if KO, id of created account if OK + * @param Adherent $member Object member + * @param string $socname Name of third party to force + * @param string $socalias Alias name of third party to force + * @param string $customercode Customer code + * @return int <0 if KO, id of created account if OK */ - function create_from_member(Adherent $member, $socname='', $socalias='') + function create_from_member(Adherent $member, $socname='', $socalias='', $customercode='') { global $user,$langs; @@ -3107,7 +3108,7 @@ class Societe extends CommonObject $this->skype=$member->skype; $this->client = 1; // A member is a customer by default - $this->code_client = -1; + $this->code_client = ($customercode?$customercode:-1); $this->code_fournisseur = -1; $this->db->begin(); From 4b6ae9d42402844f8b37fc2a9ef7e0a63d1cedcf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Dec 2018 21:27:16 +0100 Subject: [PATCH 16/16] FIX Error reported when creation of thirdparty from member fails Conflicts: htdocs/adherents/subscription.php htdocs/core/class/commonobject.class.php --- htdocs/adherents/class/adherent.class.php | 5 +++-- htdocs/adherents/subscription.php | 1 + htdocs/core/class/commonobject.class.php | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8736500757f..11fb1a1a111 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -582,13 +582,14 @@ class Adherent extends CommonObject $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; - $lthirdparty->country_id=$this->country_id; //$lthirdparty->phone_mobile=$this->phone_mobile; - $result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates + $result=$lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates + if ($result < 0) { $this->error=$lthirdparty->error; + $this->errors=$lthirdparty->errors; dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); $error++; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 94b101b4de5..60969908a44 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1019,6 +1019,7 @@ if ($rowid > 0) $customercode = $tmpcompany->get_codeclient($tmpcompany,0); $formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'); } + // @TODO Add other extrafields mandatory for thirdparty creation print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32a528c27dc..f2175962c78 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4579,6 +4579,7 @@ abstract class CommonObject if ($this->array_options[$key] === '') $mandatorypb=true; if ($mandatorypb) { + dol_syslog($this->error); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); return -1; }