Commit 390e125e by 孙亚楠

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

parents 79b74139 d403a0fc
......@@ -142,8 +142,10 @@ class InvoiceCtl extends CtlBase {
let businessmen = businessmenMap[creditCode];
let itemList = bmMap[creditCode];
let amount = 0;
let data_ids = [];
for (let item of itemList) {
amount = amount + Number(item.amt || 0);
data_ids.push(item.id); // TODO 总统测试
}
let service_tax = parseFloat((Number(amount) * Number(invoice_service_rate) / 100).toFixed(2));
if (!businessmen.is_bank) {
......@@ -169,7 +171,8 @@ class InvoiceCtl extends CtlBase {
"unit": "",
"quantity": "",
"price": "",
"remark": ""
"remark": "",
"data_ids": data_ids.join(",") // TODO 总统测试
});
}
......@@ -303,6 +306,7 @@ class InvoiceCtl extends CtlBase {
mail_addr: this.trim(params.mail_addr),
mail_mobile: this.trim(params.mail_mobile),
mail_to: this.trim(params.mail_to),
data_ids: this.trim(params.data_ids), // TODO 总统测试
personal_invoice_tax: system.y2f(invoice.personal_invoice_tax),
additional_tax: system.y2f(invoice.additional_tax),
......@@ -325,6 +329,18 @@ class InvoiceCtl extends CtlBase {
status: "1060",
}
});
// TODO 总统测试 begin
if (rs && rs.data && rs.data.length > 0) {
for (let d of rs.data) {
console.log(d.id, d.data_ids);
if (!d.data_ids) {
continue;
}
let tradeIds = d.data_ids.split(",");
await this.tradeSve.updateInvoice({ids: tradeIds, saas_invoice_id: d.id});
}
}
// TODO 总统测试 end
return system.getResultSuccess(rs);
} catch (error) {
let msg = error.message;
......
......@@ -36,6 +36,11 @@ class TradeService extends ServiceBase {
return rs;
}
async updateInvoice(params) {
let rs = await this.callms("trade", "updateItemInvoice", params);
return rs;
}
async setMerchantIdsByName(params) {
let merchantName = this.trim(params.merchant_name);
if (merchantName) {
......
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