feat(server): wip tax rate on sale invoice service

This commit is contained in:
Ahmed Bouhuolia
2023-08-14 14:59:10 +02:00
parent a7644e6481
commit d1121f0b81
18 changed files with 514 additions and 74 deletions

View File

@@ -54,6 +54,14 @@ export interface IItemDTO {
sellDescription: string;
purchaseDescription: string;
// Used as an override if the default Tax Code for the selected `costAccountId` is not correct
purchaseTaxCode: string;
purchaseTaxId: string;
// Used as an override if the default Tax Code for the selected `sellAccountId` is not correct
saleTaxCode: string;
saleTaxId: string;
quantityOnHand: number;
note: string;

View File

@@ -34,6 +34,7 @@ export interface IItemEntry {
taxCode: string;
taxRate: number;
taxAmount: number;
item?: IItem;

View File

@@ -1,5 +1,5 @@
import { Knex } from 'knex';
import { IItemEntry } from './ItemEntry';
import { IItemEntry, IItemEntryDTO } from './ItemEntry';
import { IDynamicListFilterDTO } from '@/interfaces/DynamicFilter';
export interface ISaleEstimate {
@@ -29,7 +29,7 @@ export interface ISaleEstimateDTO {
estimateDate?: Date;
reference?: string;
estimateNumber?: string;
entries: IItemEntry[];
entries: IItemEntryDTO[];
note: string;
termsConditions: string;
sendToEmail: string;

View File

@@ -1,5 +1,5 @@
import { Knex } from 'knex';
import { ISystemUser, IAccount } from '@/interfaces';
import { ISystemUser, IAccount, ITaxTransaction } from '@/interfaces';
import { IDynamicListFilter } from '@/interfaces/DynamicFilter';
import { IItemEntry, IItemEntryDTO } from './ItemEntry';
@@ -33,6 +33,9 @@ export interface ISaleInvoice {
writtenoffExpenseAccountId?: number;
writtenoffExpenseAccount?: IAccount;
taxAmountWithheld: number;
taxes: ITaxTransaction[]
}
export interface ISaleInvoiceDTO {

View File

@@ -47,3 +47,10 @@ export interface ITaxRateDeletedPayload {
tenantId: number;
trx: Knex.Transaction;
}
export interface ITaxTransaction {
taxAmount: number;
taxName: string;
taxCode: string;
}