fixed incorect payment adding when passed im addOrderPaymentDetail function

This commit is contained in:
Shreesh Arora
2023-02-07 11:17:40 +05:30
parent c0ee4685ec
commit 5a06979dab

View File

@@ -1781,7 +1781,7 @@ class OrderCore extends ObjectModel
public function addOrderPaymentDetail(OrderPayment $payment, $amount = null, $order_invoice = null)
{
if (Validate::isLoadedObject($payment)) {
if (!is_null($amount)) {
if (is_null($amount)) {
$amount = $payment->amount;
}
$order_payment_detail = new OrderPaymentDetail();