mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-11 11:32:56 +01:00
Compare commits
2 Commits
revert-368
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fa9d395dc | ||
|
|
cf621642fb |
@@ -286,7 +286,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
|
||||
if (!$error && getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = price2num(GETPOSTINT("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
$dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
if (empty($dto)) {
|
||||
$dto = 0;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
|
||||
if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = GETPOSTINT("dto_".$reg[1].'_'.$reg[2]);
|
||||
$dto = GETPOSTFLOAT("dto_".$reg[1].'_'.$reg[2]);
|
||||
if (!empty($dto)) {
|
||||
$unit_price = price2num((float) GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU');
|
||||
}
|
||||
@@ -374,7 +374,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
|
||||
if (!$error && getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = GETPOSTINT("dto_".$reg[1].'_'.$reg[2]);
|
||||
$dto = GETPOSTFLOAT("dto_".$reg[1].'_'.$reg[2]);
|
||||
//update supplier price
|
||||
if (GETPOSTISSET($saveprice)) {
|
||||
// TODO Use class
|
||||
|
||||
@@ -656,7 +656,7 @@ class MouvementStock extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($donotcleanemptylines) && !getDolGlobalInt('STOCK_MOVEMENT_FORCE_DO_NOT_CLEAN_EMPTY_LINES')) {
|
||||
if (empty($donotcleanemptylines)) {
|
||||
// If stock is now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine
|
||||
// having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot.
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".$this->db->prefix()."product_batch as pb)";
|
||||
|
||||
@@ -1052,10 +1052,8 @@ if (!$variants || getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PA
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
|
||||
$sql .= " WHERE ps.fk_entrepot = e.rowid";
|
||||
if (!getDolGlobalInt('STOCK_MOVEMENT_FORCE_DO_NOT_CLEAN_EMPTY_LINES')) {
|
||||
$sql .= " AND ps.reel != 0";
|
||||
}
|
||||
$sql .= " WHERE ps.reel != 0";
|
||||
$sql .= " AND ps.fk_entrepot = e.rowid";
|
||||
$sql .= " AND e.entity IN (".getEntity('stock').")";
|
||||
$sql .= " AND ps.fk_product = ".((int) $object->id);
|
||||
$sql .= " ORDER BY e.ref";
|
||||
|
||||
@@ -265,7 +265,7 @@ if ($action == 'updatelines' && $permissiontoreceive) {
|
||||
|
||||
if (!$error && getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = price2num(GETPOSTINT("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
$dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
if (empty($dto)) {
|
||||
$dto = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user