Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
Conflicts: htdocs/langs/en_US/admin.lang htdocs/product/dynamic_price/class/price_parser.class.php
This commit is contained in:
commit
2824dee11a
@ -1227,7 +1227,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param string $titlekey Translation key to show as title of document
|
||||
* @return void
|
||||
* @return int Return topshift value
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle")
|
||||
{
|
||||
|
||||
@ -67,13 +67,13 @@ class pdf_proforma extends pdf_einstein
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param string $titlekey Translation key to show as title of document
|
||||
* @return void
|
||||
* @return int Return topshift value
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "InvoiceProForma")
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$hookmanager;
|
||||
|
||||
parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);
|
||||
return parent::_pagehead($pdf, $object, $showaddress, $outputlangs, $titlekey);
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,6 +400,7 @@ OldVATRates=Old VAT rate
|
||||
NewVATRates=New VAT rate
|
||||
PriceBaseTypeToChange=Modify on prices with base reference value defined on
|
||||
MassConvert=Launch bulk conversion
|
||||
PriceFormatInCurrentLanguage=Price Format In Current Language
|
||||
String=String
|
||||
TextLong=Long text
|
||||
HtmlText=Html text
|
||||
@ -1908,6 +1909,7 @@ WarningValueHigherSlowsDramaticalyOutput=Warning, higher values slows dramatical
|
||||
DebugBarModuleActivated=Module debugbar is activated and slows dramaticaly the interface
|
||||
EXPORTS_SHARE_MODELS=Export models are share with everybody
|
||||
ExportSetup=Setup of module Export
|
||||
<<<<<<< HEAD
|
||||
InstanceUniqueID=Unique ID of the instance
|
||||
SmallerThan=Smaller than
|
||||
LargerThan=Larger than
|
||||
@ -1923,4 +1925,6 @@ EndPointFor=End point for %s : %s
|
||||
DeleteEmailCollector=Delete email collector
|
||||
ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector?
|
||||
RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value
|
||||
AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined
|
||||
AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined
|
||||
=======
|
||||
>>>>>>> branch '9.0' of git@github.com:Dolibarr/dolibarr.git
|
||||
|
||||
@ -262,26 +262,29 @@ class PriceParser
|
||||
return -1;
|
||||
}
|
||||
|
||||
//Get the supplier min
|
||||
//Get the supplier min price
|
||||
$productFournisseur = new ProductFournisseur($this->db);
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0) > 0) {
|
||||
$supplier_min_price = $productFournisseur->fourn_unitprice;
|
||||
$res = $productFournisseur->find_min_price_product_fournisseur($product->id, 0, 0);
|
||||
if ($res < 1) {
|
||||
$this->error_parser = array(25, null);
|
||||
return -1;
|
||||
}
|
||||
$supplier_min_price = $productFournisseur->fourn_unitprice;
|
||||
|
||||
//Accessible values by expressions
|
||||
$extra_values = array_merge($extra_values, array(
|
||||
"supplier_min_price" => $supplier_min_price,
|
||||
));
|
||||
//Accessible values by expressions
|
||||
$extra_values = array_merge($extra_values, array(
|
||||
"supplier_min_price" => $supplier_min_price,
|
||||
));
|
||||
|
||||
//Parse the expression and return the price, if not error occurred check if price is higher than min
|
||||
$result = $this->parseExpression($product, $price_expression->expression, $extra_values);
|
||||
if (empty($this->error_parser)) {
|
||||
if ($result < $product->price_min) {
|
||||
$result = $product->price_min;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
//Parse the expression and return the price, if not error occurred check if price is higher than min
|
||||
$result = $this->parseExpression($product, $price_expression->expression, $extra_values);
|
||||
if (empty($this->error_parser)) {
|
||||
if ($result < $product->price_min) {
|
||||
$result = $product->price_min;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates supplier product price based on product supplier price and associated expression
|
||||
|
||||
Loading…
Reference in New Issue
Block a user