-
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from andrewdwallo/development-3.x
Development 3.x
- Loading branch information
Showing
83 changed files
with
3,221 additions
and
2,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace App\Contracts; | ||
|
||
interface MoneyFormattableDTO | ||
{ | ||
public static function fromArray(array $balances): static; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\DTO; | ||
|
||
use App\Contracts\MoneyFormattableDTO; | ||
|
||
readonly class AgingBucketDTO implements MoneyFormattableDTO | ||
{ | ||
/** | ||
* @param array<string, string> $periods | ||
*/ | ||
public function __construct( | ||
public string $current, | ||
public array $periods, | ||
public string $overPeriods, | ||
public string $total, | ||
) {} | ||
|
||
public static function fromArray(array $balances): static | ||
{ | ||
$periods = []; | ||
|
||
// Extract all period balances | ||
foreach ($balances as $key => $value) { | ||
if (str_starts_with($key, 'period_')) { | ||
$periods[$key] = $value; | ||
unset($balances[$key]); | ||
} | ||
} | ||
|
||
return new static( | ||
current: $balances['current'], | ||
periods: $periods, | ||
overPeriods: $balances['over_periods'], | ||
total: $balances['total'], | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\DTO; | ||
|
||
readonly class ClientReportDTO | ||
{ | ||
public function __construct( | ||
public string $clientName, | ||
public string $clientId, | ||
public AgingBucketDTO $aging, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\DTO; | ||
|
||
readonly class EntityReportDTO | ||
{ | ||
public function __construct( | ||
public string $name, | ||
public string $id, | ||
public AgingBucketDTO $aging, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\DTO; | ||
|
||
readonly class VendorReportDTO | ||
{ | ||
public function __construct( | ||
public string $vendorName, | ||
public string $vendorId, | ||
public AgingBucketDTO $aging, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Enums\Accounting; | ||
|
||
use Filament\Support\Contracts\HasLabel; | ||
|
||
enum DocumentEntityType: string implements HasLabel | ||
{ | ||
case Client = 'client'; | ||
case Vendor = 'vendor'; | ||
|
||
public function getLabel(): ?string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function getReportTitle(): string | ||
{ | ||
return match ($this) { | ||
self::Client => 'Accounts Receivable Aging', | ||
self::Vendor => 'Accounts Payable Aging', | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.