Browse Source

add discount method as default document setting

3.x
Andrew Wallo 6 months ago
parent
commit
ecce8f4d5c

+ 4
- 0
app/Filament/Company/Clusters/Settings/Resources/DocumentDefaultResource.php View File

2
 
2
 
3
 namespace App\Filament\Company\Clusters\Settings\Resources;
3
 namespace App\Filament\Company\Clusters\Settings\Resources;
4
 
4
 
5
+use App\Enums\Accounting\DocumentDiscountMethod;
5
 use App\Enums\Accounting\DocumentType;
6
 use App\Enums\Accounting\DocumentType;
6
 use App\Enums\Setting\Font;
7
 use App\Enums\Setting\Font;
7
 use App\Enums\Setting\PaymentTerms;
8
 use App\Enums\Setting\PaymentTerms;
51
                     ->softRequired()
52
                     ->softRequired()
52
                     ->localizeLabel()
53
                     ->localizeLabel()
53
                     ->options(PaymentTerms::class),
54
                     ->options(PaymentTerms::class),
55
+                Forms\Components\Select::make('discount_method')
56
+                    ->softRequired()
57
+                    ->options(DocumentDiscountMethod::class),
54
             ])->columns();
58
             ])->columns();
55
     }
59
     }
56
 
60
 

+ 1
- 1
app/Filament/Company/Resources/Purchases/BillResource.php View File

167
                                     ->label('Discount method')
167
                                     ->label('Discount method')
168
                                     ->options(DocumentDiscountMethod::class)
168
                                     ->options(DocumentDiscountMethod::class)
169
                                     ->selectablePlaceholder(false)
169
                                     ->selectablePlaceholder(false)
170
-                                    ->default(DocumentDiscountMethod::PerLineItem)
170
+                                    ->default($settings->discount_method)
171
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
171
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
172
                                         $discountMethod = DocumentDiscountMethod::parse($state);
172
                                         $discountMethod = DocumentDiscountMethod::parse($state);
173
 
173
 

+ 1
- 1
app/Filament/Company/Resources/Sales/EstimateResource.php View File

165
                                     ->label('Discount method')
165
                                     ->label('Discount method')
166
                                     ->options(DocumentDiscountMethod::class)
166
                                     ->options(DocumentDiscountMethod::class)
167
                                     ->selectablePlaceholder(false)
167
                                     ->selectablePlaceholder(false)
168
-                                    ->default(DocumentDiscountMethod::PerLineItem)
168
+                                    ->default($settings->discount_method)
169
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
169
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
170
                                         $discountMethod = DocumentDiscountMethod::parse($state);
170
                                         $discountMethod = DocumentDiscountMethod::parse($state);
171
 
171
 

+ 1
- 1
app/Filament/Company/Resources/Sales/InvoiceResource.php View File

178
                                     ->label('Discount method')
178
                                     ->label('Discount method')
179
                                     ->options(DocumentDiscountMethod::class)
179
                                     ->options(DocumentDiscountMethod::class)
180
                                     ->selectablePlaceholder(false)
180
                                     ->selectablePlaceholder(false)
181
-                                    ->default(DocumentDiscountMethod::PerLineItem)
181
+                                    ->default($settings->discount_method)
182
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
182
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
183
                                         $discountMethod = DocumentDiscountMethod::parse($state);
183
                                         $discountMethod = DocumentDiscountMethod::parse($state);
184
 
184
 

+ 1
- 1
app/Filament/Company/Resources/Sales/RecurringInvoiceResource.php View File

91
                                     ->label('Discount method')
91
                                     ->label('Discount method')
92
                                     ->options(DocumentDiscountMethod::class)
92
                                     ->options(DocumentDiscountMethod::class)
93
                                     ->selectablePlaceholder(false)
93
                                     ->selectablePlaceholder(false)
94
-                                    ->default(DocumentDiscountMethod::PerLineItem)
94
+                                    ->default($settings->discount_method)
95
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
95
                                     ->afterStateUpdated(function ($state, Forms\Set $set) {
96
                                         $discountMethod = DocumentDiscountMethod::parse($state);
96
                                         $discountMethod = DocumentDiscountMethod::parse($state);
97
 
97
 

+ 3
- 0
app/Models/Setting/DocumentDefault.php View File

4
 
4
 
5
 use App\Concerns\Blamable;
5
 use App\Concerns\Blamable;
6
 use App\Concerns\CompanyOwned;
6
 use App\Concerns\CompanyOwned;
7
+use App\Enums\Accounting\DocumentDiscountMethod;
7
 use App\Enums\Accounting\DocumentType;
8
 use App\Enums\Accounting\DocumentType;
8
 use App\Enums\Setting\Font;
9
 use App\Enums\Setting\Font;
9
 use App\Enums\Setting\PaymentTerms;
10
 use App\Enums\Setting\PaymentTerms;
32
         'show_logo',
33
         'show_logo',
33
         'number_prefix',
34
         'number_prefix',
34
         'payment_terms',
35
         'payment_terms',
36
+        'discount_method',
35
         'header',
37
         'header',
36
         'subheader',
38
         'subheader',
37
         'terms',
39
         'terms',
51
         'type' => DocumentType::class,
53
         'type' => DocumentType::class,
52
         'show_logo' => 'boolean',
54
         'show_logo' => 'boolean',
53
         'payment_terms' => PaymentTerms::class,
55
         'payment_terms' => PaymentTerms::class,
56
+        'discount_method' => DocumentDiscountMethod::class,
54
         'font' => Font::class,
57
         'font' => Font::class,
55
         'template' => Template::class,
58
         'template' => Template::class,
56
         'item_name' => AsArrayObject::class,
59
         'item_name' => AsArrayObject::class,

+ 113
- 112
composer.lock View File

368
         },
368
         },
