From 20e321171905fe5fe9ca2a2f049f9701aa59a4ca Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Wed, 26 Mar 2025 18:16:16 +0500 Subject: [PATCH] wip --- app/Http/Controllers/HomeController.php | 76 ------------------- app/Modules/AppHelpers/AppHelpersModule.php | 2 +- .../Invoice/Examples/InvoiceExcellExample.php | 76 +++++++++++++++++++ app/Modules/ModuleRepository.php | 2 +- app/Providers/Filament/AdminPanelProvider.php | 2 - 5 files changed, 78 insertions(+), 80 deletions(-) create mode 100644 app/Modules/Invoice/Examples/InvoiceExcellExample.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 14db416..ef360a1 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,86 +2,10 @@ namespace App\Http\Controllers; -use App\Modules\Invoice\Actions\GenerateInvoiceExcell; -use App\Modules\Invoice\Data\InvoiceExcellData; -use App\Modules\Invoice\Data\InvoiceItem; -use Carbon\Carbon; - class HomeController extends Controller { public function index(): string { return 'F'; - GenerateInvoiceExcell::make() - ->setTemplateFile(app_path('Modules/Invoice/Resources/Docs/invoice.xls')) - ->setData(new InvoiceExcellData( - number: random_int(1, 99), - date: new Carbon('2024-11-08'), - seller_firm_type: 'Telekeçi', - seller_firm_name: 'Nurmuhammet Allanov Parahatowiç', - seller_ssb: '201126532321', - seller_bank_name: 'Türkmenistanyň „Halkbank“ paýdarlar täjirçilik banky', - seller_bank_hb_1: '23206934160169902250000', - seller_bank_hb_2: '21101934110100700005000', - seller_bank_city: 'Aşgabat', - seller_bank_bab: '390101601', - - buyer: 'Türkmenistanyň „Türkmenbaşy“ paýdarlar täjirçilik banky', - buyer_address: '744000 Aşgabat ş., Çandebil şaýoly köç., 121,', - buyer_bank: 'Türkmenistanyň Merkezi Banky', - buyer_bank_address: 'Aşgabat ş.', - buyer_bank_data: sprintf('şahsy salgyt belgisi %s, MFO %s, Hasap № %s', '101301000408', '390101304', '21101934110100300007000'), - - items: [ - new InvoiceItem( - name: 'Programma üpjünçiligini hyzmat etmek barada', - unit: 'ay', - quantity: 2, - unit_price: 100000, - vat: null, - vat_excluded: null, - vat_percentage: null, - vat_tmt: null, - total: 200000, - ), - new InvoiceItem( - name: 'Programma üpjünçiligini hyzmat etmek barada', - unit: 'ay', - quantity: 2, - unit_price: 100000, - vat: null, - vat_excluded: null, - vat_percentage: null, - vat_tmt: null, - total: 200000, - ), - new InvoiceItem( - name: 'Programma üpjünçiligini hyzmat etmek barada', - unit: 'ay', - quantity: 2, - unit_price: 100000, - vat: null, - vat_excluded: null, - vat_percentage: null, - vat_tmt: null, - total: 200000, - ), - new InvoiceItem( - name: 'Programma üpjünçiligini işläp taýýarlamak barada', - unit: 'ay', - quantity: 2, - unit_price: 100000, - vat: null, - vat_excluded: null, - vat_percentage: null, - vat_tmt: null, - total: 200000, - ), - ] - )) - ->handle() - ->save(); - - return 'F'; } } diff --git a/app/Modules/AppHelpers/AppHelpersModule.php b/app/Modules/AppHelpers/AppHelpersModule.php index 5ffaa55..93a03d8 100644 --- a/app/Modules/AppHelpers/AppHelpersModule.php +++ b/app/Modules/AppHelpers/AppHelpersModule.php @@ -43,6 +43,6 @@ class AppHelpersModule implements ModuleContract */ public function hasFilamentResource(): bool { - return true; + return false; } } diff --git a/app/Modules/Invoice/Examples/InvoiceExcellExample.php b/app/Modules/Invoice/Examples/InvoiceExcellExample.php new file mode 100644 index 0000000..59bbba4 --- /dev/null +++ b/app/Modules/Invoice/Examples/InvoiceExcellExample.php @@ -0,0 +1,76 @@ +setTemplateFile(app_path('Modules/Invoice/Resources/Docs/invoice.xls')) + ->setData(new InvoiceExcellData( + number: random_int(1, 99), + date: new Carbon('2024-11-08'), + seller_firm_type: 'Telekeçi', + seller_firm_name: 'Nurmuhammet Allanov Parahatowiç', + seller_ssb: '201126532321', + seller_bank_name: 'Türkmenistanyň „Halkbank“ paýdarlar täjirçilik banky', + seller_bank_hb_1: '23206934160169902250000', + seller_bank_hb_2: '21101934110100700005000', + seller_bank_city: 'Aşgabat', + seller_bank_bab: '390101601', + + buyer: 'Türkmenistanyň „Türkmenbaşy“ paýdarlar täjirçilik banky', + buyer_address: '744000 Aşgabat ş., Çandebil şaýoly köç., 121,', + buyer_bank: 'Türkmenistanyň Merkezi Banky', + buyer_bank_address: 'Aşgabat ş.', + buyer_bank_data: sprintf('şahsy salgyt belgisi %s, MFO %s, Hasap № %s', '101301000408', '390101304', '21101934110100300007000'), + + items: [ + new InvoiceItem( + name: 'Programma üpjünçiligini hyzmat etmek barada', + unit: 'ay', + quantity: 2, + unit_price: 100000, + vat: null, + vat_excluded: null, + vat_percentage: null, + vat_tmt: null, + total: 200000, + ), + new InvoiceItem( + name: 'Programma üpjünçiligini hyzmat etmek barada', + unit: 'ay', + quantity: 2, + unit_price: 100000, + vat: null, + vat_excluded: null, + vat_percentage: null, + vat_tmt: null, + total: 200000, + ), + new InvoiceItem( + name: 'Programma üpjünçiligini hyzmat etmek barada', + unit: 'ay', + quantity: 2, + unit_price: 100000, + vat: null, + vat_excluded: null, + vat_percentage: null, + vat_tmt: null, + total: 200000, + ), + new InvoiceItem( + name: 'Programma üpjünçiligini işläp taýýarlamak barada', + unit: 'ay', + quantity: 2, + unit_price: 100000, + vat: null, + vat_excluded: null, + vat_percentage: null, + vat_tmt: null, + total: 200000, + ), + ] + )) + ->handle() + ->save(); diff --git a/app/Modules/ModuleRepository.php b/app/Modules/ModuleRepository.php index e6c6596..315ddc7 100644 --- a/app/Modules/ModuleRepository.php +++ b/app/Modules/ModuleRepository.php @@ -48,7 +48,7 @@ class ModuleRepository /** * Set modules * - * @param bool|bool $withDisabled + * @param bool $withDisabled */ public function setModules(bool $withDisabled = false): void { diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index a8379d4..ffaa78a 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -5,8 +5,6 @@ namespace App\Providers\Filament; use Filament\Http\Middleware\Authenticate; use Filament\Http\Middleware\DisableBladeIconComponents; use Filament\Http\Middleware\DispatchServingFilamentEvent; -use Filament\Navigation\MenuItem; -use Filament\Navigation\NavigationGroup; use Filament\Pages; use Filament\Panel; use Filament\PanelProvider;