mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix(BE): add party account number in payments
This commit is contained in:
@@ -124,20 +124,25 @@ func ToTransactionDetailDTO(e entity.Payment) TransactionDetailDTO {
|
||||
|
||||
func partyFromPayment(e entity.Payment) Party {
|
||||
party := Party{
|
||||
Id: e.PartyId,
|
||||
Type: e.PartyType,
|
||||
Id: e.PartyId,
|
||||
Type: e.PartyType,
|
||||
}
|
||||
if e.PartyAccountNumber != nil {
|
||||
party.AccountNumber = *e.PartyAccountNumber
|
||||
}
|
||||
|
||||
switch utils.PaymentParty(e.PartyType) {
|
||||
case utils.PaymentPartyCustomer:
|
||||
if e.Customer != nil && e.Customer.Id != 0 {
|
||||
party.Name = e.Customer.Name
|
||||
party.AccountNumber = e.Customer.AccountNumber
|
||||
if party.AccountNumber == "" {
|
||||
party.AccountNumber = e.Customer.AccountNumber
|
||||
}
|
||||
}
|
||||
case utils.PaymentPartySupplier:
|
||||
if e.Supplier != nil && e.Supplier.Id != 0 {
|
||||
party.Name = e.Supplier.Name
|
||||
if e.Supplier.AccountNumber != nil {
|
||||
if party.AccountNumber == "" && e.Supplier.AccountNumber != nil {
|
||||
party.AccountNumber = *e.Supplier.AccountNumber
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user