Hoan thien core finance v2

This commit is contained in:
2026-04-25 04:04:14 +00:00
parent 86216ef872
commit 002c9a8b99
39 changed files with 1308 additions and 89 deletions

View File

@@ -13,10 +13,9 @@ class CreateContract extends CreateRecord
protected function afterCreate(): void
{
$contract = $this->record;
$templateId = $this->data['payment_template_id'] ?? null;
if ($templateId) {
$template = \App\Models\PaymentTemplate::find($templateId);
if ($contract->payment_template_id) {
$template = $contract->paymentTemplate;
if ($template) {
ContractScheduleService::generateFromTemplate($contract, $template);
}