LAST ADJUSTMENT REQUEST

dev
ajikamaludin 1 year ago
parent 55e60e9147
commit 77fb50f7bf
Signed by: ajikamaludin
GPG Key ID: 476C9A2B4B794EBB

@ -17,7 +17,9 @@ class GeneralController extends Controller
$totalItem = SaleItem::whereHas('sale', function ($q) { $totalItem = SaleItem::whereHas('sale', function ($q) {
return $q->where('date', now()->format('m/d/Y')); return $q->where('date', now()->format('m/d/Y'));
})->sum('quantity'); })->sum('quantity');
$totalProduct = Product::count(); $totalItemPrice = SaleItem::whereHas('sale', function ($q) {
return $q->where('date', now()->format('m/d/Y'));
})->sum('price');
$totalCustomer = Customer::count(); $totalCustomer = Customer::count();
$startDate = now()->subDays(6)->format('m/d/Y'); $startDate = now()->subDays(6)->format('m/d/Y');
@ -65,7 +67,7 @@ class GeneralController extends Controller
return inertia('Dashboard', [ return inertia('Dashboard', [
'total_sale_today' => $totalSaleToday, 'total_sale_today' => $totalSaleToday,
'total_item_today' => $totalItem, 'total_item_today' => $totalItem,
'total_product' => $totalProduct, 'total_item_price_today' => $totalItemPrice,
'total_customer' => $totalCustomer, 'total_customer' => $totalCustomer,
'sale_days' => $charts, 'sale_days' => $charts,
'favorite_categories' => $dounat, 'favorite_categories' => $dounat,

@ -28,7 +28,7 @@ export default function Dashboard(props) {
const { const {
total_sale_today, total_sale_today,
total_item_today, total_item_today,
total_product, total_item_price_today,
total_customer, total_customer,
sale_days, sale_days,
list_favorite_product, list_favorite_product,
@ -50,13 +50,13 @@ export default function Dashboard(props) {
data: sale_days.map((item) => item.stotal), data: sale_days.map((item) => item.stotal),
// backgroundColor: 'rgb(87, 13, 248, 0.5)', //rgb(87, 13, 248, 0.5) //rgba(255, 99, 132, 0.5) // backgroundColor: 'rgb(87, 13, 248, 0.5)', //rgb(87, 13, 248, 0.5) //rgba(255, 99, 132, 0.5)
backgroundColor: [ backgroundColor: [
'rgba(201, 203, 207, 1)', // 'rgba(201, 203, 207, 1)',
'rgba(255, 159, 64, 1)', // 'rgba(255, 159, 64, 1)',
'rgba(255, 205, 86, 1)', 'rgba(255, 205, 86, 1)',
'rgba(75, 192, 192, 1)', // 'rgba(75, 192, 192, 1)',
'rgba(54, 162, 235, 1)', // 'rgba(54, 162, 235, 1)',
'rgba(153, 102, 255, 1)', // 'rgba(153, 102, 255, 1)',
'rgba(255, 99, 132, 1)', // 'rgba(255, 99, 132, 1)',
], ],
}, },
], ],
@ -149,13 +149,16 @@ export default function Dashboard(props) {
Hari Ini Hari Ini
</div> </div>
<div className="text-3xl font-bold"> <div className="text-3xl font-bold">
{total_item_today} Rp. {formatIDR(total_item_price_today)}
</div> </div>
</div> </div>
<div className="p-4 overflow-hidden shadow sm:rounded-lg bg-white"> <div className="p-4 overflow-hidden shadow sm:rounded-lg bg-white">
<div className="text-xl">Jumlah Barang</div> <div className="text-xl">
Jumlah Barang Terjual <br />
Hari Ini
</div>
<div className="text-3xl font-bold"> <div className="text-3xl font-bold">
{total_product} {total_item_today}
</div> </div>
</div> </div>
<div className="p-4 overflow-hidden shadow sm:rounded-lg bg-white"> <div className="p-4 overflow-hidden shadow sm:rounded-lg bg-white">
@ -179,7 +182,7 @@ export default function Dashboard(props) {
</div> </div>
<div className="overflow-auto bg-white p-4"> <div className="overflow-auto bg-white p-4">
<div className="text-xl pb-4"> <div className="text-xl pb-4">
Top Product of The Month Produk Paling laku terjual
</div> </div>
<Doughnut <Doughnut
data={dataDounat} data={dataDounat}

Loading…
Cancel
Save