aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces.ts
blob: 53d14c34313dfd31129313733d926a60e6995ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
export interface Transport {
  Name: string
  VehicleNum: string
  Method: string
  GSTIN: string
  Builty: string
}

export interface Item {
  Model: string
  Description: string
  Quantity: number
  UnitPrice: number // price without tax/discount
  TotalValue: number // UnitPrice * Quantity
  Discount: number // percentage of discount
  DiscountValue: number
  HSN: string

  TotalGST: number // gst percentage
  SGST: number | boolean
  CGST: number | boolean
  IGST: number | boolean
  TotalGSTValue: number // total tax
  Brand: string
  Category: string
}

// for registering new item to DB
export interface NewItem {
  Model: string
  Description: string
  UnitPrice: number // price without tax/discount
  HSN: string
  TotalGST: number // gst percentage
  Brand: string
  Category: string
}

export interface Address {
  AddressLine: string
  City: string
  State: string
  PINCode: string
  Country: string
}

export interface Person {
  ID?: number
  Name: string
  Phone?: string
  Email?: string
  BillAddress: Address
  ShipAddress?: Address
  Address?: string // to be removed
}

export interface Invoice {
  //Client: Person
  Items: Item[]
  Transport: Transport
}

export interface InvoiceSummary {
  TotalQuantity: number
  TotalRawPrice: number // total price without gst/discount
  TotalDiscount: number // total amount of discount
  TotalGST: number // total gst to be paid
  TotalPriceAfterDiscount: number
  TotalPriceAfterGST: number
  TotalRoundedOff: number
}