refactor: remove status check in appendCostPreview method to streamline cost calculation in CuttingService and update labels for material cost in CuttingPosForm for improved clarity
This commit is contained in:
parent
e59c4baea6
commit
04897cb3bd
@ -950,10 +950,6 @@ private function appendCostPreview(Cutting $cutting): void
|
||||
$cutting->setAttribute('total_result_pieces', (int) $cutting->results->sum('cutting_result'));
|
||||
$cutting->setAttribute('total_material_usage', (float) $cutting->materials->sum('material_usage'));
|
||||
|
||||
if (! in_array($cutting->status, [CuttingStatus::COMPLETED, CuttingStatus::VERIFIED], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$totalMaterialCost = $cutting->total_material_cost ?? $this->calculateTotalMaterialCost($cutting);
|
||||
$sewingCost = (int) ($cutting->sewing_cost ?? 0);
|
||||
$otherCost = (int) ($cutting->other_cost ?? 0);
|
||||
|
||||
@ -1195,7 +1195,7 @@ function submit() {
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between gap-3 border-t pt-2 font-semibold">
|
||||
<span>Total Harga Modal</span>
|
||||
<span>Total Biaya Bahan</span>
|
||||
<span class="tabular-nums">{{ formatRupiah(totalMaterialCost) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -1292,7 +1292,7 @@ function submit() {
|
||||
</div>
|
||||
<div class="border-t pt-3">
|
||||
<div class="flex items-center justify-between text-sm font-semibold">
|
||||
<span>Total Harga Modal</span>
|
||||
<span>Total Biaya Bahan</span>
|
||||
<span class="text-primary">{{ formatRupiah(totalMaterialCost) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user