fix test and add invocie to parent enrollment
This commit is contained in:
@@ -1052,13 +1052,11 @@ class InvoiceController extends ResourceController
|
||||
$invoiceId = $invoice !== null ? (int) ($invoice['id'] ?? 0) : null;
|
||||
$invoiceDate = null;
|
||||
|
||||
if ($invoice !== null) {
|
||||
if ($invoice !== null && ! empty($invoice['updated_at'])) {
|
||||
$tzName = (string) (config('School')->attendance['timezone'] ?? user_timezone());
|
||||
$invoiceDate = ! empty($invoice['issue_date'])
|
||||
? (new \DateTimeImmutable($invoice['issue_date'], new \DateTimeZone('UTC')))
|
||||
->setTimezone(new \DateTimeZone($tzName))
|
||||
->format('Y-m-d H:i:s')
|
||||
: ($invoice['updated_at'] ?? null);
|
||||
$invoiceDate = (new \DateTimeImmutable($invoice['updated_at'], new \DateTimeZone('UTC')))
|
||||
->setTimezone(new \DateTimeZone($tzName))
|
||||
->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$description = '';
|
||||
|
||||
Reference in New Issue
Block a user