Browse Source

feat: top customer and report info

Muhammad Iqbal Afandi 4 years ago
parent
commit
049090a243

+ 21
- 18
app/Http/Controllers/CustomerController.php View File

97
                 ['label' => 'Perempuan', 'value' => 1],
97
                 ['label' => 'Perempuan', 'value' => 1],
98
                 ['label' => 'Laki-laki', 'value' => 2],
98
                 ['label' => 'Laki-laki', 'value' => 2],
99
             ],
99
             ],
100
-            'transactions' => $customer->transaction()
101
-                ->latest()
102
-                ->paginate(10)
103
-                ->withQueryString()
104
-                ->through(fn($transaction) => [
105
-                    'id' => $transaction->id,
106
-                    'transactionNumber' => $transaction->transaction_number,
107
-                    'createdAt' => $transaction->created_at,
108
-                    'customer' => [
109
-                        'number' => $customer->customer_number,
110
-                        'name' => $customer->name,
111
-                        'phone' => $customer->phone,
112
-                    ],
113
-                    'price' => $transaction->totalPriceAsFullString(),
114
-                    'outlet' => $transaction->outlet->name,
115
-                    'transactionStatusName' => $transaction->transactionStatus->name,
116
-                    'transactionStatusId' => $transaction->transactionStatus->id,
117
-                ]),
100
+            'transactions' => [
101
+                'details' => $customer->transaction()
102
+                    ->latest()
103
+                    ->paginate(10)
104
+                    ->withQueryString()
105
+                    ->through(fn($transaction) => [
106
+                        'id' => $transaction->id,
107
+                        'transactionNumber' => $transaction->transaction_number,
108
+                        'createdAt' => $transaction->created_at,
109
+                        'customer' => [
110
+                            'number' => $customer->customer_number,
111
+                            'name' => $customer->name,
112
+                            'phone' => $customer->phone,
113
+                        ],
114
+                        'price' => $transaction->totalPriceAsFullString(),
115
+                        'outlet' => $transaction->outlet->name,
116
+                        'transactionStatusName' => $transaction->transactionStatus->name,
117
+                        'transactionStatusId' => $transaction->transactionStatus->id,
118
+                    ]),
119
+                'totalTransaction' => $customer->transaction->count(),
120
+            ],
118
         ]);
121
         ]);
119
     }
122
     }
120
 
123
 

+ 13
- 4
app/Http/Controllers/DashboardController.php View File

33
 
33
 
34
         $products = Product::get();
34
         $products = Product::get();
35
 
35
 
36
-        $transactionChart = Transaction::get()->groupBy([
37
-            fn($transaction) => Carbon::parse($transaction->getRawOriginal('created_at'))->format('Y'),
38
-            fn($transaction) => Carbon::parse($transaction->getRawOriginal('created_at'))->format('M'),
39
-        ]);
36
+        $transactionChart = Transaction::get()
37
+            ->groupBy([
38
+                fn($transaction) => Carbon::parse($transaction->getRawOriginal('created_at'))->format('Y'),
39
+                fn($transaction) => Carbon::parse($transaction->getRawOriginal('created_at'))->format('M'),
40
+            ]);
40
 
41
 
41
         $mutationChart = Mutation::whereYear('created_at', date('Y'))
42
         $mutationChart = Mutation::whereYear('created_at', date('Y'))
42
             ->get()
43
             ->get()
53
                 fn($transaction) => $transaction->outlet->name,
54
                 fn($transaction) => $transaction->outlet->name,
54
             ]);
55
             ]);
55
 
56
 
57
+        $topTransactionChart = Transaction::get()
58
+            ->groupBy('customer_number');
59
+
56
         return inertia('home/Index', [
60
         return inertia('home/Index', [
57
             'cardStatistics' => [
61
             'cardStatistics' => [
58
                 [
62
                 [
99
                 'description' => Carbon::parse(date('Y-m-d'))->translatedFormat('F, Y'),
103
                 'description' => Carbon::parse(date('Y-m-d'))->translatedFormat('F, Y'),
100
                 'data' => (new TransactionService)->statisticData($transactionOutletChart)->first(),
104
                 'data' => (new TransactionService)->statisticData($transactionOutletChart)->first(),
101
             ],
105
             ],
106
+            'chartTopTransactionStatistic' => [
107
+                'title' => __('words.top_customer'),
108
+                'description' => __('words.top_number_customer', ['number' => 5]),
109
+                'data' => (new TransactionService)->topTransaction($topTransactionChart),
110
+            ],
102
         ]);
111
         ]);
103
     }
112
     }
104
 }
113
 }

+ 20
- 12
app/Http/Controllers/ReportMutationController.php View File

6
 use App\Http\Controllers\Controller;
6
 use App\Http\Controllers\Controller;
7
 use App\Models\Mutation;
7
 use App\Models\Mutation;
8
 use App\Models\Outlet;
8
 use App\Models\Outlet;
9
+use App\Services\MutationService;
9
 use Illuminate\Support\Facades\Gate;
10
 use Illuminate\Support\Facades\Gate;
10
 use Inertia\Inertia;
11
 use Inertia\Inertia;
11
 
12
 
24
             request()->merge(['outlet' => request()->user()->outlet_id]);
25
             request()->merge(['outlet' => request()->user()->outlet_id]);
25
         }
26
         }
26
 
27
 
