Fix Laravel Pint formatting
This commit is contained in:
@@ -18,8 +18,7 @@ class InvoiceGenerationService
|
||||
public function __construct(
|
||||
private InvoiceConfigService $config,
|
||||
private InvoiceTuitionService $tuitionService
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function generateInvoice(int $parentId, ?string $schoolYear = null): array
|
||||
{
|
||||
@@ -64,11 +63,13 @@ class InvoiceGenerationService
|
||||
|
||||
$registeredKids = array_values(array_filter($registeredKids, function ($student) use ($schoolYear) {
|
||||
$sid = (int) ($student['student_id'] ?? 0);
|
||||
|
||||
return $sid > 0 && StudentClass::hasNonEventAssignment($sid, $schoolYear);
|
||||
}));
|
||||
|
||||
$withdrawnKids = array_values(array_filter($withdrawnKids, function ($student) use ($schoolYear) {
|
||||
$sid = (int) ($student['student_id'] ?? 0);
|
||||
|
||||
return $sid > 0 && StudentClass::hasNonEventAssignment($sid, $schoolYear);
|
||||
}));
|
||||
|
||||
@@ -83,7 +84,7 @@ class InvoiceGenerationService
|
||||
|
||||
$this->recalculateAndUpdateDiscount($parentId, $schoolYear, $tuitionFee, $enrollments);
|
||||
|
||||
$refundPaid = (new Refund())->getTotalApprovedRefundByParentIdAndSchoolYear($parentId, $schoolYear);
|
||||
$refundPaid = (new Refund)->getTotalApprovedRefundByParentIdAndSchoolYear($parentId, $schoolYear);
|
||||
$totalPaid = Payment::getTotalPaidByParentId($parentId, $schoolYear);
|
||||
|
||||
$totalAmount = max(0.0, (float) $tuitionFee) + (float) $eventChargeTotal;
|
||||
@@ -93,9 +94,9 @@ class InvoiceGenerationService
|
||||
$updatedIds = [];
|
||||
$insertId = null;
|
||||
|
||||
if (!empty($existingInvoices)) {
|
||||
if (! empty($existingInvoices)) {
|
||||
foreach ($existingInvoices as $invoice) {
|
||||
if (!isset($invoice['id'])) {
|
||||
if (! isset($invoice['id'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -127,14 +128,14 @@ class InvoiceGenerationService
|
||||
} else {
|
||||
$schoolId = User::getSchoolIdByUserId($parentId);
|
||||
$invoiceNumber = $schoolId
|
||||
? ('INV-' . $schoolId . '-' . uniqid())
|
||||
? ('INV-'.$schoolId.'-'.uniqid())
|
||||
: uniqid('INV-');
|
||||
|
||||
$issueUtc = (new DateTime('now', new DateTimeZone('UTC')))->format('Y-m-d H:i:s');
|
||||
$dueUtc = null;
|
||||
$dueDate = $this->config->getDueDate();
|
||||
if (!empty($dueDate)) {
|
||||
$dueLocal = new DateTime($dueDate . ' 19:59:59', new DateTimeZone($this->config->getTimezone()));
|
||||
if (! empty($dueDate)) {
|
||||
$dueLocal = new DateTime($dueDate.' 19:59:59', new DateTimeZone($this->config->getTimezone()));
|
||||
$dueLocal->setTimezone(new DateTimeZone('UTC'));
|
||||
$dueUtc = $dueLocal->format('Y-m-d H:i:s');
|
||||
}
|
||||
@@ -180,7 +181,7 @@ class InvoiceGenerationService
|
||||
}
|
||||
|
||||
foreach ($invoices as $invoice) {
|
||||
if (!isset($invoice['id'])) {
|
||||
if (! isset($invoice['id'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -193,7 +194,7 @@ class InvoiceGenerationService
|
||||
->where('i.school_year', $schoolYear)
|
||||
->first();
|
||||
|
||||
if (!$discountUsage) {
|
||||
if (! $discountUsage) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user