|
@@ -195,19 +195,21 @@ class InvoiceDataView(APIView):
|
|
try:
|
|
try:
|
|
if not pay['amount']:
|
|
if not pay['amount']:
|
|
return CustomError('未开具发票!')
|
|
return CustomError('未开具发票!')
|
|
|
|
+ print(111111,)
|
|
invoice = Invoice.objects.filter(tenant=tenant).order_by('-id').first()
|
|
invoice = Invoice.objects.filter(tenant=tenant).order_by('-id').first()
|
|
|
|
+
|
|
if invoice:
|
|
if invoice:
|
|
data = {
|
|
data = {
|
|
- 'invoice_name': invoice['invoice_name'],
|
|
|
|
- 'tax_no': invoice['tax_no'],
|
|
|
|
- 'company_address': invoice['company_address'],
|
|
|
|
- 'phone_no': invoice['phone_no'],
|
|
|
|
- 'deposit_bank': invoice['deposit_bank'],
|
|
|
|
- 'bank_account': invoice['bank_account'],
|
|
|
|
|
|
+ 'invoice_name': invoice.invoice_name,
|
|
|
|
+ 'tax_no': invoice.tax_no,
|
|
|
|
+ 'company_address': invoice.company_address,
|
|
|
|
+ 'phone_no': invoice.phone_no,
|
|
|
|
+ 'deposit_bank': invoice.deposit_bank,
|
|
|
|
+ 'bank_account': invoice.bank_account,
|
|
'invoice_sum': pay['amount'],
|
|
'invoice_sum': pay['amount'],
|
|
- 'consignee': invoice['consignee'],
|
|
|
|
- 'consignee_tel': invoice['consignee_tel'],
|
|
|
|
- 'consignee_address': invoice['company_address'],
|
|
|
|
|
|
+ 'consignee': invoice.consignee,
|
|
|
|
+ 'consignee_tel': invoice.consignee_tel,
|
|
|
|
+ 'consignee_address': invoice.company_address,
|
|
}
|
|
}
|
|
else:
|
|
else:
|
|
data['invoice_sum']=pay['amount']
|
|
data['invoice_sum']=pay['amount']
|