mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
FIX[BE]: fixing umur on closing penjualan for penjualan OVK and PAKAN
This commit is contained in:
@@ -311,14 +311,11 @@ func (s salesOrdersService) UpdateOne(c *fiber.Ctx, req *validation.Update, id u
|
||||
}
|
||||
}
|
||||
|
||||
// Hitung total_weight dan total_price berdasarkan flag
|
||||
totalWeight := rp.Qty * rp.AvgWeight
|
||||
var totalPrice float64
|
||||
if isPakanOrOVK {
|
||||
// PAKAN atau OVK: qty × unit_price
|
||||
totalPrice = rp.Qty * rp.UnitPrice
|
||||
} else {
|
||||
// Produk lain: total_weight × unit_price
|
||||
totalPrice = totalWeight * rp.UnitPrice
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user