28
+        $mutations = Mutation::filter(request()->only('startDate', 'endDate', 'outlet'));
29
+
27
         return inertia('mutation/Report', [
30
         return inertia('mutation/Report', [
28
             'filters' => request()->all('startDate', 'endDate', 'outlet'),
31
             'filters' => request()->all('startDate', 'endDate', 'outlet'),
29
             'mutations' => Inertia::lazy(
32
             'mutations' => Inertia::lazy(
30
-                fn() => Mutation::filter(request()->only('startDate', 'endDate', 'outlet'))
31
-                    ->latest()
32
-                    ->paginate(10)
33
-                    ->withQueryString()
34
-                    ->through(fn($mutation) => [
35
-                        'createdAt' => $mutation->created_at,
36
-                        'outlet' => $mutation->outlet->name,
37
-                        'amount' => $mutation->amount,
38
-                        'type' => $mutation->type,
39
-                        'transactionId' => $mutation->transaction_id,
40
-                        'expenseId' => $mutation->expense_id,
41
-                    ])
33
+                fn() => [
34
+                    'details' => $mutations
35
+                        ->latest()
36
+                        ->paginate(10)
37
+                        ->withQueryString()
38
+                        ->through(fn($mutation) => [
39
+                            'createdAt' => $mutation->created_at,
40
+                            'outlet' => $mutation->outlet->name,
41
+                            'amount' => $mutation->amount,
42
+                            'type' => $mutation->type,
43
+                            'transactionId' => $mutation->transaction_id,
44
+                            'expenseId' => $mutation->expense_id,
45
+                        ]),
46
+                    'totalIncome' => (new MutationService)->totalIncomeAsString($mutations->get()),
47
+                    'totalExpense' => (new MutationService)->totalExpenseAsString($mutations->get()),
48
+                    'totalAmount' => (new MutationService)->totalAmountAsString($mutations->get()),
49
+                ]
42
             ),
50
             ),
43
             'outlets' => Outlet::all()
51
             'outlets' => Outlet::all()
44
                 ->transform(fn($outlet) => [
52
                 ->transform(fn($outlet) => [

+ 9
- 5
app/Http/Controllers/ReportTransactionController.php View File

25
             request()->merge(['outlet' => request()->user()->outlet_id]);
25
             request()->merge(['outlet' => request()->user()->outlet_id]);
26
         }
26
         }
27
 
27
 
28
-        $transactions = Transaction::filter(request()->only('startDate', 'endDate', 'outlet'))
29
-            ->get()
30
-            ->groupBy('created_at')
28
+        $transactions = Transaction::filter(request()->only('startDate', 'endDate', 'outlet'))->get();
29
+
30
+        $transactionGroupBy = $transactions->groupBy('created_at')
31
             ->transform(fn($transactions) => [[
31
             ->transform(fn($transactions) => [[
32
                 'date' => $transactions->first()->getRawOriginal('created_at'),
32
                 'date' => $transactions->first()->getRawOriginal('created_at'),
33
                 'createdAt' => $transactions->first()->created_at,
33
                 'createdAt' => $transactions->first()->created_at,
37
             ->flatten(1)
37
             ->flatten(1)
38
             ->toArray();
38
             ->toArray();
39
 
39
 
40
-        $transaction = (new TransactionService)->getPaginator($transactions);
40
+        $transaction = (new TransactionService)->getPaginator($transactionGroupBy);
41
 
41
 
42
         return inertia('transaction/Report', [
42
         return inertia('transaction/Report', [
43
             'filters' => request()->all('startDate', 'endDate', 'outlet'),
43
             'filters' => request()->all('startDate', 'endDate', 'outlet'),
44
             'transactions' => Inertia::lazy(
44
             'transactions' => Inertia::lazy(
45
-                fn() => $transaction
45
+                fn() => [
46
+                    'details' => $transaction,
47
+                    'totalTransaction' => $transactions->count(),
48
+                    'totalAmount' => (new TransactionService)->totalPriceGroupAsString($transactions),
49
+                ]
46
             ),
50
             ),
47
             'outlets' => Outlet::all()
51
             'outlets' => Outlet::all()
48
                 ->transform(fn($outlet) => [
52
                 ->transform(fn($outlet) => [

+ 1
- 1
app/Services/ExpenseService.php View File

14
 
14
 
15
     public function totalPriceAsString(EloquentCollection $collection)
15
     public function totalPriceAsString(EloquentCollection $collection)
16
     {
16
     {
17
-        return (new CurrencyFormatService)->setRupiahFormat($this->totalPrice($collection), true);
17
+        return $this->setRupiahFormat($this->totalPrice($collection), true);
18
     }
18
     }
19
 
19
 
20
     public function totalPerMonth(EloquentCollection $collections)
20
     public function totalPerMonth(EloquentCollection $collections)

+ 1
- 1
app/Services/MutationService.php View File

39
         return $this->setRupiahFormat($this->totalExpense($collections), true);
39
         return $this->setRupiahFormat($this->totalExpense($collections), true);
40
     }
40
     }
41
 
41
 
42
-    public function totalAmount(EloquentCollection $collections)
42
+    public function totalAmountAsString(EloquentCollection $collections)
43
     {
43
     {
44
         $amount = $this->totalIncome($collections) - $this->totalExpense($collections);
44
         $amount = $this->totalIncome($collections) - $this->totalExpense($collections);
45
         return $this->setRupiahFormat($amount, true);
45
         return $this->setRupiahFormat($amount, true);

+ 13
- 0
app/Services/TransactionService.php View File

49
         $collections->transform(fn($collections) => $this->totalPerMonth($collections));
49
         $collections->transform(fn($collections) => $this->totalPerMonth($collections));
50
         return $collections;
50
         return $collections;
51
     }
51
     }
52
+
53
+    public function topTransaction(EloquentCollection $collections, int $take = 5)
54
+    {
55
+        return $collections
56
+            ->transform(fn($collect) => [[
57
+                'customerNumber' => $collect->first()->customer->customer_number,
58
+                'name' => $collect->first()->customer->name,
59
+                'totalPrice' => $this->totalPriceGroup($collect),
60
+            ]])
61
+            ->sortByDesc('totalPrice')
62
+            ->take($take)
63
+            ->flatten(1);
64
+    }
52
 }
65
 }

+ 2
- 0
lang/en/words.php View File

27
     'mutation_statistic' => 'Mutations Statistic',
27
     'mutation_statistic' => 'Mutations Statistic',
28
     'transaction_outlet_statistic' => 'Transaction Statistic/Outlet',
28
     'transaction_outlet_statistic' => 'Transaction Statistic/Outlet',
29
     'per_year' => 'Per Year',
29
     'per_year' => 'Per Year',
30
+    'top_customer' => 'Top customer',
31
+    'top_number_customer' => 'Top :number Customer',
30
 
32
 
31
 ];
33
 ];

+ 2
- 0
lang/id/words.php View File

27
     'mutation_statistic' => 'Statistik Mutasi',
27
     'mutation_statistic' => 'Statistik Mutasi',
28
     'transaction_outlet_statistic' => 'Statistik Transaksi/Outlet',
28
     'transaction_outlet_statistic' => 'Statistik Transaksi/Outlet',
29
     'per_year' => 'Pertahun',
29
     'per_year' => 'Pertahun',
30
+    'top_customer' => 'Top Pelanggan',
31
+    'top_number_customer' => 'Top :number Pelanggan',
30
 
32
 
31
 ];
33
 ];

+ 33
- 8
public/js/resources_js_pages_customer_Edit_vue.js View File

1535
 );
1535
 );
1536
 
1536
 
1537
 var _hoisted_12 = {
1537
 var _hoisted_12 = {
1538
-  "class": "grid"
1538
+  key: 0,
1539
+  "class": "grid mt-3 ml-1"
1539
 };
1540
 };
1540
 var _hoisted_13 = {
1541
 var _hoisted_13 = {
1542
+  "class": "col-auto"
1543
+};
1544
+
1545
+var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
1546
+  "class": "text-base"
1547
+}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
1548
+  "class": "pi pi-shopping-cart"
1549
+}), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Total Transaksi")], -1
1550
+/* HOISTED */
1551
+);
1552
+
1553
+var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
1554
+/* HOISTED */
1555
+);
1556
+
1557
+var _hoisted_16 = {
1558
+  "class": "text-xl font-bold"
1559
+};
1560
+var _hoisted_17 = {
1561
+  "class": "grid"
1562
+};
1563
+var _hoisted_18 = {
1541
   "class": "col-12"
1564
   "class": "col-12"
1542
 };
1565
 };
1543
-var _hoisted_14 = {
1566
+var _hoisted_19 = {
1544
   "class": "font-bold"
1567
   "class": "font-bold"
1545
 };
1568
 };
1546
-var _hoisted_15 = {
1569
+var _hoisted_20 = {
1547
   "class": "font-bold"
1570
   "class": "font-bold"
1548
 };
1571
 };
1549
 function render(_ctx, _cache, $props, $setup, $data, $options) {
1572
 function render(_ctx, _cache, $props, $setup, $data, $options) {
1635
         _: 1
1658
         _: 1
1636
         /* STABLE */
1659
         /* STABLE */
1637
 
1660
 
1638
-      })])]), _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_12, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
1661
+      })])]), _hoisted_11, $props.transactions.totalTransaction ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_12, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_14, _hoisted_15, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_16, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.transactions.totalTransaction), 1
1662
+      /* TEXT */
1663
+      )])])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
1639
         content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
