@@ -663,10 +663,10 @@ public function canCreditmemo()
663
663
private function canCreditmemoForZeroTotalRefunded (float $ totalRefunded ): bool
664
664
{
665
665
$ isRefundZero = abs ($ totalRefunded ) < .0001 ;
666
- // Case when Adjustment Fee (adjustment_negative) has been used for first creditmemo
666
+ // Case when Adjustment Fee (adjustment_negative) has been used for first credit memo
667
667
$ hasAdjustmentFee = abs ($ totalRefunded - $ this ->getAdjustmentNegative ()) < .0001 ;
668
- $ hasActinFlag = $ this ->getActionFlag (self ::ACTION_FLAG_EDIT ) === false ;
669
- if ($ isRefundZero || $ hasAdjustmentFee || $ hasActinFlag ) {
668
+ $ hasActionFlag = $ this ->getActionFlag (self ::ACTION_FLAG_EDIT ) === false ;
669
+ if ($ isRefundZero || $ hasAdjustmentFee || $ hasActionFlag ) {
670
670
return false ;
671
671
}
672
672
@@ -682,15 +682,15 @@ private function canCreditmemoForZeroTotalRefunded(float $totalRefunded): bool
682
682
private function canCreditmemoForZeroTotal (float $ totalRefunded ): bool
683
683
{
684
684
$ totalPaid = $ this ->getTotalPaid ();
685
- //check if total paid is less than grandtotal
685
+ //check if total paid is less than grand total
686
686
$ checkAmtTotalPaid = $ totalPaid <= $ this ->getGrandTotal ();
687
687
//case when amount is due for invoice
688
- $ dueAmountCondition = $ this ->canInvoice () && $ checkAmtTotalPaid ;
689
- //case when paid amount is refunded and order has creditmemo created
690
- $ creditmemos = ($ this ->getCreditmemosCollection () === false ) ?
688
+ $ hasDueAmount = $ this ->canInvoice () && $ checkAmtTotalPaid ;
689
+ //case when paid amount is refunded and order has credit memo created
690
+ $ creditMemos = ($ this ->getCreditmemosCollection () === false ) ?
691
691
true : (count ($ this ->getCreditmemosCollection ()) > 0 );
692
- $ paidAmtIsRefunded = $ this ->getTotalRefunded () == $ totalPaid && $ creditmemos ;
693
- if (($ dueAmountCondition || $ paidAmtIsRefunded )
692
+ $ paidAmtIsRefunded = $ this ->getTotalRefunded () == $ totalPaid && $ creditMemos ;
693
+ if (($ hasDueAmount || $ paidAmtIsRefunded )
694
694
|| (!$ checkAmtTotalPaid && abs ($ totalRefunded - $ this ->getAdjustmentNegative ()) < .0001 )
695
695
) {
696
696
return false ;
0 commit comments