mirror of
https://github.com/bcomsugi/dasaproject.git
synced 2026-01-10 16:52:38 +07:00
update pretty xml
This commit is contained in:
parent
f3b1cac25b
commit
2df3be79cc
@ -198,7 +198,6 @@ class SalesOrderQuery:
|
|||||||
# if soidx == len(self.SalesOrderList)-1: #last list then set the'400_Sales_discount'
|
# if soidx == len(self.SalesOrderList)-1: #last list then set the'400_Sales_discount'
|
||||||
# print(f'disc_amount:{format(disc_amount, ".2f")}')
|
# print(f'disc_amount:{format(disc_amount, ".2f")}')
|
||||||
# if disc_amount != 0:
|
# if disc_amount != 0:
|
||||||
|
|
||||||
# # disc_amount=format(disc_amount, ".2f")
|
# # disc_amount=format(disc_amount, ".2f")
|
||||||
# InvoiceLineAdd = self.create_sub_element(ET, InvoiceAdd, "InvoiceLineAdd", "\n ", 10 )
|
# InvoiceLineAdd = self.create_sub_element(ET, InvoiceAdd, "InvoiceLineAdd", "\n ", 10 )
|
||||||
# ItemRef = self.create_sub_element(ET, InvoiceLineAdd, "ItemRef", "\n ", 12)
|
# ItemRef = self.create_sub_element(ET, InvoiceLineAdd, "ItemRef", "\n ", 12)
|
||||||
@ -219,7 +218,16 @@ class SalesOrderQuery:
|
|||||||
qbxml_query = qbxml_query + "\n" + mydata
|
qbxml_query = qbxml_query + "\n" + mydata
|
||||||
# print(f'create_invoiceadd_QBXML->Create_Invoiceadd_QBXML: {qbxml_query}')
|
# print(f'create_invoiceadd_QBXML->Create_Invoiceadd_QBXML: {qbxml_query}')
|
||||||
# print(f"replyfrom qbxml:{self.connect_to_quickbooks(qbxml_query)}")
|
# print(f"replyfrom qbxml:{self.connect_to_quickbooks(qbxml_query)}")
|
||||||
|
# print([s for s in qbxml_query.split('\n') if s.strip(' ') != ''])
|
||||||
|
|
||||||
|
import xml.dom.minidom
|
||||||
|
# dom = xml.dom.minidom.parse(xml_fname) # or
|
||||||
|
dom = xml.dom.minidom.parseString(qbxml_query)
|
||||||
|
pretty_xml_as_string = dom.toprettyxml(" ").split('\n')
|
||||||
|
# pretty_xml_as_string = '\n'.join([s for s in pretty_xml_as_string if s.strip(' ') != ""])
|
||||||
|
pretty_xml_as_string = '\n'.join([s for s in pretty_xml_as_string if s.strip() ])
|
||||||
|
|
||||||
|
print(pretty_xml_as_string)
|
||||||
return qbxml_query
|
return qbxml_query
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,7 @@ def show_inv(request):
|
|||||||
if itu:
|
if itu:
|
||||||
invoiceaddQBXML=ini.create_invoiceadd_QBXML()
|
invoiceaddQBXML=ini.create_invoiceadd_QBXML()
|
||||||
print(invoiceaddQBXML)
|
print(invoiceaddQBXML)
|
||||||
print(ini.connect_to_quickbooks(ini.create_invoiceadd_QBXML()))
|
# print(ini.connect_to_quickbooks(ini.create_invoiceadd_QBXML()))
|
||||||
|
|
||||||
return render( request, "Invoice/so_list_form.html", context)
|
return render( request, "Invoice/so_list_form.html", context)
|
||||||
# return HttpResponse('')
|
# return HttpResponse('')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user