Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0

Conflicts:
	htdocs/adherents/subscription.php
	htdocs/core/class/commonobject.class.php
	htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
	htdocs/langs/es_ES/companies.lang
	htdocs/langs/es_ES/errors.lang
	htdocs/product/stock/product.php
	htdocs/user/card.php
This commit is contained in:
Laurent Destailleur 2018-12-18 21:55:14 +01:00
commit 89068ffef1
35 changed files with 130 additions and 94 deletions

View File

@ -891,7 +891,7 @@ if (empty($action) || $action == 'view') {
// Test that setup is complete // 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); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -697,13 +697,14 @@ class Adherent extends CommonObject
$lthirdparty->phone=$this->phone; $lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id; $lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id; $lthirdparty->country_id=$this->country_id;
$lthirdparty->country_id=$this->country_id;
//$lthirdparty->phone_mobile=$this->phone_mobile; //$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) if ($result < 0)
{ {
$this->error=$lthirdparty->error; $this->error=$lthirdparty->error;
$this->errors=$lthirdparty->errors;
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
$error++; $error++;
} }

View File

@ -121,7 +121,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{ {
// Creation of thirdparty // Creation of thirdparty
$company = new Societe($db); $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) 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); $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files requiredby by page // Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members"));
// Get email content from template // Get email content from template
$arraydefaultmessage=null; $arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; $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("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"') 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); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
} }

View File

@ -4940,6 +4940,7 @@ abstract class CommonObject
if ($this->array_options[$key] === '') $mandatorypb=true; if ($this->array_options[$key] === '') $mandatorypb=true;
if ($mandatorypb) if ($mandatorypb)
{ {
dol_syslog($this->error);
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
return -1; return -1;
} }
@ -6270,7 +6271,7 @@ abstract class CommonObject
$e = 0; $e = 0;
foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label) 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; if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue;
$enabled = 1; $enabled = 1;

View File

