diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d40c5ea059b..6e6a84b1884 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -891,7 +891,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) { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index cee9ce36edd..1ce440b3afb 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -697,13 +697,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 5f7abe63253..b7973ab1953 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -121,7 +121,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) { @@ -361,6 +361,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "members")); + // Get email content from template $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; @@ -856,6 +857,15 @@ 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"'); + } + // @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 0e4bee78afb..13cdfe1c495 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4940,6 +4940,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; } @@ -6270,7 +6271,7 @@ abstract class CommonObject $e = 0; foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label) { - //Show only the key field in params + // Show only the key field in params if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue; $enabled = 1; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 97a91951e81..12aa47ce9d6 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -156,6 +156,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 9b49be6063f..6fc6594b1e3 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -163,6 +163,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 c4995ead47f..32d35edb70a 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -132,6 +132,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 d35c6c7f177..7009773e582 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -278,6 +278,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 24dcf8743b0..3375e5b7ccc 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -228,6 +228,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 73de53f7904..2427a399dd1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -229,6 +229,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 f05c9dc31e7..fc242e47e52 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -291,6 +291,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 7f3cca693b5..596be42c96c 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -257,8 +257,10 @@ class pdf_standard extends ModeleExpenseReport $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $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 + 12; // Height reserved to output the footer (value include bottom margin) - $pdf->SetAutoPageBreak(1,0); + $heightforfooter = $this->marge_basse + 12; // 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 74fac8c5544..ab2ffb3bd2a 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -326,6 +326,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 b06922acdb9..22ec100a73e 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -223,6 +223,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 77847c9a0a6..971913cb58d 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -245,6 +245,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 8d30448bf2f..e9af5b9aa6e 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -223,6 +223,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 11305e8a246..f0161b30715 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -224,6 +224,7 @@ class pdf_baleine extends ModelePDFProjects $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_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 6578b2ca5f5..bc8da2b114c 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -175,6 +175,7 @@ class pdf_beluga extends ModelePDFProjects $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/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index e369018c80b..3d7b5b44c34 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -387,6 +387,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 dec36d5adbd..f44240daa83 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -265,6 +265,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 e89a5afa801..06cf28daaed 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -313,6 +313,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 2a31f265097..5eeedb9dcfc 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -271,6 +271,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 525fdca1d59..b9f9aa39dcf 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -302,6 +302,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')) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 70f83dbab94..be3873048b0 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/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 2c25d8c26f1..a3a48e6fc56 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -38,7 +38,7 @@ ThirdPartyCustomers=Clientes ThirdPartyCustomersStats=Clientes ThirdPartyCustomersWithIdProf12=Clientes con %s ó %s ThirdPartySuppliers=Proveedores -ThirdPartyType=Tipo de empresa +ThirdPartyType=Tipo de tercero Individual=Particular ToCreateContactWithSameName=Creará automáticamente un contacto/dirección en el tercero con la misma información que el tercero. En la mayoría de los casos, aunque el tercero sea una persona física, creando solo el tercero será suficiente. ParentCompany=Sede central 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 diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index aaae328de48..f76f5eeec9c 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -161,13 +161,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; @@ -175,23 +174,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; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 852bf2a4e8d..2e081e0453f 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -137,14 +137,12 @@ 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','int')) > 0) { // Update $pse->seuil_stock_alerte = $seuil_stock_alerte; $pse->desiredstock = $desiredstock; if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs'); } else { - // Create $pse->fk_entrepot = GETPOST('fk_entrepot'); $pse->fk_product = $id; @@ -162,8 +160,9 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c { $pse = new ProductStockEntrepot($db); - $pse->fetch(GETPOST('fk_productstockwarehouse')); - if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs'); + + $pse->fetch(GETPOST('fk_productstockwarehouse','int')); + if ($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs'); $action = ''; } @@ -802,6 +801,7 @@ if (! $variants) { */ print '
'; + print ''; print ''; print ''; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 5ffd668680f..1e3054189b8 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -294,22 +294,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') . ')'; @@ -331,7 +329,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' ; } @@ -370,7 +368,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.'))))'; @@ -402,7 +400,6 @@ if (empty($resql)) dol_print_error($db); exit; } -//print $sql; $num = $db->num_rows($resql); $i = 0; @@ -511,9 +508,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 ''. ''. ''. @@ -534,7 +534,7 @@ if (!empty($conf->service->enabled) && $type == 1) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; + print ''; - // Limit stock for alerr - print ''; + // Limit stock for alert + print ''; - // Current stock + // Current stock (all warehouses) print ''; // Already ordered diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index de792c69189..40ef36ce4e8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3304,12 +3304,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='') { // phpcs:enable global $user,$langs; @@ -3337,7 +3338,7 @@ class Societe extends CommonObject $this->facebook=$member->facebook; $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(); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 9c3c51590a7..fd2628f56e6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -610,7 +610,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 @@ -1247,9 +1247,9 @@ else if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $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 if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid))
' . $langs->trans("Warehouse") . '
  ' . $langs->trans('AlertOnly') . ' ' . $langs->trans('Draft') . ' ' . $langs->trans('IncludeAlsoDraftOrders') . '  '; $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -606,20 +606,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'; @@ -659,12 +662,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) } // Desired stock - print '' . $objp->desiredstock . '' . $desiredstock . '' . $objp->alertstock . '' . $alertstock . ''. $warning . $stock. '