From e59c4baea6b6e74a147e934e0e6882251f3dcbfe Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Sun, 21 Jun 2026 11:23:39 +0700 Subject: [PATCH] refactor: standardize material usage formatting to two decimal places across cutting management components for improved consistency --- .../table/CuttingCompletedSection.vue | 226 +++++++++--------- .../cuttings/table/CuttingGroupedTable.vue | 8 +- .../table/CuttingInProgressSection.vue | 204 +++++++--------- 3 files changed, 212 insertions(+), 226 deletions(-) diff --git a/resources/js/pages/admin/manage/cuttings/table/CuttingCompletedSection.vue b/resources/js/pages/admin/manage/cuttings/table/CuttingCompletedSection.vue index 0dd022b..3437537 100644 --- a/resources/js/pages/admin/manage/cuttings/table/CuttingCompletedSection.vue +++ b/resources/js/pages/admin/manage/cuttings/table/CuttingCompletedSection.vue @@ -1,20 +1,16 @@ diff --git a/resources/js/pages/admin/manage/cuttings/table/CuttingGroupedTable.vue b/resources/js/pages/admin/manage/cuttings/table/CuttingGroupedTable.vue index 22f1e44..203046c 100644 --- a/resources/js/pages/admin/manage/cuttings/table/CuttingGroupedTable.vue +++ b/resources/js/pages/admin/manage/cuttings/table/CuttingGroupedTable.vue @@ -148,14 +148,14 @@ function formatTotalMaterialUsage(totalUsage: number | null | undefined, materia const unit = materials[0]?.raw_material_price?.raw_material?.unit; if (unit === 'yard') { - return (totalUsage * CM_PER_YARD).toFixed(4); + return (totalUsage * CM_PER_YARD).toFixed(2); } if (unit === 'meter') { - return (totalUsage * CM_PER_METER).toFixed(4); + return (totalUsage * CM_PER_METER).toFixed(2); } - return totalUsage.toFixed(4); + return totalUsage.toFixed(2); } function getTotalMaterialUsageUnit(materials: any[]): string { @@ -207,6 +207,8 @@ function getTotalMaterialUsageUnit(materials: any[]): string { Total Pemakaian Bahan {{ formatTotalMaterialUsage(cutting.total_material_usage, cutting.materials) }} {{ getTotalMaterialUsageUnit(cutting.materials) }} + Biaya Bahan {{ + cutting.total_material_cost_formatted ?? 'Rp 0' }} diff --git a/resources/js/pages/admin/manage/cuttings/table/CuttingInProgressSection.vue b/resources/js/pages/admin/manage/cuttings/table/CuttingInProgressSection.vue index 22f3521..5a329f4 100644 --- a/resources/js/pages/admin/manage/cuttings/table/CuttingInProgressSection.vue +++ b/resources/js/pages/admin/manage/cuttings/table/CuttingInProgressSection.vue @@ -1,20 +1,7 @@