Commit 862d09dc by 王昆

gsb

parent af4d68df
...@@ -9,6 +9,7 @@ module.exports = (db, DataTypes) => { ...@@ -9,6 +9,7 @@ module.exports = (db, DataTypes) => {
return db.define("iinvoice", { return db.define("iinvoice", {
// id: { type: DataTypes.STRING(32), allowNull: true, comment: "" }, // id: { type: DataTypes.STRING(32), allowNull: true, comment: "" },
channel_id: { type: DataTypes.STRING(32), allowNull: true, defaultValue: "", COMMENT: '渠道id' },
province: { type: DataTypes.STRING(10), allowNull: true, comment: "发票对应省份" }, province: { type: DataTypes.STRING(10), allowNull: true, comment: "发票对应省份" },
invoice_type: { type: DataTypes.STRING(4), allowNull: true, comment: '发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票' }, invoice_type: { type: DataTypes.STRING(4), allowNull: true, comment: '发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票' },
invoice_join: { type: DataTypes.STRING(4), allowNull: true, comment: '发票联次 10 记账联 20 发票联 30 抵扣联 40 销售方次' }, invoice_join: { type: DataTypes.STRING(4), allowNull: true, comment: '发票联次 10 记账联 20 发票联 30 抵扣联 40 销售方次' },
......
...@@ -35,7 +35,7 @@ class IInvoiceService extends ServiceBase { ...@@ -35,7 +35,7 @@ class IInvoiceService extends ServiceBase {
try { try {
let invoiceExists =await this.dao.findByChannelAndApplyNo(this.trim(params.channel_id),this.trim(params.apply_no)); let invoiceExists =await this.dao.findByChannelAndApplyNo(this.trim(params.channel_id),this.trim(params.apply_no));
if(invoiceExists.total!=0){ if(invoiceExists.total!=0){
return system.getResult(null,`发票编号已存在`); return system.getResult(null,`发票编号${params.apply_no}已存在`);
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
...@@ -56,6 +56,7 @@ class IInvoiceService extends ServiceBase { ...@@ -56,6 +56,7 @@ class IInvoiceService extends ServiceBase {
} }
let _invoice = {}; let _invoice = {};
_invoice.channel_id = this.trim(params.channel_id);
_invoice.apply_no = this.trim(params.apply_no); _invoice.apply_no = this.trim(params.apply_no);
_invoice.invoice_type = this.trim(params.invoice_type); _invoice.invoice_type = this.trim(params.invoice_type);
_invoice.apply_time = this.trim(params.apply_time); _invoice.apply_time = this.trim(params.apply_time);
......
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