Muhammad Iqbal Afandi 3 лет назад
Родитель
Сommit
05d51391fe
32 измененных файлов: 132 добавлений и 173 удалений
  1. 2
    2
      app/Http/Controllers/PurchaseController.php
  2. 1
    1
      app/Http/Controllers/SalesController.php
  3. 6
    1
      app/Http/Controllers/UserController.php
  4. 5
    10
      app/Http/Requests/Company/StoreCompanyRequest.php
  5. 2
    2
      app/Http/Requests/Customer/StoreCustomerRequest.php
  6. 2
    2
      app/Http/Requests/Customer/UpdateCustomerRequest.php
  7. 4
    4
      app/Http/Requests/Product/StoreProductRequest.php
  8. 3
    3
      app/Http/Requests/Product/UpdateProductRequest.php
  9. 1
    1
      app/Http/Requests/Purchase/StorePurchaseRequest.php
  10. 2
    2
      app/Http/Requests/Sales/StoreSaleRequest.php
  11. 1
    3
      app/Http/Requests/Sales/UpdateSaleRequest.php
  12. 2
    2
      app/Http/Requests/Supplier/StoreSupplierRequest.php
  13. 2
    2
      app/Http/Requests/Supplier/UpdateSupplierRequest.php
  14. 1
    1
      app/Http/Requests/User/StoreUserRequest.php
  15. 1
    1
      app/Http/Requests/User/UpdateUserRequest.php
  16. 0
    1
      app/Models/Ppn.php
  17. 1
    1
      app/Models/PurchaseDetail.php
  18. 1
    1
      app/Models/Sale.php
  19. 71
    14
      app/Services/DashboardService.php
  20. 0
    1
      app/Services/ProductService.php
  21. 0
    1
      app/Services/PurchaseService.php
  22. 0
    71
      app/Services/QueryService.php
  23. 1
    1
      database/migrations/2022_04_20_031727_create_users_table.php
  24. 1
    4
      database/migrations/2022_07_20_094754_create_companies_table.php
  25. 3
    3
      lang/id/validation.php
  26. 6
    8
      resources/js/pages/Dashboards/Components/CardCart.vue
  27. 3
    18
      resources/js/pages/Dashboards/Index.vue
  28. 1
    1
      resources/js/pages/Purchases/config.js
  29. 1
    1
      resources/js/pages/Sales/config.js
  30. 4
    6
      resources/js/pages/Settings/Components/Ppn.vue
  31. 1
    1
      resources/js/pages/StockProducts/Index.vue
  32. 3
    3
      resources/views/Excel/Purchases/Export.blade.php

+ 2
- 2
app/Http/Controllers/PurchaseController.php Просмотреть файл

@@ -372,7 +372,7 @@ class PurchaseController extends Controller
372 372
                 ->withQueryString()
