Commit 914cf751 by 王昆

dd

parent 86c7289c
...@@ -124,6 +124,19 @@ class InvoiceCtl extends CtlBase { ...@@ -124,6 +124,19 @@ class InvoiceCtl extends CtlBase {
return res; return res;
} }
/**
* 发票试算接口
* @param {*} pobj
*/
async calcInvoice(pobj) {
try {
return await this.invoiceSve.calcInvoice(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
// /** // /**
// * 申请发票校验 // * 申请发票校验
// * @param {*} pobj // * @param {*} pobj
...@@ -175,18 +188,7 @@ class InvoiceCtl extends CtlBase { ...@@ -175,18 +188,7 @@ class InvoiceCtl extends CtlBase {
// } // }
// } // }
/**
* 发票试算接口
* @param {*} pobj
*/
async calcInvoice(pobj) {
try {
return await this.invoiceSve.calcInvoice(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
// /** // /**
// * 计算发票增值税 // * 计算发票增值税
......
...@@ -174,10 +174,4 @@ class BusinessmenService extends ServiceBase { ...@@ -174,10 +174,4 @@ class BusinessmenService extends ServiceBase {
} }
} }
module.exports = BusinessmenService; module.exports = BusinessmenService;
// var task=new UserService(); \ No newline at end of file
// task.getUserStatisticGroupByApp().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
\ No newline at end of file
...@@ -307,11 +307,11 @@ class InvoiceService extends ServiceBase { ...@@ -307,11 +307,11 @@ class InvoiceService extends ServiceBase {
} }
let additional_tax_total = invoiceRes.data.addValueRes.additional_tax_total, //附加税累计总和 let additional_tax_total = invoiceRes.data.addValueRes.additional_tax_total, //附加税累计总和
value_added_tax_total = invoiceRes.data.addValueRes.value_added_tax_total, //增值税累计总和 value_added_tax_total = invoiceRes.data.addValueRes.value_added_tax_total, //增值税累计总和
invoice_amount_total = new Decimal(invoiceRes.data.addValueRes.invoice_amount_total).plus(params.invoice_amount); //增值税累计价税总和 (计算不对) invoice_amount_total = new Decimal(invoiceRes.data.addValueRes.invoice_amount_total).plus(params.invoice_amount).toNumber(); //增值税累计价税总和 (计算不对)
let personal_invoice_tax_total = invoiceRes.data.taxValueRes.personal_invoice_tax_total; //个税累计总和 let personal_invoice_tax_total = invoiceRes.data.taxValueRes.personal_invoice_tax_total; //个税累计总和
let personal_invoice_amount_total = new Decimal(invoiceRes.data.taxValueRes.personal_invoice_amount_total).plus(params.invoice_amount); //个税价税累计总和 (计算不对) let personal_invoice_amount_total = new Decimal(invoiceRes.data.taxValueRes.personal_invoice_amount_total).plus(params.invoice_amount).toNumber(); //个税价税累计总和 (计算不对)
//**********************************************************一下是计算个税********************************************************************************************** */ //**********************************************************一下是计算个税********************************************************************************************** */
...@@ -348,7 +348,7 @@ class InvoiceService extends ServiceBase { ...@@ -348,7 +348,7 @@ class InvoiceService extends ServiceBase {
value_added_tax = system.f2y(value_added_tax); value_added_tax = system.f2y(value_added_tax);
additional_tax = system.f2y(additional_tax); additional_tax = system.f2y(additional_tax);
service_amount = system.f2y(service_amount); service_amount = system.f2y(service_amount);
return system.getResult(personal_invoice_tax,value_added_tax,additional_tax,service_amount); return system.getResult({personal_invoice_tax,value_added_tax,additional_tax,service_amount});
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return system.getResult(null,`系统错误`); return system.getResult(null,`系统错误`);
......
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