|
@@ -189,7 +189,7 @@ func GetInvoicePaymentSummaryByRegisterIdAndInvoiceId(registerId, invocieId int)
|
|
|
|
|
|
type IncomeSummaryItem struct {
|
|
|
CompanyName string `json:"company_name" description:"客户名称"`
|
|
|
- NewCompany int `json:"new_company" description:"是否为新客户: 0-否; 1-是"`
|
|
|
+ ContractType int `json:"contract_type" description:"是否为新客户: 2-否; 1-是"`
|
|
|
InvoiceDate time.Time `json:"invoice_time" description:"开票日期"`
|
|
|
Amount float64 `json:"amount" description:"金额"`
|
|
|
SellerName string `json:"seller_name" description:"销售名称"`
|
|
@@ -200,7 +200,7 @@ func GetContractSummaryIncomeAmount(condition string, pars []interface{}) (resul
|
|
|
joinCond := ` (a.invoice_id = b.contract_invoice_id OR a.payment_id = b.contract_invoice_id) `
|
|
|
|
|
|
query := global.DEFAULT_MYSQL.Table("invoice_payment_summary AS a").
|
|
|
- Select("b.amount,b.invoice_time AS invoice_date , c.new_company,c.company_name,b.seller_name").
|
|
|
+ Select("b.amount,b.invoice_time AS invoice_date , c.contract_type,c.company_name,b.seller_name").
|
|
|
Joins(fmt.Sprintf(" JOIN contract_invoice AS b ON %s AND b.is_deleted = 0 ", joinCond)).
|
|
|
Joins("JOIN contract_register AS c ON a.register_id = c.contract_register_id AND c.is_deleted = 0").
|
|
|
Where(condition, pars...).Group("id").Order("invoice_date ")
|