def new_invoice_pay(invoice_id): money = float(request.values.get('money', 0)) pay_time = request.values.get('pay_time', '') detail = request.values.get('detail', '') bank = request.values.get('bank', '') bank_num = request.values.get('bank_num', '') company = request.values.get('company', '') mi = MediumInvoice.get(invoice_id) # if mi.pay_invoice_money + money > mi.money: # flash(u'付款金额大于发票金额,请重新填写!', 'danger') # return redirect(url_for('saler_client_order_medium_invoice.invoice', # invoice_id=invoice_id)) pay = MediumInvoicePay.add(money=money, medium_invoice=mi, pay_time=pay_time, detail=detail, bank=bank, bank_num=bank_num, company=company) pay.save() flash(u'新建打款信息成功!', 'success') mi.client_order.add_comment(g.user, u"新建打款信息\n\n发票号:%s\n\n打款金额:%s元\n\n\ 打款时间:%s\n\n公司名称:%s\n\n开户行:%s\n\n银行账号:%s" % (pay.medium_invoice.invoice_num, str(money), pay_time, company, bank, bank_num), msg_channel=3) return redirect(url_for('saler_client_order_medium_invoice.invoice', invoice_id=invoice_id))
def new_invoice_pay(invoice_id): if not g.user.is_finance(): abort(404) invoice = MediumInvoice.get(invoice_id) if not invoice: abort(404) money = float(request.values.get('money', 0)) pay_time = request.values.get('pay_time', '') detail = request.values.get('detail', '') bank = request.values.get('bank', '') bank_num = request.values.get('bank_num', '') company = request.values.get('company', '') pay = MediumInvoicePay.add(money=money, pay_status=0, medium_invoice=invoice, pay_time=pay_time, detail=detail, bank=bank, bank_num=bank_num, company=company) pay.save() flash(u'新建付款信息成功!', 'success') invoice.client_order.add_comment(g.user, u"财务添加打款信息\n\n发票号:%s\n\n打款金额:%s元\n\n\ 打款时间:%s\n\n公司名称:%s\n\n开户行:%s\n\n银行账号:%s" % (invoice.invoice_num, str(money), pay_time, company, bank, bank_num), msg_channel=3) return redirect(url_for("finance_client_order_medium_pay.pay_info", invoice_id=invoice.id))
def new_invoice_pay(invoice_id): money = float(request.values.get('money', 0)) pay_time = request.values.get('pay_time', '') detail = request.values.get('detail', '') bank = request.values.get('bank', '') bank_num = request.values.get('bank_num', '') company = request.values.get('company', '') mi = MediumInvoice.get(invoice_id) # if mi.pay_invoice_money + money > mi.money: # flash(u'付款金额大于发票金额,请重新填写!', 'danger') # return redirect(url_for('saler_client_order_medium_invoice.invoice', # invoice_id=invoice_id)) pay = MediumInvoicePay.add(money=money, medium_invoice=mi, pay_time=pay_time, detail=detail, bank=bank, bank_num=bank_num, company=company) pay.save() flash(u'新建打款信息成功!', 'success') mi.client_order.add_comment(g.user, u"新建打款信息\n\n发票号:%s\n\n打款金额:%s元\n\n\ 打款时间:%s\n\n公司名称:%s\n\n开户行:%s\n\n银行账号:%s" % (pay.medium_invoice.invoice_num, str(money), pay_time, company, bank, bank_num), msg_channel=3) return redirect( url_for('saler_client_order_medium_invoice.invoice', invoice_id=invoice_id))