Przeglądaj źródła

Merge branch 'fms_2.5' into debug

ziwen 2 lat temu
rodzic
commit
607361100a

+ 1 - 1
controller/census/invoice_payment.go

@@ -578,7 +578,7 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
 			cond += ` AND (c.invoice_time BETWEEN ? AND ?) AND (d.invoice_time BETWEEN ? AND ?) `
 			pars = append(pars, st, ed, st, ed)
 		}
-	}else if req.StartDate != "" && req.EndDate != "" {
+	} else if req.StartDate != "" && req.EndDate != "" {
 		st := fmt.Sprint(req.StartDate, " 00:00:00")
 		ed := fmt.Sprint(req.EndDate, " 23:59:59")
 		cond += ` AND ((c.invoice_time BETWEEN ? AND ?) or (d.invoice_time BETWEEN ? AND ?))`

+ 6 - 2
controller/contract/register.go

@@ -1970,9 +1970,13 @@ func (rg *RegisterController) InvoiceList(c *gin.Context) {
 		pageIndex = 1
 	}
 
-	cond := `invoice_type = ?`
+	cond := ``
+	if req.InvoiceType == 1 {
+		cond = `invoice_type IN (1,3)`
+	} else {
+		cond = `invoice_type IN (2,4)`
+	}
 	pars := make([]interface{}, 0)
-	pars = append(pars, req.InvoiceType)
 	// 搜索
 	if req.Keyword != "" {
 		kw := fmt.Sprint("%", req.Keyword, "%")

+ 1 - 0
models/fms/contract_invoice.go

@@ -508,6 +508,7 @@ func GetInvoiceListCurrencySum(condition string, pars []interface{}, groupRule s
 	query := global.DEFAULT_MYSQL.Table("contract_invoice AS a").
 		Select("a.currency_unit, a.invoice_type, SUM(a.amount) AS amount_total, SUM(a.origin_amount) AS origin_amount_total, b.company_name").
 		Joins("JOIN contract_register b ON a.contract_register_id = b.contract_register_id").
+		Where("a.is_deleted = 0").
 		Where(condition, pars...).
 		Group(groupRule)
 	err = query.Find(&results).Error