feat: discount sale and purchase transactions

This commit is contained in:
Ahmed Bouhuolia
2024-11-28 11:14:16 +02:00
parent aa4aaeb612
commit df8391201f
19 changed files with 377 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ import { IDynamicListFilterDTO } from './DynamicFilter';
import { IItemEntry, IItemEntryDTO } from './ItemEntry';
import { IBillLandedCost } from './LandedCost';
import { AttachmentLinkDTO } from './Attachments';
import { DiscountType } from './SaleInvoice';
export interface IBillDTO {
vendorId: number;
@@ -22,6 +23,13 @@ export interface IBillDTO {
projectId?: number;
isInclusiveTax?: boolean;
attachments?: AttachmentLinkDTO[];
// # Discount
discount?: number;
discountType?: DiscountType;
// # Adjustment
adjustment?: number;
}
export interface IBillEditDTO {

View File

@@ -1,5 +1,5 @@
import { Knex } from 'knex';
import { IDynamicListFilter, IItemEntry } from '@/interfaces';
import { DiscountType, IDynamicListFilter, IItemEntry } from '@/interfaces';
import { ILedgerEntry } from './Ledger';
import { AttachmentLinkDTO } from './Attachments';
@@ -23,6 +23,9 @@ export interface ICreditNoteNewDTO {
branchId?: number;
warehouseId?: number;
attachments?: AttachmentLinkDTO[];
discount?: number;
discountType?: DiscountType;
adjustment?: number;
}
export interface ICreditNoteEditDTO {

View File

@@ -3,6 +3,7 @@ import { IItemEntry, IItemEntryDTO } from './ItemEntry';
import { IDynamicListFilterDTO } from '@/interfaces/DynamicFilter';
import { CommonMailOptions, CommonMailOptionsDTO } from './Mailable';
import { AttachmentLinkDTO } from './Attachments';
import { DiscountType } from './SaleInvoice';
export interface ISaleEstimate {
id?: number;
@@ -40,6 +41,13 @@ export interface ISaleEstimateDTO {
branchId?: number;
warehouseId?: number;
attachments?: AttachmentLinkDTO[];
// # Discount
discount?: number;
discountType?: DiscountType;
// # Adjustment
adjustment?: number;
}
export interface ISalesEstimatesFilter extends IDynamicListFilterDTO {

View File

@@ -82,6 +82,11 @@ export interface ISaleInvoice {
paymentMethods?: Array<PaymentIntegrationTransactionLink>;
}
export enum DiscountType {
Percentage = 'Percentage',
Amount = 'Amount',
}
export interface ISaleInvoiceDTO {
invoiceDate: Date;
dueDate: Date;
@@ -105,7 +110,7 @@ export interface ISaleInvoiceDTO {
// # Discount
discount?: number;
discountType?: string;
discountType?: DiscountType;
// # Adjustments
adjustments?: string;

View File

@@ -2,6 +2,7 @@ import { Knex } from 'knex';
import { IItemEntry } from './ItemEntry';
import { CommonMailOptions, CommonMailOptionsDTO } from './Mailable';
import { AttachmentLinkDTO } from './Attachments';
import { DiscountType } from './SaleInvoice';
export interface ISaleReceipt {
id?: number;
@@ -47,6 +48,11 @@ export interface ISaleReceiptDTO {
entries: any[];
branchId?: number;
attachments?: AttachmentLinkDTO[];
discount?: number;
discountType?: DiscountType;
adjustment?: number;
}
export interface ISalesReceiptsService {

View File

@@ -1,4 +1,4 @@
import { IDynamicListFilter, IItemEntry, IItemEntryDTO } from '@/interfaces';
import { DiscountType, IDynamicListFilter, IItemEntry, IItemEntryDTO } from '@/interfaces';
import { Knex } from 'knex';
import { AttachmentLinkDTO } from './Attachments';
@@ -63,6 +63,11 @@ export interface IVendorCreditDTO {
branchId?: number;
warehouseId?: number;
attachments?: AttachmentLinkDTO[];
discount?: number;
discountType?: DiscountType;
adjustment?: number;
}
export interface IVendorCreditCreateDTO extends IVendorCreditDTO {}