1664
         content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
1640
           return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
1665
           return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
1641
             "responsive-layout": "scroll",
1666
             "responsive-layout": "scroll",
1642
             "column-resize-mode": "expand",
1667
             "column-resize-mode": "expand",
1643
-            value: $props.transactions.data,
1668
+            value: $props.transactions.details.data,
1644
             "row-hover": true,
1669
             "row-hover": true,
1645
             "striped-rows": true
1670
             "striped-rows": true
1646
           }, {
1671
           }, {
1656
                         field = _ref.field;
1681
                         field = _ref.field;
1657
                     return [field === 'transactionNumber' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
1682
                     return [field === 'transactionNumber' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
1658
                       key: 0
1683
                       key: 0
1659
-                    }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data[field]), 1
1684
+                    }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", _hoisted_19, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data[field]), 1
1660
                     /* TEXT */
1685
                     /* TEXT */
1661
                     ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data.createdAt), 1
1686
                     ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data.createdAt), 1
1662
                     /* TEXT */
1687
                     /* TEXT */
1664
                     /* STABLE_FRAGMENT */
1689
                     /* STABLE_FRAGMENT */
1665
                     )) : field === 'customer' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
1690
                     )) : field === 'customer' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
1666
                       key: 1
1691
                       key: 1
1667
-                    }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", _hoisted_15, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data.customer.number), 1
1692
+                    }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", _hoisted_20, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data.customer.number), 1
1668
                     /* TEXT */
1693
                     /* TEXT */
1669
                     ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data.customer.name), 1
1694
                     ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(data.customer.name), 1
1670
                     /* TEXT */
1695
                     /* TEXT */
1731
           }, 8
1756
           }, 8
1732
           /* PROPS */
1757
           /* PROPS */
1733
           , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
1758
           , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
1734
-            links: $props.transactions.links
1759
+            links: $props.transactions.details.links
1735
           }, null, 8
1760
           }, null, 8
1736
           /* PROPS */
1761
           /* PROPS */
1737
           , ["links"])];
1762
           , ["links"])];

+ 4859
- 182
public/js/resources_js_pages_home_Index_vue.js
File diff suppressed because it is too large
View File


+ 87
- 20
public/js/resources_js_pages_mutation_Report_vue.js View File

386
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
386
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
387
 /* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
387
 /* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
388
 /* harmony export */ });
388
 /* harmony export */ });