369
         {
369
         {
370
             "name": "awcodes/filament-table-repeater",
370
             "name": "awcodes/filament-table-repeater",
371
-            "version": "v3.1.2",
371
+            "version": "v3.1.3",
372
             "source": {
372
             "source": {
373
                 "type": "git",
373
                 "type": "git",
374
                 "url": "https://github.com/awcodes/filament-table-repeater.git",
374
                 "url": "https://github.com/awcodes/filament-table-repeater.git",
375
-                "reference": "1cdfdd0fefbcc183960b4623cab17f6db880029e"
375
+                "reference": "fd8df8fbb94a41d0a031a75ef739538290a14a8c"
376
             },
376
             },
377
             "dist": {
377
             "dist": {
378
                 "type": "zip",
378
                 "type": "zip",
379
-                "url": "https://api.github.com/repos/awcodes/filament-table-repeater/zipball/1cdfdd0fefbcc183960b4623cab17f6db880029e",
380
-                "reference": "1cdfdd0fefbcc183960b4623cab17f6db880029e",
379
+                "url": "https://api.github.com/repos/awcodes/filament-table-repeater/zipball/fd8df8fbb94a41d0a031a75ef739538290a14a8c",
380
+                "reference": "fd8df8fbb94a41d0a031a75ef739538290a14a8c",
381
                 "shasum": ""
381
                 "shasum": ""
382
             },
382
             },
383
             "require": {
383
             "require": {
431
             ],
431
             ],
432
             "support": {
432
             "support": {
433
                 "issues": "https://github.com/awcodes/filament-table-repeater/issues",
433
                 "issues": "https://github.com/awcodes/filament-table-repeater/issues",
434
-                "source": "https://github.com/awcodes/filament-table-repeater/tree/v3.1.2"
434
+                "source": "https://github.com/awcodes/filament-table-repeater/tree/v3.1.3"
435
             },
435
             },
436
             "funding": [
436
             "funding": [
437
                 {
437
                 {
439
                     "type": "github"
439
                     "type": "github"
440
                 }
440
                 }
441
             ],
441
             ],
442
-            "time": "2025-04-21T14:01:12+00:00"
442
+            "time": "2025-05-03T14:59:55+00:00"
443
         },
443
         },
444
         {
444
         {
445
             "name": "aws/aws-crt-php",
445
             "name": "aws/aws-crt-php",
497
         },
497
         },
