Hello, I am trying to develop a web application that converts the accounts of the online store into the accounting program by exporting an Excel file on the computer and then uploading it to an application so that the data can be transferred easily.
Language used in Python and Flask frameworks
def convert_sales_data(df):
converted_data = []
for index, row in df.iterrows():
data = {
"IssueDate": row['added_at'],
"DueDate": "By",
"DueDateDays": None,
"DueDateDate": row['last_update_at'],
"Reference": row['id'],
"QuoteNumber": None,
"OrderNumber": None,
"Customer": {"Key code": row['customer_name']},
"SalesQuote": None,
"SalesOrder": None,
"BillingAddress": None,
"Description": None,
"Lines": None,
"SalesInventoryLocation": None,
"HasLineNumber": True,
"HasLineDescription": False,
"Discount": True,
"DiscountType": "ExactAmount",
"AmountsIncludeTax": False,
"Rounding": False,
"RoundingMethod": "None",
"WithholdingTax": False,
"WithholdingTaxType": "Rate",
"WithholdingTaxPercentage": 0.0,
"WithholdingTaxAmount": 0.0,
"EarlyPaymentDiscount": False,
"EarlyPaymentDiscountType": "Percentage",
"EarlyPaymentDiscountRate": 0.0,
"EarlyPaymentDiscountAmount": 0.0,
"EarlyPaymentDiscountDays": None,
"LatePaymentFees": False,
"LatePaymentFeesPercentage": 0.0,
"TotalAmountInWords": True,
"TotalAmountInBaseCurrency": True,
"Bilingual": True,
"HasSalesInvoiceCustomTitle": False,
"SalesInvoiceCustomTitle": None,
"HasSalesInvoiceCustomTheme": False,
"SalesInvoiceCustomTheme": None,
"AutomaticReference": False,
"HideDueDate": False,
"HideBalanceDue": False,
"ClosedInvoice": False,
"ShowItemImages": False,
"ShowTaxAmountColumn": False,
"HasSalesInvoiceFooters": False,
"SalesInvoiceFooters": None,
"CustomFields": None,
"CustomFields2": None,
}
converted_data.append(data)
return converted_data
Successfully send customer data
Now I’m working on GET sales invoices for the online store, but I’m tired of solving the problem, to read the customer’s name from an Excel file and create an invoice. I used the “customer” key.