|
@@ -307,3 +307,53 @@ func (s InvoiceService) GetBillableList(param *vo.InvoiceBillListParam) (vo.Resu
|
|
}
|
|
}
|
|
return result, nil
|
|
return result, nil
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 开票金额数据-已开票、可开票、开票中
|
|
|
|
+func (s InvoiceService) ShowInvoiceBill(param *vo.InvoiceBillListParam) (map[string]float64, error) {
|
|
|
|
+ resMap := make(map[string]float64)
|
|
|
|
+ // 可开票
|
|
|
|
+ selectionAmount1, err1 := dao.SelectionInfoDAO{}.GetSelectionFinished(param.EnterpriseId, 0)
|
|
|
|
+ if err1 != nil {
|
|
|
|
+ return resMap, err1
|
|
|
|
+ }
|
|
|
|
+ projectAmount1, err1 := dao.ProjectDAO{}.GetProjectFinished(param.EnterpriseId, 0)
|
|
|
|
+ if err1 != nil {
|
|
|
|
+ return resMap, err1
|
|
|
|
+ }
|
|
|
|
+ localLifeAmount1, err1 := dao.LocalLifeDao{}.GetLocalLifeFinished(param.EnterpriseId, 0)
|
|
|
|
+ if err1 != nil {
|
|
|
|
+ return resMap, err1
|
|
|
|
+ }
|
|
|
|
+ // 开票中
|
|
|
|
+ selectionAmount2, err2 := dao.SelectionInfoDAO{}.GetSelectionFinished(param.EnterpriseId, 1)
|
|
|
|
+ if err2 != nil {
|
|
|
|
+ return resMap, err2
|
|
|
|
+ }
|
|
|
|
+ projectAmount2, err2 := dao.ProjectDAO{}.GetProjectFinished(param.EnterpriseId, 1)
|
|
|
|
+ if err2 != nil {
|
|
|
|
+ return resMap, err2
|
|
|
|
+ }
|
|
|
|
+ localLifeAmount2, err2 := dao.LocalLifeDao{}.GetLocalLifeFinished(param.EnterpriseId, 1)
|
|
|
|
+ if err2 != nil {
|
|
|
|
+ return resMap, err2
|
|
|
|
+ }
|
|
|
|
+ // 已开票
|
|
|
|
+ selectionAmount3, err3 := dao.SelectionInfoDAO{}.GetSelectionFinished(param.EnterpriseId, 2)
|
|
|
|
+ if err3 != nil {
|
|
|
|
+ return resMap, err3
|
|
|
|
+ }
|
|
|
|
+ projectAmount3, err3 := dao.ProjectDAO{}.GetProjectFinished(param.EnterpriseId, 2)
|
|
|
|
+ if err3 != nil {
|
|
|
|
+ return resMap, err3
|
|
|
|
+ }
|
|
|
|
+ localLifeAmount3, err3 := dao.LocalLifeDao{}.GetLocalLifeFinished(param.EnterpriseId, 2)
|
|
|
|
+ if err3 != nil {
|
|
|
|
+ return resMap, err3
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ resMap["invoicableAmount"] = selectionAmount1 + projectAmount1 + localLifeAmount1
|
|
|
|
+ resMap["invoicingAmount"] = selectionAmount2 + projectAmount2 + localLifeAmount2
|
|
|
|
+ resMap["invoicedAmount"] = selectionAmount3 + projectAmount3 + localLifeAmount3
|
|
|
|
+
|
|
|
|
+ return resMap, nil
|
|
|
|
+}
|