498
         {
498
         {
499
             "name": "aws/aws-sdk-php",
499
             "name": "aws/aws-sdk-php",
500
-            "version": "3.343.2",
500
+            "version": "3.343.3",
501
             "source": {
501
             "source": {
502
                 "type": "git",
502
                 "type": "git",
503
                 "url": "https://github.com/aws/aws-sdk-php.git",
503
                 "url": "https://github.com/aws/aws-sdk-php.git",
504
-                "reference": "95d43e71d3395622394b36079f2fb2289d3284b3"
504
+                "reference": "d7ad5f6bdee792a16d2c9d5a3d9b56acfaaaf979"
505
             },
505
             },
506
             "dist": {
506
             "dist": {
507
                 "type": "zip",
507
                 "type": "zip",
508
-                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/95d43e71d3395622394b36079f2fb2289d3284b3",
509
-                "reference": "95d43e71d3395622394b36079f2fb2289d3284b3",
508
+                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d7ad5f6bdee792a16d2c9d5a3d9b56acfaaaf979",
509
+                "reference": "d7ad5f6bdee792a16d2c9d5a3d9b56acfaaaf979",
510
                 "shasum": ""
510
                 "shasum": ""
511
             },
511
             },
512
             "require": {
512
             "require": {
588
             "support": {
588
             "support": {
589
                 "forum": "https://github.com/aws/aws-sdk-php/discussions",
589
                 "forum": "https://github.com/aws/aws-sdk-php/discussions",
590
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
590
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
591
-                "source": "https://github.com/aws/aws-sdk-php/tree/3.343.2"
591
+                "source": "https://github.com/aws/aws-sdk-php/tree/3.343.3"
592
             },
592
             },
593
-            "time": "2025-05-01T18:05:02+00:00"
593
+            "time": "2025-05-02T18:04:58+00:00"
594
         },
594
         },
595
         {
595
         {
596
             "name": "aws/aws-sdk-php-laravel",
596
             "name": "aws/aws-sdk-php-laravel",
6794
         },
6794
         },
6795
         {
6795
         {
6796
             "name": "symfony/console",
6796
             "name": "symfony/console",
6797
-            "version": "v7.2.5",
6797
+            "version": "v7.2.6",
6798
             "source": {
6798
             "source": {
6799
                 "type": "git",
6799
                 "type": "git",
6800
                 "url": "https://github.com/symfony/console.git",
6800
                 "url": "https://github.com/symfony/console.git",
6801
-                "reference": "e51498ea18570c062e7df29d05a7003585b19b88"
6801
+                "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218"
6802
             },
6802
             },
6803
             "dist": {
6803
             "dist": {
6804
                 "type": "zip",
6804
                 "type": "zip",
6805
-                "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88",
6806
-                "reference": "e51498ea18570c062e7df29d05a7003585b19b88",
6805
+                "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218",
6806
+                "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218",
6807
                 "shasum": ""
6807
                 "shasum": ""
6808
             },
6808
             },
6809
             "require": {
6809
             "require": {
6867
                 "terminal"
6867
                 "terminal"
6868
             ],
6868
             ],
6869
             "support": {
6869
             "support": {
6870
-                "source": "https://github.com/symfony/console/tree/v7.2.5"
6870
+                "source": "https://github.com/symfony/console/tree/v7.2.6"
6871
             },
6871
             },
6872
             "funding": [
6872
             "funding": [
6873
                 {
6873
                 {
6883
                     "type": "tidelift"
6883
                     "type": "tidelift"
6884
                 }
6884
                 }
6885
             ],
6885
             ],
6886
-            "time": "2025-03-12T08:11:12+00:00"
6886
+            "time": "2025-04-07T19:09:28+00:00"
6887
         },
6887
         },
6888
         {
6888
         {
6889
             "name": "symfony/css-selector",
6889
             "name": "symfony/css-selector",
7314
         },
7314
         },
7315
         {
7315
         {
7316
             "name": "symfony/html-sanitizer",
7316
             "name": "symfony/html-sanitizer",
7317
-            "version": "v7.2.3",
7317
+            "version": "v7.2.6",
7318
             "source": {
7318
             "source": {
7319
                 "type": "git",
7319
                 "type": "git",
7320
                 "url": "https://github.com/symfony/html-sanitizer.git",
7320
                 "url": "https://github.com/symfony/html-sanitizer.git",
7321
-                "reference": "91443febe34cfa5e8e00425f892e6316db95bc23"
7321
+                "reference": "1bd0c8fd5938d9af3f081a7c43d360ddefd494ca"
7322
             },
7322
             },
7323
             "dist": {
7323
             "dist": {
7324
                 "type": "zip",
7324
                 "type": "zip",
7325
-                "url": "https://api.github.com/repos/symfony/html-sanitizer/zipball/91443febe34cfa5e8e00425f892e6316db95bc23",
7326
-                "reference": "91443febe34cfa5e8e00425f892e6316db95bc23",
7325
+                "url": "https://api.github.com/repos/symfony/html-sanitizer/zipball/1bd0c8fd5938d9af3f081a7c43d360ddefd494ca",
7326
+                "reference": "1bd0c8fd5938d9af3f081a7c43d360ddefd494ca",
7327
                 "shasum": ""
7327
                 "shasum": ""
7328
             },
7328
             },
7329
             "require": {
7329
             "require": {
7363
                 "sanitizer"
7363
                 "sanitizer"
7364
             ],
7364
             ],
7365
             "support": {
7365
             "support": {
7366
-                "source": "https://github.com/symfony/html-sanitizer/tree/v7.2.3"
7366
+                "source": "https://github.com/symfony/html-sanitizer/tree/v7.2.6"
7367
             },
7367
             },
7368
             "funding": [
7368
             "funding": [
7369
                 {
7369
                 {
7379
                     "type": "tidelift"
7379
                     "type": "tidelift"
7380
                 }
7380
                 }
7381
             ],
7381
             ],
7382
-            "time": "2025-01-27T11:08:17+00:00"
7382
+            "time": "2025-03-31T08:29:03+00:00"
7383
         },
7383
         },
7384
         {
7384
         {
7385
             "name": "symfony/http-foundation",
7385
             "name": "symfony/http-foundation",
7386
-            "version": "v7.2.5",
7386
+            "version": "v7.2.6",
7387
             "source": {
7387
             "source": {
7388
                 "type": "git",
7388
                 "type": "git",
7389
                 "url": "https://github.com/symfony/http-foundation.git",
7389
                 "url": "https://github.com/symfony/http-foundation.git",
7390
-                "reference": "371272aeb6286f8135e028ca535f8e4d6f114126"
7390
+                "reference": "6023ec7607254c87c5e69fb3558255aca440d72b"
7391
             },
7391
             },
7392
             "dist": {
7392
             "dist": {
7393
                 "type": "zip",
7393
                 "type": "zip",
7394
-                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/371272aeb6286f8135e028ca535f8e4d6f114126",
7395
-                "reference": "371272aeb6286f8135e028ca535f8e4d6f114126",
7394
+                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6023ec7607254c87c5e69fb3558255aca440d72b",
7395
+                "reference": "6023ec7607254c87c5e69fb3558255aca440d72b",
7396
                 "shasum": ""
7396
                 "shasum": ""
7397
             },
7397
             },
7398
             "require": {
7398
             "require": {
7441
             "description": "Defines an object-oriented layer for the HTTP specification",
7441
             "description": "Defines an object-oriented layer for the HTTP specification",
7442
             "homepage": "https://symfony.com",
7442
             "homepage": "https://symfony.com",
7443
             "support": {
7443
             "support": {
7444
-                "source": "https://github.com/symfony/http-foundation/tree/v7.2.5"
7444
+                "source": "https://github.com/symfony/http-foundation/tree/v7.2.6"
7445
             },
7445
             },
7446
             "funding": [
7446
             "funding": [
7447
                 {
7447
                 {
7457
                     "type": "tidelift"
7457
                     "type": "tidelift"
7458
                 }
7458
                 }
7459
             ],
7459
             ],
7460
-            "time": "2025-03-25T15:54:33+00:00"
7460
+            "time": "2025-04-09T08:14:01+00:00"
7461
         },
7461
         },
7462
         {
7462
         {
7463
             "name": "symfony/http-kernel",
7463
             "name": "symfony/http-kernel",
7464
-            "version": "v7.2.5",
7464
+            "version": "v7.2.6",
7465
             "source": {
7465
             "source": {
7466
                 "type": "git",
7466
                 "type": "git",
7467
                 "url": "https://github.com/symfony/http-kernel.git",
7467
                 "url": "https://github.com/symfony/http-kernel.git",
7468
-                "reference": "b1fe91bc1fa454a806d3f98db4ba826eb9941a54"
7468
+                "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec"
7469
             },
7469
             },
7470
             "dist": {
7470
             "dist": {
7471
                 "type": "zip",
7471
                 "type": "zip",
7472
-                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b1fe91bc1fa454a806d3f98db4ba826eb9941a54",
7473
-                "reference": "b1fe91bc1fa454a806d3f98db4ba826eb9941a54",
7472
+                "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f9dec01e6094a063e738f8945ef69c0cfcf792ec",
7473
+                "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec",
7474
                 "shasum": ""
7474
                 "shasum": ""
7475
             },
7475
             },
7476
             "require": {
7476
             "require": {
7555
             "description": "Provides a structured process for converting a Request into a Response",
7555
             "description": "Provides a structured process for converting a Request into a Response",
7556
             "homepage": "https://symfony.com",
7556
             "homepage": "https://symfony.com",
7557
             "support": {
7557
             "support": {
7558
-                "source": "https://github.com/symfony/http-kernel/tree/v7.2.5"
7558
+                "source": "https://github.com/symfony/http-kernel/tree/v7.2.6"
7559
             },
7559
             },
7560
             "funding": [
7560
             "funding": [
7561
                 {
7561
                 {
7571
                     "type": "tidelift"
7571
                     "type": "tidelift"
7572
                 }
7572
                 }
7573
             ],
7573
             ],
7574
-            "time": "2025-03-28T13:32:50+00:00"
7574
+            "time": "2025-05-02T09:04:03+00:00"
7575
         },
7575
         },
7576
         {
7576
         {
7577
             "name": "symfony/intl",
7577
             "name": "symfony/intl",
7578
-            "version": "v6.4.15",
7578
+            "version": "v6.4.21",
7579
             "source": {
7579
             "source": {
7580
                 "type": "git",
7580
                 "type": "git",
7581
                 "url": "https://github.com/symfony/intl.git",
7581
                 "url": "https://github.com/symfony/intl.git",
7582
-                "reference": "b1d5e8d82615b60f229216edfee0b59e2ef66da6"
7582
+                "reference": "b248d227fa10fd6345efd4c1c74efaa1c1de6f76"
7583
             },
7583
             },
7584
             "dist": {
7584
             "dist": {
7585
                 "type": "zip",
7585
                 "type": "zip",
7586
-                "url": "https://api.github.com/repos/symfony/intl/zipball/b1d5e8d82615b60f229216edfee0b59e2ef66da6",
7587
-                "reference": "b1d5e8d82615b60f229216edfee0b59e2ef66da6",
7586
+                "url": "https://api.github.com/repos/symfony/intl/zipball/b248d227fa10fd6345efd4c1c74efaa1c1de6f76",
7587
+                "reference": "b248d227fa10fd6345efd4c1c74efaa1c1de6f76",
7588
                 "shasum": ""
7588
                 "shasum": ""
7589
             },
7589
             },
7590
             "require": {
7590
             "require": {
7638
                 "localization"
7638
                 "localization"
7639
             ],
7639
             ],
7640
             "support": {
7640
             "support": {
7641
-                "source": "https://github.com/symfony/intl/tree/v6.4.15"
7641
+                "source": "https://github.com/symfony/intl/tree/v6.4.21"
7642
             },
7642
             },
7643
             "funding": [
7643
             "funding": [
7644
                 {
7644
                 {
7654
                     "type": "tidelift"
7654
                     "type": "tidelift"
7655
                 }
7655
                 }
7656
             ],
7656
             ],
7657
-            "time": "2024-11-08T15:28:48+00:00"
7657
+            "time": "2025-04-07T19:02:30+00:00"
7658
         },
7658
         },
7659
         {
7659
         {
7660
             "name": "symfony/mailer",
7660
             "name": "symfony/mailer",
7661
-            "version": "v7.2.3",
7661
+            "version": "v7.2.6",
7662
             "source": {
7662
             "source": {
7663
                 "type": "git",
7663
                 "type": "git",
7664
                 "url": "https://github.com/symfony/mailer.git",
7664
                 "url": "https://github.com/symfony/mailer.git",
7665
-                "reference": "f3871b182c44997cf039f3b462af4a48fb85f9d3"
7665
+                "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356"
7666
             },
7666
             },
7667
             "dist": {
7667
             "dist": {
7668
                 "type": "zip",
7668
                 "type": "zip",
7669
-                "url": "https://api.github.com/repos/symfony/mailer/zipball/f3871b182c44997cf039f3b462af4a48fb85f9d3",
7670
-                "reference": "f3871b182c44997cf039f3b462af4a48fb85f9d3",
7669
+                "url": "https://api.github.com/repos/symfony/mailer/zipball/998692469d6e698c6eadc7ef37a6530a9eabb356",
7670
+                "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356",
7671
                 "shasum": ""
7671
                 "shasum": ""
7672
             },
7672
             },
7673
             "require": {
7673
             "require": {
7718
             "description": "Helps sending emails",
7718
             "description": "Helps sending emails",
7719
             "homepage": "https://symfony.com",
7719
             "homepage": "https://symfony.com",
7720
             "support": {
7720
             "support": {
7721
-                "source": "https://github.com/symfony/mailer/tree/v7.2.3"
7721
+                "source": "https://github.com/symfony/mailer/tree/v7.2.6"
7722
             },
7722
             },
7723
             "funding": [
7723
             "funding": [
7724
                 {
7724
                 {
7734
                     "type": "tidelift"
7734
                     "type": "tidelift"
7735
                 }
7735
                 }
7736
             ],
7736
             ],
7737
-            "time": "2025-01-27T11:08:17+00:00"
7737
+            "time": "2025-04-04T09:50:51+00:00"
7738
         },
7738
         },
7739
         {
7739
         {
7740
             "name": "symfony/mime",
7740
             "name": "symfony/mime",
7741
-            "version": "v7.2.4",
7741
+            "version": "v7.2.6",
7742
             "source": {
7742
             "source": {
7743
                 "type": "git",
7743
                 "type": "git",
7744
                 "url": "https://github.com/symfony/mime.git",
7744
                 "url": "https://github.com/symfony/mime.git",
7745
-                "reference": "87ca22046b78c3feaff04b337f33b38510fd686b"
7745
+                "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1"
7746
             },
7746
             },
7747
             "dist": {
7747
             "dist": {
7748
                 "type": "zip",
7748
                 "type": "zip",
7749
-                "url": "https://api.github.com/repos/symfony/mime/zipball/87ca22046b78c3feaff04b337f33b38510fd686b",
7750
-                "reference": "87ca22046b78c3feaff04b337f33b38510fd686b",
7749
+                "url": "https://api.github.com/repos/symfony/mime/zipball/706e65c72d402539a072d0d6ad105fff6c161ef1",
7750
+                "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1",
7751
                 "shasum": ""
7751
                 "shasum": ""
7752
             },
7752
             },
7753
             "require": {
7753
             "require": {
7802
                 "mime-type"
7802
                 "mime-type"
7803
             ],
7803
             ],
7804
             "support": {
7804
             "support": {
7805
-                "source": "https://github.com/symfony/mime/tree/v7.2.4"
7805
+                "source": "https://github.com/symfony/mime/tree/v7.2.6"
7806
             },
7806
             },
7807
             "funding": [
7807
             "funding": [
7808
                 {
7808
                 {
7818
                     "type": "tidelift"
7818
                     "type": "tidelift"
7819
                 }
7819
                 }
7820
             ],
7820
             ],
7821
-            "time": "2025-02-19T08:51:20+00:00"
7821
+            "time": "2025-04-27T13:34:41+00:00"
7822
         },
7822
         },
7823
         {
7823
         {
7824
             "name": "symfony/polyfill-ctype",
7824
             "name": "symfony/polyfill-ctype",
7825
-            "version": "v1.31.0",
7825
+            "version": "v1.32.0",
7826
             "source": {
7826
             "source": {
7827
                 "type": "git",
7827
                 "type": "git",
7828
                 "url": "https://github.com/symfony/polyfill-ctype.git",
7828
                 "url": "https://github.com/symfony/polyfill-ctype.git",
7881
                 "portable"
7881
                 "portable"
7882
             ],
7882
             ],
7883
             "support": {
7883
             "support": {
7884
-                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
7884
+                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0"
7885
             },
7885
             },
7886
             "funding": [
7886
             "funding": [
7887
                 {
7887
                 {
7901
         },
7901
         },
7902
         {
7902
         {
7903
             "name": "symfony/polyfill-intl-grapheme",
7903
             "name": "symfony/polyfill-intl-grapheme",
7904
-            "version": "v1.31.0",
7904
+            "version": "v1.32.0",
7905
             "source": {
7905
             "source": {
7906
                 "type": "git",
7906
                 "type": "git",
7907
                 "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
7907
                 "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
7959
                 "shim"
7959
                 "shim"
7960
             ],
7960
             ],
7961
             "support": {
7961
             "support": {
7962
-                "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
7962
+                "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0"
7963
             },
7963
             },
7964
             "funding": [
7964
             "funding": [
7965
                 {
7965
                 {
7979
         },
7979
         },
7980
         {
7980
         {
7981
             "name": "symfony/polyfill-intl-idn",
7981
             "name": "symfony/polyfill-intl-idn",
7982
-            "version": "v1.31.0",
7982
+            "version": "v1.32.0",
7983
             "source": {
7983
             "source": {
7984
                 "type": "git",
7984
                 "type": "git",
7985
                 "url": "https://github.com/symfony/polyfill-intl-idn.git",
7985
                 "url": "https://github.com/symfony/polyfill-intl-idn.git",
7986
-                "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773"
7986
+                "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3"
7987
             },
7987
             },
7988
             "dist": {
7988
             "dist": {
7989
                 "type": "zip",
7989
                 "type": "zip",
7990
-                "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773",
7991
-                "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773",
7990
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3",
7991
+                "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3",
7992
                 "shasum": ""
7992
                 "shasum": ""
7993
             },
7993
             },
7994
             "require": {
7994
             "require": {
8042
                 "shim"
8042
                 "shim"
8043
             ],
8043
             ],
8044
             "support": {
8044
             "support": {
8045
-                "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0"
8045
+                "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0"
8046
             },
8046
             },
8047
             "funding": [
8047
             "funding": [
8048
                 {
8048
                 {
8058
                     "type": "tidelift"
8058
                     "type": "tidelift"
8059
                 }
8059
                 }
8060
             ],
8060
             ],
8061
-            "time": "2024-09-09T11:45:10+00:00"
8061
+            "time": "2024-09-10T14:38:51+00:00"
8062
         },
8062
         },
8063
         {
8063
         {
8064
             "name": "symfony/polyfill-intl-normalizer",
8064
             "name": "symfony/polyfill-intl-normalizer",
8065
-            "version": "v1.31.0",
8065
+            "version": "v1.32.0",
8066
             "source": {
8066
             "source": {
8067
                 "type": "git",
8067
                 "type": "git",
8068
                 "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
8068
                 "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
8123
                 "shim"
8123
                 "shim"
8124
             ],
8124
             ],
8125
             "support": {
8125
             "support": {
8126
-                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
8126
+                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0"
8127
             },
8127
             },
8128
             "funding": [
8128
             "funding": [
8129
                 {
8129
                 {
8143
         },
8143
         },
8144
         {
8144
         {
8145
             "name": "symfony/polyfill-mbstring",
8145
             "name": "symfony/polyfill-mbstring",
8146
-            "version": "v1.31.0",
8146
+            "version": "v1.32.0",
8147
             "source": {
8147
             "source": {
8148
                 "type": "git",
8148
                 "type": "git",
8149
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
8149
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
8150
-                "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
8150
+                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
8151
             },
8151
             },
8152
             "dist": {
8152
             "dist": {
8153
                 "type": "zip",
8153
                 "type": "zip",
8154
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
8155
-                "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
8154
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
8155
+                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
8156
                 "shasum": ""
8156
                 "shasum": ""
8157
             },
8157
             },
8158
             "require": {
8158
             "require": {
8159
+                "ext-iconv": "*",
8159
                 "php": ">=7.2"
8160
                 "php": ">=7.2"
8160
             },
8161
             },
8161
             "provide": {
8162
             "provide": {
8203
                 "shim"
8204
                 "shim"
8204
             ],
8205
             ],
8205
             "support": {
8206
             "support": {
8206
-                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
8207
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0"
8207
             },
8208
             },
8208
             "funding": [
8209
             "funding": [
8209
                 {
8210
                 {
8219
                     "type": "tidelift"
8220
                     "type": "tidelift"
8220
                 }
8221
                 }
8221
             ],
8222
             ],
8222
-            "time": "2024-09-09T11:45:10+00:00"
8223
+            "time": "2024-12-23T08:48:59+00:00"
8223
         },
8224
         },
8224
         {
8225
         {
8225
             "name": "symfony/polyfill-php80",
8226
             "name": "symfony/polyfill-php80",
8226
-            "version": "v1.31.0",
8227
+            "version": "v1.32.0",
8227
             "source": {
8228
             "source": {
8228
                 "type": "git",
8229
                 "type": "git",
8229
                 "url": "https://github.com/symfony/polyfill-php80.git",
8230
                 "url": "https://github.com/symfony/polyfill-php80.git",
8230
-                "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
8231
+                "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
8231
             },
8232
             },
8232
             "dist": {
8233
             "dist": {
8233
                 "type": "zip",
8234
                 "type": "zip",
8234
-                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
8235
-                "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
8235
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
8236
+                "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
8236
                 "shasum": ""
8237
                 "shasum": ""
8237
             },
8238
             },
8238
             "require": {
8239
             "require": {
8283
                 "shim"
8284
                 "shim"
8284
             ],
8285
             ],
8285
             "support": {
8286
             "support": {
8286
-                "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
8287
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
8287
             },
8288
             },
8288
             "funding": [
8289
             "funding": [
8289
                 {
8290
                 {
8299
                     "type": "tidelift"
8300
                     "type": "tidelift"
8300
                 }
8301
                 }
8301
             ],
8302
             ],
8302
-            "time": "2024-09-09T11:45:10+00:00"
8303
+            "time": "2025-01-02T08:10:11+00:00"
8303
         },
8304
         },
8304
         {
8305
         {
8305
             "name": "symfony/polyfill-php83",
8306
             "name": "symfony/polyfill-php83",
8306
-            "version": "v1.31.0",
8307
+            "version": "v1.32.0",
8307
             "source": {
8308
             "source": {
8308
                 "type": "git",
8309
                 "type": "git",
8309
                 "url": "https://github.com/symfony/polyfill-php83.git",
8310
                 "url": "https://github.com/symfony/polyfill-php83.git",
8359
                 "shim"
8360
                 "shim"
8360
             ],
8361
             ],
8361
             "support": {
8362
             "support": {
8362
-                "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0"
8363
+                "source": "https://github.com/symfony/polyfill-php83/tree/v1.32.0"
8363
             },
8364
             },
8364
             "funding": [
8365
             "funding": [
8365
                 {
8366
                 {
8379
         },
8380
         },
8380
         {
8381
         {
8381
             "name": "symfony/polyfill-uuid",
8382
             "name": "symfony/polyfill-uuid",
8382
-            "version": "v1.31.0",
8383
+            "version": "v1.32.0",
8383
             "source": {
8384
             "source": {
8384
                 "type": "git",
8385
                 "type": "git",
8385
                 "url": "https://github.com/symfony/polyfill-uuid.git",
8386
                 "url": "https://github.com/symfony/polyfill-uuid.git",
8438
                 "uuid"
8439
                 "uuid"
8439
             ],
8440
             ],
8440
             "support": {
8441
             "support": {
8441
-                "source": "https://github.com/symfony/polyfill-uuid/tree/v1.31.0"
8442
+                "source": "https://github.com/symfony/polyfill-uuid/tree/v1.32.0"
8442
             },
8443
             },
8443
             "funding": [
8444
             "funding": [
8444
                 {
8445
                 {
8683
         },
8684
         },
8684
         {
8685
         {
8685
             "name": "symfony/string",
8686
             "name": "symfony/string",
8686
-            "version": "v7.2.0",
8687
+            "version": "v7.2.6",
8687
             "source": {
8688
             "source": {
8688
                 "type": "git",
8689
                 "type": "git",
8689
                 "url": "https://github.com/symfony/string.git",
8690
                 "url": "https://github.com/symfony/string.git",
8690
-                "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82"
8691
+                "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931"
8691
             },
8692
             },
8692
             "dist": {
8693
             "dist": {
8693
                 "type": "zip",
8694
                 "type": "zip",
8694
-                "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82",
8695
-                "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82",
8695
+                "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931",
8696
+                "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931",
8696
                 "shasum": ""
8697
                 "shasum": ""
8697
             },
8698
             },
8698
             "require": {
8699
             "require": {
8750
                 "utf8"
8751
                 "utf8"
8751
             ],
8752
             ],
8752
             "support": {
8753
             "support": {
8753
-                "source": "https://github.com/symfony/string/tree/v7.2.0"
8754
+                "source": "https://github.com/symfony/string/tree/v7.2.6"
8754
             },
8755
             },
8755
             "funding": [
8756
             "funding": [
8756
                 {
8757
                 {
8766
                     "type": "tidelift"
8767
                     "type": "tidelift"
8767
                 }
8768
                 }
8768
             ],
8769
             ],
8769
-            "time": "2024-11-13T13:31:26+00:00"
8770
+            "time": "2025-04-20T20:18:16+00:00"
8770
         },
8771
         },
8771
         {
8772
         {
8772
             "name": "symfony/translation",
8773
             "name": "symfony/translation",
8773
-            "version": "v7.2.4",
8774
+            "version": "v7.2.6",
8774
             "source": {
8775
             "source": {
8775
                 "type": "git",
8776
                 "type": "git",
8776
                 "url": "https://github.com/symfony/translation.git",
8777
                 "url": "https://github.com/symfony/translation.git",
8777
-                "reference": "283856e6981286cc0d800b53bd5703e8e363f05a"
8778
+                "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6"
8778
             },
8779
             },
8779
             "dist": {
8780
             "dist": {
8780
                 "type": "zip",
8781
                 "type": "zip",
8781
-                "url": "https://api.github.com/repos/symfony/translation/zipball/283856e6981286cc0d800b53bd5703e8e363f05a",
8782
-                "reference": "283856e6981286cc0d800b53bd5703e8e363f05a",
8782
+                "url": "https://api.github.com/repos/symfony/translation/zipball/e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6",
8783
+                "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6",
8783
                 "shasum": ""
8784
                 "shasum": ""
8784
             },
8785
             },
8785
             "require": {
8786
             "require": {
8845
             "description": "Provides tools to internationalize your application",
8846
             "description": "Provides tools to internationalize your application",
8846
             "homepage": "https://symfony.com",
8847
             "homepage": "https://symfony.com",
8847
             "support": {
8848
             "support": {
8848
-                "source": "https://github.com/symfony/translation/tree/v7.2.4"
8849
+                "source": "https://github.com/symfony/translation/tree/v7.2.6"
8849
             },
8850
             },
8850
             "funding": [
8851
             "funding": [
8851
                 {
8852
                 {
8861
                     "type": "tidelift"
8862
                     "type": "tidelift"
8862
                 }
8863
                 }
8863
             ],
8864
             ],
8864
-            "time": "2025-02-13T10:27:23+00:00"
8865
+            "time": "2025-04-07T19:09:28+00:00"
8865
         },
8866
         },
8866
         {
8867
         {
8867
             "name": "symfony/translation-contracts",
8868
             "name": "symfony/translation-contracts",
9017
         },
9018
         },
9018
         {
9019
         {
9019
             "name": "symfony/var-dumper",
9020
             "name": "symfony/var-dumper",
9020
-            "version": "v7.2.3",
9021
+            "version": "v7.2.6",
9021
             "source": {
9022
             "source": {
9022
                 "type": "git",
9023
                 "type": "git",
9023
                 "url": "https://github.com/symfony/var-dumper.git",
9024
                 "url": "https://github.com/symfony/var-dumper.git",
9024
-                "reference": "82b478c69745d8878eb60f9a049a4d584996f73a"
9025
+                "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb"
9025
             },
9026
             },
9026
             "dist": {
9027
             "dist": {
9027
                 "type": "zip",
9028
                 "type": "zip",
9028
-                "url": "https://api.github.com/repos/symfony/var-dumper/zipball/82b478c69745d8878eb60f9a049a4d584996f73a",
9029
-                "reference": "82b478c69745d8878eb60f9a049a4d584996f73a",
9029
+                "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9c46038cd4ed68952166cf7001b54eb539184ccb",
9030
+                "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb",
9030
                 "shasum": ""
9031
                 "shasum": ""
9031
             },
9032
             },
9032
             "require": {
9033
             "require": {
9080
                 "dump"
9081
                 "dump"
9081
             ],
9082
             ],
9082
             "support": {
9083
             "support": {
9083
-                "source": "https://github.com/symfony/var-dumper/tree/v7.2.3"
9084
+                "source": "https://github.com/symfony/var-dumper/tree/v7.2.6"
9084
             },
9085
             },
9085
             "funding": [
9086
             "funding": [
9086
                 {
9087
                 {
9096
                     "type": "tidelift"
9097
                     "type": "tidelift"
9097
                 }
9098
                 }
9098
             ],
9099
             ],
9099
-            "time": "2025-01-17T11:39:41+00:00"
9100
+            "time": "2025-04-09T08:14:01+00:00"
9100
         },
9101
         },
9101
         {
9102
         {
9102
             "name": "tijsverkoyen/css-to-inline-styles",
9103
             "name": "tijsverkoyen/css-to-inline-styles",
13098
         },
13099
         },
13099
         {
13100
         {
13100
             "name": "symfony/polyfill-iconv",
13101
             "name": "symfony/polyfill-iconv",
13101
-            "version": "v1.31.0",
13102
+            "version": "v1.32.0",
13102
             "source": {
13103
             "source": {
13103
                 "type": "git",
13104
                 "type": "git",
13104
                 "url": "https://github.com/symfony/polyfill-iconv.git",
13105
                 "url": "https://github.com/symfony/polyfill-iconv.git",
13105
-                "reference": "48becf00c920479ca2e910c22a5a39e5d47ca956"
13106
+                "reference": "5f3b930437ae03ae5dff61269024d8ea1b3774aa"
13106
             },
13107
             },
13107
             "dist": {
13108
             "dist": {
13108
                 "type": "zip",
13109
                 "type": "zip",
13109
-                "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/48becf00c920479ca2e910c22a5a39e5d47ca956",
13110
-                "reference": "48becf00c920479ca2e910c22a5a39e5d47ca956",
13110
+                "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/5f3b930437ae03ae5dff61269024d8ea1b3774aa",
13111
+                "reference": "5f3b930437ae03ae5dff61269024d8ea1b3774aa",
13111
                 "shasum": ""
13112
                 "shasum": ""
13112
             },
13113
             },
13113
             "require": {
13114
             "require": {
13158
                 "shim"
13159
                 "shim"
13159
             ],
13160
             ],
13160
             "support": {
13161
             "support": {
13161
-                "source": "https://github.com/symfony/polyfill-iconv/tree/v1.31.0"
13162
+                "source": "https://github.com/symfony/polyfill-iconv/tree/v1.32.0"
13162
             },
13163
             },
13163
             "funding": [
13164
             "funding": [
13164
                 {
13165
                 {
13174
                     "type": "tidelift"
13175
                     "type": "tidelift"
13175
                 }
13176
                 }
13176
             ],
13177
             ],
13177
-            "time": "2024-09-09T11:45:10+00:00"
13178
+            "time": "2024-09-17T14:58:18+00:00"
13178
         },
13179
         },
13179
         {
13180
         {
13180
             "name": "symfony/stopwatch",
13181
             "name": "symfony/stopwatch",
13240
         },
13241
         },
13241
         {
13242
         {
13242
             "name": "symfony/yaml",
13243
             "name": "symfony/yaml",
13243
-            "version": "v7.2.5",
13244
+            "version": "v7.2.6",
13244
             "source": {
13245
             "source": {
13245
                 "type": "git",
13246
                 "type": "git",
13246
                 "url": "https://github.com/symfony/yaml.git",
13247
                 "url": "https://github.com/symfony/yaml.git",
13247
-                "reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912"
13248
+                "reference": "0feafffb843860624ddfd13478f481f4c3cd8b23"
13248
             },
13249
             },
13249
             "dist": {
13250
             "dist": {
13250
                 "type": "zip",
13251
                 "type": "zip",
13251
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
13252
-                "reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
13252
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/0feafffb843860624ddfd13478f481f4c3cd8b23",
13253
+                "reference": "0feafffb843860624ddfd13478f481f4c3cd8b23",
13253
                 "shasum": ""
13254
                 "shasum": ""
13254
             },
13255
             },
13255
             "require": {
13256
             "require": {
13292
             "description": "Loads and dumps YAML files",
13293
             "description": "Loads and dumps YAML files",
13293
             "homepage": "https://symfony.com",
13294
             "homepage": "https://symfony.com",
13294
             "support": {
13295
             "support": {
13295
-                "source": "https://github.com/symfony/yaml/tree/v7.2.5"
13296
+                "source": "https://github.com/symfony/yaml/tree/v7.2.6"
13296
             },
13297
             },
13297
             "funding": [
13298
             "funding": [
13298
                 {
13299
                 {
13308
                     "type": "tidelift"
13309
                     "type": "tidelift"
13309
                 }
13310
                 }
13310
             ],
13311
             ],
13311
-            "time": "2025-03-03T07:12:39+00:00"
13312
+            "time": "2025-04-04T10:10:11+00:00"
13312
         },
13313
         },
13313
         {
13314
         {
13314
             "name": "ta-tikoma/phpunit-architecture-test",
13315
             "name": "ta-tikoma/phpunit-architecture-test",

+ 28
- 0
database/migrations/2025_05_03_150845_add_discount_method_to_document_defaults_table.php View File

1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+return new class extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     */
12
+    public function up(): void
13
+    {
14
+        Schema::table('document_defaults', function (Blueprint $table) {
15
+            $table->string('discount_method')->default('per_document')->after('payment_terms');
16
+        });
17
+    }
18
+
19
+    /**
20
+     * Reverse the migrations.
21
+     */
22
+    public function down(): void
23
+    {
24
+        Schema::table('document_defaults', function (Blueprint $table) {
25
+            $table->dropColumn('discount_method');
26
+        });
27
+    }
28
+};

+ 37
- 0
database/migrations/2025_05_03_152233_update_discount_method_defaults_on_document_tables.php View File

1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+
6
+return new class extends Migration
7
+{
8
+    /**
9
+     * Run the migrations.
10
+     */
11
+    public function up(): void
12
+    {
13
+        if (Schema::hasColumn('bills', 'discount_method')) {
14
+            Schema::table('bills', function (Blueprint $table) {
15
+                $table->string('discount_method')->default('per_document')->change();
16
+            });
17
+        }
18
+
19
+        if (Schema::hasColumn('estimates', 'discount_method')) {
20
+            Schema::table('estimates', function (Blueprint $table) {
21
+                $table->string('discount_method')->default('per_document')->change();
22
+            });
23
+        }
24
+
25
+        if (Schema::hasColumn('recurring_invoices', 'discount_method')) {
26
+            Schema::table('recurring_invoices', function (Blueprint $table) {
27
+                $table->string('discount_method')->default('per_document')->change();
28
+            });
29
+        }
30
+
31
+        if (Schema::hasColumn('invoices', 'discount_method')) {
32
+            Schema::table('invoices', function (Blueprint $table) {
33
+                $table->string('discount_method')->default('per_document')->change();
34
+            });
35
+        }
36
+    }
37
+};

Loading…
Cancel
Save