@ -156,6 +156,7 @@ class pdf_ban extends ModeleBankAccountDoc
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -163,6 +163,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -132,6 +132,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -278,6 +278,7 @@ class pdf_einstein extends ModelePDFCommandes
$heightforinfotot = 40; // Height reserved to output the info and total part $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 $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) $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')) if (class_exists('TCPDF'))
{ {

View File

@ -228,6 +228,7 @@ class pdf_strato extends ModelePDFContract
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -229,6 +229,7 @@ class pdf_merou extends ModelePdfExpedition
$heightforinfotot = 0; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -291,6 +291,7 @@ class pdf_rouget extends ModelePdfExpedition
$heightforinfotot = 8; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -257,8 +257,10 @@ class pdf_standard extends ModeleExpenseReport
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 40; // Height reserved to output the info and total part $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 $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) $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0); if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))
{ {

View File

@ -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 $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 $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) $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')) if (class_exists('TCPDF'))
{ {

View File

@ -223,6 +223,7 @@ class pdf_soleil extends ModelePDFFicheinter
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -245,6 +245,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$heightforinfotot = 30; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -223,6 +223,7 @@ class pdf_standard extends ModelePDFProduct
$heightforinfotot = 40; // Height reserved to output the info and total part $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 $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) $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')) if (class_exists('TCPDF'))
{ {

View File

@ -224,6 +224,7 @@ class pdf_baleine extends ModelePDFProjects
$heightforinfotot = 40; // Height reserved to output the info and total part $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 $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) $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')) if (class_exists('TCPDF'))
{ {

View File

@ -175,6 +175,7 @@ class pdf_beluga extends ModelePDFProjects
$heightforinfotot = 40; // Height reserved to output the info and total part $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 $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) $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')) if (class_exists('TCPDF'))
{ {

View File

@ -387,6 +387,7 @@ class pdf_azur extends ModelePDFPropales
$heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0; $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 $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) $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; //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit;
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);

View File

@ -265,6 +265,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -313,6 +313,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -271,6 +271,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -302,6 +302,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$heightforinfotot = 50; // Height reserved to output the info and total part $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 $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) $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); $pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))

View File

@ -29,6 +29,8 @@ MovementId=Movement ID
StockMovementForId=Movement ID %d StockMovementForId=Movement ID %d
ListMouvementStockProject=List of stock movements associated to project ListMouvementStockProject=List of stock movements associated to project
StocksArea=Warehouses area StocksArea=Warehouses area
AllWarehouses=All warehouses
IncludeAlsoDraftOrders=Include also draft orders
Location=Location Location=Location
LocationSummary=Short name location LocationSummary=Short name location
NumberOfDifferentProducts=Number of different products NumberOfDifferentProducts=Number of different products

View File

@ -38,7 +38,7 @@ ThirdPartyCustomers=Clientes
ThirdPartyCustomersStats=Clientes ThirdPartyCustomersStats=Clientes
ThirdPartyCustomersWithIdProf12=Clientes con %s ó %s ThirdPartyCustomersWithIdProf12=Clientes con %s ó %s
ThirdPartySuppliers=Proveedores ThirdPartySuppliers=Proveedores
ThirdPartyType=Tipo de empresa ThirdPartyType=Tipo de tercero
Individual=Particular 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. 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 ParentCompany=Sede central

View File

@ -28,10 +28,10 @@ UseDiscountAsService=Como un servicio
UseDiscountOnTotal=Sobre el total 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_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 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) MargeType2=Margen en Precio Medio Ponderado (PMP)
MargeType3=Margen en Precio de coste MargeType3=Margen en Precio de coste
MarginTypeDesc=* Margin on best buying price = Selling price - Best vendor price defined on product card<br>* Margin on Weighted Average Price (WAP) = Selling price - Product Weighted Average Price (WAP) or best supplier price if WAP not yet defined<br>* 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<br>* 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 <br > * 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 CostPrice=Precio de compra
UnitCharges=Carga unitaria UnitCharges=Carga unitaria
Charges=Cargas Charges=Cargas

View File

@ -101,8 +101,8 @@ DraftSuppliersOrders=Draft purchase orders
OnProcessOrders=Pedidos en proceso OnProcessOrders=Pedidos en proceso
RefOrder=Ref. pedido RefOrder=Ref. pedido
RefCustomerOrder=Ref. pedido para el cliente RefCustomerOrder=Ref. pedido para el cliente
RefOrderSupplier=Ref. order for vendor RefOrderSupplier=Ref. pedido para el proveedor
RefOrderSupplierShort=Ref. order vendor RefOrderSupplierShort=Ref. ped. prov.
SendOrderByMail=Enviar pedido por e-mail SendOrderByMail=Enviar pedido por e-mail
ActionsOnOrder=Eventos sobre el pedido ActionsOnOrder=Eventos sobre el pedido
NoArticleOfTypeProduct=No hay artículos de tipo 'producto' y por lo tanto enviables en este 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_BILLING=Contacto cliente facturación pedido
TypeContact_commande_external_SHIPPING=Contacto cliente entrega pedido TypeContact_commande_external_SHIPPING=Contacto cliente entrega pedido
TypeContact_commande_external_CUSTOMER=Contacto cliente seguimiento 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_internal_SHIPPING=Responsable recepción pedido a proveedor
TypeContact_order_supplier_external_BILLING=Vendor invoice contact TypeContact_order_supplier_external_BILLING=Contacto proveedor factura
TypeContact_order_supplier_external_SHIPPING=Vendor shipping contact TypeContact_order_supplier_external_SHIPPING=Contacto seguimiento proveedor
TypeContact_order_supplier_external_CUSTOMER=Vendor contact following-up order TypeContact_order_supplier_external_CUSTOMER=Contacto seguimiento pedido a proveedor
Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constante COMMANDE_SUPPLIER_ADDON no definida Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constante COMMANDE_SUPPLIER_ADDON no definida
Error_COMMANDE_ADDON_NotDefined=Constante COMMANDE_ADDON no definida Error_COMMANDE_ADDON_NotDefined=Constante COMMANDE_ADDON no definida
Error_OrderNotChecked=No se han seleccionado pedidos a facturar Error_OrderNotChecked=No se han seleccionado pedidos a facturar

View File

@ -1,22 +1,22 @@
# Dolibarr language file - Source file is en_US - supplier_proposal # Dolibarr language file - Source file is en_US - supplier_proposal
SupplierProposal=Vendor commercial proposals SupplierProposal=Presupuestos de proveedor
supplier_proposalDESC=Manage price requests to vendors supplier_proposalDESC=Gestiona presupuestos de proveedor
SupplierProposalNew=Nuevo presupuesto SupplierProposalNew=Nuevo presupuesto
CommRequest=Presupuesto CommRequest=Presupuesto
CommRequests=Presupuestos CommRequests=Presupuestos
SearchRequest=Buscar un presupuesto SearchRequest=Buscar un presupuesto
DraftRequests=Presupuestos borrador DraftRequests=Presupuestos borrador
SupplierProposalsDraft=Draft vendor proposals SupplierProposalsDraft=Presupuestos de proveedor borrador
LastModifiedRequests=Últimos %s consultas de precios modificados LastModifiedRequests=Últimos %s presupuestos
RequestsOpened=Presupuestos abiertos RequestsOpened=Presupuestos abiertos
SupplierProposalArea=Vendor proposals area SupplierProposalArea=Área presupuestos de proveedor
SupplierProposalShort=Vendor proposal SupplierProposalShort=Presupuesto de proveedor
SupplierProposals=Vendor proposals SupplierProposals=Presupuestos de proveedor
SupplierProposalsShort=Vendor proposals SupplierProposalsShort=Presup. proveedor
NewAskPrice=Nuevo presupuesto NewAskPrice=Nuevo presupuesto
ShowSupplierProposal=Mostrar presupuesto ShowSupplierProposal=Mostrar presupuesto
AddSupplierProposal=Crear un presupuesto AddSupplierProposal=Crear un presupuesto
SupplierProposalRefFourn=Vendor ref SupplierProposalRefFourn=Ref. proveedor
SupplierProposalDate=Fecha de entrega SupplierProposalDate=Fecha de entrega
SupplierProposalRefFournNotice=Antes de cerrar a "Aceptado", piense en consultar las referencias de proveedores. SupplierProposalRefFournNotice=Antes de cerrar a "Aceptado", piense en consultar las referencias de proveedores.
ConfirmValidateAsk=¿Está seguro de querer validar este presupuesto bajo la referencia <b>%s</b>? ConfirmValidateAsk=¿Está seguro de querer validar este presupuesto bajo la referencia <b>%s</b>?
@ -47,9 +47,9 @@ CommercialAsk=Presupuesto
DefaultModelSupplierProposalCreate=Modelo por defecto DefaultModelSupplierProposalCreate=Modelo por defecto
DefaultModelSupplierProposalToBill=Modelo por defecto al cerrar un presupuesto (aceptado) DefaultModelSupplierProposalToBill=Modelo por defecto al cerrar un presupuesto (aceptado)
DefaultModelSupplierProposalClosed=Modelo por defecto al cerrar un presupuesto (rechazado) DefaultModelSupplierProposalClosed=Modelo por defecto al cerrar un presupuesto (rechazado)
ListOfSupplierProposals=List of vendor proposal requests ListOfSupplierProposals=Listado de presupuestos de proveedor
ListSupplierProposalsAssociatedProject=List of vendor proposals associated with project ListSupplierProposalsAssociatedProject=Listado de presupuestos de proveedor asociados al proyecto
SupplierProposalsToClose=Vendor proposals to close SupplierProposalsToClose=Presupuestos de proveedor a cerrar
SupplierProposalsToProcess=Vendor proposals to process SupplierProposalsToProcess=Presupuestos de proveedor a procesar
LastSupplierProposals=Últimos %s presupuestos LastSupplierProposals=Últimos %s presupuestos
AllPriceRequests=Todos los presupuestos AllPriceRequests=Todos los presupuestos

View File

@ -1,11 +1,11 @@
# Dolibarr language file - Source file is en_US - suppliers # Dolibarr language file - Source file is en_US - suppliers
Suppliers=Vendors Suppliers=Proveedores
SuppliersInvoice=Vendor invoice SuppliersInvoice=Factura de proveedor
ShowSupplierInvoice=Show Vendor Invoice ShowSupplierInvoice=Ver factura de proveedor
NewSupplier=New vendor NewSupplier=Nuevo proveedor
History=Histórico History=Histórico
ListOfSuppliers=List of vendors ListOfSuppliers=Listado de proveedores
ShowSupplier=Show vendor ShowSupplier=Ver proveedor
OrderDate=Fecha de pedido OrderDate=Fecha de pedido
BuyingPriceMin=Mejor precio de compra BuyingPriceMin=Mejor precio de compra
BuyingPriceMinShort=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 SomeSubProductHaveNoPrices=Algunos subproductos no tienen precio definido
AddSupplierPrice=Añadir precio de compra AddSupplierPrice=Añadir precio de compra
ChangeSupplierPrice=Cambiar 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 ReferenceSupplierIsAlreadyAssociatedWithAProduct=Esta referencia de proveedor ya está asociada a la referencia: %s
NoRecordedSuppliers=No vendor recorded NoRecordedSuppliers=Sin proveedores registrados
SupplierPayment=Vendor payment SupplierPayment=Pagos a proveedor
SuppliersArea=Vendor area SuppliersArea=Área proveedores
RefSupplierShort=Ref. vendor RefSupplierShort=Ref. proveedor
Availability=Disponibilidad Availability=Disponibilidad
ExportDataset_fournisseur_1=Facturas de proveedor y líneas de factura ExportDataset_fournisseur_1=Facturas de proveedor y líneas de factura
ExportDataset_fournisseur_2=Facturas de proveedor y pagos 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 <b>%s</b>? ConfirmCancelThisOrder=¿Está seguro de querer cancelar el pedido a proveedor <b>%s</b>?
AddSupplierOrder=Crear pedido a proveedor AddSupplierOrder=Crear pedido a proveedor
AddSupplierInvoice=Crear factura de proveedor AddSupplierInvoice=Crear factura de proveedor
ListOfSupplierProductForSupplier=List of products and prices for vendor <b>%s</b> ListOfSupplierProductForSupplier=Listado de productos y precios del proveedor <b>%s</b>
SentToSuppliers=Sent to vendors SentToSuppliers=Enviado a proveedores
ListOfSupplierOrders=Listado de pedidos a proveedor ListOfSupplierOrders=Listado de pedidos a proveedor
MenuOrdersSupplierToBill=Pedidos a proveedor a facturar MenuOrdersSupplierToBill=Pedidos a proveedor a facturar
NbDaysToDelivery=Tiempo de entrega en días NbDaysToDelivery=Tiempo de entrega en días
DescNbDaysToDelivery=El mayor retraso en las entregas de productos de este pedido DescNbDaysToDelivery=El mayor retraso en las entregas de productos de este pedido
SupplierReputation=Vendor reputation SupplierReputation=Reputación proveedor
DoNotOrderThisProductToThisSupplier=No realizar pedidos DoNotOrderThisProductToThisSupplier=No realizar pedidos
NotTheGoodQualitySupplier=Mala calidad NotTheGoodQualitySupplier=Mala calidad
ReputationForThisProduct=Reputación ReputationForThisProduct=Reputación
BuyerName=Nombre del comprador BuyerName=Nombre del comprador
AllProductServicePrices=Todos los precios de producto / servicio AllProductServicePrices=Todos los precios de producto / servicio
AllProductReferencesOfSupplier=Todos las referencias de proveedores de producto / servicio AllProductReferencesOfSupplier=Todos las referencias de proveedores de producto / servicio
BuyingPriceNumShort=Vendor prices BuyingPriceNumShort=Precios proveedor

View File

@ -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_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) 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 # 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_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=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_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 AutomaticCreation=Creación automática
AutomaticClassification=Clasificación automática AutomaticClassification=Clasificación automática

View File

@ -161,13 +161,12 @@ class ProductStockEntrepot extends CommonObject
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
* @param int $id Id object * @param int $id Id object
* @param int $fk_product Id product * @param int $fk_product Id product
* @param int $fk_entrepot Id warehouse * @param int $fk_entrepot Id warehouse
* * @return int <0 if KO, 0 if not found, >0 if OK
* @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; if(empty($id) && (empty($fk_product) || empty($fk_entrepot))) return -1;
@ -175,23 +174,22 @@ class ProductStockEntrepot extends CommonObject
$sql = 'SELECT'; $sql = 'SELECT';
$sql .= ' t.rowid,'; $sql .= ' t.rowid,';
$sql .= " t.tms,"; $sql .= " t.tms,";
$sql .= " t.fk_product,"; $sql .= " t.fk_product,";
$sql .= " t.fk_entrepot,"; $sql .= " t.fk_entrepot,";
$sql .= " t.seuil_stock_alerte,"; $sql .= " t.seuil_stock_alerte,";
$sql .= " t.desiredstock,"; $sql .= " t.desiredstock,";
$sql .= " t.import_key"; $sql .= " t.import_key";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
if(!empty($id)) $sql .= ' WHERE t.rowid = ' . $id; if(!empty($id)) $sql .= ' WHERE t.rowid = ' . $id;
else $sql.= ' WHERE t.fk_product = '.$fk_product.' AND t.fk_entrepot = '.$fk_entrepot; else $sql.= ' WHERE t.fk_product = '.$fk_product.' AND t.fk_entrepot = '.$fk_entrepot;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql)
{
$numrows = $this->db->num_rows($resql); $numrows = $this->db->num_rows($resql);
if ($numrows) { if ($numrows)
{
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;

View File

@ -137,14 +137,12 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
if($maj_ok) { if($maj_ok) {
$pse = new ProductStockEntrepot($db); $pse = new ProductStockEntrepot($db);
if($pse->fetch('', $id, GETPOST('fk_entrepot')) > 0) { if ($pse->fetch(0, $id, GETPOST('fk_entrepot','int')) > 0) {
// Update // Update
$pse->seuil_stock_alerte = $seuil_stock_alerte; $pse->seuil_stock_alerte = $seuil_stock_alerte;
$pse->desiredstock = $desiredstock; $pse->desiredstock = $desiredstock;
if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs'); if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs');
} else { } else {
// Create // Create
$pse->fk_entrepot = GETPOST('fk_entrepot'); $pse->fk_entrepot = GETPOST('fk_entrepot');
$pse->fk_product = $id; $pse->fk_product = $id;
@ -162,8 +160,9 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c
{ {
$pse = new ProductStockEntrepot($db); $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 = ''; $action = '';
} }
@ -802,6 +801,7 @@ if (! $variants) {
*/ */
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4">' . $langs->trans("Warehouse") . '</td>'; print '<td colspan="4">' . $langs->trans("Warehouse") . '</td>';

View File

@ -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 = '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.price_ttc, p.price_base_type,p.fk_product_type,';
$sql.= ' p.tms as datem, p.duration, p.tobuy'; $sql.= ' p.tms as datem, p.duration, p.tobuy,';
$sql.= ' ,p.desiredstock,p.seuil_stock_alerte'; $sql.= ' p.desiredstock, 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.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,';
$sql.= ', pse.seuil_stock_alerte' ;
} }
$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.= ' SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique';
$sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; $sql.= ' FROM ' . MAIN_DB_PREFIX . 'product as p';
$sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s'; $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').')))'; $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.')'; $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.= ' 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') . ')'; $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.duration, p.tobuy';
$sql.= ', p.desiredstock'; $sql.= ', p.desiredstock';
$sql.= ', p.seuil_stock_alerte'; $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.desiredstock' ;
$sql.= ', pse.seuil_stock_alerte' ; $sql.= ', pse.seuil_stock_alerte' ;
} }
@ -370,7 +368,7 @@ if ($usevirtualstock)
$sqlReceptionFourn.= " AND fd.fk_product = p.rowid"; $sqlReceptionFourn.= " AND fd.fk_product = p.rowid";
$sqlReceptionFourn.= " AND cf.fk_statut IN (3,4))"; $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.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))';
$sql.= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql.= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')';
$sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.'))))'; $sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.'))))';
@ -402,7 +400,6 @@ if (empty($resql))
dol_print_error($db); dol_print_error($db);
exit; exit;
} }
//print $sql;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
@ -511,9 +508,12 @@ $param .= '&fk_supplier=' . $fk_supplier;
$param .= '&fk_entrepot=' . $fk_entrepot; $param .= '&fk_entrepot=' . $fk_entrepot;
$stocklabel = $langs->trans('Stock'); $stocklabel = $langs->trans('Stock');
if ($usevirtualstock == 1) $stocklabel = 'VirtualStock'; if ($usevirtualstock == 1) $stocklabel = $langs->trans('VirtualStock');
if ($usevirtualstock == 0) $stocklabel = 'PhysicalStock'; 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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">'. print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">'.
'<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">'. '<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">'.
'<input type="hidden" name="fk_supplier" value="' . $fk_supplier . '">'. '<input type="hidden" name="fk_supplier" value="' . $fk_supplier . '">'.
@ -534,7 +534,7 @@ if (!empty($conf->service->enabled) && $type == 1) print '<td class="liste_titre
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">&nbsp;</td>'; print '<td class="liste_titre" align="right">&nbsp;</td>';
print '<td class="liste_titre" align="right">' . $langs->trans('AlertOnly') . '&nbsp;<input type="checkbox" id="salert" name="salert" ' . (!empty($alertchecked)?$alertchecked:'') . '></td>'; print '<td class="liste_titre" align="right">' . $langs->trans('AlertOnly') . '&nbsp;<input type="checkbox" id="salert" name="salert" ' . (!empty($alertchecked)?$alertchecked:'') . '></td>';
print '<td class="liste_titre" align="right">' . $langs->trans('Draft') . '&nbsp;<input type="checkbox" id="draftorder" name="draftorder" ' . (!empty($draftchecked)?$draftchecked:'') . '></td>'; print '<td class="liste_titre" align="right">' . $langs->trans('IncludeAlsoDraftOrders') . '&nbsp;<input type="checkbox" id="draftorder" name="draftorder" ' . (!empty($draftchecked)?$draftchecked:'') . '></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
@ -606,20 +606,23 @@ while ($i < ($limit ? min($num, $limit) : $num))
//print $prod->stats_reception['qty']; //print $prod->stats_reception['qty'];
$ordered = $prod->stats_commande_fournisseur['qty'] - $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=''; $warning='';
if ($objp->alertstock && ($stock < $objp->alertstock)) if ($alertstock && ($stock < $alertstock))
{ {
$warning = img_warning($langs->trans('StockTooLow')) . ' '; $warning = img_warning($langs->trans('StockTooLow')) . ' ';
} }
//depending on conf, use either physical stock or //depending on conf, use either physical stock or
//virtual stock to compute the stock to buy value //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 = ''; $disabled = '';
if ($ordered > 0) if ($ordered > 0)
{ {
$stockforcompare = $usevirtualstock ? $stock : $stock + $ordered; $stockforcompare = $usevirtualstock ? $stock : $stock + $ordered;
if ($stockforcompare >= $objp->desiredstock) if ($stockforcompare >= $desiredstock)
{ {
$picto = img_picto('', './img/yes', '', 1); $picto = img_picto('', './img/yes', '', 1);
$disabled = 'disabled'; $disabled = 'disabled';
@ -659,12 +662,12 @@ while ($i < ($limit ? min($num, $limit) : $num))
} }
// Desired stock // Desired stock
print '<td align="right">' . $objp->desiredstock . '</td>'; print '<td align="right">' . $desiredstock . '</td>';
// Limit stock for alerr // Limit stock for alert
print '<td align="right">' . $objp->alertstock . '</td>'; print '<td align="right">' . $alertstock . '</td>';
// Current stock // Current stock (all warehouses)
print '<td align="right">'. $warning . $stock. '</td>'; print '<td align="right">'. $warning . $stock. '</td>';
// Already ordered // Already ordered

View File

@ -3304,12 +3304,13 @@ class Societe extends CommonObject
/** /**
* Create a third party into database from a member object * Create a third party into database from a member object
* *
* @param Adherent $member Object member * @param Adherent $member Object member
* @param string $socname Name of third party to force * @param string $socname Name of third party to force
* @param string $socalias Alias 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 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 // phpcs:enable
global $user,$langs; global $user,$langs;
@ -3337,7 +3338,7 @@ class Societe extends CommonObject
$this->facebook=$member->facebook; $this->facebook=$member->facebook;
$this->client = 1; // A member is a customer by default $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->code_fournisseur = -1;
$this->db->begin(); $this->db->begin();

View File

@ -610,7 +610,7 @@ if (empty($reshook)) {
$trigger_name='USER_SENTBYMAIL'; $trigger_name='USER_SENTBYMAIL';
$paramname='id'; // Name of param key to open the card $paramname='id'; // Name of param key to open the card
$mode='emailfromuser'; $mode='emailfromuser';
$trackid='use'.$object->id; $trackid='use'.$id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
// Actions to build doc // Actions to build doc
@ -1247,9 +1247,9 @@ else
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{ {
$object->getrights(); $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 // Connexion ldap
// pour recuperer passDoNotExpire et userChangePassNextLogon // pour recuperer passDoNotExpire et userChangePassNextLogon
if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid))