@silexpert/core 1.1.38 → 1.1.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.38",
3
+ "version": "1.1.40",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
6
6
  "main": "js/index.js",
@@ -107,7 +107,7 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
107
107
  const isNil = payload.isNil === true;
108
108
  const isHolidayDeposit = payload.isHolidayDeposit === true;
109
109
 
110
- const sumToAdd = isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8, 2)) : (_round(payload.vat?.sumToAdd ?? 0) + mxToAdd);
110
+ const sumToAdd = setZeroIfIsNegative(isNil ? 0 : isHolidayDeposit ? (_round((payload.previousVatDeclaration?.toPay?.total ?? 0) * 0.8)) : (_round(payload.vat?.sumToAdd ?? 0) + mxToAdd));
111
111
  const comment = isHolidayDeposit ? `ACOMPTE CONGES ${payload.comment ?? ''}` : (payload.comment ?? null);
112
112
 
113
113
  const initialPayload: Cerfa3310_2023 = {
@@ -322,7 +322,7 @@ export function getCerfa3517Century23Payload(accountingEntries: IAccountingEntry
322
322
  data.net.advance.toPay = data.net.advance1.toPay + data.net.advance2.toPay;
323
323
  data.net.advance.total = data.net.advance.paid + data.net.advance.toPay;
324
324
 
325
- data.net.balance = data.net.due - (data.net.credit + data.net.advance.total) > 0 ? data.net.due - (data.net.due + data.net.advance.total) : 0;
325
+ data.net.balance = data.net.due - (data.net.credit + data.net.advance.total) > 0 ? data.net.due - (data.net.credit + data.net.advance.total) : 0;
326
326
  data.net.surplus = data.net.advance.total - data.net.due > 0 ? data.net.advance.total - data.net.due : 0;
327
327
  data.net.balanceSurplus = data.net.credit + data.net.surplus;
328
328