Skip to content

Commit

Permalink
accepts new labels from pay check
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingeek committed Feb 4, 2024
1 parent d311d75 commit 4ca795c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2024-02-04
## [1.3.2] - 2024-02-05

### Changed

- Mise à jour des données pour les revenus 2023

### Fixed

- accepte les bulletins de paie avec un label DP GN (erreur sur les bulletins de 06/2023)
- En test : prise en compte pour les frais d'emploi des nouveaux libellés (IR EXONEREES, IR NON EXONEREES, IND TRANSPORT EXO)

## [1.2.0] - 2023-01-22

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flytax",
"version": "1.3.0",
"version": "1.3.2",
"type": "module",
"scripts": {
"build": "rollup -c",
Expand Down
5 changes: 4 additions & 1 deletion src/components/PayTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
{#if $taxYear !== $taxData.year}
<tr class="warning"><th colspan="3">Attention les montants sont basés sur les données fiscales de {$taxData.year}</th></tr>
{/if}
{#if $taxYear === "2023"}
<tr class="warning"><th colspan="3">Le calcul des frais d'emploi est encore en test pour 2023</th></tr>
{/if}
</thead>
<tbody>
<tr>
Expand Down Expand Up @@ -148,7 +151,7 @@
</tbody>
<tfoot>
<tr>
<td colspan="5">1. Les Frais d’emploi comprennent les lignes IND.REPAS, INDEMNITE REPAS, IR.FIN ANNEE DOUBL, IND. TRANSPORT, FRAIS REELS TRANSP, R. FRAIS DE TRANSPORT du bulletin de paye.</td>
<td colspan="5">1. Les Frais d’emploi comprennent les lignes IND.REPAS, INDEMNITE REPAS, IR.FIN ANNEE DOUBL, IND. TRANSPORT, IND. TRANSPORT EXO, FRAIS REELS TRANSP, R. FRAIS DE TRANSPORT, IR EXONEREES, IR NON EXONEREES du bulletin de paye.</td>
</tr>
<tr>
<td colspan="5">2. Cette colonne reprend la ligne I.DECOUCHERS F.PRO, elle est utilisée pour l’estimation. Pour les impôts, c’est uniquement l’attestation des nuitées AF qui doit être prise en compte.</td>
Expand Down
8 changes: 4 additions & 4 deletions src/parsers/payParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// convert a text number to a decimal (accepts "12345,67 or 12345.67 or 12 345.67)
// forces 2 precision digits
// returns a string
// returns a string
export const decimal = (text) => {
const number = text.replace(',', '.').replace(' ', '');
const [left, right] = number.split(".");
Expand Down Expand Up @@ -75,9 +75,9 @@ const sum = (decimals) => cents2decimal(decimals.map(decimal2cents).reduce((a, b
export const payParser = (text, fileName, fileOrder) => {
//console.log(text);
let result = {"type": "pay", fileName, fileOrder, errors: []};
let re = /(?:IND\.REPAS_+|INDEMNITE REPAS_+|IR\.FIN ANNEE DOUBL_+)([\-0-9, ]+)/g;
let re = /(?:IND\.REPAS_+|INDEMNITE REPAS_+|IR\.FIN ANNEE DOUBL_+|IR EXONEREES_+|IR NON EXONEREES_+)([\-0-9, ]+)/g;
result.repas = matchAll(text, re, "0").map(decimal);
re = /(?:IND\. TRANSPORT_+|FRAIS REELS TRANSP_+|R\. FRAIS DE TRANSPORT_+)([\-0-9, ]+)/g;
re = /(?:IND\. TRANSPORT EXO_+|IND\. TRANSPORT_+|FRAIS REELS TRANSP_+|R\. FRAIS DE TRANSPORT_+)([\-0-9, ]+)/g;
result.transport = matchAll(text, re, "0").map(decimal);
re = /(?:_I.DECOUCHERS F.PRO_+)([\-0-9, ]+)/g;
result.decouchers_fpro = matchAll(text, re, "0").map(decimal);
Expand All @@ -102,4 +102,4 @@ export const payParser = (text, fileName, fileOrder) => {
throw new Error(`Date non trouvée`);
}
return result;
}
}
2 changes: 1 addition & 1 deletion src/parsers/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {nightsAFParser} from "./nightsAFParser";
// Return array of result
export const router = (text, fileName, fileOrder, taxYear, taxData, base, tzConverter) => {
const results = [];
if (text.match(/BULLETIN DE PAIE_(AIR FRANCE|BASE)/)) {
if (text.match(/BULLETIN DE PAIE_(AIR FRANCE|BASE|DP GN)/)) {
try {
const result = payParser(text, fileName, fileOrder);
if (result.errors) {
Expand Down

0 comments on commit 4ca795c

Please sign in to comment.