Commit 510bacaf by 孙亚楠

dd

parents 126153fd 1be53006
{
"editor.tabSize": 2
}
\ No newline at end of file
......@@ -57,31 +57,10 @@ class ActionAPI extends APIBase {
case "uploadDetail": // 查询发票详细信息
opResult = await this.iinvoiceSve.uploadDetailSve(action_body);
break;
case "merchantinvoicePage" : //发票列表(商户)
opResult = await this.saasinvoiceSve.merchantinvoicePage(action_body);
case "accumulatedAmount": // 查询累计金额
opResult = await this.iinvoiceSve.accumulatedAmount(action_body);
break;
case "platforminvoicePage" : //发票列表(平台)
opResult = await this.saasinvoiceSve.platforminvoicePage(action_body);
break;
case "merchantinvoiceapplyPage" : //发票申请列表(商户)
opResult = await this.saasinvoiceapplySve.merchantinvoiceapplyPage(action_body);
break;
case "platforminvoiceapplyPage" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.platforminvoiceapplyPage(action_body);
break;
case "invoiceapplySave" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.save(action_body);
break;
case "invoiceapplyById" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.byId(action_body);
break;
case "invoiceapplyAudit" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.audit(action_body);
break;
case "invoiceapplyMakeOut" : //发票申请列表(平台)
opResult = await this.saasinvoiceapplySve.makeout(action_body);
break;
// case "verificationAndCalculation": // 发票试算接口
// opResult = await rule.dispatcher(action_body);
// break;
......
......@@ -79,6 +79,32 @@ class IInvoiceDao extends Dao {
return counts[0];
}
//计算附加税累计
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,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`;
let res= await this.customQuery(sql,{businessmen_credit_code:businessmen_credit_code,beginTime:beginTime,endTime:endTime});
if(res.length==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,invoice_amount_total:res[0].invoice_amount_total || 0};
}
/**
* 计算个税累计
* @param {*} beginTime
* @param {*} endTime
*/
async accumulatedTaxAmountByTime(businessmen_credit_code,beginTime,endTime){
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`;
let res = await this.customQuery(sql,{businessmen_credit_code:businessmen_credit_code,beginTime:beginTime,endTime:endTime});
if(!res || res.length == 0) {
return {personal_invoice_tax_total: 0,personal_invoice_amount_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};
}
// /**
// * 红冲列表总计
// * @param {*} params
......
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