@silexpert/core 1.1.24 → 1.1.26
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/es/api/resources/AccountingFiles.d.ts +1 -1
- package/es/api/resources/AccountingFiles.d.ts.map +1 -1
- package/es/api/resources/AccountingFiles.js +4 -1
- package/es/api/resources/AccountingFiles.js.map +1 -1
- package/es/api/resources/CashAndExpense.d.ts +8 -0
- package/es/api/resources/CashAndExpense.d.ts.map +1 -0
- package/es/api/resources/CashAndExpense.js +27 -0
- package/es/api/resources/CashAndExpense.js.map +1 -0
- package/es/api/resources/FIle.d.ts +3 -1
- package/es/api/resources/FIle.d.ts.map +1 -1
- package/es/api/resources/FIle.js +3 -0
- package/es/api/resources/FIle.js.map +1 -1
- package/es/api/resources/Mail.d.ts.map +1 -1
- package/es/api/resources/Mail.js +5 -0
- package/es/api/resources/Mail.js.map +1 -1
- package/es/api/resources/Prestations.d.ts +6 -0
- package/es/api/resources/Prestations.d.ts.map +1 -1
- package/es/api/resources/Prestations.js +8 -0
- package/es/api/resources/Prestations.js.map +1 -1
- package/es/api/resources.d.ts +2 -0
- package/es/api/resources.d.ts.map +1 -1
- package/es/api/resources.js +2 -0
- package/es/api/resources.js.map +1 -1
- package/es/types/Enum/Account.d.ts +8 -0
- package/es/types/Enum/Account.d.ts.map +1 -1
- package/es/types/Enum/Account.js +8 -0
- package/es/types/Enum/Account.js.map +1 -1
- package/es/types/Enum/BalanceSheet.d.ts +1 -1
- package/es/types/Enum/BalanceSheet.js +1 -1
- package/es/types/Enum/BalanceSheet.js.map +1 -1
- package/es/types/Enum/BrandClementine.js +2 -2
- package/es/types/Enum/BrandClementine.js.map +1 -1
- package/es/types/Enum/CashDeskTransactionType.d.ts +7 -0
- package/es/types/Enum/CashDeskTransactionType.d.ts.map +1 -0
- package/es/types/Enum/CashDeskTransactionType.js +8 -0
- package/es/types/Enum/CashDeskTransactionType.js.map +1 -0
- package/es/types/Enum/Compensation.d.ts +15 -0
- package/es/types/Enum/Compensation.d.ts.map +1 -0
- package/es/types/Enum/Compensation.js +15 -0
- package/es/types/Enum/Compensation.js.map +1 -0
- package/es/types/Enum/ConstitutionState.d.ts +0 -2
- package/es/types/Enum/ConstitutionState.d.ts.map +1 -1
- package/es/types/Enum/ConstitutionState.js +10 -10
- package/es/types/Enum/ConstitutionState.js.map +1 -1
- package/es/types/Enum/InternalService.d.ts +12 -0
- package/es/types/Enum/InternalService.d.ts.map +1 -1
- package/es/types/Enum/InternalService.js +12 -0
- package/es/types/Enum/InternalService.js.map +1 -1
- package/es/types/Enum/JobTitle.d.ts +7 -1
- package/es/types/Enum/JobTitle.d.ts.map +1 -1
- package/es/types/Enum/JobTitle.js +36 -0
- package/es/types/Enum/JobTitle.js.map +1 -1
- package/es/types/Enum/Log.d.ts +201 -1
- package/es/types/Enum/Log.d.ts.map +1 -1
- package/es/types/Enum/Log.js +200 -0
- package/es/types/Enum/Log.js.map +1 -1
- package/es/types/Enum/MealExpenseThresholds.d.ts.map +1 -1
- package/es/types/Enum/MealExpenseThresholds.js +6 -2
- package/es/types/Enum/MealExpenseThresholds.js.map +1 -1
- package/es/types/Enum/PrestationType.js +1 -1
- package/es/types/Enum/PrestationType.js.map +1 -1
- package/es/types/Enum/ReportService.d.ts +9 -4
- package/es/types/Enum/ReportService.d.ts.map +1 -1
- package/es/types/Enum/ReportService.js +17 -6
- package/es/types/Enum/ReportService.js.map +1 -1
- package/es/types/Enum/Role.d.ts +3 -1
- package/es/types/Enum/Role.d.ts.map +1 -1
- package/es/types/Enum/Role.js +2 -0
- package/es/types/Enum/Role.js.map +1 -1
- package/es/types/Enum/RoleDetail.d.ts +14 -0
- package/es/types/Enum/RoleDetail.d.ts.map +1 -1
- package/es/types/Enum/RoleDetail.js +15 -1
- package/es/types/Enum/RoleDetail.js.map +1 -1
- package/es/types/Enum/TaskResponseType.d.ts +3 -1
- package/es/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/es/types/Enum/TaskResponseType.js +57 -0
- package/es/types/Enum/TaskResponseType.js.map +1 -1
- package/es/types/Enum/ThirdParty.d.ts +7 -0
- package/es/types/Enum/ThirdParty.d.ts.map +1 -0
- package/es/types/Enum/ThirdParty.js +7 -0
- package/es/types/Enum/ThirdParty.js.map +1 -0
- package/es/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +1 -0
- package/es/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
- package/es/types/Interface/api/accountingFiles/queryAccountingFiles.js +5 -1
- package/es/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
- package/es/types/Interface/api/archive/ImportSocietyArchive.d.ts +1 -1
- package/es/types/Interface/api/archive/ImportSocietyArchive.d.ts.map +1 -1
- package/es/types/Interface/api/archive/ImportSocietyArchive.js +1 -1
- package/es/types/Interface/api/archive/ImportSocietyArchive.js.map +1 -1
- package/es/types/Interface/api/cashAndExpense/Create.d.ts +27 -0
- package/es/types/Interface/api/cashAndExpense/Create.d.ts.map +1 -0
- package/es/types/Interface/api/cashAndExpense/Create.js +91 -0
- package/es/types/Interface/api/cashAndExpense/Create.js.map +1 -0
- package/es/types/Interface/api/file/Query.d.ts +4 -0
- package/es/types/Interface/api/file/Query.d.ts.map +1 -0
- package/es/types/Interface/api/file/Query.js +17 -0
- package/es/types/Interface/api/file/Query.js.map +1 -0
- package/es/types/Interface/api/generalLedger/IGeneralLedgerAccount.d.ts +2 -0
- package/es/types/Interface/api/generalLedger/IGeneralLedgerAccount.d.ts.map +1 -1
- package/es/types/Interface/api/generalLedger/IGeneralLedgerAccount.js.map +1 -1
- package/es/types/Interface/api/prestation/QueryCreatePrestationSocieties.d.ts +7 -0
- package/es/types/Interface/api/prestation/QueryCreatePrestationSocieties.d.ts.map +1 -0
- package/es/types/Interface/api/prestation/QueryCreatePrestationSocieties.js +39 -0
- package/es/types/Interface/api/prestation/QueryCreatePrestationSocieties.js.map +1 -0
- package/es/types/Interface/api/report/ReadReportStats.d.ts +1 -0
- package/es/types/Interface/api/report/ReadReportStats.d.ts.map +1 -1
- package/es/types/Interface/api/report/ReadReportStats.js.map +1 -1
- package/es/types/Interface/api/taxDeadline/QueryTaxDeadline.d.ts +2 -1
- package/es/types/Interface/api/taxDeadline/QueryTaxDeadline.d.ts.map +1 -1
- package/es/types/Interface/api/taxDeadline/QueryTaxDeadline.js +9 -4
- package/es/types/Interface/api/taxDeadline/QueryTaxDeadline.js.map +1 -1
- package/es/types/Interface/api/vatDeclaration/QueryVatDeclaration.d.ts +3 -1
- package/es/types/Interface/api/vatDeclaration/QueryVatDeclaration.d.ts.map +1 -1
- package/es/types/Interface/api/vatDeclaration/QueryVatDeclaration.js +13 -2
- package/es/types/Interface/api/vatDeclaration/QueryVatDeclaration.js.map +1 -1
- package/es/types/Interface/models/IAccountingTransaction.d.ts +2 -0
- package/es/types/Interface/models/IAccountingTransaction.d.ts.map +1 -1
- package/es/types/Interface/models/IAccountingTransaction.js.map +1 -1
- package/es/types/Interface/models/IApiError.d.ts +2 -1
- package/es/types/Interface/models/IApiError.d.ts.map +1 -1
- package/es/types/Interface/models/IApiError.js +2 -0
- package/es/types/Interface/models/IApiError.js.map +1 -1
- package/es/types/Interface/models/IEstimateInvoice.d.ts +1 -0
- package/es/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
- package/es/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/es/types/Interface/models/IExercice.d.ts +2 -0
- package/es/types/Interface/models/IExercice.d.ts.map +1 -1
- package/es/types/Interface/models/IExercice.js.map +1 -1
- package/es/types/Interface/models/IKilometricAllowanceScale.d.ts +1 -0
- package/es/types/Interface/models/IKilometricAllowanceScale.d.ts.map +1 -1
- package/es/types/Interface/models/IKilometricAllowanceScale.js.map +1 -1
- package/es/types/Interface/models/ILog.d.ts +0 -2
- package/es/types/Interface/models/ILog.d.ts.map +1 -1
- package/es/types/Interface/models/ILog.js.map +1 -1
- package/es/types/Interface/models/IPayment.d.ts +1 -0
- package/es/types/Interface/models/IPayment.d.ts.map +1 -1
- package/es/types/Interface/models/IPayment.js.map +1 -1
- package/es/types/Interface/models/IRegulate.d.ts +5 -3
- package/es/types/Interface/models/IRegulate.d.ts.map +1 -1
- package/es/types/Interface/models/IRegulate.js.map +1 -1
- package/es/types/Interface/models/IReport.d.ts +3 -0
- package/es/types/Interface/models/IReport.d.ts.map +1 -1
- package/es/types/Interface/models/IReport.js.map +1 -1
- package/es/types/Interface/models/ISociety.d.ts +2 -1
- package/es/types/Interface/models/ISociety.d.ts.map +1 -1
- package/es/types/Interface/models/ISociety.js.map +1 -1
- package/es/types/Interface/models/IThirdPartySociety.d.ts +2 -0
- package/es/types/Interface/models/IThirdPartySociety.d.ts.map +1 -1
- package/es/types/Interface/models/IThirdPartySociety.js.map +1 -1
- package/es/types/index.d.ts +6 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +6 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/email/templates/signature.d.ts.map +1 -1
- package/es/utils/email/templates/signature.js +6 -7
- package/es/utils/email/templates/signature.js.map +1 -1
- package/es/utils/quotation.d.ts.map +1 -1
- package/es/utils/quotation.js +5 -3
- package/es/utils/quotation.js.map +1 -1
- package/es/utils/vat/3517/century23.js +9 -9
- package/es/utils/vat/3517/century23.js.map +1 -1
- package/es/utils/vat/utils.d.ts.map +1 -1
- package/es/utils/vat/utils.js +1 -3
- package/es/utils/vat/utils.js.map +1 -1
- package/js/api/resources/AccountingFiles.js +4 -1
- package/js/api/resources/AccountingFiles.js.map +1 -1
- package/js/api/resources/CashAndExpense.js +37 -0
- package/js/api/resources/CashAndExpense.js.map +1 -0
- package/js/api/resources/FIle.js +6 -0
- package/js/api/resources/FIle.js.map +1 -1
- package/js/api/resources/Mail.js +5 -0
- package/js/api/resources/Mail.js.map +1 -1
- package/js/api/resources/Prestations.js +8 -0
- package/js/api/resources/Prestations.js.map +1 -1
- package/js/api/resources.js +3 -1
- package/js/api/resources.js.map +1 -1
- package/js/types/Enum/Account.js +8 -0
- package/js/types/Enum/Account.js.map +1 -1
- package/js/types/Enum/BalanceSheet.js +1 -1
- package/js/types/Enum/BalanceSheet.js.map +1 -1
- package/js/types/Enum/BrandClementine.js +2 -2
- package/js/types/Enum/BrandClementine.js.map +1 -1
- package/js/types/Enum/CashDeskTransactionType.js +13 -0
- package/js/types/Enum/CashDeskTransactionType.js.map +1 -0
- package/js/types/Enum/Compensation.js +20 -0
- package/js/types/Enum/Compensation.js.map +1 -0
- package/js/types/Enum/ConstitutionState.js +6 -6
- package/js/types/Enum/ConstitutionState.js.map +1 -1
- package/js/types/Enum/InternalService.js +12 -0
- package/js/types/Enum/InternalService.js.map +1 -1
- package/js/types/Enum/JobTitle.js +30 -0
- package/js/types/Enum/JobTitle.js.map +1 -1
- package/js/types/Enum/Log.js +200 -0
- package/js/types/Enum/Log.js.map +1 -1
- package/js/types/Enum/MealExpenseThresholds.js +6 -2
- package/js/types/Enum/MealExpenseThresholds.js.map +1 -1
- package/js/types/Enum/PrestationType.js +1 -1
- package/js/types/Enum/PrestationType.js.map +1 -1
- package/js/types/Enum/ReportService.js +21 -9
- package/js/types/Enum/ReportService.js.map +1 -1
- package/js/types/Enum/Role.js +2 -0
- package/js/types/Enum/Role.js.map +1 -1
- package/js/types/Enum/RoleDetail.js +15 -1
- package/js/types/Enum/RoleDetail.js.map +1 -1
- package/js/types/Enum/TaskResponseType.js +52 -0
- package/js/types/Enum/TaskResponseType.js.map +1 -1
- package/js/types/Enum/ThirdParty.js +12 -0
- package/js/types/Enum/ThirdParty.js.map +1 -0
- package/js/types/Interface/api/accountingFiles/queryAccountingFiles.js +1 -0
- package/js/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
- package/js/types/Interface/api/archive/ImportSocietyArchive.js +1 -1
- package/js/types/Interface/api/archive/ImportSocietyArchive.js.map +1 -1
- package/js/types/Interface/api/cashAndExpense/Create.js +44 -0
- package/js/types/Interface/api/cashAndExpense/Create.js.map +1 -0
- package/js/types/Interface/api/file/Query.js +21 -0
- package/js/types/Interface/api/file/Query.js.map +1 -0
- package/js/types/Interface/api/generalLedger/IGeneralLedgerAccount.js.map +1 -1
- package/js/types/Interface/api/prestation/QueryCreatePrestationSocieties.js +30 -0
- package/js/types/Interface/api/prestation/QueryCreatePrestationSocieties.js.map +1 -0
- package/js/types/Interface/api/report/ReadReportStats.js.map +1 -1
- package/js/types/Interface/api/taxDeadline/QueryTaxDeadline.js +2 -1
- package/js/types/Interface/api/taxDeadline/QueryTaxDeadline.js.map +1 -1
- package/js/types/Interface/api/vatDeclaration/QueryVatDeclaration.js +3 -1
- package/js/types/Interface/api/vatDeclaration/QueryVatDeclaration.js.map +1 -1
- package/js/types/Interface/models/IAccountingTransaction.js.map +1 -1
- package/js/types/Interface/models/IApiError.js +2 -0
- package/js/types/Interface/models/IApiError.js.map +1 -1
- package/js/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/js/types/Interface/models/IExercice.js.map +1 -1
- package/js/types/Interface/models/IKilometricAllowanceScale.js.map +1 -1
- package/js/types/Interface/models/ILog.js.map +1 -1
- package/js/types/Interface/models/IPayment.js.map +1 -1
- package/js/types/Interface/models/IRegulate.js.map +1 -1
- package/js/types/Interface/models/IReport.js.map +1 -1
- package/js/types/Interface/models/ISociety.js.map +1 -1
- package/js/types/Interface/models/IThirdPartySociety.js.map +1 -1
- package/js/types/index.js +66 -6
- package/js/types/index.js.map +1 -1
- package/js/utils/email/templates/signature.js +6 -7
- package/js/utils/email/templates/signature.js.map +1 -1
- package/js/utils/quotation.js +5 -3
- package/js/utils/quotation.js.map +1 -1
- package/js/utils/vat/3517/century23.js +9 -9
- package/js/utils/vat/3517/century23.js.map +1 -1
- package/js/utils/vat/utils.js +1 -3
- package/js/utils/vat/utils.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/AccountingFiles.ts +5 -2
- package/ts/api/resources/CashAndExpense.ts +31 -0
- package/ts/api/resources/FIle.ts +5 -0
- package/ts/api/resources/Mail.ts +5 -0
- package/ts/api/resources/Prestations.ts +9 -0
- package/ts/api/resources.ts +2 -0
- package/ts/types/Enum/Account.ts +8 -0
- package/ts/types/Enum/BalanceSheet.ts +1 -1
- package/ts/types/Enum/BrandClementine.ts +2 -2
- package/ts/types/Enum/CashDeskTransactionType.ts +6 -0
- package/ts/types/Enum/Compensation.ts +14 -0
- package/ts/types/Enum/ConstitutionState.ts +4 -4
- package/ts/types/Enum/InternalService.ts +12 -0
- package/ts/types/Enum/JobTitle.ts +36 -0
- package/ts/types/Enum/Log.ts +202 -1
- package/ts/types/Enum/MealExpenseThresholds.ts +6 -2
- package/ts/types/Enum/PrestationType.ts +1 -1
- package/ts/types/Enum/ReportService.ts +20 -8
- package/ts/types/Enum/Role.ts +2 -0
- package/ts/types/Enum/RoleDetail.ts +15 -1
- package/ts/types/Enum/TaskResponseType.ts +57 -0
- package/ts/types/Enum/ThirdParty.ts +6 -0
- package/ts/types/Interface/api/accountingFiles/queryAccountingFiles.ts +4 -1
- package/ts/types/Interface/api/archive/ImportSocietyArchive.ts +1 -1
- package/ts/types/Interface/api/cashAndExpense/Create.ts +67 -0
- package/ts/types/Interface/api/file/Query.ts +6 -0
- package/ts/types/Interface/api/generalLedger/IGeneralLedgerAccount.ts +3 -1
- package/ts/types/Interface/api/prestation/QueryCreatePrestationSocieties.ts +27 -0
- package/ts/types/Interface/api/report/ReadReportStats.ts +2 -1
- package/ts/types/Interface/api/taxDeadline/QueryTaxDeadline.ts +7 -3
- package/ts/types/Interface/api/vatDeclaration/QueryVatDeclaration.ts +11 -2
- package/ts/types/Interface/models/IAccountingTransaction.ts +2 -0
- package/ts/types/Interface/models/IApiError.ts +3 -0
- package/ts/types/Interface/models/IEstimateInvoice.ts +1 -0
- package/ts/types/Interface/models/IExercice.ts +2 -0
- package/ts/types/Interface/models/IKilometricAllowanceScale.ts +1 -0
- package/ts/types/Interface/models/ILog.ts +0 -2
- package/ts/types/Interface/models/IPayment.ts +1 -0
- package/ts/types/Interface/models/IRegulate.ts +5 -3
- package/ts/types/Interface/models/IReport.ts +3 -0
- package/ts/types/Interface/models/ISociety.ts +2 -0
- package/ts/types/Interface/models/IThirdPartySociety.ts +5 -0
- package/ts/types/index.ts +6 -0
- package/ts/utils/email/templates/signature.ts +6 -7
- package/ts/utils/quotation.ts +5 -3
- package/ts/utils/vat/3517/century23.ts +9 -9
- package/ts/utils/vat/utils.ts +1 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotation.js","sourceRoot":"","sources":["../../ts/utils/quotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAoBtD,MAAM,UAAU,gBAAgB,CAAC,MAA8B;IAC7D,MAAM,EACJ,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,GACvF,GAAG,MAAM,CAAC;IACX,IACE,SAAS,KAAK,MAAM;WACjB,QAAQ,KAAK,MAAM;YACnB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;WACtB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EACjG;QACA,OAAO,CAAC,CAAC;KACV;IACD,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,wBAAwB;IACxB,IAAI,SAAS;QAAE,SAAS,IAAI,CAAC,CAAC;IAE9B,qBAAqB;IACrB,IAAI,QAAQ;QAAE,SAAS,IAAI,CAAC,CAAC;IAE7B,qCAAqC;IACrC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ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CAAC;KACb;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import * as dayjs from 'dayjs';\nimport { ForbidenDomain, BasicDomain } from '../types/Enum/MailDomainType';\nimport { Activity } from '../types/Enum/Activity';\nimport { ComptaType } from '../types/Enum/ComptaType';\nimport { ISociety } from '../types/Interface/models/ISociety';\nimport { ICotation } from '../types/Interface/models/ICotation';\nimport {\n BasePaginate,\n IPayment,\n IRating, IReport, ISocietyProceding, ReadClientQuotation,\n} from '../types';\n\ntype getLeadQuotationParams = {\n firstname: string,\n lastname: string,\n phone: string,\n mail: string,\n annualTurnover: number,\n source: number,\n alreadyExist: boolean,\n activitySector: number,\n};\n\nexport function getLeadQuotation(params: getLeadQuotationParams):number {\n const {\n firstname, lastname, phone, mail, annualTurnover, source, alreadyExist, activitySector,\n } = params;\n if (\n firstname === 'test'\n || lastname === 'test'\n || mail?.includes('test')\n || ['606060606', '707070707', '612345678', '712345678', '687654321', '787654321'].includes(phone)\n ) {\n return 0;\n }\n let quotation = 0;\n\n /* cotation du prénom */\n if (firstname) quotation += 5;\n\n /* cotation du nom */\n if (lastname) quotation += 5;\n\n /* cotation du numéro de téléphone */\n if (['6', '7'].includes(phone.substr(0, 1))) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n\n /* cotation de l'adresse email */\n if (BasicDomain.find((domain) => mail?.includes(domain))) {\n quotation += 5;\n } else\n if (!ForbidenDomain.find((domain) => mail?.includes(domain))) {\n quotation += 15;\n }\n\n /* cotation du CA annuel */\n if ([0, 150000, 400000, 783000, 783001].includes(annualTurnover)) {\n quotation += 10;\n } else if ([50000, 234000].includes(annualTurnover)) {\n quotation += 5;\n }\n\n /* cotation de la date d'ajout */\n if ([1, 2, 3, 4, 5].includes(new Date().getDay())) {\n const dateTime = new Date();\n const year = dateTime.getFullYear();\n const month = dateTime.getMonth();\n const day = dateTime.getDate();\n const startTime = new Date(`${year}-${month + 1}-${day} 08:45:00`);\n const endTime = new Date(`${year}-${month + 1}-${day} 18:45:00`);\n if ((startTime.getTime() <= dateTime.getTime()) && (endTime.getTime() >= dateTime.getTime())) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n } else {\n quotation += 5;\n }\n\n /* cotation de la source */\n /* Parrainage */\n if (source === 49) {\n quotation += 10;\n\n /* calendly, appel entrant */\n } else if (source === 2) {\n quotation += 8;\n\n /* adWords, Bing, Formulaire */\n } else if (source === 4) {\n quotation += 6;\n\n /* Chat, Whatsapp */\n } else if ([29, 92].includes(source)) {\n quotation += 2;\n }\n\n /* cotation de la qualité (nombre de champs remplis) */\n const fieldNumber = [firstname, lastname, phone, mail, annualTurnover, activitySector].filter((data) => !!data).length;\n switch (fieldNumber) {\n case 6:\n quotation += 10;\n break;\n case 5:\n quotation += 8;\n break;\n case 4:\n quotation += 6;\n break;\n case 3:\n quotation += 4;\n break;\n case 2:\n quotation += 2;\n break;\n default:\n break;\n }\n\n /* cotation de l'existence du lead (déjà existant ou non) */\n if (alreadyExist) quotation += 8;\n\n /* cotation du secteur d'activité */\n if ([Activity.INFORMATIQUE, Activity.CONSEIL].includes(activitySector)) {\n quotation += 10;\n } else if ([Activity.TRANSPORT, Activity.BTP, Activity.RESTAURATION, Activity.COMMERCANT, Activity.MEDICAL, Activity.PROF_LIB].includes(activitySector)) {\n quotation += 5;\n }\n\n return quotation;\n}\n\n/* besoin en entré de la société concerné avec les différents imports (society), ainsi que la liste des autres sociétés ou l'owner est owner (otherSocieties) */\nexport function getClientQuotation(society: ISociety, otherSocieties: ISociety[], lastNotice: BasePaginate<IRating>, unpaidDetails: [], reports: IReport[], societyProcedings: ISocietyProceding[], tabBankAccount: any, firstPaiement: IPayment[]): ReadClientQuotation {\n let quotationPositive = 0;\n let quotationNegative = 0;\n let quotation = 0;\n const detailQuotation = {\n signature: 0,\n seniority: 0,\n additionalBenefits: 0,\n additionalCompanies: 0,\n unpayed: 0,\n updatedAnnotations: 0,\n bankSynchronization: 0,\n rating: 0,\n labRefused: 0,\n ongoingProceedings: 0,\n report: 0,\n termination: 0,\n created: 0,\n };\n\n // calcul de l'ancienneté de la société\n const anciennete = firstPaiement?.length > 0 ? dayjs().diff(dayjs(firstPaiement[0].datePayment, 'YYYY-MM-DD'), 'years') : 0;\n const ponderation = (anciennete * 0.1) + 1;\n\n /* Type de comptabilité du client (Tresorerie (+10) / Engagement (+15)) */\n if (society.idComptaType) {\n if ([ComptaType.CASH_BASED, ComptaType.CASH_BASED_ASSISTANCE, ComptaType.CASH_BASED_SEIZURE].includes(society.idComptaType)) {\n quotationPositive += 10;\n detailQuotation.signature += 10;\n } else if ([ComptaType.ACCRUALS, ComptaType.ACCRUALS_ASSISTANCE, ComptaType.ACCRUALS_SEIZURE].includes(society.idComptaType)) {\n quotationPositive += 15;\n detailQuotation.signature += 15;\n }\n }\n\n /* Ancienneté (1 ans < firstPaiement < 2 ans (+10) / 2 ans < firstPaiement (+20 / année)) */\n if (firstPaiement?.length > 0) {\n const yearAsClient = Number(new Date().getFullYear()) - Number(new Date(firstPaiement[0].datePayment).getFullYear());\n if (yearAsClient === 1) {\n quotationPositive += 10;\n detailQuotation.seniority += 10;\n } else if (yearAsClient > 1) {\n quotationPositive += (20 * (yearAsClient - 1) + 10);\n detailQuotation.seniority += (20 * (yearAsClient - 1) + 10);\n }\n }\n\n /* Prestations Complémentaires (+5 / prestation) */\n if (society.prestationsSocieties?.length) {\n const prestationsCompl = society.prestationsSocieties.filter((prestation) => prestation.idPrestationComplementary);\n prestationsCompl.forEach(() => {\n quotationPositive += Math.ceil(5 * ponderation);\n detailQuotation.additionalBenefits += Math.ceil(5 * ponderation);\n });\n }\n\n /* Sociétés supplémentaires (+8 / société) */\n if (otherSocieties.length) {\n quotationPositive += Math.ceil(8 * otherSocieties.length * ponderation);\n detailQuotation.additionalCompanies += Math.ceil(8 * otherSocieties.length * ponderation);\n }\n\n /* Impayés (-15 / mois) */\n if (unpaidDetails.length) {\n quotationNegative -= Math.ceil(15 * unpaidDetails.length * ponderation);\n detailQuotation.unpayed -= Math.ceil(15 * unpaidDetails.length * ponderation);\n }\n\n /* annotations à jour */\n if (tabBankAccount.societyAccountingTransactions?.length) {\n // on check s'il y a 80% des lignes annotées (dateLocked)\n let countNotAnnoted = 0;\n let percentageAnnotations = 100;\n tabBankAccount.societyAccountingTransactions.map((na:any) => {\n if (na.dateLocked === null) {\n countNotAnnoted += 1;\n }\n return countNotAnnoted;\n });\n if (countNotAnnoted !== 0) percentageAnnotations = (countNotAnnoted / tabBankAccount.societyAccountingTransactions?.length) * 100;\n if (percentageAnnotations >= 80) {\n quotationPositive += Math.ceil(12 * ponderation);\n detailQuotation.updatedAnnotations += Math.ceil(12 * ponderation);\n } else {\n quotationNegative -= Math.ceil(12 * ponderation);\n detailQuotation.updatedAnnotations -= Math.ceil(12 * ponderation);\n }\n }\n\n /* synchronisation bancaire */\n if (tabBankAccount.societyActivatedBankAccounts?.length) {\n // comptes synchro\n const synchro = tabBankAccount.societyActivatedBankAccounts.length - tabBankAccount.desactivatedBankAccount.length;\n quotationPositive += Math.ceil(12 * synchro * ponderation);\n detailQuotation.bankSynchronization += Math.ceil(12 * synchro * ponderation);\n\n // comptes desynchro\n quotationNegative -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);\n detailQuotation.bankSynchronization -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);\n }\n\n /* avis */\n if (lastNotice && lastNotice.data.length === 1) {\n if (lastNotice.data[0].average === 5) {\n quotationPositive += Math.ceil(10 * ponderation);\n detailQuotation.rating += Math.ceil(10 * ponderation);\n } else {\n quotationNegative -= 10;\n detailQuotation.rating -= 10;\n }\n }\n\n /* LAB refusée */\n if (!society.societyDetail?.acceptation) {\n quotationNegative -= 10;\n detailQuotation.labRefused -= 10;\n }\n\n /* Cessation de paiement - redressement judiciaire - procédure en cours / signalements / résiliation */\n if (societyProcedings?.length) {\n quotationNegative -= 5 * societyProcedings.length;\n detailQuotation.ongoingProceedings -= 5 * societyProcedings.length;\n }\n\n if (reports?.length) {\n quotationNegative -= 10;\n detailQuotation.report -= 10;\n }\n\n if (society.isWaitingEnd) {\n quotationNegative -= 50;\n detailQuotation.termination -= 50;\n }\n\n /* Création chez nous */\n if (society.prestationsSocieties?.length) {\n const prestationsCreation = society.prestationsSocieties.filter((prestation) => prestation.idPrestationList === 15); // creation pas d'enum\n prestationsCreation.forEach(() => {\n quotationPositive += 10;\n detailQuotation.created += 10;\n });\n }\n\n if (quotationPositive > 100) quotationPositive = 100;\n if (quotationNegative > 100) quotationNegative = 100;\n\n quotation = quotationPositive + quotationNegative;\n\n if (quotation < 0) quotation = 0;\n\n return {\n cotation: quotation,\n data: detailQuotation,\n idSociety: society.id as number,\n };\n}\n\nexport function compareTwoCotation(cotations: ICotation[]):boolean | null {\n // on recupere les 2 dernieres cotations de la societe\n const higher = false;\n if (cotations[0].cotation === cotations[1].cotation) {\n return null;\n } if (cotations[0].cotation > cotations[1].cotation) {\n return true;\n }\n return higher;\n}"]}
|
|
1
|
+
{"version":3,"file":"quotation.js","sourceRoot":"","sources":["../../ts/utils/quotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAoBtD,MAAM,UAAU,gBAAgB,CAAC,MAA8B;IAC7D,MAAM,EACJ,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,GACvF,GAAG,MAAM,CAAC;IACX,IACE,SAAS,KAAK,MAAM;WACjB,QAAQ,KAAK,MAAM;YACnB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;WACtB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW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I,EAAE,eAAe;QACrB,SAAS,EAAE,OAAO,CAAC,EAAY;KAChC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,SAAsB;IACvD,sDAAsD;IACtD,MAAM,MAAM,GAAG,KAAK,CAAC;IACrB,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACnD,OAAO,IAAI,CAAC;KACb;IAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACnD,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import * as dayjs from 'dayjs';\nimport { ForbidenDomain, BasicDomain } from '../types/Enum/MailDomainType';\nimport { Activity } from '../types/Enum/Activity';\nimport { ComptaType } from '../types/Enum/ComptaType';\nimport { ISociety } from '../types/Interface/models/ISociety';\nimport { ICotation } from '../types/Interface/models/ICotation';\nimport {\n BasePaginate,\n IPayment,\n IRating, IReport, ISocietyProceding, ReadClientQuotation,\n} from '../types';\n\ntype getLeadQuotationParams = {\n firstname: string,\n lastname: string,\n phone: string,\n mail: string,\n annualTurnover: number,\n source: number,\n alreadyExist: boolean,\n activitySector: number,\n};\n\nexport function getLeadQuotation(params: getLeadQuotationParams):number {\n const {\n firstname, lastname, phone, mail, annualTurnover, source, alreadyExist, activitySector,\n } = params;\n if (\n firstname === 'test'\n || lastname === 'test'\n || mail?.includes('test')\n || ['606060606', '707070707', '612345678', '712345678', '687654321', '787654321'].includes(phone)\n ) {\n return 0;\n }\n let quotation = 0;\n\n /* cotation du prénom */\n if (firstname) quotation += 5;\n\n /* cotation du nom */\n if (lastname) quotation += 5;\n\n /* cotation du numéro de téléphone */\n if (['6', '7'].includes(phone.substr(0, 1))) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n\n /* cotation de l'adresse email */\n if (BasicDomain.find((domain) => mail?.includes(domain))) {\n quotation += 5;\n } else\n if (!ForbidenDomain.find((domain) => mail?.includes(domain))) {\n quotation += 15;\n }\n\n /* cotation du CA annuel */\n if ([0, 150000, 400000, 783000, 783001].includes(annualTurnover)) {\n quotation += 10;\n } else if ([50000, 234000].includes(annualTurnover)) {\n quotation += 5;\n }\n\n /* cotation de la date d'ajout */\n if ([1, 2, 3, 4, 5].includes(new Date().getDay())) {\n const dateTime = new Date();\n const year = dateTime.getFullYear();\n const month = dateTime.getMonth();\n const day = dateTime.getDate();\n const startTime = new Date(`${year}-${month + 1}-${day} 08:45:00`);\n const endTime = new Date(`${year}-${month + 1}-${day} 18:45:00`);\n if ((startTime.getTime() <= dateTime.getTime()) && (endTime.getTime() >= dateTime.getTime())) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n } else {\n quotation += 5;\n }\n\n /* cotation de la source */\n /* Parrainage */\n if (source === 49) {\n quotation += 10;\n\n /* calendly, appel entrant */\n } else if (source === 2) {\n quotation += 8;\n\n /* adWords, Bing, Formulaire */\n } else if (source === 4) {\n quotation += 6;\n\n /* Chat, Whatsapp */\n } else if ([29, 92].includes(source)) {\n quotation += 2;\n }\n\n /* cotation de la qualité (nombre de champs remplis) */\n const fieldNumber = [firstname, lastname, phone, mail, annualTurnover, activitySector].filter((data) => !!data).length;\n switch (fieldNumber) {\n case 6:\n quotation += 10;\n break;\n case 5:\n quotation += 8;\n break;\n case 4:\n quotation += 6;\n break;\n case 3:\n quotation += 4;\n break;\n case 2:\n quotation += 2;\n break;\n default:\n break;\n }\n\n /* cotation de l'existence du lead (déjà existant ou non) */\n if (alreadyExist) quotation += 8;\n\n /* cotation du secteur d'activité */\n if ([Activity.INFORMATIQUE, Activity.CONSEIL].includes(activitySector)) {\n quotation += 10;\n } else if ([Activity.TRANSPORT, Activity.BTP, Activity.RESTAURATION, Activity.COMMERCANT, Activity.MEDICAL, Activity.PROF_LIB].includes(activitySector)) {\n quotation += 5;\n }\n\n return quotation;\n}\n\n/* besoin en entré de la société concerné avec les différents imports (society), ainsi que la liste des autres sociétés ou l'owner est owner (otherSocieties) */\nexport function getClientQuotation(society: ISociety, otherSocieties: ISociety[], lastNotice: BasePaginate<IRating>, unpaidDetails: [], reports: IReport[], societyProcedings: ISocietyProceding[], tabBankAccount: any, firstPaiement: IPayment[]): ReadClientQuotation {\n let quotationPositive = 0;\n let quotationNegative = 0;\n let quotation = 0;\n const detailQuotation = {\n signature: 0,\n seniority: 0,\n additionalBenefits: 0,\n additionalCompanies: 0,\n unpayed: 0,\n updatedAnnotations: 0,\n bankSynchronization: 0,\n rating: 0,\n labRefused: 0,\n ongoingProceedings: 0,\n report: 0,\n termination: 0,\n created: 0,\n };\n\n // calcul de l'ancienneté de la société\n const anciennete = firstPaiement?.length > 0 ? dayjs().diff(dayjs(firstPaiement[0].datePayment, 'YYYY-MM-DD'), 'years') : 0;\n const ponderation = (anciennete * 0.1) + 1;\n\n /* Type de comptabilité du client (Tresorerie (+10) / Engagement (+15)) */\n if (society.idComptaType) {\n if ([ComptaType.CASH_BASED, ComptaType.CASH_BASED_ASSISTANCE, ComptaType.CASH_BASED_SEIZURE].includes(society.idComptaType)) {\n quotationPositive += 10;\n detailQuotation.signature += 10;\n } else if ([ComptaType.ACCRUALS, ComptaType.ACCRUALS_ASSISTANCE, ComptaType.ACCRUALS_SEIZURE].includes(society.idComptaType)) {\n quotationPositive += 15;\n detailQuotation.signature += 15;\n }\n }\n\n /* Ancienneté (1 ans < firstPaiement < 2 ans (+10) / 2 ans < firstPaiement (+20 / année)) */\n if (firstPaiement?.length > 0) {\n const yearAsClient = Number(new Date().getFullYear()) - Number(new Date(firstPaiement[0].datePayment).getFullYear());\n if (yearAsClient === 1) {\n quotationPositive += 10;\n detailQuotation.seniority += 10;\n } else if (yearAsClient > 1) {\n quotationPositive += (20 * (yearAsClient - 1) + 10);\n detailQuotation.seniority += (20 * (yearAsClient - 1) + 10);\n }\n }\n\n /* Prestations Complémentaires (+5 / prestation) */\n if (society.prestationsSocieties?.length) {\n const prestationsCompl = society.prestationsSocieties.filter((prestation) => prestation.idPrestationComplementary);\n prestationsCompl.forEach(() => {\n quotationPositive += Math.ceil(5 * ponderation);\n detailQuotation.additionalBenefits += Math.ceil(5 * ponderation);\n });\n }\n\n /* Sociétés supplémentaires (+8 / société) */\n if (otherSocieties.length) {\n quotationPositive += Math.ceil(8 * otherSocieties.length * ponderation);\n detailQuotation.additionalCompanies += Math.ceil(8 * otherSocieties.length * ponderation);\n }\n\n /* Impayés (-15 / mois) */\n if (unpaidDetails.length) {\n quotationNegative -= Math.ceil(15 * unpaidDetails.length * ponderation);\n detailQuotation.unpayed -= Math.ceil(15 * unpaidDetails.length * ponderation);\n }\n\n /* annotations à jour */\n if (tabBankAccount.societyAccountingTransactions?.length) {\n // on check s'il y a 80% des lignes annotées (dateLocked)\n let countNotAnnoted = 0;\n let percentageAnnotations = 100;\n tabBankAccount.societyAccountingTransactions.map((na:any) => {\n if (na.dateLocked === null) {\n countNotAnnoted += 1;\n }\n return countNotAnnoted;\n });\n if (countNotAnnoted !== 0) percentageAnnotations = (countNotAnnoted / tabBankAccount.societyAccountingTransactions?.length) * 100;\n if (percentageAnnotations >= 80) {\n quotationPositive += Math.ceil(12 * ponderation);\n detailQuotation.updatedAnnotations += Math.ceil(12 * ponderation);\n } else {\n quotationNegative -= Math.ceil(12 * ponderation);\n detailQuotation.updatedAnnotations -= Math.ceil(12 * ponderation);\n }\n }\n\n /* synchronisation bancaire */\n if (tabBankAccount.societyActivatedBankAccounts?.length) {\n // comptes synchro\n const synchro = tabBankAccount.societyActivatedBankAccounts.length - tabBankAccount.desactivatedBankAccount.length;\n quotationPositive += Math.ceil(12 * synchro * ponderation);\n detailQuotation.bankSynchronization += Math.ceil(12 * synchro * ponderation);\n\n // comptes desynchro\n quotationNegative -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);\n detailQuotation.bankSynchronization -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);\n }\n\n /* avis */\n if (lastNotice && lastNotice.data.length === 1) {\n if (lastNotice.data[0].average === 5) {\n quotationPositive += Math.ceil(10 * ponderation);\n detailQuotation.rating += Math.ceil(10 * ponderation);\n } else {\n quotationNegative -= 10;\n detailQuotation.rating -= 10;\n }\n }\n\n /* LAB refusée */\n if (society?.societyDetail) {\n if (!society.societyDetail?.acceptation) {\n quotationNegative -= 10;\n detailQuotation.labRefused -= 10;\n }\n }\n\n /* Cessation de paiement - redressement judiciaire - procédure en cours / signalements / résiliation */\n if (societyProcedings?.length) {\n quotationNegative -= 5 * societyProcedings.length;\n detailQuotation.ongoingProceedings -= 5 * societyProcedings.length;\n }\n\n if (reports?.length) {\n quotationNegative -= 10;\n detailQuotation.report -= 10;\n }\n\n if (society.isWaitingEnd) {\n quotationNegative -= 50;\n detailQuotation.termination -= 50;\n }\n\n /* Création chez nous */\n if (society.prestationsSocieties?.length) {\n const prestationsCreation = society.prestationsSocieties.filter((prestation) => prestation.idPrestationList === 15); // creation pas d'enum\n prestationsCreation.forEach(() => {\n quotationPositive += 10;\n detailQuotation.created += 10;\n });\n }\n\n if (quotationPositive > 100) quotationPositive = 100;\n if (quotationNegative > 100) quotationNegative = 100;\n\n quotation = quotationPositive + quotationNegative;\n\n if (quotation < 0) quotation = 0;\n\n return {\n cotation: quotation,\n data: detailQuotation,\n idSociety: society.id as number,\n };\n}\n\nexport function compareTwoCotation(cotations: ICotation[]):boolean | null {\n // on recupere les 2 dernieres cotations de la societe\n const higher = false;\n if (cotations[0].cotation === cotations[1].cotation) {\n return null;\n } if (cotations[0].cotation > cotations[1].cotation) {\n return true;\n }\n return higher;\n}"]}
|
|
@@ -14,18 +14,18 @@ export function getCerfa3517Century23Payload(accountingEntries, payload) {
|
|
|
14
14
|
const intracomVat = vats.filter((v) => v.isVatIntracom && !v.isVatImportation).map((v) => v.id);
|
|
15
15
|
const frenchVat = vats.filter((v) => !v.isVatImportation && !v.isVatIntracom).map((v) => v.id);
|
|
16
16
|
const taxedOperationsAccounts = ['701', '702', '703', '704', '705', '706', '707', '708'];
|
|
17
|
-
const vatNormalRate20 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_20.id), taxedOperationsAccounts);
|
|
18
|
-
const vatReducedRate5Dot5 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_5_5.id), taxedOperationsAccounts);
|
|
19
|
-
const vatReducedRate10 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_10.id), taxedOperationsAccounts);
|
|
20
|
-
const vatReducedRate8Dot5 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_8_5.id), taxedOperationsAccounts);
|
|
21
|
-
const vatReducedRate2Dot1 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_2_1.id), taxedOperationsAccounts);
|
|
17
|
+
const vatNormalRate20 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_20.id), taxedOperationsAccounts, 0, true);
|
|
18
|
+
const vatReducedRate5Dot5 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_5_5.id), taxedOperationsAccounts, 0, true);
|
|
19
|
+
const vatReducedRate10 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_10.id), taxedOperationsAccounts, 0, true);
|
|
20
|
+
const vatReducedRate8Dot5 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_8_5.id), taxedOperationsAccounts, 0, true);
|
|
21
|
+
const vatReducedRate2Dot1 = getAmountByAccountNumber(vatEntries.filter((ae) => ae.idVat === Vat.TX_2_1.id), taxedOperationsAccounts, 0, true);
|
|
22
22
|
const prestation2Entries = vatEntries.filter((ae) => intracomVat.includes(ae.idVat));
|
|
23
23
|
const presta2Accounts = ['604', '61', '62'];
|
|
24
|
-
const prestation2Base = getAmountByAccountNumber(prestation2Entries, presta2Accounts);
|
|
24
|
+
const prestation2Base = getAmountByAccountNumber(prestation2Entries, presta2Accounts, 0, true);
|
|
25
25
|
const prestation2AmountOfVat = getTaxAmountByAccountNumber(prestation2Entries, presta2Accounts);
|
|
26
|
-
const saleOfImmobilization = getAmountByAccountNumber(vatEntries.filter((ae) => !withoutTaxVat.includes(ae.idVat) && frenchVat.includes(ae.idVat)), ['775']);
|
|
27
|
-
const onInvoiceDeductible = getAmountByAccountNumber(vatEntries, ['445660']);
|
|
28
|
-
const onImmobilizationDeductible = getAmountByAccountNumber(vatEntries, ['445662']);
|
|
26
|
+
const saleOfImmobilization = getAmountByAccountNumber(vatEntries.filter((ae) => !withoutTaxVat.includes(ae.idVat) && frenchVat.includes(ae.idVat)), ['775'], 0, true);
|
|
27
|
+
const onInvoiceDeductible = getAmountByAccountNumber(vatEntries, ['445660'], 0, true);
|
|
28
|
+
const onImmobilizationDeductible = getAmountByAccountNumber(vatEntries, ['445662'], 0, true);
|
|
29
29
|
const julyAdvance = (_e = (_d = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _d === void 0 ? void 0 : _d.find((a) => dayjs(a.endDate).month() === 6)) !== null && _e !== void 0 ? _e : null;
|
|
30
30
|
const julyAdvancePayload = (_f = julyAdvance === null || julyAdvance === void 0 ? void 0 : julyAdvance.payload) !== null && _f !== void 0 ? _f : null;
|
|
31
31
|
const decemberAdvance = (_h = (_g = payload === null || payload === void 0 ? void 0 : payload.exerciceAdvanceRegistrations) === null || _g === void 0 ? void 0 : _g.find((a) => dayjs(a.endDate).month() === 11)) !== null && _h !== void 0 ? _h : null;
|