ziwen 1 year ago
parent
commit
403be6b71e
2 changed files with 3 additions and 3 deletions
  1. 1 1
      controller/contract/pre_register.go
  2. 2 2
      models/fms/contract_invoice.go

+ 1 - 1
controller/contract/pre_register.go

@@ -828,7 +828,7 @@ func (rg *PreRegisterController) Detail(c *gin.Context) {
 		return
 	}
 
-	dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(nItme.CompanyName, nItme.StartDate, nItme.EndDate)
+	dupList, e := fms.GetDuplicateContractInvoiceDetailItemList(nItme.CompanyName, nItme.StartDate, nItme.EndDate, req.InvoiceType)
 	if e != nil {
 		err = fmt.Errorf("获取开票到款列表失败, Err: %s", e.Error())
 		return

+ 2 - 2
models/fms/contract_invoice.go

@@ -599,12 +599,12 @@ func (c *ContractInvoice) FetchByRegisterId(registerId int) (items []*ContractIn
 }
 
 // GetDuplicateContractInvoiceDetailItemList 预登记列表详情用-获取开票到款列表
-func GetDuplicateContractInvoiceDetailItemList(companyName, startDate, endDate string) (itemList []*ContractInvoiceDetailItem, err error) {
+func GetDuplicateContractInvoiceDetailItemList(companyName, startDate, endDate string, invoiceType int) (itemList []*ContractInvoiceDetailItem, err error) {
 	list := make([]*ContractInvoice, 0)
 	err = global.DEFAULT_MYSQL.Table("contract_invoice as a ").
 		Select(" a.* ").
 		Joins(" JOIN contract_register as b ON a.contract_register_id = b.contract_register_id ").
-		Where(fmt.Sprintf("a.is_deleted = 0 AND b.company_name = '%s' AND b.start_date= '%s' AND b.end_date= '%s' AND b.is_deleted=0 AND (a.invoice_type=3 OR a.invoice_type=4)",companyName, startDate, endDate)).
+		Where(fmt.Sprintf("a.is_deleted = 0 AND b.company_name = '%s' AND b.start_date= '%s' AND b.end_date= '%s' AND b.is_deleted=0 AND (a.invoice_type=3 OR a.invoice_type=4) AND a.invoice_type = %v ",companyName, startDate, endDate, invoiceType)).
 		Order("a.contract_invoice_id ASC").
 		Find(&list).Error
 	if err != nil {