Merge branch 'revert-fc413415' into 'company-credit-report-backend'

Revert "fix duplicated invoices bug"

See merge request CIEFWorldwideSdnBhd/exchange-2.0!58
This commit is contained in:
omair saleh
2021-07-16 09:56:57 +00:00
2 changed files with 2 additions and 11 deletions
@@ -13,9 +13,9 @@ class CalculatesBookingTransferredAmount
public function execute(Booking $booking, int $type){
return $type === 1 ?
$booking->transactions()->bills()->transferred()
$booking->transactions()->payments()->transferred()
->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total') :
$booking->transactions()->bills()->transferred()->sum('original_amount');
$booking->transactions()->payments()->transferred()->sum('original_amount');
}
}
-9
View File
@@ -75,15 +75,6 @@ class Transaction extends AbstractModel implements Documentable
return $query->where('type', TransactionType::PAYMENT);
}
/**
* @param Builder $query
* @return Builder
*/
public function scopeBills(Builder $query)
{
return $query->where('type', TransactionType::BILL);
}
/**
* @param Builder $query
* @return Builder