373 373
                 ->through(
374 374
                     fn($purchaseDetail) => [
375
-                        "createdAt" => $purchaseDetail->created_at,
375
+                        "updatedAt" => $purchaseDetail->updated_at,
376 376
                         "totalPrice" => FunctionService::rupiahFormat(
377 377
                             $purchaseDetail->price * $purchaseDetail->qty
378 378
                         ),
@@ -393,7 +393,7 @@ class PurchaseController extends Controller
393 393
                 ->get()
394 394
                 ->map(
395 395
                     fn($purchaseDetail) => [
396
-                        "createdAt" => $purchaseDetail->created_at,
396
+                        "updatedAt" => $purchaseDetail->updated_at,
397 397
                         "qty" => $purchaseDetail->qty,
398 398
                         "status" => $purchaseDetail->purchase->status,
399 399
                         "price" =>

+ 1
- 1
app/Http/Controllers/SalesController.php Просмотреть файл

@@ -41,7 +41,7 @@ class SalesController extends Controller
41 41
                 ->through(
42 42
                     fn($sale) => [
43 43
                         "id" => $sale->id,
44
-                        "updatedAt" => $sale->updated_at,
44
+                        "createdAt" => $sale->created_at,
45 45
                         "name" => $sale->customer->name,
46 46
                         "phone" => $sale->customer->phone,
47 47
                         "email" => $sale->customer->email,

+ 6
- 1
app/Http/Controllers/UserController.php Просмотреть файл

@@ -70,7 +70,12 @@ class UserController extends Controller
70 70
      */
71 71
     public function store(StoreUserRequest $request)
72 72
     {
73
-        User::create($request->validated());
73
+        $validated = $request
74
+            ->safe()
75
+            ->merge(["password" => bcrypt($request->username)])
76
+            ->all();
77
+
78
+        User::create($validated);
74 79
 
75 80
         return back()->with("success", __("messages.success.store.user"));
76 81
     }

+ 5
- 10
app/Http/Requests/Company/StoreCompanyRequest.php Просмотреть файл

@@ -24,16 +24,11 @@ class StoreCompanyRequest extends FormRequest
24 24
     public function rules()
25 25
     {
26 26
         return [
27
-            "name" => "required|string|max:25",
28
-            "address" => "required|string",
29
-            "telephone" =>
30
-                "required|numeric|digits_between:10,15|unique:companies,telephone," .
31
-                $this->id,
32
-            "email" =>
33
-                "string|email|nullable|unique:companies,email," . $this->id,
34
-            "npwp" =>
35
-                "required|numeric|digits_between:15,20|unique:companies,npwp," .
36
-                $this->id,
27
+            "name" => "required|string|max:50",
28
+            "address" => "required|string|max:200",
29
+            "telephone" => "required|numeric|digits_between:4,20",
30
+            "email" => "string|email|nullable",
31
+            "npwp" => "required|numeric|digits_between:15,20",
37 32
         ];
38 33
     }
39 34
 }

+ 2
- 2
app/Http/Requests/Customer/StoreCustomerRequest.php Просмотреть файл

@@ -25,9 +25,9 @@ class StoreCustomerRequest extends FormRequest
25 25
     {
26 26
         return [
27 27
             "name" => "required|string|max:50",
28
-            "address" => "required|string",
28
+            "address" => "required|string|max:200",
29 29
             "phone" =>
30
-                "required|numeric|digits_between:12,15|unique:customers,phone",
30
+                "required|numeric|digits_between:4,20|unique:customers,phone",
31 31
             "npwp" =>
32 32
                 "required|numeric|digits_between:15,20|unique:customers,npwp",
33 33
         ];

+ 2
- 2
app/Http/Requests/Customer/UpdateCustomerRequest.php Просмотреть файл

@@ -25,9 +25,9 @@ class UpdateCustomerRequest extends FormRequest
25 25
     {
26 26
         return [
27 27
             "name" => "required|string|max:50",
28
-            "address" => "required|string",
28
+            "address" => "required|string|max:200",
29 29
             "phone" =>
30
-                "required|numeric|digits_between:12,15|unique:customers,phone," .
30
+                "required|numeric|digits_between:4,20|unique:customers,phone," .
31 31
                 $this->customer->id,
32 32
             "npwp" =>
33 33
                 "required|numeric|digits_between:15,20|unique:customers,npwp," .

+ 4
- 4
app/Http/Requests/Product/StoreProductRequest.php Просмотреть файл

@@ -24,10 +24,10 @@ class StoreProductRequest extends FormRequest
24 24
     public function rules()
25 25
     {
26 26
         return [
27
-            "number" => "required|string|unique:products,number",
28
-            "name" => "required|string",
29
-            "unit" => "required|string",
30
-            "profit" => "numeric|digits_between:0,100",
27
+            "number" => "required|string",
28
+            "name" => "required|string|max:50",
29
+            "unit" => "required|string|max:25",
30
+            "profit" => "numeric|min:0|max:100",
31 31
         ];
32 32
     }
33 33
 }

+ 3
- 3
app/Http/Requests/Product/UpdateProductRequest.php Просмотреть файл

@@ -26,9 +26,9 @@ class UpdateProductRequest extends FormRequest
26 26
         return [
27 27
             "number" =>
28 28
                 "required|string|unique:products,number," . $this->product->id,
29
-            "name" => "required|string",
30
-            "unit" => "required|string",
31
-            "profit" => "numeric|digits_between:0,100",
29
+            "name" => "required|string|max:50",
30
+            "unit" => "required|string|max:25",
31
+            "profit" => "numeric|min:0|max:100",
32 32
         ];
33 33
     }
34 34
 }

+ 1
- 1
app/Http/Requests/Purchase/StorePurchaseRequest.php Просмотреть файл

@@ -26,9 +26,9 @@ class StorePurchaseRequest extends FormRequest
26 26
         return [
27 27
             "number" => "required|string|unique:sales,number",
28 28
             "status" => "required|string",
29
-            "ppn" => "required|boolean",
30 29
             "supplier_id" => "required|numeric",
31 30
             "products" => "required",
31
+            "ppn" => "required|boolean",
32 32
         ];
33 33
     }
34 34
 }

+ 2
- 2
app/Http/Requests/Sales/StoreSaleRequest.php Просмотреть файл

@@ -24,11 +24,11 @@ class StoreSaleRequest extends FormRequest
24 24
     public function rules()
25 25
     {
26 26
         return [
27
-            "number" => "required|string|unique:sales,number",
27
+            "number" => "required|string",
28 28
             "status" => "required|string",
29
-            "ppn" => "required|boolean",
30 29
             "customer_id" => "required|numeric",
31 30
             "products" => "required",
31
+            "ppn" => "required|boolean",
32 32
         ];
33 33
     }
34 34
 }

+ 1
- 3
app/Http/Requests/Sales/UpdateSaleRequest.php Просмотреть файл

@@ -24,9 +24,7 @@ class UpdateSaleRequest extends FormRequest
24 24
     public function rules()
25 25
     {
26 26
         return [
27
-            "status" => "required|string",
28
-            "products" => "required",
29
-            "ppn" => "required|boolean",
27
+            //
30 28
         ];
31 29
     }
32 30
 }

+ 2
- 2
app/Http/Requests/Supplier/StoreSupplierRequest.php Просмотреть файл

@@ -25,10 +25,10 @@ class StoreSupplierRequest extends FormRequest
25 25
     {
26 26
         return [
27 27
             "name" => "required|string|max:50",
28
-            "address" => "required|string",
28
+            "address" => "required|string|:max:200",
29 29
             "email" => "string|email|nullable|unique:suppliers,email",
30 30
             "phone" =>
31
-                "required|numeric|digits_between:12,15|unique:suppliers,phone",
31
+                "required|numeric|digits_between:12,20|unique:suppliers,phone",
32 32
             "npwp" =>
33 33
                 "required|numeric|digits_between:15,20|unique:suppliers,npwp",
34 34
         ];

+ 2
- 2
app/Http/Requests/Supplier/UpdateSupplierRequest.php Просмотреть файл

@@ -25,12 +25,12 @@ class UpdateSupplierRequest extends FormRequest
25 25
     {
26 26
         return [
27 27
             "name" => "required|string|max:50",
28
-            "address" => "required|string",
28
+            "address" => "required|string|max:200",
29 29
             "email" =>
30 30
                 "string|email|nullable|unique:suppliers,email," .
31 31
                 $this->supplier->id,
32 32
             "phone" =>
33
-                "required|numeric|digits_between:12,15|unique:suppliers,phone," .
33
+                "required|numeric|digits_between:12,20|unique:suppliers,phone," .
34 34
                 $this->supplier->id,
35 35
             "npwp" =>
36 36
                 "required|numeric|digits_between:15,20|unique:suppliers,npwp," .

+ 1
- 1
app/Http/Requests/User/StoreUserRequest.php Просмотреть файл

@@ -26,7 +26,7 @@ class StoreUserRequest extends FormRequest
26 26
         return [
27 27
             "name" => "required|string|max:50",
28 28
             "username" =>
29
-                "required|string|regex:/^\S*$/u|min:5|unique:users,username",
29
+                "required|string|regex:/^\S*$/u|min:6|max:25|unique:users,username",
30 30
             "role_id" => "required|numeric",
31 31
         ];
32 32
     }

+ 1
- 1
app/Http/Requests/User/UpdateUserRequest.php Просмотреть файл

@@ -26,7 +26,7 @@ class UpdateUserRequest extends FormRequest
26 26
         return [
27 27
             "name" => "required|string|max:50",
28 28
             "username" =>
29
-                "required|string|regex:/^\S*$/u|min:5|unique:users,username," .
29
+                "required|string|regex:/^\S*$/u|min:6|max:25|unique:users,username," .
30 30
                 $this->user->id,
31 31
             "role_id" => "required|numeric",
32 32
         ];

+ 0
- 1
app/Models/Ppn.php Просмотреть файл

@@ -2,7 +2,6 @@
2 2
 
3 3
 namespace App\Models;
4 4
 
5
-use Illuminate\Database\Eloquent\Casts\Attribute;
6 5
 use Illuminate\Database\Eloquent\Factories\HasFactory;
7 6
 use Illuminate\Database\Eloquent\Model;
8 7
 

+ 1
- 1
app/Models/PurchaseDetail.php Просмотреть файл

@@ -14,7 +14,7 @@ class PurchaseDetail extends Model
14 14
 
15 15
     protected $fillable = ["price", "qty", "purchase_number", "product_number"];
16 16
 
17
-    protected function createdAt(): Attribute
17
+    protected function updatedAt(): Attribute
18 18
     {
19 19
         return Attribute::make(
20 20
             get: fn($value) => Carbon::parse($value)->translatedFormat(

+ 1
- 1
app/Models/Sale.php Просмотреть файл

@@ -15,7 +15,7 @@ class Sale extends Model
15 15
 
16 16
     protected $with = ["saleDetail.product", "customer"];
17 17
 
18
-    protected function updatedAt(): Attribute
18
+    protected function createdAt(): Attribute
19 19
     {
20 20
         return Attribute::make(
21 21
             get: fn($value) => Carbon::parse($value)->translatedFormat(

+ 71
- 14
app/Services/DashboardService.php Просмотреть файл

@@ -2,6 +2,7 @@
2 2
 
3 3
 namespace App\Services;
4 4
 
5
+use Carbon\Carbon;
5 6
 use Illuminate\Support\Facades\DB;
6 7
 
7 8
 class DashboardService
@@ -35,22 +36,18 @@ class DashboardService
35 36
     {
36 37
         return [
37 38
             "data" => [
38
-                QueryService::amount(
39
-                    "sales",
40
-                    __("words.sale"),
41
-                    __("words.today")
42
-                ),
43
-                QueryService::amount(
39
+                self::amount("sales", __("words.sale"), __("words.today")),
40
+                self::amount(
44 41
                     "purchases",
45 42
                     __("words.purchase"),
46 43
                     __("words.today")
47 44
                 ),
48
-                QueryService::amount(
45
+                self::amount(
49 46
                     "products",
50 47
                     __("words.product"),
51 48
                     __("words.today")
52 49
                 ),
53
-                QueryService::amount(
50
+                self::amount(
54 51
                     "stock_products",
55 52
                     __("words.stock_product"),
56 53
                     __("words.today")
@@ -67,10 +64,8 @@ class DashboardService
67 64
                 "number" => now()->translatedFormat("Y"),
68 65
             ]),
69 66
             "data" => [
70
-                __("words.sale") => QueryService::amountStatistic("sales"),
71
-                __("words.purchase") => QueryService::amountStatistic(
72
-                    "purchases"
73
-                ),
67
+                __("words.sale") => self::amountStatistic("sales"),
68
+                __("words.purchase") => self::amountStatistic("purchases"),
74 69
             ],
75 70
         ];
76 71
     }
@@ -79,7 +74,7 @@ class DashboardService
79 74
     {
80 75
         return [
81 76
             "title" => __("words.sale"),
82
-            "data" => QueryService::priceStatistic("sale_details"),
77
+            "data" => self::priceStatistic("sale_details"),
83 78
         ];
84 79
     }
85 80
 
@@ -87,10 +82,72 @@ class DashboardService
87 82
     {
88 83
         return [
89 84
             "title" => __("words.purchase"),
90
-            "data" => QueryService::priceStatistic("purchase_details"),
85
+            "data" => self::priceStatistic("purchase_details"),
91 86
         ];
92 87
     }
93 88
 
89
+    public static function amount(
90
+        string $table,
91
+        string $title,
92
+        string $description
93
+    ) {
94
+        return DB::table($table)
95
+            ->selectRaw(
96
+                "COUNT(*) AS amount, (
97
+                 SELECT
98
+                    COUNT(*)
99
+                 FROM
100
+                    products
101
+                 WHERE
102
+                    DATE(created_at) = CURDATE()) AS amountToday"
103
+            )
104
+            ->get()
105
+            ->transform(
106
+                fn($table) => [
107
+                    "title" => $title,
108
+                    "amount" => $table->amount,
109
+                    "amountToday" => $table->amountToday,
110
+                    "amountTodayDescription" => $description,
111
+                ]
112
+            )
113
+            ->first();
114
+    }
115
+
116
+    public static function amountStatistic(string $table)
117
+    {
118
+        return DB::table($table)
119
+            ->selectRaw(
120
+                "COUNT(*) AS amount,
121
+                 DATE_FORMAT(created_at, '%b') AS month"
122
+            )
123
+            ->whereRaw("YEAR(created_at) = YEAR(CURDATE())")
124
+            ->groupByRaw("month")
125
+            ->orderByRaw("created_at")
126
+            ->get()
127
+            ->pluck("amount", "month");
128
+    }
129
+
130
+    public static function priceStatistic(string $table)
131
+    {
132
+        return DB::table($table)
133
+            ->selectRaw(
134
+                "price,
135
+                 created_at"
136
+            )
137
+            ->orderByRaw("created_at")
138
+            ->get()
139
+            ->groupBy([
140
+                fn($value) => Carbon::parse($value->created_at)->format("Y"),
141
+                fn($value) => Carbon::parse($value->created_at)->format("M"),
142
+            ])
143
+            ->take(2)
144
+            ->transform(
145
+                fn($year) => $year->transform(
146
+                    fn($month) => $month->sum(fn($arr) => $arr->price)
147
+                )
148
+            );
149
+    }
150
+
94 151
     public static function dump()
95 152
     {
96 153
         return dd(

+ 0
- 1
app/Services/ProductService.php Просмотреть файл

@@ -3,7 +3,6 @@
3 3
 namespace App\Services;
4 4
 
5 5
 use App\Models\Product;
6
-use Illuminate\Support\Facades\DB;
7 6
 
8 7
 class ProductService
9 8
 {

+ 0
- 1
app/Services/PurchaseService.php Просмотреть файл

@@ -3,7 +3,6 @@
3 3
 namespace App\Services;
4 4
 
5 5
 use App\Models\Purchase;
6
-use Illuminate\Support\Facades\DB;
7 6
 
8 7
 class PurchaseService
9 8
 {

+ 0
- 71
app/Services/QueryService.php Просмотреть файл

@@ -1,71 +0,0 @@
1
-<?php
2
-
3
-namespace App\Services;
4
-
5
-use Carbon\Carbon;
6
-use Illuminate\Support\Facades\DB;
7
-
8
-class QueryService
9
-{
10
-    public static function amount(
11
-        string $table,
12
-        string $title,
13
-        string $description
14
-    ) {
15
-        return DB::table($table)
16
-            ->selectRaw(
17
-                "COUNT(*) AS amount, (
18
-                 SELECT
19
-                    COUNT(*)
20
-                 FROM
21
-                    products
22
-                 WHERE
23
-                    DATE(created_at) = CURDATE()) AS amountToday"
24
-            )
25
-            ->get()
26
-            ->transform(
27
-                fn($table) => [
28
-                    "title" => $title,
29
-                    "amount" => $table->amount,
30
-                    "amountToday" => $table->amountToday,
31
-                    "amountTodayDescription" => $description,
32
-                ]
33
-            )
34
-            ->first();
35
-    }
36
-
37
-    public static function amountStatistic(string $table)
38
-    {
39
-        return DB::table($table)
40
-            ->selectRaw(
41
-                "COUNT(*) AS amount,
42
-                 DATE_FORMAT(created_at, '%b') AS month"
43
-            )
44
-            ->whereRaw("YEAR(created_at) = YEAR(CURDATE())")
45
-            ->groupByRaw("month")
46
-            ->orderByRaw("created_at")
47
-            ->get()
48
-            ->pluck("amount", "month");
49
-    }
50
-
51
-    public static function priceStatistic(string $table)
52
-    {
53
-        return DB::table($table)
54
-            ->selectRaw(
55
-                "price,
56
-                 created_at"
57
-            )
58
-            ->orderByRaw("created_at")
59
-            ->get()
60
-            ->groupBy([
61
-                fn($value) => Carbon::parse($value->created_at)->format("Y"),
62
-                fn($value) => Carbon::parse($value->created_at)->format("M"),
63
-            ])
64
-            ->take(2)
65
-            ->transform(
66
-                fn($year) => $year->transform(
67
-                    fn($month) => $month->sum(fn($arr) => $arr->price)
68
-                )
69
-            );
70
-    }
71
-}

+ 1
- 1
database/migrations/2022_04_20_031727_create_users_table.php Просмотреть файл

@@ -17,7 +17,7 @@ return new class extends Migration
17 17
             $table->id();
18 18
             $table->string('name');
19 19
             $table->string('username')->unique();
20
-            $table->string('password')->default(bcrypt('12345678'));
20
+            $table->string('password');
21 21
             $table->boolean('status')->default(true); // true(active) false(not active)
22 22
             $table->foreignId('role_id')->constrained();
23 23
             $table->rememberToken();

+ 1
- 4
database/migrations/2022_07_20_094754_create_companies_table.php Просмотреть файл

@@ -17,10 +17,7 @@ return new class extends Migration {
17 17
             $table->string("name");
18 18
             $table->string("address");
19 19
             $table->string("telephone");
20
-            $table
21
-                ->string("email")
22
-                ->unique()
23
-                ->nullable();
20
+            $table->string("email")->nullable();
24 21
             $table->string("npwp");
25 22
             $table->timestamps();
26 23
         });

+ 3
- 3
lang/id/validation.php Просмотреть файл

@@ -18,7 +18,7 @@ return [
18 18
     'active_url' => 'Nilai is not a valid URL.',
19 19
     'after' => 'Tanggal harus setelah tanggal :date.',
20 20
     'after_or_equal' => 'Tanggal harus setelah atau sama dengan :date.',
21
-    'alpha' => 'Nilai harus only contain letters.',
21
+    'alpha' => 'Nilai hanya boleh berisi huruf.',
22 22
     'alpha_dash' => 'Nilai harus only contain letters, numbers, dashes and underscores.',
23 23
     'alpha_num' => 'Nilai harus only contain letters and numbers.',
24 24
     'array' => 'Nilai harus be an array.',
@@ -79,7 +79,7 @@ return [
79 79
         'array' => 'Nilai harus not have more than :value items.',
80 80
     ],
81 81
     'max' => [
82
-        'numeric' => 'Nilai harus :max angka.',
82
+        'numeric' => 'Nilai maksimal harus :max angka.',
83 83
         'file' => 'Nilai harus not be greater than :max kilobytes.',
84 84
         'string' => 'Nilai harus :max karakter.',
85 85
         'array' => 'Nilai harus not have more than :max items.',
@@ -87,7 +87,7 @@ return [
87 87
     'mimes' => 'Harus berupa file dengan format: :values.',
88 88
     'mimetypes' => 'Nilai harus be a file of type: :values.',
89 89
     'min' => [
90
-        'numeric' => 'Nilai harus :min angka.',
90
+        'numeric' => 'Nilai minimal harus :min angka.',
91 91
         'file' => 'Nilai harus be at least :min kilobytes.',
92 92
         'string' => 'Nilai harus :min karakter.',
93 93
         'array' => 'Nilai harus have at least :min items.',

+ 6
- 8
resources/js/pages/Dashboards/Components/CardCart.vue Просмотреть файл

@@ -1,19 +1,17 @@
1 1
 <script setup>
2 2
 defineProps({
3
-  title: {
4
-    type: String,
5
-  },
6
-  description: {
7
-    type: String,
3
+  data: {
4
+    required: true,
5
+    type: Object,
8 6
   },
9 7
 })
10 8
 </script>
11 9
 
12 10
 <template>
13 11
   <div class="card">
14
-    <h5 class="mb-1">{{ title }}</h5>
15
-    <span>{{ description }}</span>
12
+    <h5 class="mb-1">{{ data.title }}</h5>
13
+    <span>{{ data.description }}</span>
16 14
 
17
-    <Chart v-bind="$attrs" />
15
+    <Chart :type="$attrs.type" :data="data.data" />
18 16
   </div>
19 17
 </template>

+ 3
- 18
resources/js/pages/Dashboards/Index.vue Просмотреть файл

@@ -41,12 +41,7 @@ const purchasePriceStatistic = useStatisticDualYear(
41 41
           </div>
42 42
 
43 43
           <div class="col-12">
44
-            <CardCart
45
-              type="line"
46
-              :title="salePurchaseAmountStatistic.title"
47
-              :description="salePurchaseAmountStatistic.description"
48
-              :data="salePurchaseAmountStatistic.data"
49
-            />
44
+            <CardCart type="line" :data="salePurchaseAmountStatistic" />
50 45
           </div>
51 46
         </div>
52 47
       </div>
@@ -54,21 +49,11 @@ const purchasePriceStatistic = useStatisticDualYear(
54 49
       <div class="col-12 xl:col-6">
55 50
         <div class="grid">
56 51
           <div class="col-12">
57
-            <CardCart
58
-              type="bar"
59
-              :title="salePriceStatistic.title"
60
-              :description="salePriceStatistic.description"
61
-              :data="salePriceStatistic.data"
62
-            />
52
+            <CardCart type="bar" :data="salePriceStatistic" />
63 53
           </div>
64 54
 
65 55
           <div class="col-12">
66
-            <CardCart
67
-              type="bar"
68
-              :title="purchasePriceStatistic.title"
69
-              :description="purchasePriceStatistic.description"
70
-              :data="purchasePriceStatistic.data"
71
-            />
56
+            <CardCart type="bar" :data="purchasePriceStatistic" />
72 57
           </div>
73 58
         </div>
74 59
       </div>

+ 1
- 1
resources/js/pages/Purchases/config.js Просмотреть файл

@@ -39,7 +39,7 @@ export const cartTable = [
39 39
 ]
40 40
 
41 41
 export const reportTable = [
42
-  { field: 'createdAt', header: 'Tanggal' },
42
+  { field: 'updatedAt', header: 'Tanggal' },
43 43
   { field: 'totalPrice', header: 'Total Harga' },
44 44
   { field: 'qty', header: 'Kuantitas' },
45 45
   { field: 'status', header: 'Status' },

+ 1
- 1
resources/js/pages/Sales/config.js Просмотреть файл

@@ -10,7 +10,7 @@ export const optionStatus = [
10 10
 ]
11 11
 
12 12
 export const indexTable = [
13
-  { field: 'updatedAt', header: 'Tanggal' },
13
+  { field: 'createdAt', header: 'Tanggal' },
14 14
   { field: 'name', header: 'Nama Pelanggan' },
15 15
   { field: 'phone', header: 'No HP Pelanggan' },
16 16
   { field: 'price', header: 'Total Harga' },

+ 4
- 6
resources/js/pages/Settings/Components/Ppn.vue Просмотреть файл

@@ -16,13 +16,11 @@ const { state, setState } = useState()
16 16
 const onSubmit = () => {
17 17
   setState()
18 18
 
19
-  if (state.disable) {
20
-    if (!form.ppn) {
21
-      form.ppn = 0
22
-    }
23
-
24
-    form.post(route('ppn.store'))
19
+  if (!form.ppn) {
20
+    form.ppn = 0
25 21
   }
22
+
23
+  form.post(route('ppn.store'))
26 24
 }
27 25
 </script>
28 26
 

+ 1
- 1
resources/js/pages/StockProducts/Index.vue Просмотреть файл

@@ -5,8 +5,8 @@ import AppPagination from '@/components/AppPagination.vue'
5 5
 import DashboardLayout from '@/layouts/Dashboard/DashboardLayout.vue'
6 6
 
7 7
 defineProps({
8
-  stockProducts: Object,
9 8
   initialFilters: Object,
9
+  stockProducts: Object,
10 10
 })
11 11
 </script>
12 12
 

+ 3
- 3
resources/views/Excel/Purchases/Export.blade.php Просмотреть файл

@@ -5,9 +5,9 @@
5 5
         </tr>
6 6
         <tr>
7 7
             <th colspan="5" rowspan="2">{{ __('words.period', ['number' => '']) }}
8
-                {{ $purchases->first()['createdAt'] }}
8
+                {{ $purchases->first()['updatedAt'] }}
9 9
                 -
10
-                {{ $purchases->last()['createdAt'] }} </th>
10
+                {{ $purchases->last()['updatedAt'] }} </th>
11 11
         </tr>
12 12
         <tr></tr>
13 13
         <tr>
@@ -22,7 +22,7 @@
22 22
         @foreach ($purchases as $index => $purchase)
23 23
             <tr>
24 24
                 <td>{{ ++$index }}</td>
25
-                <td>{{ $purchase['createdAt'] }}</td>
25
+                <td>{{ $purchase['updatedAt'] }}</td>
26 26
                 <td>{{ $purchase['qty'] }}</td>
27 27
                 <td>{{ $purchase['status'] }}</td>
28 28
                 <td>{{ $purchase['price'] }}</td>