|
@@ -721,9 +721,8 @@ func UpdateContractRegisterPre(item *ContractRegister, updateCols []string, serv
|
|
|
StartDate: item.StartDate,
|
|
|
EndDate: item.EndDate,
|
|
|
CurrencyUnit: item.CurrencyUnit,
|
|
|
- ServiceProductId: productId,
|
|
|
}
|
|
|
- tx.Model(&invoiceItem).Select([]string{"StartDate", "EndDate", "CurrencyUnit"}).Where("ContractRegisterId", item.ContractRegisterId).Updates(invoiceItem)
|
|
|
+ tx.Model(&invoiceItem).Select([]string{"StartDate", "EndDate", "CurrencyUnit"}).Where("contract_register_id", item.ContractRegisterId).Updates(invoiceItem)
|
|
|
|
|
|
// 开票到款操作类型: 0-无; 1-更新; 2-新增;
|
|
|
if invoiceHandleType == 2 {
|
|
@@ -759,6 +758,24 @@ func UpdateContractRegisterPre(item *ContractRegister, updateCols []string, serv
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ pp := &ContractPreRegister{}
|
|
|
+ ppItem, e := pp.Fetch(ppList[0].PreRegisterId)
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
+ }
|
|
|
+ //更新同一预登记记录下的productid
|
|
|
+ otherInvoiceItem := ContractInvoice{
|
|
|
+ ServiceProductId: productId,
|
|
|
+ }
|
|
|
+ if ppList[0].InvoiceType == 3 {
|
|
|
+ otherInvoiceItem.ContractInvoiceId = ppItem.ArriveId
|
|
|
+ } else {
|
|
|
+ otherInvoiceItem.ContractInvoiceId = ppItem.InvoiceId
|
|
|
+ }
|
|
|
+
|
|
|
+ tx.Model(&otherInvoiceItem).Select([]string{"ServiceProductId"}).Where("contract_invoice_id", otherInvoiceItem.ContractInvoiceId).Updates(otherInvoiceItem)
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|