From 37ef1ab2f544a05b5878c5bdaafd37155a054289 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 3 Dec 2023 22:16:22 +0530 Subject: added invoice edit page --- package.json | 2 +- src/classes/invoice.ts | 34 +++++ src/classes/invoice_item.ts | 21 +++ src/classes/item.ts | 2 - src/components/invoice_header.vue | 213 +++++++++++++++---------------- src/components/invoice_header_editor.vue | 151 ++++++++++++++++++++++ src/components/item_selector.vue | 176 +++++++++++++++++++++++++ src/components/new_customer.vue | 22 ++-- src/router/index.ts | 7 + src/views/EditInvoice.vue | 47 +++++++ src/views/NewInvoice.vue | 4 +- 11 files changed, 555 insertions(+), 124 deletions(-) create mode 100644 src/classes/invoice.ts create mode 100644 src/classes/invoice_item.ts create mode 100644 src/components/invoice_header_editor.vue create mode 100644 src/components/item_selector.vue create mode 100644 src/views/EditInvoice.vue diff --git a/package.json b/package.json index f0b187e..3990276 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openbills-web", - "version": "0.0.5", + "version": "0.1.0", "private": false, "scripts": { "dev": "vite", diff --git a/src/classes/invoice.ts b/src/classes/invoice.ts new file mode 100644 index 0000000..213eddc --- /dev/null +++ b/src/classes/invoice.ts @@ -0,0 +1,34 @@ +import Address from './address' +import Item from './item' + +export default class Customer { + InvoiceDate: string + InvoiceNumber: number + BillingAddress: Address + ShippingAddress: Address + IsDraft: boolean + Items: Item[] + + CustomerName: string + CustomerGstin: string + CustomerContactName: string + CustomerPhone: string + CustomerEmail: string + CustomerWebsite: string + + constructor() { + this.InvoiceDate = "" + this.InvoiceNumber = 0 + this.BillingAddress = new Address() + this.ShippingAddress = new Address() + this.IsDraft = true + this.Items = [] + + this.CustomerName = "" + this.CustomerGstin = "" + this.CustomerContactName = "" + this.CustomerPhone = "" + this.CustomerEmail = "" + this.CustomerWebsite = "" + } +} diff --git a/src/classes/invoice_item.ts b/src/classes/invoice_item.ts new file mode 100644 index 0000000..a7a0a85 --- /dev/null +++ b/src/classes/invoice_item.ts @@ -0,0 +1,21 @@ +export default class InvoiceItem { + UnitOfMeasure: string + Quantity: string + Name: string + Description: string + HSN: string + UnitPrice: string + GSTPercentage: string + BrandName: string + + constructor() { + this.Name = '' + this.Description = '' + this.HSN = '' + this.UnitPrice = '' + this.GSTPercentage = '' + this.UnitOfMeasure = '' + this.Quantity = "" + this.BrandName = "" + } +} diff --git a/src/classes/item.ts b/src/classes/item.ts index 271eb3d..ba437a7 100644 --- a/src/classes/item.ts +++ b/src/classes/item.ts @@ -1,6 +1,5 @@ export default class Item { unitofmeasure: string - hasdecimalquantity: boolean name: string description: string hsn: string @@ -15,7 +14,6 @@ export default class Item { this.unitprice = '' this.gstpercentage = '' this.unitofmeasure = '' - this.hasdecimalquantity = false this.brandid = 0 } } diff --git a/src/components/invoice_header.vue b/src/components/invoice_header.vue index 2c62f15..2c3c515 100644 --- a/src/components/invoice_header.vue +++ b/src/components/invoice_header.vue @@ -1,118 +1,115 @@ diff --git a/src/components/invoice_header_editor.vue b/src/components/invoice_header_editor.vue new file mode 100644 index 0000000..0a39ce5 --- /dev/null +++ b/src/components/invoice_header_editor.vue @@ -0,0 +1,151 @@ + + + diff --git a/src/components/item_selector.vue b/src/components/item_selector.vue new file mode 100644 index 0000000..5dc9b84 --- /dev/null +++ b/src/components/item_selector.vue @@ -0,0 +1,176 @@ + + + diff --git a/src/components/new_customer.vue b/src/components/new_customer.vue index cbabac4..abb8736 100644 --- a/src/components/new_customer.vue +++ b/src/components/new_customer.vue @@ -48,7 +48,7 @@ const submit = async (e) => { class="form-control" id="customer-name-input" placeholder="Firm Name" - v-model="customer.name" + v-model="customer.Name" />
@@ -58,7 +58,7 @@ const submit = async (e) => { class="form-control" id="customer-gstin-input" placeholder="22AAAAA0000A1Z5" - v-model="customer.gstin" + v-model="customer.Gstin" />
@@ -68,7 +68,7 @@ const submit = async (e) => { class="form-control" id="customer-contactname-input" placeholder="Contact Name" - v-model="customer.contactname" + v-model="customer.ContactName" />
@@ -79,7 +79,7 @@ const submit = async (e) => { class="form-control" id="customer-phone-input" placeholder="Contact Number" - v-model="customer.phone" + v-model="customer.Phone" />
@@ -89,7 +89,7 @@ const submit = async (e) => { class="form-control" id="customer-email-input" placeholder="E-Mail Address" - v-model="customer.email" + v-model="customer.Email" />
@@ -99,7 +99,7 @@ const submit = async (e) => { class="form-control" id="customer-website-input" placeholder="Website" - v-model="customer.website" + v-model="customer.Website" />
@@ -110,7 +110,7 @@ const submit = async (e) => { class="form-control" id="inputAddress" placeholder="1234 Main St" - v-model="customer.billingaddress.addresstext" + v-model="customer.BillingAddress.AddressText" >
@@ -119,7 +119,7 @@ const submit = async (e) => { type="text" class="form-control" id="inputCity" - v-model="customer.billingaddress.city" + v-model="customer.BillingAddress.city" />
@@ -128,7 +128,7 @@ const submit = async (e) => { type="text" class="form-control" id="inputState" - v-model="customer.billingaddress.state" + v-model="customer.BillingAddress.state" />
@@ -137,7 +137,7 @@ const submit = async (e) => { type="text" class="form-control" id="inputZip" - v-model="customer.billingaddress.postalcode" + v-model="customer.BillingAddress.postalcode" />
@@ -146,7 +146,7 @@ const submit = async (e) => { type="text" class="form-control" id="inputCountry" - v-model="customer.billingaddress.country" + v-model="customer.BillingAddress.country" />
diff --git a/src/router/index.ts b/src/router/index.ts index 7719220..55e2070 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -9,6 +9,7 @@ import NewCustomer from '../views/NewCustomer.vue' import AllItems from '../views/AllItems.vue' import NewItem from '../views/NewItem.vue' import NewInvoice from '../views/NewInvoice.vue' +import EditInvoice from '../views/EditInvoice.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -67,6 +68,12 @@ const router = createRouter({ component: NewInvoice, meta: { isAuth: true } }, + { + path: '/invoice/edit-draft/:id', + name: 'edit-draft', + component: EditInvoice, + meta: { isAuth: true } + }, ] }) diff --git a/src/views/EditInvoice.vue b/src/views/EditInvoice.vue new file mode 100644 index 0000000..983e9ef --- /dev/null +++ b/src/views/EditInvoice.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/views/NewInvoice.vue b/src/views/NewInvoice.vue index b2f32e2..06d3ec7 100644 --- a/src/views/NewInvoice.vue +++ b/src/views/NewInvoice.vue @@ -1,7 +1,7 @@ -- cgit v1.2.3