@@ -63,6 +63,8 @@ public function generateReport(
6363 $ data = collect ($ results )->map (function ($ row ) {
6464 $ currencyCode = strtoupper ($ row ->currency ?? 'USD ' );
6565 $ divisor = Currency::isZeroDecimalCurrency ($ currencyCode ) ? 1 : 100 ;
66+ $ gross = $ row ->application_fee_gross ?? 0 ;
67+ $ net = $ row ->application_fee_net ?? $ gross ;
6668
6769 return (object ) [
6870 'event_name ' => $ row ->event_name ,
@@ -71,10 +73,10 @@ public function generateReport(
7173 'order_reference ' => $ row ->order_reference ,
7274 'order_id ' => $ row ->order_id ,
7375 'amount_paid ' => Currency::round (($ row ->amount_received ?? 0 ) / $ divisor ),
74- 'fee_amount ' => Currency::round (( $ row -> application_fee_net ?? 0 ) / $ divisor ),
75- 'vat_rate ' => $ row ->application_fee_vat_rate ?? 0 ,
76+ 'fee_amount ' => Currency::round ($ net / $ divisor ),
77+ 'vat_rate ' => $ row ->application_fee_vat_rate ,
7678 'vat_amount ' => Currency::round (($ row ->application_fee_vat ?? 0 ) / $ divisor ),
77- 'total_fee ' => Currency::round (( $ row -> application_fee_gross ?? 0 ) / $ divisor ),
79+ 'total_fee ' => Currency::round ($ gross / $ divisor ),
7880 'currency ' => $ currencyCode ,
7981 'payment_intent_id ' => $ row ->payment_intent_id ,
8082 ];
0 commit comments