2011-07-11 23:24:12 +02:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
2012-04-17 00:28:48 +02:00
|
|
|
|
# $Id: paypal_build_invoices,v 1.22 2011/12/02 04:08:46 gilles Exp gilles $
|
|
|
|
|
|
|
|
|
|
# usage: sh paypal_build_invoices /g/var/paypal_invoices/????
|
2011-07-11 23:24:12 +02:00
|
|
|
|
|
|
|
|
|
lyx -e latex /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.lyx
|
|
|
|
|
cp /home/gilles/public_html/AGIL/factures/000/facture_imapsync-000.tex /g/var/paypal_invoices/
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 147 /g/paypal/paypal_2010_11_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 214 /g/paypal/paypal_2010_12_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 294 /g/paypal/paypal_2011_01_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 382 /g/paypal/paypal_2011_02_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 473 /g/paypal/paypal_2011_03_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 570 /g/paypal/paypal_2011_04_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 645 /g/paypal/paypal_2011_05_complet.csv
|
2011-09-25 22:31:48 +02:00
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 733 /g/paypal/paypal_2011_06_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 824 /g/paypal/paypal_2011_07_complet.csv
|
2012-04-17 00:26:18 +02:00
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 917 /g/paypal/paypal_2011_08_complet.csv
|
2012-04-17 00:27:13 +02:00
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 999 /g/paypal/paypal_2011_09_complet.csv
|
|
|
|
|
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1094 /g/paypal/paypal_2011_10_complet.csv
|
|
|
|
|
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
|
2012-04-17 00:28:48 +02:00
|
|
|
|
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
|
2011-09-25 22:31:48 +02:00
|
|
|
|
|
2012-04-17 00:28:48 +02:00
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 294 --usdeur 1.3385 /g/paypal/paypal_2011_01_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 382 /g/paypal/paypal_2011_02_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 473 /g/paypal/paypal_2011_03_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 570 /g/paypal/paypal_2011_04_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 645 /g/paypal/paypal_2011_05_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 733 /g/paypal/paypal_2011_06_complet.csv
|
2012-04-17 00:26:18 +02:00
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 824 /g/paypal/paypal_2011_07_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 917 /g/paypal/paypal_2011_08_complet.csv
|
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1094 /g/paypal/paypal_2011_10_complet.csv
|
2012-04-17 00:27:13 +02:00
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
|
2012-04-17 00:28:48 +02:00
|
|
|
|
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
|
2011-07-11 23:24:12 +02:00
|
|
|
|
set +x
|
|
|
|
|
|
|
|
|
|
# La totale
|
|
|
|
|
: || /g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug \
|
2012-04-17 00:26:18 +02:00
|
|
|
|
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093' \
|
2011-07-11 23:24:12 +02:00
|
|
|
|
/g/paypal/paypal_201?_??_complet.csv
|
|
|
|
|
|
2011-09-25 22:31:48 +02:00
|
|
|
|
: || /g/public_html/imapsync/W/paypal_reply/paypal_bilan \
|
2012-04-17 00:26:18 +02:00
|
|
|
|
--first_in 147 --avoid_numbers '292 293 643 644 731 732 1093' \
|
2011-09-25 22:31:48 +02:00
|
|
|
|
/g/paypal/paypal_201?_??_complet.csv
|
|
|
|
|
|
2012-04-17 00:28:48 +02:00
|
|
|
|
echo 'sh paypal_build_invoices /g/var/paypal_invoices/1???'
|
|
|
|
|
|
|
|
|
|
|
2011-09-25 22:31:48 +02:00
|
|
|
|
|
2011-07-11 23:24:12 +02:00
|
|
|
|
# USD de 147 <20> 340
|
|
|
|
|
# EUR de 341 <20> ...
|
|
|
|
|
|
|
|
|
|
# 20110413 Found problems with 189 199 249 258 263 359 537
|
|
|
|
|
# 20110412 Found problems with 189 199 242 249 258 263 359 382 537
|
|
|
|
|
# cen cen JAP cen cen cen cen TCH JAP
|
|
|
|
|
# cen
|
|
|
|
|
# 155 TVA 1,89
|
|
|
|
|
# 171 TVA 4,42
|
|
|
|
|
# 220 TVA 3,16
|
|
|
|
|
# 225 TVA 3,16
|
|
|
|
|
# 236 TVA 4,42
|
|
|
|
|
# 298 TVA 3,16
|
|
|
|
|
# 307 TVA 4,42
|
|
|
|
|
# 312 TVA 4,42
|
|
|
|
|
# 324 TVA 4,42
|
|
|
|
|
# 351 TVA 4,92
|
|
|
|
|
# 395 TVA 4,92
|
|
|
|
|
# 408 TVA 4,92
|
|
|
|
|
# 419 TVA 4,92
|
|
|
|
|
# 432 TVA 4,92
|
|
|
|
|
# 435 TVA 4,92
|
|
|
|
|
# 452 TVA 4,92
|
|
|
|
|
# 460 TVA 4,92
|
|
|
|
|
# 461 TVA 4,92
|
|
|
|
|
# 463 TVA 4,92
|
|
|
|
|
# 464 TVA 4,92
|
|
|
|
|
# 475 TVA 4,92
|
|
|
|
|
# 487 TVA 4,92
|
|
|
|
|
# 489 TVA 4,92
|
|
|
|
|
# 502 TVA 4,92
|
|
|
|
|
# 504 TVA 4,92
|
|
|
|
|
# 511 TVA 4,92
|
|
|
|
|
# 522 TVA 4,92
|
|
|
|
|
# 523 TVA 4,92
|
|
|
|
|
# 533 TVA 4,92
|
|
|
|
|
# 537 TVA 4,92
|
|
|
|
|
# 540 TVA 4,92
|
|
|
|
|
# 543 TVA 4,92
|
|
|
|
|
# 549 TVA 4,92
|
|
|
|
|
# 551 TVA 4,92
|
|
|
|
|
# 552 TVA 4,92
|
|
|
|
|
# 556 TVA 4,92
|
|
|
|
|
# 563 TVA 4,92
|
|
|
|
|
|
|
|
|
|
for d in "$@"; do
|
|
|
|
|
echo "==== $d ===="
|
|
|
|
|
cd $d
|
|
|
|
|
bd=`basename $d`
|
|
|
|
|
|
|
|
|
|
if ls SENT_TO_* 2>/dev/null ; then
|
|
|
|
|
echo "!!! Already sent "
|
|
|
|
|
continue
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
rm -f facture_imapsync-$bd.tex
|
|
|
|
|
cp -f ../facture_imapsync-000.tex facture_imapsync-$bd.tex
|
|
|
|
|
|
|
|
|
|
if ! pdflatex facture_imapsync-$bd.tex < /dev/null > /dev/null; then
|
|
|
|
|
echo "PB $bd"
|
|
|
|
|
if test -f facture_imapsync-${bd}_good.tex \
|
|
|
|
|
&& pdflatex facture_imapsync-${bd}_good.tex < /dev/null > /dev/null
|
|
|
|
|
then
|
|
|
|
|
ln -f facture_imapsync-${bd}_good.pdf facture_imapsync-$bd.pdf
|
|
|
|
|
echo "PB $bd solved with manual facture_imapsync-${bd}_good.tex"
|
|
|
|
|
PB_LIST_MANUAL="$PB_LIST_MANUAL $bd"
|
|
|
|
|
else
|
|
|
|
|
PB_LIST="$PB_LIST $bd"
|
|
|
|
|
rm -f facture_imapsync-$bd.pdf
|
|
|
|
|
continue
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
gpg --use-agent --armor --detach-sign --yes facture_imapsync-$bd.pdf
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo "Found problems with $PB_LIST"
|
|
|
|
|
echo "Manual invoices for $PB_LIST_MANUAL"
|