Skip to content

Commit

Permalink
fix pay parser
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingeek committed May 3, 2024
1 parent b6e5645 commit 26cd480
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
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.9] - 2024-05-03

### Fixed

- Correctif pour les frais de transport qui peuvent avoir un détail du kilométrage et un taux de remboursement kilométrique dans certains cas

## [1.3.8] - 2024-04-19

### Fixed
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.8",
"version": "1.3.9",
"type": "module",
"scripts": {
"build": "rollup -c",
Expand Down
4 changes: 2 additions & 2 deletions src/components/PayTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
font-size: initial;
}
.col1 {
width: 130px;
width: 140px;
}
.col2 {
width: 50%;
Expand Down Expand Up @@ -237,7 +237,7 @@
}
td input {
margin-bottom: 0;
width: 120px;
width: 130px;
}
td input:disabled {
color: var(--green);
Expand Down
11 changes: 9 additions & 2 deletions src/parsers/payParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,15 @@ export const payParser = (text, fileName, fileOrder) => {
let result = {"type": "pay", fileName, fileOrder, errors: []};
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 EXO_+|IND\. TRANSPORT_+|FRAIS REELS TRANSP_+|R\. FRAIS DE TRANSPORT_+)([\-0-9, ]+)/g;
result.transport = matchAll(text, re, "0").map(decimal);
// case where there is a quantity, value, total
re = /(?:IND\. TRANSPORT EXO_+|IND\. TRANSPORT_+|FRAIS REELS TRANSP_+|R\. FRAIS DE TRANSPORT_+)[\-0-9, ]+_[\-0-9, ]+_([\-0-9, ]+)/g;
let matches = matchAll(text, re, "0").map(decimal);
if (matches.toString() == "0.00") {
// case where there is just a total
re = /(?:IND\. TRANSPORT EXO_+|IND\. TRANSPORT_+|FRAIS REELS TRANSP_+|R\. FRAIS DE TRANSPORT_+)([\-0-9, ]+)/g;
matches = matchAll(text, re, "0").map(decimal);
}
result.transport = matches;
re = /(?:_I.DECOUCHERS F.PRO_+)([\-0-9, ]+)/g;
result.decouchers_fpro = matchAll(text, re, "0").map(decimal);
try {
Expand Down

0 comments on commit 26cd480

Please sign in to comment.