import { ObjectId } from 'mongodb'; import { BaseModel } from './baseModel'; import { Customer } from './customer'; import { LmDispatch } from './lmDispatch'; import { OperationCenter } from './operationCenter'; import { SKU } from './sku'; import { TaxComponent } from './taxComponent'; export interface DispatchInvoice extends BaseModel { lmDispatch: LmDispatch | ObjectId; invoiceNumber?: string; date: Date; operationCenter: OperationCenter | ObjectId; dcGstNumber?: string; customer: Customer | ObjectId; poNumber?: string; billTo: string; billingAddressLine1: string; billingAddressLine2?: string; billingAddressCity: string; billingAddressState: string; billingAddressCountry: string; billingAddressPincode: string; deliverTo: string; deliveryAddressLine1: string; deliveryAddressLine2?: string; deliveryAddressCity: string; deliveryAddressState: string; deliveryAddressCountry: string; deliveryAddressPincode: string; billingFullAddress: string; deliveryFullAddress: string; items: DispatchInvoiceItem[]; totalQuantity: number; totalTax?: number; amount: number; /**Runtime Tax field */ fieldwiseTaxSum?: { [key: string]: number; }; percentagewiseTaxSum?: { [key: number]: number; }; taxComponent?: TaxComponent[]; invoiceType?: string; account?: string; } export interface DispatchInvoiceItem extends BaseModel { dispatchInvoice: DispatchInvoice | ObjectId; date: Date; sku: SKU | ObjectId; quantity: number; unitPrice: number; amount: number; hsn?: string; taxComponent?: TaxComponent[]; taxValue: number; }