Commit d6f88592 by 王昆

dd

parent 4845ccce
...@@ -81,13 +81,13 @@ class IInvoiceDao extends Dao { ...@@ -81,13 +81,13 @@ class IInvoiceDao extends Dao {
//计算附加税累计 //计算附加税累计
async accumulatedAddValueAmountByTime(businessmen_credit_code,beginTime,endTime){ async accumulatedAddValueAmountByTime(businessmen_credit_code,beginTime,endTime){
let sql =`select SUM(t1.additional_tax) AS additional_tax_total,SUM(t1.value_added_tax) AS value_added_tax_total from i_invoice t1 let sql =`select SUM(t1.additional_tax) AS additional_tax_total,SUM(t1.value_added_tax) AS value_added_tax_total,SUM(t1.invoice_amount) as invoice_amount_total from i_invoice t1
where t1.businessmen_credit_code = :businessmen_credit_code and t1.apply_time>= :beginTime and t1.apply_time <=:endTime`; where t1.businessmen_credit_code = :businessmen_credit_code and t1.apply_time>= :beginTime and t1.apply_time <=:endTime`;
let res= await this.customQuery(sql,{businessmen_credit_code:businessmen_credit_code,beginTime:beginTime,endTime:endTime}); let res= await this.customQuery(sql,{businessmen_credit_code:businessmen_credit_code,beginTime:beginTime,endTime:endTime});
if(res.length==0){ if(res.length==0){
return {additional_tax_total:0,value_added_tax_total:0}; return {additional_tax_total:0,value_added_tax_total:0,invoice_amount_total:0};
} }
return {additional_tax_total:res[0].additional_tax_total || 0 ,value_added_tax_total:res[0].value_added_tax_total || 0}; return {additional_tax_total:res[0].additional_tax_total || 0 ,value_added_tax_total:res[0].value_added_tax_total || 0,invoice_amount_total:res[0].invoice_amount_total || 0};
} }
...@@ -97,13 +97,13 @@ class IInvoiceDao extends Dao { ...@@ -97,13 +97,13 @@ class IInvoiceDao extends Dao {
* @param {*} endTime * @param {*} endTime
*/ */
async accumulatedTaxAmountByTime(businessmen_credit_code,beginTime,endTime){ async accumulatedTaxAmountByTime(businessmen_credit_code,beginTime,endTime){
let sql =`select SUM(t1.personal_invoice_tax) AS personal_invoice_tax_total from i_invoice t1 let sql =`select SUM(t1.personal_invoice_tax) AS personal_invoice_tax_total,SUM(t1.invoice_amount) as personal_invoice_amount_total from i_invoice t1
where t1.businessmen_credit_code = :businessmen_credit_code and t1.apply_time>= :beginTime and t1.apply_time <= :endTime`; where t1.businessmen_credit_code = :businessmen_credit_code and t1.apply_time>= :beginTime and t1.apply_time <= :endTime`;
let res = await this.customQuery(sql,{businessmen_credit_code:businessmen_credit_code,beginTime:beginTime,endTime:endTime}); let res = await this.customQuery(sql,{businessmen_credit_code:businessmen_credit_code,beginTime:beginTime,endTime:endTime});
if(!res || res.length == 0) { if(!res || res.length == 0) {
return {personal_invoice_tax_total: 0}; return {personal_invoice_tax_total: 0,personal_invoice_amount_total: 0};
} }
return {personal_invoice_tax_total:res[0].personal_invoice_tax_total || 0}; return {personal_invoice_tax_total:res[0].personal_invoice_tax_total || 0,personal_invoice_amount_total:res[0].personal_invoice_amount_total || 0};
} }
// /** // /**
// * 红冲列表总计 // * 红冲列表总计
......
...@@ -431,7 +431,7 @@ class IInvoiceService extends ServiceBase { ...@@ -431,7 +431,7 @@ class IInvoiceService extends ServiceBase {
date = "01"; date = "01";
let maxDate = moment(`${year}-${month}`, "YYYY-MM").daysInMonth(); let maxDate = moment(`${year}-${month}`, "YYYY-MM").daysInMonth();
beginTime = `${year}-${month}-${date} 00:00:00`; beginTime = `${year}-${month}-${date} 00:00:00`;
endTime = `${year}-${month}-${maxDate} 00:00:00` endTime = `${year}-${month}-${maxDate} 23:59:59`
} }
if (type == 2) { if (type == 2) {
//获取当前是第几季度 //获取当前是第几季度
...@@ -445,7 +445,7 @@ class IInvoiceService extends ServiceBase { ...@@ -445,7 +445,7 @@ class IInvoiceService extends ServiceBase {
else else
endMonth += '' endMonth += ''
let endMonthDays = moment(year + '-' + endMonth).daysInMonth(); // 末尾月天数 let endMonthDays = moment(year + '-' + endMonth).daysInMonth(); // 末尾月天数
endTime = year + '-' + endMonth + '-' + endMonthDays; //完整年月日整合 endTime = year + '-' + endMonth + '-' + endMonthDays + " 23:59:59"; //完整年月日整合
} }
return { return {
beginTime, beginTime,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment