mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
feat[BE]: membetulkan perhitungan hpp di module penjualan harian
This commit is contained in:
@@ -96,28 +96,8 @@ func (c *RepportController) GetMarketing(ctx *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Calculate total summary from result items
|
||||
var total *dto.Summary
|
||||
if len(result) > 0 {
|
||||
totalQty := 0
|
||||
totalWeightKg := 0.0
|
||||
totalSalesAmount := int64(0)
|
||||
totalHppAmount := int64(0)
|
||||
|
||||
for _, item := range result {
|
||||
totalQty += int(item.Qty)
|
||||
totalWeightKg += item.TotalWeightKg
|
||||
totalSalesAmount += int64(item.SalesAmount)
|
||||
totalHppAmount += int64(item.HppAmount)
|
||||
}
|
||||
|
||||
total = &dto.Summary{
|
||||
TotalQty: totalQty,
|
||||
TotalWeightKg: totalWeightKg,
|
||||
TotalSalesAmount: totalSalesAmount,
|
||||
TotalHppAmount: totalHppAmount,
|
||||
}
|
||||
}
|
||||
|
||||
total := dto.ToSummaryFromDTOItems(result)
|
||||
|
||||
return ctx.Status(fiber.StatusOK).
|
||||
JSON(MarketingReportResponse{
|
||||
|
||||
Reference in New Issue
Block a user