mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
fix(BE): edit customer, finance: bank optional, nominal minus, and filter
This commit is contained in:
@@ -20,7 +20,7 @@ type InitialRelationDTO struct {
|
||||
InitialBalanceType string `json:"initial_balance_type"`
|
||||
InitialBalanceTypeLabel string `json:"initial_balance_type_label"`
|
||||
Party Party `json:"party"`
|
||||
Bank bankDTO.BankRelationDTO `json:"bank,omitempty"`
|
||||
Bank *bankDTO.BankRelationDTO `json:"bank"`
|
||||
Direction string `json:"direction"`
|
||||
Nominal float64 `json:"nominal"`
|
||||
Notes string `json:"notes"`
|
||||
@@ -128,11 +128,12 @@ func partyFromInitial(e entity.Payment) Party {
|
||||
return party
|
||||
}
|
||||
|
||||
func bankFromInitial(e entity.Payment) bankDTO.BankRelationDTO {
|
||||
func bankFromInitial(e entity.Payment) *bankDTO.BankRelationDTO {
|
||||
if e.BankWarehouse.Id == 0 {
|
||||
return bankDTO.BankRelationDTO{}
|
||||
return nil
|
||||
}
|
||||
return bankDTO.ToBankRelationDTO(e.BankWarehouse)
|
||||
bank := bankDTO.ToBankRelationDTO(e.BankWarehouse)
|
||||
return &bank
|
||||
}
|
||||
|
||||
func userFromInitial(e entity.Payment) userDTO.UserRelationDTO {
|
||||
@@ -161,7 +162,7 @@ func initialBalanceLabel(balanceType string) string {
|
||||
}
|
||||
|
||||
func initialBalanceTypeFromPayment(e entity.Payment) string {
|
||||
if strings.EqualFold(e.Direction, "OUT") || e.Nominal < 0 {
|
||||
if e.Nominal < 0 {
|
||||
return "NEGATIVE"
|
||||
}
|
||||
return "POSITIVE"
|
||||
|
||||
Reference in New Issue
Block a user