...
|
...
|
@@ -147,13 +147,19 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred |
|
|
// 预算明细
|
|
|
var accountDetail []*domain.AccountDetail
|
|
|
var settlementAmount float64
|
|
|
var goodAmountCount float64
|
|
|
for _, dividendsEstimate := range dividendsEstimates {
|
|
|
accountDetail = append(accountDetail, &domain.AccountDetail{
|
|
|
DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
|
|
|
DividendsType: dividendsEstimate.DividendsType,
|
|
|
DividendsAmount: dividendsEstimate.DividendsAmount,
|
|
|
OrderGoodId: dividendsEstimate.OrderGoodId,
|
|
|
OrderGoodAmount: dividendsEstimate.OrderGoodAmount,
|
|
|
CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
|
|
|
})
|
|
|
settlementAmount = settlementAmount + dividendsEstimate.DividendsAmount
|
|
|
|
|
|
goodAmountCount = goodAmountCount + dividendsEstimate.OrderGoodAmount
|
|
|
}
|
|
|
|
|
|
// 生成账期结算单号
|
...
|
...
|
@@ -195,6 +201,8 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred |
|
|
CreatedAt: time.Now(),
|
|
|
DeletedAt: time.Time{},
|
|
|
UpdatedAt: time.Time{},
|
|
|
GoodAmountCount: goodAmountCount,
|
|
|
CooperationContractNumber: "", // TODO 弃用
|
|
|
}
|
|
|
|
|
|
if creditAccount, err13 := creditAccountRepository.Save(newCreditAccount); err13 != nil {
|
...
|
...
|
|