import { ObjectId } from 'mongodb'; import { Attachment } from './attachment'; import { BaseModel } from './baseModel'; import { Customer } from './customer'; import { OperationCenter } from './operationCenter'; import { SKU } from './sku'; import { Invoice, InvoiceItem } from './invoice'; import { TaxComponent } from './taxComponent'; export interface CreditNote extends BaseModel { date: Date; status: string; code?: string; invoice: Invoice | ObjectId; invoiceNumber: string; creditNoteNumber: string; operationCenter: OperationCenter | ObjectId; dcGstNumber?: string; customer: Customer | ObjectId; customerRemarks?: 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; items: CreditNoteItem[]; attachments?: Attachment[]; comments?: string; totalTax?: number; fieldwiseTaxSum?: { [key: string]: number; }; percentagewiseTaxSum?: { [key: number]: number; }; taxComponent?: TaxComponent[]; amount: number; irn?: string; account?: string; } export interface CreditNoteItem extends BaseModel { creditNote: CreditNote | ObjectId; invoiceItem: InvoiceItem | ObjectId; date: Date; operationCenter: OperationCenter | ObjectId; customer: Customer | ObjectId; sku: SKU | ObjectId; quantity: number; unitPrice: number; amount: number; comments?: string; hsn?: string; taxComponent: TaxComponent[]; taxValue: number; preTaxValue?: number; }