File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -537,22 +537,26 @@ public function getTotal()
537537
538538 $ process = 0 ;
539539
540- $ conditions = $ this ->getConditions ();
540+ $ conditions = $ this
541+ ->getConditions ()
542+ ->filter (function ($ cond ) {
543+ return $ cond ->getTarget () === 'subtotal ' ;
544+ });
541545
542546 // if no conditions were added, just return the sub total
543547 if (!$ conditions ->count ()) {
544548 return Helpers::formatValue ($ subTotal , $ this ->config ['format_numbers ' ], $ this ->config );
545549 }
546550
547- $ conditions-> each ( function ( $ cond ) use ( $ subTotal , & $ newTotal , & $ process ) {
548- if ($ cond-> getTarget () === ' subtotal ' ) {
549- ($ process > 0 ) ? $ toBeCalculated = $ newTotal : $ toBeCalculated = $ subTotal ;
551+ $ conditions
552+ -> each ( function ($ cond) use ( $ subTotal , & $ newTotal , & $ process ) {
553+ $ toBeCalculated = ($ process > 0 ) ? $ newTotal : $ subTotal ;
550554
551555 $ newTotal = $ cond ->applyCondition ($ toBeCalculated );
552556
553557 $ process ++;
554- }
555- });
558+
559+ });
556560
557561 return Helpers::formatValue ($ newTotal , $ this ->config ['format_numbers ' ], $ this ->config );
558562 }
You can’t perform that action at this time.
0 commit comments