389
-/* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
390
-/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
389
+/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
390
+/* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
391
 /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
391
 /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
392
 /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
392
 /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
393
 /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);
393
 /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);
411
     mutations: {
411
     mutations: {
412
       type: Object,
412
       type: Object,
413
       "default": {
413
       "default": {
414
-        data: [],
415
-        links: [],
416
-        total: 0
414
+        details: {
415
+          data: [],
416
+          links: [],
417
+          total: 0
418
+        }
417
       }
419
       }
418
     },
420
     },
419
     filters: Object,
421
     filters: Object,
429
       endDate: props.filters.endDate,
431
       endDate: props.filters.endDate,
430
       outlet: props.filters.outlet
432
       outlet: props.filters.outlet
431
     });
433
     });
432
-    (0,vue__WEBPACK_IMPORTED_MODULE_1__.onMounted)(function () {
434
+    (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
433
       if (props.filters.startDate || props.filters.endDate) {
435
       if (props.filters.startDate || props.filters.endDate) {
434
         if (props.filters.endDate) {
436
         if (props.filters.endDate) {
435
           filterForm.dates = [new Date(props.filters.startDate), new Date(props.filters.endDate)];
437
           filterForm.dates = [new Date(props.filters.startDate), new Date(props.filters.endDate)];
438
         }
440
         }
439
       }
441
       }
440
     });
442
     });
441
-    (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)(filterForm, function () {
443
+    (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(filterForm, function () {
442
       if (filterForm.dates) {
444
       if (filterForm.dates) {
443
         if (filterForm.dates[1]) {
445
         if (filterForm.dates[1]) {
444
           filterForm.startDate = dayjs__WEBPACK_IMPORTED_MODULE_3___default()(filterForm.dates[0]).format('YYYY-MM-DD');
446
           filterForm.startDate = dayjs__WEBPACK_IMPORTED_MODULE_3___default()(filterForm.dates[0]).format('YYYY-MM-DD');
452
         filterForm.startDate = null;
454
         filterForm.startDate = null;
453
       }
455
       }
454
 
456
 
455
-      _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.reload({
457
+      _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
456
         data: lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()({
458
         data: lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()({
457
           startDate: filterForm.startDate,
459
           startDate: filterForm.startDate,
458
           endDate: filterForm.endDate,
460
           endDate: filterForm.endDate,
465
     });
467
     });
466
 
468
 
467
     var filterReset = function filterReset() {
469
     var filterReset = function filterReset() {
468
-      _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/reports/mutations');
470
+      _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/reports/mutations');
469
     };
471
     };
470
 
472
 
471
     var linkReference = function linkReference(data) {
473
     var linkReference = function linkReference(data) {
476
       }
478
       }
477
     };
479
     };
478
 
480
 
479
-    var exportExcelLink = (0,vue__WEBPACK_IMPORTED_MODULE_1__.ref)('/reports/mutations/export/excel');
481
+    var exportExcelLink = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)('/reports/mutations/export/excel');
480
     var __returned__ = {
482
     var __returned__ = {
481
       props: props,
483
       props: props,
482
       filterForm: filterForm,
484
       filterForm: filterForm,
483
       filterReset: filterReset,
485
       filterReset: filterReset,
484
       linkReference: linkReference,
486
       linkReference: linkReference,
485
       exportExcelLink: exportExcelLink,
487
       exportExcelLink: exportExcelLink,
486
-      Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
487
-      watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
488
-      computed: vue__WEBPACK_IMPORTED_MODULE_1__.computed,
489
-      onMounted: vue__WEBPACK_IMPORTED_MODULE_1__.onMounted,
490
-      ref: vue__WEBPACK_IMPORTED_MODULE_1__.ref,
488
+      watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
489
+      onMounted: vue__WEBPACK_IMPORTED_MODULE_0__.onMounted,
490
+      ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
491
+      Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
491
       Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
492
       Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
492
       useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm,
493
       useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm,
493
-      usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage,
494
       dayjs: (dayjs__WEBPACK_IMPORTED_MODULE_3___default()),
494
       dayjs: (dayjs__WEBPACK_IMPORTED_MODULE_3___default()),
495
       pickBy: (lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()),
495
       pickBy: (lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()),
496
       AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
496
       AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
1154
 var _hoisted_8 = {
1154
 var _hoisted_8 = {
1155
   "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
1155
   "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
1156
 };
1156
 };
1157
+var _hoisted_9 = {
1158
+  key: 0,
1159
+  "class": "grid mt-3 ml-1"
1160
+};
1161
+var _hoisted_10 = {
1162
+  "class": "col-auto mr-7"
1163
+};
1164
+
1165
+var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
1166
+  "class": "text-base"
1167
+}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
1168
+  "class": "pi pi-wallet"
1169
+}), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Pendapatan")], -1
1170
+/* HOISTED */
1171
+);
1172
+
1173
+var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
1174
+/* HOISTED */
1175
+);
1176
+
1177
+var _hoisted_13 = {
1178
+  "class": "text-xl font-bold"
1179
+};
1180
+var _hoisted_14 = {
1181
+  "class": "col-auto mr-7"
1182
+};
1183
+
1184
+var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
1185
+  "class": "text-base"
1186
+}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
1187
+  "class": "pi pi-wallet"
1188
+}), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Pengeluaran")], -1
1189
+/* HOISTED */
1190
+);
1191
+
1192
+var _hoisted_16 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
1193
+/* HOISTED */
1194
+);
1195
+
1196
+var _hoisted_17 = {
1197
+  "class": "text-xl font-bold"
1198
+};
1199
+var _hoisted_18 = {
1200
+  "class": "col-auto"
1201
+};
1202
+
1203
+var _hoisted_19 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
1204
+  "class": "text-base"
1205
+}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
1206
+  "class": "pi pi-wallet"
1207
+}), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Total")], -1
1208
+/* HOISTED */
1209
+);
1210
+
1211
+var _hoisted_20 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
1212
+/* HOISTED */
1213
+);
1214
+
1215
+var _hoisted_21 = {
1216
+  "class": "text-xl font-bold"
1217
+};
1157
 function render(_ctx, _cache, $props, $setup, $data, $options) {
1218
 function render(_ctx, _cache, $props, $setup, $data, $options) {
1158
   var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
1219
   var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
1159
 
1220
 
1172
       }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
1233
       }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
1173
         "responsive-layout": "scroll",
1234
         "responsive-layout": "scroll",
1174
         "column-resize-mode": "expand",
1235
         "column-resize-mode": "expand",
1175
-        value: $props.mutations.data,
1236
+        value: $props.mutations.details.data,
1176
         "row-hover": true,
1237
         "row-hover": true,
1177
         "striped-rows": true
1238
         "striped-rows": true
1178
       }, {
1239
       }, {
1205
             label: "reset",
1266
             label: "reset",
1206
             "class": "p-button-link",
1267
             "class": "p-button-link",
1207
             onClick: $setup.filterReset
1268
             onClick: $setup.filterReset
1208
-          })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [$props.mutations.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButton"], {
1269
+          })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [$props.mutations.details.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButton"], {
1209
             key: 0,
1270
             key: 0,
1210
             label: "Export excel",
1271
             label: "Export excel",
1211
             "class-button": "p-button-outlined md:w-16rem",
1272
             "class-button": "p-button-outlined md:w-16rem",
1214
             href: $setup.exportExcelLink
1275
             href: $setup.exportExcelLink
1215
           }, null, 8
1276
           }, null, 8
1216
           /* PROPS */
1277
           /* PROPS */
1217
-          , ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])])];
1278
+          , ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]), $props.mutations.totalAmount ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_11, _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalIncome), 1
1279
+          /* TEXT */
1280
+          )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_15, _hoisted_16, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_17, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalExpense), 1
1281
+          /* TEXT */
1282
+          )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_19, _hoisted_20, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_21, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalAmount), 1
1283
+          /* TEXT */
1284
+          )])])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
1218
         }),
1285
         }),
1219
         "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
1286
         "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
1220
           return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.TableHeader, function (tableHeader) {
1287
           return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.TableHeader, function (tableHeader) {
1249
       }, 8
1316
       }, 8
1250
       /* PROPS */
1317
       /* PROPS */
1251
       , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
1318
       , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
1252
-        links: $props.mutations.links
1319
+        links: $props.mutations.details.links
1253
       }, null, 8
1320
       }, null, 8
1254
       /* PROPS */
1321
       /* PROPS */
1255
       , ["links"])];
1322
       , ["links"])];

+ 55
- 9
public/js/resources_js_pages_transaction_Report_vue.js View File

411
     transactions: {
411
     transactions: {
412
       type: Object,
412
       type: Object,
413
       "default": {
413
       "default": {
414
-        data: [],
415
-        links: [],
416
-        total: 0
414
+        details: {
415
+          data: [],
416
+          links: [],
417
+          total: 0
418
+        }
417
       }
419
       }
418
     },
420
     },
419
     filters: Object,
421
     filters: Object,
475
       filterReset: filterReset,
477
       filterReset: filterReset,
476
       exportExcelLink: exportExcelLink,
478
       exportExcelLink: exportExcelLink,
477
       watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
479
       watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
478
-      computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
479
       onMounted: vue__WEBPACK_IMPORTED_MODULE_0__.onMounted,
480
       onMounted: vue__WEBPACK_IMPORTED_MODULE_0__.onMounted,
