|
@@ -1451,37 +1451,37 @@ func (this *Invoice) InvoiceSubmit() {
|
|
|
this.ServeJson(NewResult("", errors.New("缺少参数")))
|
|
|
return
|
|
|
}
|
|
|
+ if !config.InvoiceConfig.Invoice_type[this.GetString("invoice_variety")] {
|
|
|
+ this.ServeJson(NewResult("", errors.New("发票类型有误")))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if this.GetString("invoice_type") != "个人" && this.GetString("invoice_type") != "单位" {
|
|
|
+ this.ServeJson(NewResult("", errors.New("发票抬头有误")))
|
|
|
+ return
|
|
|
+ }
|
|
|
now := time.Now()
|
|
|
again, _ := this.GetInteger("again") //是否是失败重新开票 0 首次提交 1 再此提交
|
|
|
oldOnlyIdentifying := this.GetString("oldOnlyIdentifying") //最后一次失败的发票信息唯一标识
|
|
|
data := map[string]interface{}{
|
|
|
- //"order_code": orderCode,
|
|
|
- "company_name": this.GetString("company_name"),
|
|
|
- "phone": this.GetString("phone"),
|
|
|
- "mail": this.GetString("mail"),
|
|
|
- "invoice_type": this.GetString("invoice_type"),
|
|
|
- "invoice_content": this.GetString("invoiceContent"),
|
|
|
- "invoice_status": 0,
|
|
|
- "invoice_changed": 0,
|
|
|
- //"invoice_order_code": orderCode,
|
|
|
+ "company_name": this.GetString("company_name"),
|
|
|
+ "phone": this.GetString("phone"),
|
|
|
+ "mail": this.GetString("mail"),
|
|
|
+ "invoice_type": this.GetString("invoice_type"),
|
|
|
+ "invoice_content": this.GetString("invoiceContent"),
|
|
|
+ "invoice_status": 0,
|
|
|
+ "invoice_changed": 0,
|
|
|
"company_phone": this.GetString("company_phone"),
|
|
|
"taxpayer_identnum": this.GetString("taxpayer_identnum"),
|
|
|
"create_time": time.Now().Unix(),
|
|
|
- //"user_id": userId,
|
|
|
- "operable_time": FormatDate(&now, Date_Full_Layout),
|
|
|
- //"invoice_money": payMoney,
|
|
|
- //"invoice_order_money": payMoney,
|
|
|
- "invoicing_entity": "北京剑鱼信息技术有限公司",
|
|
|
- "remark": this.GetString("remark"),
|
|
|
- //"source": 0,
|
|
|
- "invoice_variety": this.GetString("invoice_variety"),
|
|
|
- "bank_account": this.GetString("bank_account"),
|
|
|
- //"only_Identifying": onlyIdentifying,
|
|
|
- "company_address": this.GetString("company_address"),
|
|
|
- "bank_name": this.GetString("bank_name"),
|
|
|
- "recipient": this.GetString("recipient"),
|
|
|
- "delivery_address": this.GetString("delivery_address"),
|
|
|
- //"product_type": qutil.ObjToString((*orderInfo)["product_type"]),
|
|
|
+ "operable_time": FormatDate(&now, Date_Full_Layout),
|
|
|
+ "invoicing_entity": "北京剑鱼信息技术有限公司",
|
|
|
+ "remark": this.GetString("remark"),
|
|
|
+ "invoice_variety": this.GetString("invoice_variety"),
|
|
|
+ "bank_account": this.GetString("bank_account"),
|
|
|
+ "company_address": this.GetString("company_address"),
|
|
|
+ "bank_name": this.GetString("bank_name"),
|
|
|
+ "recipient": this.GetString("recipient"),
|
|
|
+ "delivery_address": this.GetString("delivery_address"),
|
|
|
}
|
|
|
if again == 1 {
|
|
|
err := OpenInvoiceAgain(oldOnlyIdentifying, data)
|