Update payment type

This commit is contained in:
aditya.siregar 2024-08-28 12:59:44 +07:00
parent 0b8c247045
commit 7aceb0488b
2 changed files with 9 additions and 1 deletions

View File

@ -240,3 +240,11 @@ type OrderPrintDetail struct {
Total float64 `gorm:"column:total"`
Fee float64 `gorm:"column:fee"`
}
func (o *OrderPrintDetail) GetPaymanetType() string {
if o.PaymentType == "CASH" {
return "TUNAI"
}
return o.PaymentType
}

View File

@ -460,7 +460,7 @@ func MapOrderToPrintDetailResponse(order *entity.OrderPrintDetail, casherName st
OrderID: order.OrderID,
Total: order.Total,
Fee: order.Fee,
PaymentType: order.PaymentType,
PaymentType: order.GetPaymanetType(),
Source: order.Source,
VisitDateAt: order.VisitDate.Format("2006-01-02"),
VisitTime: time.Now().Format("15:04:05"),