480
       ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
481
       ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
481
       Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
482
       Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
482
       Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
483
       Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
483
       useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm,
484
       useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.useForm,
484
-      usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage,
485
       dayjs: (dayjs__WEBPACK_IMPORTED_MODULE_3___default()),
485
       dayjs: (dayjs__WEBPACK_IMPORTED_MODULE_3___default()),
486
       pickBy: (lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()),
486
       pickBy: (lodash_pickBy__WEBPACK_IMPORTED_MODULE_4___default()),
487
       AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
487
       AppLayout: _layouts_AppLayout_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
1145
 var _hoisted_8 = {
1145
 var _hoisted_8 = {
1146
   "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
1146
   "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
1147
 };
1147
 };
1148
+var _hoisted_9 = {
1149
+  key: 0,
1150
+  "class": "grid mt-3 ml-1"
1151
+};
1152
+var _hoisted_10 = {
1153
+  "class": "col-auto mr-7"
1154
+};
1155
+
1156
+var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
1157
+  "class": "text-base"
1158
+}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
1159
+  "class": "pi pi-shopping-cart"
1160
+}), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Total Transaksi")], -1
1161
+/* HOISTED */
1162
+);
1163
+
1164
+var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
1165
+/* HOISTED */
1166
+);
1167
+
1168
+var _hoisted_13 = {
1169
+  "class": "text-xl font-bold"
1170
+};
1171
+var _hoisted_14 = {
1172
+  "class": "col-auto"
1173
+};
1174
+
1175
+var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
1176
+  "class": "text-base"
1177
+}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
1178
+  "class": "pi pi-wallet"
1179
+}), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Total Nilai")], -1
1180
+/* HOISTED */
1181
+);
1182
+
1183
+var _hoisted_16 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
1184
+/* HOISTED */
1185
+);
1186
+
1187
+var _hoisted_17 = {
1188
+  "class": "text-xl font-bold"
1189
+};
1148
 function render(_ctx, _cache, $props, $setup, $data, $options) {
1190
 function render(_ctx, _cache, $props, $setup, $data, $options) {
1149
   var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
1191
   var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
1150
 
1192
 
1163
       }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
1205
       }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
1164
         "responsive-layout": "scroll",
1206
         "responsive-layout": "scroll",
1165
         "column-resize-mode": "expand",
1207
         "column-resize-mode": "expand",
1166
-        value: $props.transactions.data,
1208
+        value: $props.transactions.details.data,
1167
         "row-hover": true,
1209
         "row-hover": true,
1168
         "striped-rows": true
1210
         "striped-rows": true
1169
       }, {
1211
       }, {
1196
             label: "reset",
1238
             label: "reset",
1197
             "class": "p-button-link",
1239
             "class": "p-button-link",
1198
             onClick: $setup.filterReset
1240
             onClick: $setup.filterReset
1199
-          })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [$props.transactions.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButton"], {
1241
+          })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [$props.transactions.details.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButton"], {
1200
             key: 0,
1242
             key: 0,
1201
             label: "Export excel",
1243
             label: "Export excel",
1202
             "class-button": "p-button-outlined md:w-16rem",
1244
             "class-button": "p-button-outlined md:w-16rem",
1205
             href: $setup.exportExcelLink
1247
             href: $setup.exportExcelLink
1206
           }, null, 8
1248
           }, null, 8
1207
           /* PROPS */
1249
           /* PROPS */
1208
-          , ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])])];
1250
+          , ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]), $props.transactions.totalAmount ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_11, _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.transactions.totalTransaction), 1
1251
+          /* TEXT */
1252
+          )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_15, _hoisted_16, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_17, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.transactions.totalAmount), 1
1253
+          /* TEXT */
1254
+          )])])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
1209
         }),
1255
         }),
1210
         "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
1256
         "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
1211
           return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.TransactionReportTable, function (tableHeader) {
1257
           return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.TransactionReportTable, function (tableHeader) {
1240
       }, 8
1286
       }, 8
1241
       /* PROPS */
1287
       /* PROPS */
1242
       , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
1288
       , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
1243
-        links: $props.transactions.links
1289
+        links: $props.transactions.details.links
1244
       }, null, 8
1290
       }, null, 8
1245
       /* PROPS */
1291
       /* PROPS */
1246
       , ["links"])];
1292
       , ["links"])];

+ 1
- 1
public/js/vue.js View File

58088
 /******/ 		// This function allow to reference async chunks
58088
 /******/ 		// This function allow to reference async chunks
