@silexpert/core 1.1.270 → 1.1.271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/resources/Transaction.d.ts +2 -2
- package/dist/cjs/api/resources/Transaction.d.ts.map +1 -1
- package/dist/cjs/api/resources/Transaction.js.map +1 -1
- package/dist/cjs/types/Enum/AccountType.d.ts +28 -0
- package/dist/cjs/types/Enum/AccountType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/AccountType.js +28 -0
- package/dist/cjs/types/Enum/AccountType.js.map +1 -1
- package/dist/cjs/types/Interface/api/account/Create.d.ts +2 -0
- package/dist/cjs/types/Interface/api/account/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/account/Create.js +12 -0
- package/dist/cjs/types/Interface/api/account/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/account/Update.d.ts +2 -0
- package/dist/cjs/types/Interface/api/account/Update.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/account/Update.js +12 -0
- package/dist/cjs/types/Interface/api/account/Update.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +3 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Read.d.ts +2 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.js +21 -11
- package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/vat.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/vat.js +3 -1
- package/dist/cjs/utils/commercialManagement/vat.js.map +1 -1
- package/dist/mjs/api/resources/Transaction.d.ts +2 -2
- package/dist/mjs/api/resources/Transaction.d.ts.map +1 -1
- package/dist/mjs/api/resources/Transaction.js.map +1 -1
- package/dist/mjs/types/Enum/AccountType.d.ts +28 -0
- package/dist/mjs/types/Enum/AccountType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/AccountType.js +28 -0
- package/dist/mjs/types/Enum/AccountType.js.map +1 -1
- package/dist/mjs/types/Interface/api/account/Create.d.ts +2 -0
- package/dist/mjs/types/Interface/api/account/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/account/Create.js +15 -1
- package/dist/mjs/types/Interface/api/account/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/account/Update.d.ts +2 -0
- package/dist/mjs/types/Interface/api/account/Update.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/account/Update.js +15 -1
- package/dist/mjs/types/Interface/api/account/Update.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +3 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js +2 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Read.d.ts +2 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.js +14 -0
- package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/vat.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/vat.js +2 -0
- package/dist/mjs/utils/commercialManagement/vat.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Transaction.ts +2 -1
- package/ts/types/Enum/AccountType.ts +28 -0
- package/ts/types/Interface/api/account/Create.ts +11 -1
- package/ts/types/Interface/api/account/Update.ts +12 -1
- package/ts/types/Interface/api/commercialManagement/Create.ts +3 -1
- package/ts/types/Interface/api/commercialManagement/Read.ts +2 -0
- package/ts/utils/commercialManagement/document.ts +18 -1
- package/ts/utils/commercialManagement/vat.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAEyB;AAEzB,6CAAqE;AACrE,sFAA2E;AAC3E,6EAAkG;AAClG,mEAAoE;AACpE,iEAA8D;AAO9D,MAAa,uBAAuB;CAwNnC;AAvNC;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,EAAE;QACN,OAAO,EAAE,4BAA4B;KACtC,CAAC;;wDACwB;AAE1B;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACe;AAE1B;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACW;AAEtB;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qEAC4B;AAEvC;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACY;AAEvB;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACY;AAEvB;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACW;AAEtB;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACmB;AAE9B;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4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DateString, IsEnum, IsNumber, IsOptional, IsString, Min,\n} from 'class-validator';\nimport { IFile } from '../../..';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\nimport { AccountingCategoryId, FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { RecurrenceType } from '../../../Enum/RecurrenceType';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ISocietyGescom } from '../../models/ISocietyGescom';\nimport { IThirdParty } from '../../models/IThirdParty';\n\nexport type IProductInvoiceToCreate = IProductInvoice & { save?: boolean };\n\nexport class CreateCommercialSetting {\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n @Min(0, {\n message: 'Capital should be positive',\n })\n capital?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n tvaCode?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n rcs?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n numberTradeDirectory?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bank?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n iban?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bic?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n mailContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n phoneContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n website?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n commercialName?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n penalties?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n discount?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n recoveryCost?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n vatMention?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n generatedBy?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n acceptCheque?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n mentionAutoent?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startInvoice?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startEstimate?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n dayOfValidity?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n paymentsAccepted?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n stripePaymentByDefault?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n displayLogo?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n invoiceCgv?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n color?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeInvoiceText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeEstimateText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n logoAlignment?: LogoAlignment | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n idFont?: FontIds | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isEdgingDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n edgingColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n fontColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isCoordinatesFrameDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areLinesSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areColumnsSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n accountingCategory?: AccountingCategoryId;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideEmailHeader?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideBrandName?: boolean;\n}\n\nexport class CreateCommercialMail {\n @ApiProperty()\n @IsString()\n to: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n cc?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bcc?: string;\n\n @ApiProperty()\n @IsString()\n subject: string;\n\n @ApiProperty()\n @IsString()\n content: string;\n}\n\nexport class CreateCommercialMailWithMultipleFiles extends CreateCommercialMail {\n idsFile: number[];\n}\n\nexport class CommercialDocumentInputs {\n @ApiProperty()\n legalForm: string | null;\n\n @ApiProperty()\n capital: number | null;\n\n @ApiProperty()\n siren: string | null;\n\n @ApiProperty()\n rcs: string | null;\n\n @ApiProperty()\n vatCode: string | null;\n\n @ApiProperty()\n nafCode: string | null;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n thirdParty: IThirdParty;\n\n @ApiProperty()\n @IsDateString()\n emissionDate: string;\n\n @ApiProperty()\n @IsDateString()\n dueDate: string;\n\n @ApiProperty({ description: 'Date d\\'expiration pour la facture d\\'acompte' })\n expirationDate: string | null;\n\n @ApiProperty({ description: 'Conditions de réglement' })\n termsOfPayment: string | null;\n\n @ApiProperty()\n @IsArray()\n products: Array<IProductInvoiceToCreate>;\n\n @ApiProperty({ description: 'Escompte' })\n discount: string | null;\n\n @ApiProperty()\n comment: string | null;\n\n @ApiProperty({ description: 'Pénalité de retard' })\n penalties: string | null;\n\n @ApiPropertyOptional({ description: 'Remise globale' })\n generalDiscount2: number | null;\n\n @ApiProperty({ description: 'Indemnité forfaitaire' })\n compensation: string | null;\n\n @ApiProperty()\n vatMention: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n disableVat: boolean;\n\n @ApiProperty()\n title: string | null;\n\n @ApiProperty({ description: 'Commercial name of seller' })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Commercial number address of seller' })\n number?: string | null;\n\n @ApiProperty({ description: 'Commercial street address of seller' })\n street: string | null;\n\n @ApiProperty({ description: 'Commercial zip code address of seller' })\n zipCode: string | null;\n\n @ApiProperty({ description: 'Commercial city address of seller' })\n city: string | null;\n\n @ApiProperty()\n settings: ISocietyGescom;\n\n @ApiProperty()\n cgv: string | null;\n\n @ApiProperty()\n logoUrl: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isStripeAllowed: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isDraft: boolean;\n\n @ApiProperty()\n idEstimateInvoiceType: EstimateInvoiceType;\n\n @ApiProperty()\n accountingCategory: AccountingCategoryId;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n\n @ApiPropertyOptional({ description: 'Moyen de paiement' })\n paymentType?: string | null;\n}\n\nexport class CreatePreSaleDocument extends CommercialDocumentInputs {\n paymentLink?: '#';\n deposit?: undefined;\n fromEstimateId: undefined;\n assetMarginVatIds?: [];\n}\nexport class CreateInvoiceDocument extends CommercialDocumentInputs {\n paymentLink?: string;\n deposit?: number;\n fromInvoiceId?: number | null; // Nécessaire lors de la création d'un avoir à partir d'une facture\n fromEstimateId: number | null; // Nécessaire lors du passage d'un devis à facture\n assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes\n}\n\nexport class CreateCgv {\n @ApiProperty()\n cgv: string | null;\n}\n\nexport class CreateReminder {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n beforeThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n dueDate: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterSeven: boolean;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n subject?: string;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n message?: string;\n\n @ApiProperty()\n @IsString()\n email: string;\n}\n\nexport class CreateRecurrence {\n @ApiProperty()\n @IsEnum(RecurrenceType)\n type: number;\n\n @ApiProperty()\n @IsDateString()\n startDate: string;\n\n @ApiProperty()\n @IsDateString()\n endDate: string;\n\n @ApiProperty()\n @ToBoolean()\n @IsBoolean()\n isActive: boolean;\n}\n\nexport class CreateRegenerateDocument {\n @ApiProperty()\n @IsString()\n label: string;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n @IsString()\n title: string;\n}\n\nexport type CreateMailHeader = {\n payload: {\n reference: string,\n dueDate: Date | null,\n idEstimateInvoiceType: EstimateInvoiceType,\n totalTaxExcluded: number,\n totalTaxIncluded: number,\n file?: IFile\n },\n logoUrl: string | null,\n companyName: string,\n fileUrl: string | null,\n hostS3: string,\n hasVat: boolean\n};"]}
|
|
1
|
+
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAEyB;AAEzB,6CAAqE;AACrE,sFAA2E;AAC3E,6EAAkG;AAClG,mEAAoE;AACpE,iEAA8D;AAO9D,MAAa,uBAAuB;CAwNnC;AAvNC;IAAC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,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AA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACM;AAEnB;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;6CACK;AAjClB,wCAkCC;AAED,MAAa,gBAAgB;CAiB5B;AAhBC;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,wBAAM,EAAC,+BAAc,CAAC;;8CACR;AAEf;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;mDACK;AAEpB;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;iDACG;AAElB;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,6BAAS,GAAE;IACX,IAAA,2BAAS,GAAE;;kDACQ;AAhBtB,4CAiBC;AAED,MAAa,wBAAwB;CAYpC;AAXC;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;uDACK;AAEhB;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;2DACS;AAEpB;IAAC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;uDACK;AAXlB,4DAYC","sourcesContent":["import {\n IsArray, IsBoolean, IsDateString, IsEnum, IsNumber, IsOptional, IsString, Min,\n} from 'class-validator';\nimport { IFile, ReadProductEditing } from '../../..';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\nimport { AccountingCategoryId, FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { RecurrenceType } from '../../../Enum/RecurrenceType';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ISocietyGescom } from '../../models/ISocietyGescom';\nimport { IThirdParty } from '../../models/IThirdParty';\n\nexport type IProductInvoiceToCreate = IProductInvoice & { save?: boolean };\n\nexport class CreateCommercialSetting {\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n @Min(0, {\n message: 'Capital should be positive',\n })\n capital?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n tvaCode?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n rcs?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n numberTradeDirectory?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bank?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n iban?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bic?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n mailContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n phoneContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n website?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n commercialName?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n penalties?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n discount?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n recoveryCost?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n vatMention?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n generatedBy?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n acceptCheque?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n mentionAutoent?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startInvoice?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startEstimate?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n dayOfValidity?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n paymentsAccepted?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n stripePaymentByDefault?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n displayLogo?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n invoiceCgv?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n color?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeInvoiceText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeEstimateText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n logoAlignment?: LogoAlignment | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n idFont?: FontIds | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isEdgingDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n edgingColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n fontColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isCoordinatesFrameDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areLinesSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areColumnsSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n accountingCategory?: AccountingCategoryId;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideEmailHeader?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideBrandName?: boolean;\n}\n\nexport class CreateCommercialMail {\n @ApiProperty()\n @IsString()\n to: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n cc?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bcc?: string;\n\n @ApiProperty()\n @IsString()\n subject: string;\n\n @ApiProperty()\n @IsString()\n content: string;\n}\n\nexport class CreateCommercialMailWithMultipleFiles extends CreateCommercialMail {\n idsFile: number[];\n}\n\nexport class CommercialDocumentInputs {\n @ApiProperty()\n legalForm: string | null;\n\n @ApiProperty()\n capital: number | null;\n\n @ApiProperty()\n siren: string | null;\n\n @ApiProperty()\n rcs: string | null;\n\n @ApiProperty()\n vatCode: string | null;\n\n @ApiProperty()\n nafCode: string | null;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n thirdParty: IThirdParty;\n\n @ApiProperty()\n @IsDateString()\n emissionDate: string;\n\n @ApiProperty()\n @IsDateString()\n dueDate: string;\n\n @ApiProperty({ description: 'Date d\\'expiration pour la facture d\\'acompte' })\n expirationDate: string | null;\n\n @ApiProperty({ description: 'Conditions de réglement' })\n termsOfPayment: string | null;\n\n @ApiProperty()\n @IsArray()\n products: Array<IProductInvoiceToCreate>;\n\n @ApiProperty({ description: 'Escompte' })\n discount: string | null;\n\n @ApiProperty()\n comment: string | null;\n\n @ApiProperty({ description: 'Pénalité de retard' })\n penalties: string | null;\n\n @ApiPropertyOptional({ description: 'Remise globale' })\n generalDiscount2: number | null;\n\n @ApiProperty({ description: 'Indemnité forfaitaire' })\n compensation: string | null;\n\n @ApiProperty()\n vatMention: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n disableVat: boolean;\n\n @ApiProperty()\n title: string | null;\n\n @ApiProperty({ description: 'Commercial name of seller' })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Commercial number address of seller' })\n number?: string | null;\n\n @ApiProperty({ description: 'Commercial street address of seller' })\n street: string | null;\n\n @ApiProperty({ description: 'Commercial zip code address of seller' })\n zipCode: string | null;\n\n @ApiProperty({ description: 'Commercial city address of seller' })\n city: string | null;\n\n @ApiProperty()\n settings: ISocietyGescom;\n\n @ApiProperty()\n cgv: string | null;\n\n @ApiProperty()\n logoUrl: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isStripeAllowed: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isDraft: boolean;\n\n @ApiProperty()\n idEstimateInvoiceType: EstimateInvoiceType;\n\n @ApiProperty()\n accountingCategory: AccountingCategoryId;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n\n @ApiPropertyOptional({ description: 'Moyen de paiement' })\n paymentType?: string | null;\n}\n\nexport class CreatePreSaleDocument extends CommercialDocumentInputs {\n paymentLink?: '#';\n deposit?: undefined;\n fromEstimateId: undefined;\n assetMarginVatIds?: [];\n advanceProducts?: [];\n}\nexport class CreateInvoiceDocument extends CommercialDocumentInputs {\n paymentLink?: string;\n deposit?: number;\n fromInvoiceId?: number | null; // Nécessaire lors de la création d'un avoir à partir d'une facture\n fromEstimateId: number | null; // Nécessaire lors du passage d'un devis à facture\n assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes\n advanceProducts?: ReadProductEditing[]; // Laisser vide côté front, utilisé pour l'affichage des bases TVA sur les acomptes\n}\n\nexport class CreateCgv {\n @ApiProperty()\n cgv: string | null;\n}\n\nexport class CreateReminder {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n beforeThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n dueDate: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterSeven: boolean;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n subject?: string;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n message?: string;\n\n @ApiProperty()\n @IsString()\n email: string;\n}\n\nexport class CreateRecurrence {\n @ApiProperty()\n @IsEnum(RecurrenceType)\n type: number;\n\n @ApiProperty()\n @IsDateString()\n startDate: string;\n\n @ApiProperty()\n @IsDateString()\n endDate: string;\n\n @ApiProperty()\n @ToBoolean()\n @IsBoolean()\n isActive: boolean;\n}\n\nexport class CreateRegenerateDocument {\n @ApiProperty()\n @IsString()\n label: string;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n @IsString()\n title: string;\n}\n\nexport type CreateMailHeader = {\n payload: {\n reference: string,\n dueDate: Date | null,\n idEstimateInvoiceType: EstimateInvoiceType,\n totalTaxExcluded: number,\n totalTaxIncluded: number,\n file?: IFile\n },\n logoUrl: string | null,\n companyName: string,\n fileUrl: string | null,\n hostS3: string,\n hasVat: boolean\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Read.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,kDAAkD,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAE7E,MAAM,MAAM,mBAAmB,G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AAQ,GACtB,aAAa,CAAC,OAAO,GACrB,cAAc,CAAC,OAAO,GACtB,cAAc,CAAC,MAAM,GACrB,cAAc,CAAC,QAAQ,GACvB,cAAc,CAAC,OAAO,GACtB,cAAc,CAAC,OAAO,CAAC;AAEvB,KAAK,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAAE,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,cAAc,CAAC;KAAE,CAAA;IACpF,QAAQ,EAAE;QAAE,QAAQ,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;KAAE,CAAA;CAC1F,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Read.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Read.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { IAccountingFile } from '../../models/IAccountingFile';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ReadFormattedAccountingTransaction } from '../accountingEntry/AnnotateAccountingTransaction';\nimport { CommercialDocumentInputs } from './Create';\nimport { IEstimateInvoice } from '../../models/IEstimateInvoice';\nimport { EstimateStatus, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';\nimport { IThirdParty } from '../../models/IThirdParty';\n\nexport type ReadCashBasedInvoice = Partial<IAccountingFile>;\n\nexport type ReadAccrualInvoice = Partial<ReadFormattedAccountingTransaction>;\n\nexport type ReadEstimateInvoice = IEstimateInvoice & { id: number };\n\nexport type ReadProductEditing = IProductInvoice & {\n totalTaxExcluded: number;\n unitFormatted: string;\n vatFormatted: string;\n discountFormatted: string | null;\n discountTypeFormatted: string | null;\n priceTaxExcludedFormatted: string | null;\n totalTaxExcludedFormatted: string | null;\n marginVatFormatted: string | null;\n};\n\nexport type ReadThirdPartyEditing = IThirdParty & {\n deliveryCountry: string | null;\n country: string | null;\n};\n\nexport type ReadVatEditing = {\n id: number;\n name: string;\n amount: number;\n value: number;\n baseFormatted: string;\n amountFormatted: string;\n};\n\nexport type ReadPreview = { idFile: number; };\n\nexport type ReadDocumentEditing = CommercialDocumentInputs & {\n title?: string | null;\n idEstimateInvoiceType: EstimateInvoiceType;\n phoneContact: string | null;\n dueDateFormatted: string | null;\n expirationDateFormatted: string | null;\n capitalFormatted: string | null;\n depositFormatted: string | null;\n emissionDateFormatted: string | null;\n products: ReadProductEditing[];\n vats: ReadVatEditing[];\n totalTaxExcluded: number;\n totalTaxIncluded: number;\n totalTaxAndDiscountIncluded: number;\n generalDiscountFormatted: string | null;\n totalTaxExcludedFormatted: string;\n totalTaxIncludedFormatted: string;\n totalTaxAndDiscountIncludedFormatted: string;\n totalVatAmountFormatted: string;\n font: {\n id: FontIds;\n name: string;\n url: string;\n },\n shouldDisplayDiscountColumn: boolean;\n paymentLink?: string;\n marginVats: string[];\n accountingCategoryFormatted: string | null;\n};\n\nexport type ReadCommercialDocumentTemplate = {\n header: string;\n body: string;\n footer: string;\n data: ReadDocumentEditing;\n};\n\nexport type ReadEstimateInvoiceStatus =\nInvoiceStatus.PAID |\nInvoiceStatus.UNPAID |\nInvoiceStatus.CANCELED |\nInvoiceStatus.WAITING |\nEstimateStatus.REFUSED |\nEstimateStatus.BILLED |\nEstimateStatus.ACCEPTED |\nEstimateStatus.WAITING |\nEstimateStatus.EXPIRED;\n\ntype CountAndNumber = { count: number; amount: number; };\n\nexport type ReadCountDocumentByStatus = {\n invoices: { paid: CountAndNumber; waiting: CountAndNumber; unpaid: CountAndNumber; }\n preSales: { accepted: CountAndNumber; waiting: CountAndNumber; refused: CountAndNumber; }\n};\n\nexport type ReadCommercialMailTemplate = {\n header: string;\n};"]}
|
|
1
|
+
{"version":3,"file":"Read.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Read.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { IAccountingFile } from '../../models/IAccountingFile';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ReadFormattedAccountingTransaction } from '../accountingEntry/AnnotateAccountingTransaction';\nimport { CommercialDocumentInputs } from './Create';\nimport { IEstimateInvoice } from '../../models/IEstimateInvoice';\nimport { EstimateStatus, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';\nimport { IThirdParty } from '../../models/IThirdParty';\n\nexport type ReadCashBasedInvoice = Partial<IAccountingFile>;\n\nexport type ReadAccrualInvoice = Partial<ReadFormattedAccountingTransaction>;\n\nexport type ReadEstimateInvoice = IEstimateInvoice & { id: number };\n\nexport type ReadProductEditing = IProductInvoice & {\n totalTaxExcluded: number;\n unitFormatted: string;\n vatFormatted: string;\n discountFormatted: string | null;\n discountTypeFormatted: string | null;\n priceTaxExcludedFormatted: string | null;\n totalTaxExcludedFormatted: string | null;\n marginVatFormatted: string | null;\n};\n\nexport type ReadThirdPartyEditing = IThirdParty & {\n deliveryCountry: string | null;\n country: string | null;\n};\n\nexport type ReadVatEditing = {\n id: number;\n name: string;\n amount: number;\n value: number;\n baseFormatted: string;\n amountFormatted: string;\n toPay: number;\n base: number;\n};\n\nexport type ReadPreview = { idFile: number; };\n\nexport type ReadDocumentEditing = CommercialDocumentInputs & {\n title?: string | null;\n idEstimateInvoiceType: EstimateInvoiceType;\n phoneContact: string | null;\n dueDateFormatted: string | null;\n expirationDateFormatted: string | null;\n capitalFormatted: string | null;\n depositFormatted: string | null;\n emissionDateFormatted: string | null;\n products: ReadProductEditing[];\n vats: ReadVatEditing[];\n totalTaxExcluded: number;\n totalTaxIncluded: number;\n totalTaxAndDiscountIncluded: number;\n generalDiscountFormatted: string | null;\n totalTaxExcludedFormatted: string;\n totalTaxIncludedFormatted: string;\n totalTaxAndDiscountIncludedFormatted: string;\n totalVatAmountFormatted: string;\n font: {\n id: FontIds;\n name: string;\n url: string;\n },\n shouldDisplayDiscountColumn: boolean;\n paymentLink?: string;\n marginVats: string[];\n accountingCategoryFormatted: string | null;\n};\n\nexport type ReadCommercialDocumentTemplate = {\n header: string;\n body: string;\n footer: string;\n data: ReadDocumentEditing;\n};\n\nexport type ReadEstimateInvoiceStatus =\nInvoiceStatus.PAID |\nInvoiceStatus.UNPAID |\nInvoiceStatus.CANCELED |\nInvoiceStatus.WAITING |\nEstimateStatus.REFUSED |\nEstimateStatus.BILLED |\nEstimateStatus.ACCEPTED |\nEstimateStatus.WAITING |\nEstimateStatus.EXPIRED;\n\ntype CountAndNumber = { count: number; amount: number; };\n\nexport type ReadCountDocumentByStatus = {\n invoices: { paid: CountAndNumber; waiting: CountAndNumber; unpaid: CountAndNumber; }\n preSales: { accepted: CountAndNumber; waiting: CountAndNumber; refused: CountAndNumber; }\n};\n\nexport type ReadCommercialMailTemplate = {\n header: string;\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuC,MAAM,qDAAqD,CAAC;AAI1I,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAC3F,MAAM,aAAa,CAAC;AAgBrB,wBAAgB,0BAA0B,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,8BAA8B,CA0GnP;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,0BAA0B,CAuB7J"}
|
|
@@ -16,15 +16,25 @@ const brands_1 = require("../brands");
|
|
|
16
16
|
const ejs = require('ejs');
|
|
17
17
|
require('dayjs/locale/fr');
|
|
18
18
|
function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBrandName = false, nodeEnv = undefined) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
20
20
|
const products = (0, lodash_1.orderBy)(payload.products.map((product) => (0, product_1.productToReadProductEditing)(product), 'reorder'));
|
|
21
21
|
const vats = (0, lodash_1.orderBy)(Object.values((0, lodash_1.groupBy)(products, 'vatFormatted')).map((v) => ((0, vat_1.vatToReadVatEditing)(v)), 'value')).filter((v) => v.id !== Vat_1.Vat.MARGE.id);
|
|
22
22
|
const thirdParty = (0, thirdParty_1.thirdPartyToReadThirdPartyEditing)(payload.thirdParty);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
let forcedVats = undefined;
|
|
24
|
+
if ((_a = payload.advanceProducts) === null || _a === void 0 ? void 0 : _a.length) {
|
|
25
|
+
const advanceVats = Object.values((0, lodash_1.groupBy)(payload.advanceProducts, 'vatFormatted')).map((v) => ((0, vat_1.vatToReadVatEditing)(v)), 'value').filter((v) => v.id !== Vat_1.Vat.MARGE.id);
|
|
26
|
+
forcedVats = vats.map(v => {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
const base = v.base - ((_b = (_a = advanceVats.find(a => a.id === v.id)) === null || _a === void 0 ? void 0 : _a.base) !== null && _b !== void 0 ? _b : 0);
|
|
29
|
+
const toPay = v.toPay - ((_d = (_c = advanceVats.find(a => a.id === v.id)) === null || _c === void 0 ? void 0 : _c.toPay) !== null && _d !== void 0 ? _d : 0);
|
|
30
|
+
return Object.assign(Object.assign({}, v), { baseFormatted: (0, amount_1.integerToFormattedAmountString)(base), amountFormatted: (0, amount_1.integerToFormattedAmountString)(toPay) });
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const data = Object.assign(Object.assign({}, payload), { thirdParty, paymentLink: (_b = payload.paymentLink) !== null && _b !== void 0 ? _b : '#', idEstimateInvoiceType, title: (_c = payload.title) !== null && _c !== void 0 ? _c : null, penalties: (_d = payload.penalties) !== null && _d !== void 0 ? _d : null, compensation: (_e = payload.compensation) !== null && _e !== void 0 ? _e : null, discount: (_f = payload.discount) !== null && _f !== void 0 ? _f : null, vatMention: (_g = payload.vatMention) !== null && _g !== void 0 ? _g : null, phoneContact: (_j = (_h = payload.settings) === null || _h === void 0 ? void 0 : _h.phoneContact) !== null && _j !== void 0 ? _j : null, products,
|
|
34
|
+
vats, totalTaxExcluded: (0, lodash_1.sumBy)(products, 'totalTaxExcluded'), totalTaxIncluded: (0, lodash_1.sumBy)(products, 'totalTaxExcluded') + (0, lodash_1.sumBy)(vats, 'amount'), totalTaxAndDiscountIncluded: (0, lodash_1.sumBy)(products, 'totalTaxExcluded') + (0, lodash_1.sumBy)(vats, 'amount'), generalDiscountFormatted: payload.generalDiscount2 ? (0, amount_1.integerToFormattedAmountString)(payload.generalDiscount2) : null, depositFormatted: payload.deposit ? (0, amount_1.integerToFormattedAmountString)(payload.deposit) : null, totalTaxExcludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded')), totalTaxIncludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded') + (0, lodash_1.sumBy)(vats, 'amount')), totalTaxAndDiscountIncludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded') + (0, lodash_1.sumBy)(vats, 'amount') - ((_k = payload.generalDiscount2) !== null && _k !== void 0 ? _k : 0) - ((_l = payload.deposit) !== null && _l !== void 0 ? _l : 0)), totalVatAmountFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(vats, 'amount')), font: {
|
|
35
|
+
id: (_o = (_m = payload.settings) === null || _m === void 0 ? void 0 : _m.idFont) !== null && _o !== void 0 ? _o : CommercialManagement_1.FontIds.CIRCULAR_STD,
|
|
36
|
+
name: (_q = (_p = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _p === void 0 ? void 0 : _p.name) !== null && _q !== void 0 ? _q : CommercialManagement_1.fontList[0].name,
|
|
37
|
+
url: (_s = (_r = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _r === void 0 ? void 0 : _r.link) !== null && _s !== void 0 ? _s : CommercialManagement_1.fontList[0].link,
|
|
28
38
|
}, capitalFormatted: payload.capital
|
|
29
39
|
? `${payload.capital}`.split('')
|
|
30
40
|
.reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')
|
|
@@ -33,7 +43,7 @@ function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBr
|
|
|
33
43
|
// @ts-ignore
|
|
34
44
|
marginVats: (0, lodash_1.uniq)(products
|
|
35
45
|
.filter((p) => p.marginVatFormatted !== null)
|
|
36
|
-
.map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (
|
|
46
|
+
.map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (_u = (_t = CommercialManagement_1.AccountingCategoryList.find((a) => a.id === payload.accountingCategory)) === null || _t === void 0 ? void 0 : _t.label) !== null && _u !== void 0 ? _u : null,
|
|
37
47
|
// @ts-ignore
|
|
38
48
|
brandColors: (0, brands_1.getBrandConfig)({ objectWaited: 'colors', nodeEnv }), brandName: `${(0, brands_1.getBrandConfig)({ objectWaited: 'name', nodeEnv })}`, shouldHideBrandName, paymentType: payload.paymentType });
|
|
39
49
|
const commonTemplate = new common_1.CommercialDocumentCommonHTML();
|
|
@@ -41,18 +51,18 @@ function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBr
|
|
|
41
51
|
EstimateInvoice_1.EstimateInvoiceType.DEVIS,
|
|
42
52
|
EstimateInvoice_1.EstimateInvoiceType.BON,
|
|
43
53
|
].includes(idEstimateInvoiceType)
|
|
44
|
-
? (
|
|
45
|
-
: (
|
|
54
|
+
? (_v = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _v === void 0 ? void 0 : _v.freeEstimateText
|
|
55
|
+
: (_w = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _w === void 0 ? void 0 : _w.freeInvoiceText;
|
|
46
56
|
return {
|
|
47
57
|
header: ejs.render(commonTemplate.header, data),
|
|
48
58
|
body: ejs.render(body_1.bodyTemplate, Object.assign(Object.assign({}, data), { comment: data.comment && typeof data.comment === 'string'
|
|
49
|
-
? (
|
|
59
|
+
? (_x = data.comment) === null || _x === void 0 ? void 0 : _x.replace(/\n/g, '<br/>')
|
|
50
60
|
: null, products: data.products.map((p) => {
|
|
51
61
|
var _a;
|
|
52
62
|
return (Object.assign(Object.assign({}, p), { comment: p.comment && typeof p.comment === 'string'
|
|
53
63
|
? (_a = p.comment) === null || _a === void 0 ? void 0 : _a.replace(/\n/g, '<br/>')
|
|
54
64
|
: null }));
|
|
55
|
-
}) })),
|
|
65
|
+
}), vats: forcedVats !== null && forcedVats !== void 0 ? forcedVats : vats })),
|
|
56
66
|
footer: ejs.render(commonTemplate.footer, Object.assign(Object.assign({}, data), { freeText: documentFreeText !== null && documentFreeText !== void 0 ? documentFreeText : null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uniq,\n} from 'lodash';\nimport * as dayjs from 'dayjs';\nimport { ReadCommercialDocumentTemplate, ReadDocumentEditing } from '../../types/Interface/api/commercialManagement/Read';\nimport {\n AccountingCategoryList, FontIds, fontList,\n} from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument, CreateMailHeader, CreatePreSaleDocument, ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\n\nconst ejs = require('ejs');\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string,\n primary50: string,\n primary100: string,\n primary300: string,\n primary500: string,\n primary700: string\n};\n\nexport function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties ?? null,\n compensation: payload.compensation ?? null,\n discount: payload.discount ?? null,\n vatMention: payload.vatMention ?? null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n totalTaxAndDiscountIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount')),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount') - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`.split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find(\n (p) => p.discount2 && p.discount2 > 0,\n ),\n // @ts-ignore\n marginVats: _uniq(\n products\n .filter((p) => p.marginVatFormatted !== null)\n .map((p) => p.marginVatFormatted),\n ),\n accountingCategoryFormatted:\n AccountingCategoryList.find((a) => a.id === payload.accountingCategory)\n ?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [\n EstimateInvoiceType.DEVIS,\n EstimateInvoiceType.BON,\n ].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment:\n data.comment && typeof data.comment === 'string'\n ? data.comment?.replace(/\\n/g, '<br/>')\n : null,\n products: data.products.map((p) => ({\n ...p,\n comment:\n p.comment && typeof p.comment === 'string'\n ? p.comment?.replace(/\\n/g, '<br/>')\n : null,\n })),\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(params: CreateMailHeader, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialMailTemplate {\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded - params.payload.totalTaxExcluded),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}"]}
|
|
1
|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AC;IACnB,MAAM,IAAI,mCACL,MAAM,CAAC,OAAO,KACjB,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,iBAAiB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EACpH,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EACtG,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,IAAA,uBAAc,EAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB,EAClF,mBAAmB,GACpB,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,mCAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC;AAvBD,gDAuBC","sourcesContent":["import {\n orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq,\n} from 'lodash';\nimport * as dayjs from 'dayjs';\nimport { ReadCommercialDocumentTemplate, ReadDocumentEditing, ReadVatEditing } from '../../types/Interface/api/commercialManagement/Read';\nimport {\n AccountingCategoryList, FontIds, fontList,\n} from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument, CreateMailHeader, CreatePreSaleDocument, ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\n\nconst ejs = require('ejs');\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string,\n primary50: string,\n primary100: string,\n primary300: string,\n primary500: string,\n primary700: string\n};\n\nexport function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n let forcedVats: ReadVatEditing[] | undefined = undefined;\n\n if (payload.advanceProducts?.length) {\n const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value').filter((v) => v.id !== Vat.MARGE.id);\n \n forcedVats = vats.map(v => {\n const base = v.base - (advanceVats.find(a => a.id === v.id)?.base ?? 0);\n const toPay = v.toPay - (advanceVats.find(a => a.id === v.id)?.toPay ?? 0);\n return {\n ...v,\n baseFormatted: integerToFormattedAmountString(base),\n amountFormatted: integerToFormattedAmountString(toPay),\n };\n });\n }\n\n const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties ?? null,\n compensation: payload.compensation ?? null,\n discount: payload.discount ?? null,\n vatMention: payload.vatMention ?? null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n totalTaxAndDiscountIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount')),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount') - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`.split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find(\n (p) => p.discount2 && p.discount2 > 0,\n ),\n // @ts-ignore\n marginVats: _uniq(\n products\n .filter((p) => p.marginVatFormatted !== null)\n .map((p) => p.marginVatFormatted),\n ),\n accountingCategoryFormatted:\n AccountingCategoryList.find((a) => a.id === payload.accountingCategory)\n ?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [\n EstimateInvoiceType.DEVIS,\n EstimateInvoiceType.BON,\n ].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment:\n data.comment && typeof data.comment === 'string'\n ? data.comment?.replace(/\\n/g, '<br/>')\n : null,\n products: data.products.map((p) => ({\n ...p,\n comment:\n p.comment && typeof p.comment === 'string'\n ? p.comment?.replace(/\\n/g, '<br/>')\n : null,\n })),\n vats: forcedVats ?? vats,\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(params: CreateMailHeader, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialMailTemplate {\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded - params.payload.totalTaxExcluded),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/vat.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEvD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/vat.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEvD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,cAAc,CAYlF"}
|
|
@@ -14,7 +14,7 @@ function getById(id) {
|
|
|
14
14
|
}
|
|
15
15
|
exports.getById = getById;
|
|
16
16
|
function vatToReadVatEditing(products) {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f;
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18
18
|
const { idVat } = products[0];
|
|
19
19
|
return {
|
|
20
20
|
id: idVat,
|
|
@@ -23,6 +23,8 @@ function vatToReadVatEditing(products) {
|
|
|
23
23
|
value: (_d = (_c = getById(idVat)) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 0,
|
|
24
24
|
baseFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0))),
|
|
25
25
|
amountFormatted: (0, amount_1.integerToFormattedAmountString)(((0, lodash_1.sumBy)(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * (((_f = (_e = getById(idVat)) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : 0))) / 100),
|
|
26
|
+
toPay: ((0, lodash_1.sumBy)(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * (((_h = (_g = getById(idVat)) === null || _g === void 0 ? void 0 : _g.value) !== null && _h !== void 0 ? _h : 0))) / 100,
|
|
27
|
+
base: (0, lodash_1.sumBy)(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)),
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
exports.vatToReadVatEditing = vatToReadVatEditing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/vat.ts"],"names":[],"mappings":";;;AAAA,mCAAyC;AACzC,8CAAoD;AACpD,sCAA2D;AAG3D,SAAgB,SAAS,CAAC,MAAqB,EAAE,QAAgB;IAC/D,MAAM,OAAO,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,CAAC,CAAC;IAC5B,OAAO,OAAO,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;AACpC,CAAC;AA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AAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtH,eAAe,EAAE,IAAA,uCAA8B,EAAC,CAAC,IAAA,cAAM,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAA,MAAA,OAAO,CAAC,KAAK,CAAC,0CAAE,KAAK,mCAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACjK,KAAK,EAAE,CAAC,IAAA,cAAM,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAA,MAAA,OAAO,CAAC,KAAK,CAAC,0CAAE,KAAK,mCAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACvH,IAAI,EAAE,IAAA,cAAM,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC;AAZD,kDAYC","sourcesContent":["import { sumBy as _sumBy } from 'lodash';\nimport { Vat, VatType } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString } from '../amount';\nimport { ReadProductEditing, ReadVatEditing } from '../../types';\n\nexport function getAmount(amount: number | null, vatValue: number): number {\n const _amount = amount ?? 0;\n return _amount * (vatValue / 100);\n}\n\nexport function getById(id: number): VatType | undefined {\n return Object.values(Vat).find((vat) => vat.id === id);\n}\n\nexport function vatToReadVatEditing(products: ReadProductEditing[]): ReadVatEditing {\n const { idVat } = products[0];\n return {\n id: idVat,\n name: getById(idVat)?.saleName ?? '',\n amount: _sumBy(products, (p) => getAmount(p.totalTaxExcluded, getById(idVat)?.value ?? 0)),\n value: getById(idVat)?.value ?? 0,\n baseFormatted: integerToFormattedAmountString(_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0))),\n amountFormatted: integerToFormattedAmountString((_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * ((getById(idVat)?.value ?? 0))) / 100),\n toPay: (_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * ((getById(idVat)?.value ?? 0))) / 100,\n base: _sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)),\n };\n}"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Resource } from '../Resource';
|
|
3
|
-
import { BasePaginate, ReadFormattedAccountingTransaction, UpdateAccountingTransaction, DeleteTransactions, QueryUnexport, QueryGetAllTransactions, IAccountingTransaction, ReadAccountantBalance, CreateManualEntry, IAccountingEntry, QueryDeleteInvoices, ReadDeletedInvoices, QuerySocietyTransactionCount, ReadSocietyTransactionCount, ReadBankAccountSum, QueryBankAccountSum, QueryTransaction, ReadPartnerTransactionType, DuplicateAccountingTransaction, CreateWithMasterEntry } from '../../types';
|
|
3
|
+
import { BasePaginate, ReadFormattedAccountingTransaction, UpdateAccountingTransaction, DeleteTransactions, QueryUnexport, QueryGetAllTransactions, IAccountingTransaction, ReadAccountantBalance, CreateManualEntry, IAccountingEntry, QueryDeleteInvoices, ReadDeletedInvoices, QuerySocietyTransactionCount, ReadSocietyTransactionCount, ReadBankAccountSum, QueryBankAccountSum, QueryTransaction, ReadPartnerTransactionType, DuplicateAccountingTransaction, CreateWithMasterEntry, QueryExport } from '../../types';
|
|
4
4
|
export declare class Transaction extends Resource {
|
|
5
5
|
getFormattedPaginate(idSociety: number, params: QueryTransaction): Promise<BasePaginate<ReadFormattedAccountingTransaction>>;
|
|
6
6
|
exportInfo(idSociety: number, params: QueryTransaction): Promise<Buffer>;
|
|
7
7
|
update(id: number, params: Partial<IAccountingTransaction>): Promise<IAccountingTransaction>;
|
|
8
8
|
getAll(idSociety: number, query: QueryGetAllTransactions): Promise<IAccountingTransaction[]>;
|
|
9
9
|
unexport(idSociety: number, params: QueryUnexport): Promise<number>;
|
|
10
|
-
export(idSociety: number, params:
|
|
10
|
+
export(idSociety: number, params: QueryExport): Promise<number>;
|
|
11
11
|
annotate(id: number, data: UpdateAccountingTransaction): Promise<ReadFormattedAccountingTransaction>;
|
|
12
12
|
delete(idSociety: number, id: number): Promise<number>;
|
|
13
13
|
deleteTransactions(id: number, data: DeleteTransactions): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Transaction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,kCAAkC,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Transaction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,kCAAkC,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,aAAa,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAm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AI,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIhG,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAI7G,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAI5F,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAInG,eAAe,CACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,2BAA2B,CAAC;IAIvC,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI1E,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAI5D,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC,kBAAkB,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAI3D,SAAS,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC;CAGjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../ts/api/resources/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../ts/api/resources/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACvC,oBAAoB,CAAC,SAAiB,EAAE,MAAwB;QAC9D,OAAO,IAAI,CAAC,KA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,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACjE,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,CAAC,IAAoC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport {\n BasePaginate,\n ReadFormattedAccountingTransaction, UpdateAccountingTransaction, DeleteTransactions, QueryUnexport, QueryGetAllTransactions, IAccountingTransaction, ReadAccountantBalance, CreateManualEntry, IAccountingEntry, QueryDeleteInvoices, ReadDeletedInvoices, QuerySocietyTransactionCount, ReadSocietyTransactionCount, ReadBankAccountSum, QueryBankAccountSum, QueryTransaction, ReadPartnerTransactionType, DuplicateAccountingTransaction, CreateWithMasterEntry,\n QueryExport,\n} from '../../types';\n\nexport class Transaction extends Resource {\n getFormattedPaginate(idSociety: number, params: QueryTransaction): Promise<BasePaginate<ReadFormattedAccountingTransaction>> {\n return this.axios.$get(`/society/${idSociety}/transactions`, {\n params,\n });\n }\n\n exportInfo(idSociety: number, params: QueryTransaction): Promise<Buffer> {\n return this.axios.$get(`/society/${idSociety}/transactions/export`, {\n params,\n responseType: 'arraybuffer',\n headers: {\n Accept: 'application/pdf',\n },\n });\n }\n\n update(id: number, params: Partial<IAccountingTransaction>): Promise<IAccountingTransaction> {\n return this.axios.$patch(`/transactions/${id}`, params);\n }\n\n getAll(idSociety: number, query: QueryGetAllTransactions): Promise<IAccountingTransaction[]> {\n return this.axios.$get(`/society/${idSociety}/transactions/list`, { params: query });\n }\n unexport(idSociety: number, params: QueryUnexport): Promise<number> {\n return this.axios.$put(`/society/${idSociety}/transactions/unexport`, params);\n }\n\n export(idSociety: number, params: QueryExport): Promise<number> {\n return this.axios.$put(`/society/${idSociety}/transactions/export`, params);\n }\n annotate(id: number, data: UpdateAccountingTransaction): Promise<ReadFormattedAccountingTransaction> {\n return this.axios.$put(`/transactions/${id}`, data);\n }\n delete(idSociety: number, id: number): Promise<number> {\n return this.axios.$delete(`/society/${idSociety}/transaction/${id}`);\n }\n deleteTransactions(id: number, data: DeleteTransactions): Promise<number> {\n return this.axios.$delete(`/bankAccount/${id}/transactions`, { params: data });\n }\n\n getBalanceQuotaShare(idExercice: number): Promise<Array<ReadAccountantBalance>> {\n return this.axios.$get(`/society/balance/${idExercice}`);\n }\n\n createManual(idSociety: number, data: Array<CreateManualEntry>): Promise<IAccountingTransaction> {\n return this.axios.$post(`/society/${idSociety}/manual-transactions`, data);\n }\n\n createWithMasterEntry(idSociety: number, data: Array<CreateWithMasterEntry>): Promise<IAccountingTransaction> {\n return this.axios.$post(`/society/${idSociety}/transactions`, data);\n }\n\n getAllManual(idSociety: number, idExercice: number): Promise<Array<Array<IAccountingEntry>>> {\n return this.axios.$get(`/society/${idSociety}/exercices/${idExercice}/manual-transactions`);\n }\n\n deleteMultipleInvoices(idSociety: number, query: QueryDeleteInvoices): Promise<ReadDeletedInvoices> {\n return this.axios.$delete(`/society/${idSociety}/invoice-transactions`, { params: query });\n }\n\n toAnnotateCount(\n idSociety: number,\n params: QuerySocietyTransactionCount,\n ): Promise<ReadSocietyTransactionCount> {\n return this.axios.$get(`/society/${idSociety}/transactions/to-annotate/count`, { params });\n }\n\n getBankAccountSum(query: QueryBankAccountSum): Promise<ReadBankAccountSum> {\n return this.axios.$get('/society/transactions/bank-account-sum', { params: query });\n }\n\n get(id: number): Promise<ReadFormattedAccountingTransaction> {\n return this.axios.$get(`/transactions/${id}`);\n }\n\n getCashdeskSum(): Promise<number> {\n return this.axios.$get('/societies/transactions/cashdesk-sum');\n }\n\n getAllPartnerTypes(): Promise<ReadPartnerTransactionType[]> {\n return this.axios.$get('/transactions/partners-types');\n }\n\n duplicate(data: DuplicateAccountingTransaction): Promise<number> {\n return this.axios.$post('/transactions/duplicate', data);\n }\n}"]}
|
|
@@ -3,141 +3,169 @@ export declare const AccountType: {
|
|
|
3
3
|
id: number;
|
|
4
4
|
color: string;
|
|
5
5
|
icon: string;
|
|
6
|
+
name: string;
|
|
6
7
|
};
|
|
7
8
|
BANQUES: {
|
|
8
9
|
id: number;
|
|
9
10
|
color: string;
|
|
10
11
|
icon: string;
|
|
12
|
+
name: string;
|
|
11
13
|
};
|
|
12
14
|
DEPENSES_DIVERSES: {
|
|
13
15
|
id: number;
|
|
14
16
|
color: string;
|
|
15
17
|
icon: string;
|
|
18
|
+
name: string;
|
|
16
19
|
};
|
|
17
20
|
SOUS_TRAITANCES: {
|
|
18
21
|
id: number;
|
|
19
22
|
color: string;
|
|
20
23
|
icon: string;
|
|
24
|
+
name: string;
|
|
21
25
|
};
|
|
22
26
|
ACHAT_MARCHANDISES: {
|
|
23
27
|
id: number;
|
|
24
28
|
color: string;
|
|
25
29
|
icon: string;
|
|
30
|
+
name: string;
|
|
26
31
|
};
|
|
27
32
|
CHARGES_SOCIALES: {
|
|
28
33
|
id: number;
|
|
29
34
|
color: string;
|
|
30
35
|
icon: string;
|
|
36
|
+
name: string;
|
|
31
37
|
};
|
|
32
38
|
TAXES: {
|
|
33
39
|
id: number;
|
|
34
40
|
color: string;
|
|
35
41
|
icon: string;
|
|
42
|
+
name: string;
|
|
36
43
|
};
|
|
37
44
|
FONCTIONNEMENT: {
|
|
38
45
|
id: number;
|
|
39
46
|
color: string;
|
|
40
47
|
icon: string;
|
|
48
|
+
name: string;
|
|
41
49
|
};
|
|
42
50
|
RECETTES_PRODUCTION: {
|
|
43
51
|
id: number;
|
|
44
52
|
color: string;
|
|
45
53
|
icon: string;
|
|
54
|
+
name: string;
|
|
46
55
|
};
|
|
47
56
|
RECETTES_NEGOCE: {
|
|
48
57
|
id: number;
|
|
49
58
|
color: string;
|
|
50
59
|
icon: string;
|
|
60
|
+
name: string;
|
|
51
61
|
};
|
|
52
62
|
RECETTES_DIVERSES: {
|
|
53
63
|
id: number;
|
|
54
64
|
color: string;
|
|
55
65
|
icon: string;
|
|
66
|
+
name: string;
|
|
56
67
|
};
|
|
57
68
|
AUTRES: {
|
|
58
69
|
id: number;
|
|
59
70
|
color: string;
|
|
60
71
|
icon: string;
|
|
72
|
+
name: string;
|
|
61
73
|
};
|
|
62
74
|
ACHATS: {
|
|
63
75
|
id: number;
|
|
64
76
|
color: string;
|
|
65
77
|
icon: string;
|
|
78
|
+
name: string;
|
|
66
79
|
};
|
|
67
80
|
SALAIRES: {
|
|
68
81
|
id: number;
|
|
69
82
|
color: string;
|
|
70
83
|
icon: string;
|
|
84
|
+
name: string;
|
|
71
85
|
};
|
|
72
86
|
IMMOBILIER: {
|
|
73
87
|
id: number;
|
|
74
88
|
color: string;
|
|
75
89
|
icon: string;
|
|
90
|
+
name: string;
|
|
76
91
|
};
|
|
77
92
|
SERVICES: {
|
|
78
93
|
id: number;
|
|
79
94
|
color: string;
|
|
80
95
|
icon: string;
|
|
96
|
+
name: string;
|
|
81
97
|
};
|
|
82
98
|
ABONNEMENTS: {
|
|
83
99
|
id: number;
|
|
84
100
|
color: string;
|
|
85
101
|
icon: string;
|
|
102
|
+
name: string;
|
|
86
103
|
};
|
|
87
104
|
DEPENSES_COURANTES: {
|
|
88
105
|
id: number;
|
|
89
106
|
color: string;
|
|
90
107
|
icon: string;
|
|
108
|
+
name: string;
|
|
91
109
|
};
|
|
92
110
|
TRANSPORTS: {
|
|
93
111
|
id: number;
|
|
94
112
|
color: string;
|
|
95
113
|
icon: string;
|
|
114
|
+
name: string;
|
|
96
115
|
};
|
|
97
116
|
ADMINISTRATIF: {
|
|
98
117
|
id: number;
|
|
99
118
|
color: string;
|
|
100
119
|
icon: string;
|
|
120
|
+
name: string;
|
|
101
121
|
};
|
|
102
122
|
PUBLICITES_ET_MISSIONS: {
|
|
103
123
|
id: number;
|
|
104
124
|
color: string;
|
|
105
125
|
icon: string;
|
|
126
|
+
name: string;
|
|
106
127
|
};
|
|
107
128
|
DIVERS: {
|
|
108
129
|
id: number;
|
|
109
130
|
color: string;
|
|
110
131
|
icon: string;
|
|
132
|
+
name: string;
|
|
111
133
|
};
|
|
112
134
|
FINANCES: {
|
|
113
135
|
id: number;
|
|
114
136
|
color: string;
|
|
115
137
|
icon: string;
|
|
138
|
+
name: string;
|
|
116
139
|
};
|
|
117
140
|
IMMOBILISATIONS: {
|
|
118
141
|
id: number;
|
|
119
142
|
color: string;
|
|
120
143
|
icon: string;
|
|
144
|
+
name: string;
|
|
121
145
|
};
|
|
122
146
|
TIERS: {
|
|
123
147
|
id: number;
|
|
124
148
|
color: string;
|
|
125
149
|
icon: string;
|
|
150
|
+
name: string;
|
|
126
151
|
};
|
|
127
152
|
STOCKS: {
|
|
128
153
|
id: number;
|
|
129
154
|
color: string;
|
|
130
155
|
icon: string;
|
|
156
|
+
name: string;
|
|
131
157
|
};
|
|
132
158
|
ACHATS_MATIERE_PREMIERE: {
|
|
133
159
|
id: number;
|
|
134
160
|
color: string;
|
|
135
161
|
icon: string;
|
|
162
|
+
name: string;
|
|
136
163
|
};
|
|
137
164
|
ACHATS_EXTERNES: {
|
|
138
165
|
id: number;
|
|
139
166
|
color: string;
|
|
140
167
|
icon: string;
|
|
168
|
+
name: string;
|
|
141
169
|
};
|
|
142
170
|
};
|
|
143
171
|
//# sourceMappingURL=AccountType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountType.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/AccountType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"AccountType.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/AccountType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyKvB,CAAC"}
|