Fix a bug with 100% discount and null payment (#37)
This commit is contained in:
parent
02e6beb385
commit
cf41e3dc20
@ -645,7 +645,7 @@ class RetailCrmHistory
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($itemCost) && $itemCost > 0) {
|
||||
if (isset($itemCost) && $itemCost >= 0) {
|
||||
$item->setField('CUSTOM_PRICE', 'Y');
|
||||
$item->setField('PRICE', $itemCost);
|
||||
$item->setField('DISCOUNT_NAME', '');
|
||||
@ -1258,4 +1258,4 @@ class RetailUser extends CUser
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -672,7 +672,7 @@ class RetailCrmHistory
|
||||
|
||||
if (array_key_exists('discountTotal', $product)) {
|
||||
$itemCost = $item->getField('BASE_PRICE');
|
||||
if (isset($itemCost) && $itemCost > 0) {
|
||||
if (isset($itemCost) && $itemCost >= 0) {
|
||||
$item->setField('CUSTOM_PRICE', 'Y');
|
||||
$item->setField('PRICE', $itemCost - $product['discountTotal']);
|
||||
$item->setField('DISCOUNT_PRICE', $product['discountTotal']);
|
||||
@ -743,7 +743,9 @@ class RetailCrmHistory
|
||||
RCrmActions::apiMethod($api, 'paymentEditById', __METHOD__, $newHistoryPayments[$orderPayment->getField('XML_ID')]);
|
||||
}
|
||||
|
||||
\Bitrix\Sale\Internals\PaymentTable::update($paymentExternalId, array('XML_ID' => ''));
|
||||
if (!is_null($paymentExternalId)) {
|
||||
\Bitrix\Sale\Internals\PaymentTable::update($paymentExternalId, array('XML_ID' => ''));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1240,4 +1242,4 @@ class RetailUser extends CUser
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user