58089
 /******/ 		__webpack_require__.u = (chunkId) => {
58089
 /******/ 		__webpack_require__.u = (chunkId) => {
58090
 /******/ 			// return url for filenames based on template
58090
 /******/ 			// return url for filenames based on template
58091
-/******/ 			return "js/" + chunkId + ".js?id=" + {"node_modules_chart_js_auto_auto_esm_js":"10c6b388645ceb22","resources_js_pages_auth_ForgotPassword_vue":"06e3fde2f6b5dfa3","resources_js_pages_auth_Login_vue":"0d70b4f828bb2ae3","resources_js_pages_auth_ResetPassword_vue":"2ba70d514b47ecff","resources_js_pages_auth_VerifyEmail_vue":"ebac28cf5fb51cfc","resources_js_pages_customer_Create_vue":"1220be5949d46569","resources_js_pages_customer_Edit_vue":"7571072c6961cb67","resources_js_pages_customer_Index_vue":"89aeb69bc7bf9125","resources_js_pages_customer_TableHeader_js":"71be5afdca048a9c","resources_js_pages_discount_Index_vue":"7a73e2119e6e6c6f","resources_js_pages_error_Error_vue":"39121f9961877130","resources_js_pages_expense_Create_vue":"8fa047c8fcff0fa3","resources_js_pages_expense_Index_vue":"b56d8a0027fef24c","resources_js_pages_expense_Show_vue":"e46cf4a28b9e732b","resources_js_pages_expense_TableHeader_js":"72e3dee74175b1c0","resources_js_pages_home_Index_vue":"1802df7736a203e0","resources_js_pages_laundry_Create_vue":"f5731b3f078c4bff","resources_js_pages_laundry_Edit_vue":"430f285b197d2fc1","resources_js_pages_laundry_Index_vue":"ee761f9e7d6e4502","resources_js_pages_laundry_TableHeader_js":"494e577855bbcaf6","resources_js_pages_mutation_Report_vue":"f53d6840d3891069","resources_js_pages_mutation_TableHeader_js":"82c2999bd7d098a1","resources_js_pages_outlet_Create_vue":"4958b1a88d1e03d1","resources_js_pages_outlet_Edit_vue":"3ce4dea5bd8e134a","resources_js_pages_outlet_Index_vue":"f58972cb6db52f4a","resources_js_pages_outlet_TableHeader_js":"498bf7e64bc0d0c4","resources_js_pages_product_Create_vue":"6f7ae2bf0addfd2c","resources_js_pages_product_Edit_vue":"aec56d000e33fbe6","resources_js_pages_product_Index_vue":"e73d3cd965bdbfb3","resources_js_pages_product_TableHeader_js":"b8eaaa9de25a2322","resources_js_pages_transaction_Create_vue":"04881653c83db0e8","resources_js_pages_transaction_Index_vue":"54a40dce85162abd","resources_js_pages_transaction_Report_vue":"8b3c37b617041b96","resources_js_pages_transaction_Show_vue":"bc1cb7b5161b5386","resources_js_pages_transaction_TableHeader_js":"be63e672e103818b","resources_js_pages_user_Create_vue":"9328027e33f14038","resources_js_pages_user_Edit_vue":"5e97bc1dbb553877","resources_js_pages_user_Index_vue":"bc60d10f530734f1","resources_js_pages_user_Show_vue":"0acbc3d158904cf1","resources_js_pages_user_TableHeader_js":"5653ecbcd70fd235"}[chunkId] + "";
58091
+/******/ 			return "js/" + chunkId + ".js?id=" + {"node_modules_chart_js_auto_auto_esm_js":"10c6b388645ceb22","resources_js_pages_auth_ForgotPassword_vue":"06e3fde2f6b5dfa3","resources_js_pages_auth_Login_vue":"0d70b4f828bb2ae3","resources_js_pages_auth_ResetPassword_vue":"2ba70d514b47ecff","resources_js_pages_auth_VerifyEmail_vue":"ebac28cf5fb51cfc","resources_js_pages_customer_Create_vue":"1220be5949d46569","resources_js_pages_customer_Edit_vue":"9b1098714289a805","resources_js_pages_customer_Index_vue":"89aeb69bc7bf9125","resources_js_pages_customer_TableHeader_js":"71be5afdca048a9c","resources_js_pages_discount_Index_vue":"7a73e2119e6e6c6f","resources_js_pages_error_Error_vue":"39121f9961877130","resources_js_pages_expense_Create_vue":"8fa047c8fcff0fa3","resources_js_pages_expense_Index_vue":"b56d8a0027fef24c","resources_js_pages_expense_Show_vue":"e46cf4a28b9e732b","resources_js_pages_expense_TableHeader_js":"72e3dee74175b1c0","resources_js_pages_home_Index_vue":"bf3cb4af92334410","resources_js_pages_laundry_Create_vue":"f5731b3f078c4bff","resources_js_pages_laundry_Edit_vue":"430f285b197d2fc1","resources_js_pages_laundry_Index_vue":"ee761f9e7d6e4502","resources_js_pages_laundry_TableHeader_js":"494e577855bbcaf6","resources_js_pages_mutation_Report_vue":"0c16f00427eb4815","resources_js_pages_mutation_TableHeader_js":"82c2999bd7d098a1","resources_js_pages_outlet_Create_vue":"4958b1a88d1e03d1","resources_js_pages_outlet_Edit_vue":"3ce4dea5bd8e134a","resources_js_pages_outlet_Index_vue":"f58972cb6db52f4a","resources_js_pages_outlet_TableHeader_js":"498bf7e64bc0d0c4","resources_js_pages_product_Create_vue":"6f7ae2bf0addfd2c","resources_js_pages_product_Edit_vue":"aec56d000e33fbe6","resources_js_pages_product_Index_vue":"e73d3cd965bdbfb3","resources_js_pages_product_TableHeader_js":"b8eaaa9de25a2322","resources_js_pages_transaction_Create_vue":"04881653c83db0e8","resources_js_pages_transaction_Index_vue":"54a40dce85162abd","resources_js_pages_transaction_Report_vue":"a3646e1ede56ed0d","resources_js_pages_transaction_Show_vue":"bc1cb7b5161b5386","resources_js_pages_transaction_TableHeader_js":"be63e672e103818b","resources_js_pages_user_Create_vue":"9328027e33f14038","resources_js_pages_user_Edit_vue":"5e97bc1dbb553877","resources_js_pages_user_Index_vue":"bc60d10f530734f1","resources_js_pages_user_Show_vue":"0acbc3d158904cf1","resources_js_pages_user_TableHeader_js":"5653ecbcd70fd235"}[chunkId] + "";
58092
 /******/ 		};
58092
 /******/ 		};
58093
 /******/ 	})();
58093
 /******/ 	})();
58094
 /******/ 	
58094
 /******/ 	

+ 13
- 2
resources/js/pages/customer/Edit.vue View File

112
     </div>
112
     </div>
113
 
113
 
114
     <h2>Riwayat Transaksi</h2>
114
     <h2>Riwayat Transaksi</h2>
115
+    <div v-if="transactions.totalTransaction" class="grid mt-3 ml-1">
116
+      <div class="col-auto">
117
+        <h2>
118
+          <span class="text-base"> <i class="pi pi-shopping-cart" /> Total Transaksi</span>
119
+
120
+          <br />
121
+
122
+          <span class="text-xl font-bold">{{ transactions.totalTransaction }}</span>
123
+        </h2>
124
+      </div>
125
+    </div>
115
     <div class="grid">
126
     <div class="grid">
116
       <div class="col-12">
127
       <div class="col-12">
117
         <Card>
128
         <Card>
119
             <DataTable
130
             <DataTable
120
               responsive-layout="scroll"
131
               responsive-layout="scroll"
121
               column-resize-mode="expand"
132
               column-resize-mode="expand"
122
-              :value="transactions.data"
133
+              :value="transactions.details.data"
123
               :row-hover="true"
134
               :row-hover="true"
124
               :striped-rows="true"
135
               :striped-rows="true"
125
             >
136
             >
165
               </Column>
176
               </Column>
166
             </DataTable>
177
             </DataTable>
167
 
178
 
168
-            <AppPagination :links="transactions.links" />
179
+            <AppPagination :links="transactions.details.links" />
169
           </template>
180
           </template>
170
         </Card>
181
         </Card>
171
       </div>
182
       </div>

+ 64
- 24
resources/js/pages/home/Index.vue View File

1
 <script setup>
1
 <script setup>
2
-import { onMounted } from 'vue'
3
 import { Head } from '@inertiajs/inertia-vue3'
2
 import { Head } from '@inertiajs/inertia-vue3'
3
+import orderBy from 'lodash/orderBy'
4
 import AppLayout from '@/layouts/AppLayout.vue'
