Commit a25497f4 by 王昆

Merge branch 'xgg-admin' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-admin

parents caf2d580 8f0d8b71
...@@ -36,6 +36,26 @@ class TestAPI extends APIBase { ...@@ -36,6 +36,26 @@ class TestAPI extends APIBase {
return "success"; return "success";
} }
/**
* 重置订单处理流程
* @param pobj
* @param query
* @param req
* @returns {Promise<void>}
*/
async resetOrderProcess(pobj, query, req){
if(pobj.ids.length==0){
return system.getResult(null, `参数错误`);
}
let res = [];
for(let item of pobj.ids) {
let temp = await this.orderSve.resetOrderProcess({id:item}) || {};
temp.id = item;
res.push(temp);
}
return system.getResultSuccess(res);
}
async testInvoice() { async testInvoice() {
let params = { let params = {
uploadPeriod: "201910", uploadPeriod: "201910",
......
...@@ -266,7 +266,7 @@ class InvoiceService extends ServiceBase { ...@@ -266,7 +266,7 @@ class InvoiceService extends ServiceBase {
companyId: deliver.nt_company_id, //公司ID companyId: deliver.nt_company_id, //公司ID
customerId: businessmen.customer_id, //客户ID customerId: businessmen.customer_id, //客户ID
uploadPeriod: moment(businessmen.create_account_time).format('YYYYMM'), //上传账期 uploadPeriod: moment(businessmen.create_account_time).format('YYYYMM'), //上传账期
imageName: invoice['invoice_img'].slice(invoice['invoice_img'].lastIndexOf("/") + 1, -1) || "", //图片名称 imageName: invoice['invoice_img'].slice(invoice['invoice_img'].lastIndexOf("/") + 1) || "", //图片名称
imageBasename: invoice['invoice_img'] || "", //图片url imageBasename: invoice['invoice_img'] || "", //图片url
billType: this.formatInvoiceType(_invoicesummaryinfo), //发票类型 billType: this.formatInvoiceType(_invoicesummaryinfo), //发票类型
isDaikai: `1`, //是否代开 1:yes 0:no isDaikai: `1`, //是否代开 1:yes 0:no
...@@ -329,6 +329,20 @@ class InvoiceService extends ServiceBase { ...@@ -329,6 +329,20 @@ class InvoiceService extends ServiceBase {
if (!businessmenBean.sign_time) { if (!businessmenBean.sign_time) {
return system.getResult(null, `个体户未签约`); return system.getResult(null, `个体户未签约`);
} }
//************************************************************一下是计算服务费************************************* */
let service_rate = new Decimal(businessmenBean.service_rate).div(100).toNumber();
let service_amount = new Decimal(params.invoice_amount).mul(service_rate).toNumber();
//如果已经开户 所有的税金都应该是0 ,之后服务费用
if (businessmenBean.is_bank) {
return system.getResultSuccess({
personal_invoice_tax: 0,
value_added_tax: 0,
additional_tax: 0,
service_amount: service_amount,
credit_code: params.credit_code
});
}
// params.invoice_amount = system.y2f(this.trim(params.invoice_amount)); // params.invoice_amount = system.y2f(this.trim(params.invoice_amount));
//增值税累计类型 1按月 2按季度 add_value_up_type //增值税累计类型 1按月 2按季度 add_value_up_type
//个税累计类型 1按月累计 2按季度累计 tax_up_type //个税累计类型 1按月累计 2按季度累计 tax_up_type
...@@ -378,9 +392,7 @@ class InvoiceService extends ServiceBase { ...@@ -378,9 +392,7 @@ class InvoiceService extends ServiceBase {
//附加税 =增值税*附加税 //附加税 =增值税*附加税
let additional_tax = new Decimal(value_added_tax).mul(AVRateRes.fujiaRate).toNumber().toFixed(2); let additional_tax = new Decimal(value_added_tax).mul(AVRateRes.fujiaRate).toNumber().toFixed(2);
//************************************************************一下是计算服务费************************************* */
let service_rate = new Decimal(businessmenBean.service_rate).div(100).toNumber();
let service_amount = new Decimal(params.invoice_amount).mul(service_rate).toNumber();
personal_invoice_tax = system.f2y(personal_invoice_tax); personal_invoice_tax = system.f2y(personal_invoice_tax);
value_added_tax = system.f2y(value_added_tax); value_added_tax = system.f2y(value_added_tax);
......
...@@ -288,5 +288,18 @@ class OrderService extends ServiceBase { ...@@ -288,5 +288,18 @@ class OrderService extends ServiceBase {
return system.getResult(null,`系统错误`); return system.getResult(null,`系统错误`);
} }
} }
// 重置订单处理流程
async resetOrderProcess(params) {
if (!params.id) {
return system.getResult(null, `参数错误 ID不能为空`);
}
try {
return await this.callms("order", "resetOrderProcess", params);
} catch (error) {
console.log(error);
return system.getResult(null,`系统错误 错误信息 ${error}`);
}
}
} }
module.exports = OrderService; module.exports = OrderService;
\ No newline at end of file
...@@ -182,7 +182,7 @@ class System { ...@@ -182,7 +182,7 @@ class System {
// merchant: "http://127.0.0.1:3101" + path, // merchant: "http://127.0.0.1:3101" + path,
// 订单服务 // 订单服务
order: domain + ":3103" + path, order: domain2 + ":3103" + path,
// order: domain + ":3103" + path, // order: domain + ":3103" + path,
// 发票服务 // 发票服务
......
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