aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/invoice_header_editor.vue19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/components/invoice_header_editor.vue b/src/components/invoice_header_editor.vue
index 6bd62b8..964bd04 100644
--- a/src/components/invoice_header_editor.vue
+++ b/src/components/invoice_header_editor.vue
@@ -44,12 +44,27 @@ const submit = async (e: Event) => {
try {
const c = toRaw(customer.value)
+ console.log(c.BillingAddress)
const res = await axios.post('/invoice', {
"invoicedate": new Date(toRaw(invoiceDate.value)).toISOString(),
"isdraft": true,
- "billingaddress": c.BillingAddress,
- "shippingaddress": c.BillingAddress, // TODO
+ "BillingAddress": {
+ // NOTE: just c.BillingAddress doesn't work for some reason
+ "AddressText": c.BillingAddress.AddressText,
+ "City": c.BillingAddress.City,
+ "State": c.BillingAddress.State,
+ "PostalCode": c.BillingAddress.PostalCode,
+ "Country": c.BillingAddress.Country,
+ },
+ "ShippingAddress": {
+ // TODO: don't use the billing address!
+ "AddressText": c.BillingAddress.AddressText,
+ "City": c.BillingAddress.City,
+ "State": c.BillingAddress.State,
+ "PostalCode": c.BillingAddress.PostalCode,
+ "Country": c.BillingAddress.Country,
+ },
"customername": c.Name,
"customergstin": c.Gstin,
"customercontactname": c.ContactName,