4
 import AppLayout from '@/layouts/AppLayout.vue'
5
 
5
 
6
-const props = defineProps({
6
+defineProps({
7
   cardStatistics: Object,
7
   cardStatistics: Object,
8
   chartTransactionStatistics: Object,
8
   chartTransactionStatistics: Object,
9
   chartOutletStatistic: Object,
9
   chartOutletStatistic: Object,
10
+  chartTopTransactionStatistic: Object,
10
 })
11
 })
11
 
12
 
12
-onMounted(() => {
13
-  console.log(props.chartTransactionStatistics)
14
-  console.log(props.chartOutletStatistic)
15
-})
13
+const colors = [
14
+  '#349dcf',
15
+  '#00b2da',
16
+  '#00c7dd',
17
+  '#1fdbdb',
18
+  '#57eed3',
19
+  '#88ffc9',
20
+  '#96ed9a',
21
+  '#a8d96c',
22
+  '#bbc242',
23
+  '#cda91d',
24
+]
16
 
25
 
17
 const transactionBarData = (chartData) => {
26
 const transactionBarData = (chartData) => {
18
-  const colors = ['#17b6ff', '#ffb51c']
27
+  const colors = ['#349dcf', '#a8d96c']
19
 
28
 
20
   const data = {
29
   const data = {
21
     datasets: [],
30
     datasets: [],
36
 }
45
 }
37
 
46
 
38
 const transactionBarOption = {
47
 const transactionBarOption = {
39
-  responsive: true,
40
   maintainAspectRatio: false,
48
   maintainAspectRatio: false,
41
   datasetFill: false,
49
   datasetFill: false,
42
-  scales: {
43
-    y: {
44
-      ticks: {
45
-        beginAtZero: true,
46
-        callback: function (label) {
47
-          if (Math.floor(label) === label) {
48
-            return label
49
-          }
50
-        },
51
-      },
52
-    },
53
-  },
54
 }
50
 }
55
 
51
 
56
 const transactionOutletPieData = (chartData) => {
52
 const transactionOutletPieData = (chartData) => {
67
     datasets: [
63
     datasets: [
68
       {
64
       {
69
         data: data,
65
         data: data,
70
-        backgroundColor: ['#17b6ff', '#00c3f7', '#00cbdc', '#00d1b2', '#2bd281', '#86cf50', '#c5c623', '#ffb51c'],
66
+        backgroundColor: colors,
71
       },
67
       },
72
     ],
68
     ],
73
   }
69
   }
76
 const transactionOutletPieOption = {
72
 const transactionOutletPieOption = {
77
   maintainAspectRatio: false,
73
   maintainAspectRatio: false,
78
   datasetFill: false,
74
   datasetFill: false,
75
+}
76
+
77
+const topTransactionData = (chartData) => {
78
+  const labels = []
79
+  const data = []
80
+
81
+  for (const chartData of orderBy(chartData, ['totalPrice'], ['desc'])) {
82
+    labels.push([chartData.customerNumber, chartData.name])
83
+    data.push(chartData.totalPrice)
84
+  }
85
+
86
+  return {
87
+    labels: labels,
88
+    datasets: [
89
+      {
90
+        data: data,
91
+        backgroundColor: colors,
92
+      },
93
+    ],
94
+  }
95
+}
96
+
97
+const topTransactionOption = {
98
+  maintainAspectRatio: false,
99
+  datasetFill: false,
100
+  indexAxis: 'y',
79
   plugins: {
101
   plugins: {
80
     legend: {
102
     legend: {
81
-      labels: {
82
-        color: '#495057',
83
-      },
103
+      display: false,
84
     },
104
     },
85
   },
105
   },
86
 }
106
 }
145
           </template>
165
           </template>
146
         </Card>
166
         </Card>
147
       </div>
167
       </div>
168
+
169
+      <div class="col-12 md:col-6">
170
+        <Card>
171
+          <template #title>
172
+            <div class="flex flex-column">
173
+              <span>{{ chartTopTransactionStatistic.title }}</span>
174
+              <span class="text-base font-normal">{{ chartTopTransactionStatistic.description }}</span>
175
+            </div>
176
+          </template>
177
+          <template #content>
178
+            <Chart
179
+              type="bar"
180
+              :width="600"
181
+              :height="300"
182
+              :data="topTransactionData(chartTopTransactionStatistic.data)"
183
+              :options="topTransactionOption"
184
+            />
185
+          </template>
186
+        </Card>
187
+      </div>
148
     </div>
188
     </div>
149
   </AppLayout>
189
   </AppLayout>
150
 </template>
190
 </template>

+ 40
- 8
resources/js/pages/mutation/Report.vue View File

1
 <script setup>
1
 <script setup>
2
+import { watch, onMounted, ref } from 'vue'
2
 import { Inertia } from '@inertiajs/inertia'
3
 import { Inertia } from '@inertiajs/inertia'
3
-import { watch, computed, onMounted, ref } from 'vue'
4
-import { Head, useForm, usePage } from '@inertiajs/inertia-vue3'
4
+import { Head, useForm } from '@inertiajs/inertia-vue3'
5
 import dayjs from 'dayjs'
5
 import dayjs from 'dayjs'
6
 import pickBy from 'lodash/pickBy'
6
 import pickBy from 'lodash/pickBy'
7
 import AppLayout from '@/layouts/AppLayout.vue'
7
 import AppLayout from '@/layouts/AppLayout.vue'
14
   mutations: {
14
   mutations: {
15
     type: Object,
15
     type: Object,
16
     default: {
16
     default: {
17
-      data: [],
18
-      links: [],
19
-      total: 0,
17
+      details: {
18
+        data: [],
19
+        links: [],
20
+        total: 0,
21
+      },
20
     },
22
     },
21
   },
23
   },
22
   filters: Object,
24
   filters: Object,
89
     <DataTable
91
     <DataTable
90
       responsive-layout="scroll"
92
       responsive-layout="scroll"
91
       column-resize-mode="expand"
93
       column-resize-mode="expand"
92
-      :value="mutations.data"
94
+      :value="mutations.details.data"
93
       :row-hover="true"
95
       :row-hover="true"
94
       :striped-rows="true"
96
       :striped-rows="true"
95
     >
97
     >
126
           </div>
128
           </div>
127
           <div class="col-12 md:col-4 flex flex-column md:flex-row justify-content-end">
129
           <div class="col-12 md:col-4 flex flex-column md:flex-row justify-content-end">
128
             <AppButton
130
             <AppButton
129
-              v-if="mutations.total"
131
+              v-if="mutations.details.total"
130
               label="Export excel"
132
               label="Export excel"
131
               class-button="p-button-outlined md:w-16rem"
133
               class-button="p-button-outlined md:w-16rem"
132
               icon="pi pi-file-excel"
134
               icon="pi pi-file-excel"
135
             />
137
             />
136
           </div>
138
           </div>
137
         </div>
139
         </div>
140
+
141
+        <div v-if="mutations.totalAmount" class="grid mt-3 ml-1">
142
+          <div class="col-auto mr-7">
143
+            <h2>
144
+              <span class="text-base"> <i class="pi pi-wallet" /> Pendapatan</span>
145
+
146
+              <br />
147
+
148
+              <span class="text-xl font-bold">{{ mutations.totalIncome }}</span>
149
+            </h2>
150
+          </div>
151
+          <div class="col-auto mr-7">
152
+            <h2>
153
+              <span class="text-base"> <i class="pi pi-wallet" /> Pengeluaran</span>
154
+
155
+              <br />
156
+
157
+              <span class="text-xl font-bold">{{ mutations.totalExpense }}</span>
158
+            </h2>
159
+          </div>
160
+          <div class="col-auto">
161
+            <h2>
162
+              <span class="text-base"> <i class="pi pi-wallet" /> Total</span>
163
+
164
+              <br />
165
+
166
+              <span class="text-xl font-bold">{{ mutations.totalAmount }}</span>
167
+            </h2>
168
+          </div>
169
+        </div>
138
       </template>
170
       </template>
139
 
171
 
140
       <Column
172
       <Column
155
       </Column>
187
       </Column>
156
     </DataTable>
188
     </DataTable>
157
 
189
 
158
-    <AppPagination :links="mutations.links" />
190
+    <AppPagination :links="mutations.details.links" />
159
   </AppLayout>
191
   </AppLayout>
160
 </template>
192
 </template>

+ 30
- 8
resources/js/pages/transaction/Report.vue View File

1
 <script setup>
1
 <script setup>
2
-import { watch, computed, onMounted, ref } from 'vue'
2
+import { watch, onMounted, ref } from 'vue'
3
 import { Inertia } from '@inertiajs/inertia'
3
 import { Inertia } from '@inertiajs/inertia'
4
-import { Head, useForm, usePage } from '@inertiajs/inertia-vue3'
4
+import { Head, useForm } from '@inertiajs/inertia-vue3'
5
 import dayjs from 'dayjs'
5
 import dayjs from 'dayjs'
6
 import pickBy from 'lodash/pickBy'
6
 import pickBy from 'lodash/pickBy'
7
 import AppLayout from '@/layouts/AppLayout.vue'
7
 import AppLayout from '@/layouts/AppLayout.vue'
14
   transactions: {
14
   transactions: {
15
     type: Object,
15
     type: Object,
16
     default: {
16
     default: {
17
-      data: [],
18
-      links: [],
19
-      total: 0,
17
+      details: {
18
+        data: [],
19
+        links: [],
20
+        total: 0,
21
+      },
20
     },
22
     },
21
   },
23
   },
22
   filters: Object,
24
   filters: Object,
81
     <DataTable
83
     <DataTable
82
       responsive-layout="scroll"
84
       responsive-layout="scroll"
83
       column-resize-mode="expand"
85
       column-resize-mode="expand"
84
-      :value="transactions.data"
86
+      :value="transactions.details.data"
85
       :row-hover="true"
87
       :row-hover="true"
86
       :striped-rows="true"
88
       :striped-rows="true"
87
     >
89
     >
118
           </div>
120
           </div>
119
           <div class="col-12 md:col-4 flex flex-column md:flex-row justify-content-end">
121
           <div class="col-12 md:col-4 flex flex-column md:flex-row justify-content-end">
120
             <AppButton
122
             <AppButton
121
-              v-if="transactions.total"
123
+              v-if="transactions.details.total"
122
               label="Export excel"
124
               label="Export excel"
123
               class-button="p-button-outlined md:w-16rem"
125
               class-button="p-button-outlined md:w-16rem"
124
               icon="pi pi-file-excel"
126
               icon="pi pi-file-excel"
127
             />
129
             />
128
           </div>
130
           </div>
129
         </div>
131
         </div>
132
+        <div v-if="transactions.totalAmount" class="grid mt-3 ml-1">
133
+          <div class="col-auto mr-7">
134
+            <h2>
135
+              <span class="text-base"> <i class="pi pi-shopping-cart" /> Total Transaksi</span>
136
+
137
+              <br />
138
+
139
+              <span class="text-xl font-bold">{{ transactions.totalTransaction }}</span>
140
+            </h2>
141
+          </div>
142
+          <div class="col-auto">
143
+            <h2>
144
+              <span class="text-base"> <i class="pi pi-wallet" /> Total Nilai</span>
145
+
146
+              <br />
147
+
148
+              <span class="text-xl font-bold">{{ transactions.totalAmount }}</span>
149
+            </h2>
150
+          </div>
151
+        </div>
130
       </template>
152
       </template>
131
 
153
 
132
       <Column
154
       <Column
147
       </Column>
169
       </Column>
148
     </DataTable>
170
     </DataTable>
149
 
171
 
150
-    <AppPagination :links="transactions.links" />
172
+    <AppPagination :links="transactions.details.links" />
151
   </AppLayout>
173
   </AppLayout>
152
 </template>
174
 </template>

+ 3
- 3
resources/views/excel/mutation-report.blade.php View File

33
         </tr>
33
         </tr>
34
         <tr>
34
         <tr>
35
             <td colspan="3">Pendapatan</td>
35
             <td colspan="3">Pendapatan</td>
36
-            <td>{{ (new App\Services\MutationService)->totalIncomeAsString($mutations) }}</td>
36
+            <td>{{ (new App\Services\MutationService())->totalIncomeAsString($mutations) }}</td>
37
         </tr>
37
         </tr>
38
         <tr>
38
         <tr>
39
             <td colspan="3">Pengeluran</td>
39
             <td colspan="3">Pengeluran</td>
40
-            <td>{{ (new App\Services\MutationService)->totalExpenseAsString($mutations) }}</td>
40
+            <td>{{ (new App\Services\MutationService())->totalExpenseAsString($mutations) }}</td>
41
         </tr>
41
         </tr>
42
         <tr>
42
         <tr>
43
             <td colspan="3">Jumlah</td>
43
             <td colspan="3">Jumlah</td>
44
-            <td>{{ (new App\Services\MutationService)->totalAmount($mutations) }}</td>
44
+            <td>{{ (new App\Services\MutationService())->totalAmountAsString($mutations) }}</td>
45
         </tr>
45
         </tr>
46
     </tbody>
46
     </tbody>
47
 </table>
47
 </table>