44 lines
914 B
Bash
Executable File
44 lines
914 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# $1 : NOM-DONATEUR
|
|
# $2 : STATUT-DONATEUR
|
|
# $3 : ADRESSE-DONATEUR
|
|
# $4 : SOMME
|
|
# $5 : DATE-VERSEMENT
|
|
# $6 : FORME-DON
|
|
# $7 : NATURE-DON
|
|
# $8 : MODE-VERSEMENT
|
|
|
|
set -e
|
|
|
|
if [ $# -ne 8 ]; then
|
|
|
|
echo "Nombre d'arguments incorrect"
|
|
exit 1
|
|
fi
|
|
|
|
FILE=$(echo "$1" | tr " " "_")_reçu_don_$(echo "$5" | tr "/" ".").pdf
|
|
NOM_DONATEUR=$1
|
|
STATUT_DONATEUR=$2
|
|
ADRESSE_DONATEUR=$3
|
|
SOMME=$4
|
|
DATE_VERSEMENT=$(date -d$5 +%d/%m/%Y)
|
|
FORME_DON=$6
|
|
NATURE_DON=$7
|
|
MODE_VERSEMENT=$8
|
|
|
|
cat RECU_FISCAL.tex > "$FILE"
|
|
|
|
sed -i "s/NOM-DONATEUR/$NOM_DONATEUR/" "$FILE"
|
|
sed -i "s/STATUT-DONATEUR/$STATUT_DONATEUR/" "$FILE"
|
|
sed -i "s/ADRESSE-DONATEUR/$ADRESSE_DONATEUR/" "$FILE"
|
|
sed -i "s/SOMME/$SOMME/" "$FILE"
|
|
sed -i "s|DATE-VERSEMENT|$DATE_VERSEMENT|" "$FILE"
|
|
sed -i "s/FORME-DON/$FORME_DON/" "$FILE"
|
|
sed -i "s/NATURE-DON/$NATURE_DON/" "$FILE"
|
|
sed -i "s/MODE-VERSEMENT/$MODE_VERSEMENT/" "$FILE"
|
|
|
|
pdflatex "$FILE"
|
|
|
|
rm -f *.aux *.log
|