mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Prepare code for #24386
This commit is contained in:
parent
a3cd50944d
commit
d0c14c6414
|
|
@ -2065,7 +2065,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
$label = ''; // deprecated
|
||||
|
||||
if ($fk_product > 0) {
|
||||
if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) { // Not the common case
|
||||
if (getDolGlobalInt('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case
|
||||
// Check quantity is enough
|
||||
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." ref_supplier=".$ref_supplier);
|
||||
$prod = new ProductFournisseur($this->db);
|
||||
|
|
|
|||
|
|
@ -2140,7 +2140,7 @@ class FactureFournisseur extends CommonInvoice
|
|||
$this->db->begin();
|
||||
|
||||
if ($fk_product > 0) {
|
||||
if (getDolGlobalString('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
if (getDolGlobalInt('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case
|
||||
// Check quantity is enough
|
||||
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." qty=".$qty." ref_supplier=".$ref_supplier);
|
||||
$prod = new ProductFournisseur($this->db);
|
||||
|
|
|
|||
|
|
@ -783,7 +783,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
if (getDolGlobalInt('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case
|
||||
if ($line->fk_product > 0 && $productsupplier->get_buyprice(0, price2num(GETPOSTINT('qty')), $line->fk_product, 'none', GETPOSTINT('socid')) < 0) {
|
||||
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
||||
}
|
||||
|
|
@ -2394,8 +2394,8 @@ if ($action == 'create') {
|
|||
$dateSelector = 0;
|
||||
$inputalsopricewithtax = 1;
|
||||
$senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
|
||||
if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
$senderissupplier = 1;
|
||||
if (getDolGlobalInt('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
$senderissupplier = getDolGlobalInt('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY');
|
||||
}
|
||||
|
||||
// Show object lines
|
||||
|
|
|
|||
|
|
@ -1451,7 +1451,7 @@ if (empty($reshook)) {
|
|||
|
||||
if (GETPOST('productid') > 0) {
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
if (getDolGlobalString('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
if (getDolGlobalInt('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case
|
||||
if (GETPOST('productid') > 0 && $productsupplier->get_buyprice(0, price2num(GETPOST('qty')), GETPOSTINT('productid'), 'restricthtml', GETPOSTINT('socid')) < 0) {
|
||||
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
||||
}
|
||||
|
|
@ -3953,8 +3953,8 @@ if ($action == 'create') {
|
|||
$inputalsopricewithtax = 1;
|
||||
$senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
|
||||
//if (!empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2;
|
||||
if (getDolGlobalString('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
$senderissupplier = 1;
|
||||
if (getDolGlobalInt('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
$senderissupplier = getDolGlobalInt('SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY');
|
||||
}
|
||||
|
||||
// Show object lines (result may vary according to hidden option MAIN_NO_INPUT_PRICE_WITH_TAX)
|
||||
|
|
|
|||
|
|
@ -1026,7 +1026,7 @@ if (empty($reshook)) {
|
|||
$productid = GETPOSTINT('productid');
|
||||
if (!empty($productid)) {
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
if (getDolGlobalString('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
if (getDolGlobalInt('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case
|
||||
if ($productid > 0 && $productsupplier->get_buyprice(0, price2num(GETPOST('qty')), $productid, 'none', GETPOSTINT('socid')) < 0) {
|
||||
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
||||
}
|
||||
|
|
@ -1908,8 +1908,8 @@ if ($action == 'create') {
|
|||
$dateSelector = 0;
|
||||
$inputalsopricewithtax = 1;
|
||||
$senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty.
|
||||
if (getDolGlobalString('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
$senderissupplier = 1;
|
||||
if (getDolGlobalInt('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
$senderissupplier = getDolGlobalInt('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY');
|
||||
}
|
||||
|
||||
if (!empty($object->lines)) {
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ class SupplierProposal extends CommonObject
|
|||
$this->db->begin();
|
||||
|
||||
if ($fk_product > 0) {
|
||||
if (getDolGlobalString('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY')) {
|
||||
if (getDolGlobalInt('SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case
|
||||
// Check quantity is enough
|
||||
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_fournprice=".$fk_fournprice." qty=".$qty." ref_supplier=".$ref_supplier);
|
||||
$productsupplier = new ProductFournisseur($this->db);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user