mirror of
https://github.com/imapsync/imapsync.git
synced 2025-08-02 15:11:49 +02:00
1.488
This commit is contained in:
parent
1466872026
commit
b62a0dae2a
58 changed files with 612 additions and 140 deletions
|
@ -5,10 +5,10 @@
|
|||
|
||||
echo paypal_bilan_tests_invoice
|
||||
paypal_bilan_tests_invoice() {
|
||||
# DID output no diff between paypal_bilan_1.46 and 1.47
|
||||
# DID output no diff between paypal_bilan_1.47 and 1.48
|
||||
(
|
||||
#set -x
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.46 --bnc --debug --debug_invoice --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334' /g/paypal/paypal_201?_??_complet.csv \
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan_1.47 --bnc --debug --debug_invoice --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334' /g/paypal/paypal_201?_??_complet.csv \
|
||||
> /g/var/paypal_bilan/tests/paypal_invoice.out1 2>&1
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --bnc --debug --debug_invoice --first_in 147 --avoid_numbers '292 293 643 644 731 732 1093 1330 1331 1332 1333 1334' /g/paypal/paypal_201?_??_complet.csv \
|
||||
> /g/var/paypal_bilan/tests/paypal_invoice.out2 2>&1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# $Id: paypal_bilan,v 1.47 2012/02/24 12:22:05 gilles Exp gilles $
|
||||
# $Id: paypal_bilan,v 1.48 2012/04/15 09:24:49 gilles Exp gilles $
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
@ -477,8 +477,10 @@ sub compute_line {
|
|||
$FR_flag = ' FR' if $Pays eq 'France' ;
|
||||
my $IND_flag = '' ;
|
||||
$IND_flag = ' IND' if ('imapsync usage' eq $Nom_Option_1 and 'individual' eq $Valeur_Option_1 ) ;
|
||||
my $SUPPORT_flag = '' ;
|
||||
$SUPPORT_flag = ' support' if ( 'imapsync support' eq $Titre_de_l_objet ) ;
|
||||
print "FE $invoice$FR_flag$IND_flag\n" ;
|
||||
print "FE $invoice$FR_flag$IND_flag imapsync $Nom\n" ;
|
||||
print "FE $invoice$FR_flag$IND_flag imapsync$SUPPORT_flag $Nom\n" ;
|
||||
printf( "%.2f [EUR %.2f]\n", $Montant, $MontantEUR ) ;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# $Id: paypal_bilan,v 1.46 2012/02/24 11:53:06 gilles Exp gilles $
|
||||
# $Id: paypal_bilan,v 1.47 2012/02/24 12:22:05 gilles Exp gilles $
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
@ -27,6 +27,7 @@ my $total_eur_invoice = 0 ;
|
|||
my $nb_invoice = 0 ;
|
||||
my $nb_invoice_refund = 0 ;
|
||||
my $nb_invoice_suspended = 0 ;
|
||||
my $nb_invoice_canceled = 0 ;
|
||||
|
||||
my ( $tests, $testeur ) ;
|
||||
my $debug ;
|
||||
|
@ -41,6 +42,7 @@ my $bnc = '' ;
|
|||
my $usdeur = 1.2981 ;
|
||||
my $invoices ;
|
||||
my %invoice_refund ;
|
||||
my %invoice_canceled ;
|
||||
my %invoice_suspended ;
|
||||
my $write_invoices = 0 ;
|
||||
my $avoid_numbers ;
|
||||
|
@ -148,6 +150,10 @@ foreach my $invoice ( @invoices_wanted ) {
|
|||
my $nb_invoice_sent = scalar( @invoice_sent ) ;
|
||||
@invoice_not_sent = sort { $a <=> $b } keys( %invoice_not_sent ) ;
|
||||
|
||||
my @invoice_canceled = sort { $a <=> $b } keys( %invoice_canceled ) ;
|
||||
my @invoice_suspended = sort { $a <=> $b } keys( %invoice_suspended ) ;
|
||||
my @invoice_refund = sort { $a <=> $b } keys( %invoice_refund ) ;
|
||||
|
||||
print "USD banque $total_usd_received\n" ;
|
||||
print "USD invoice $total_usd_invoice\n" ;
|
||||
my $total_eur_from_usd ;
|
||||
|
@ -174,8 +180,9 @@ print "EUR total TVA $total_TVA_EUR\n" ;
|
|||
print "EUR total HT sup $total_HT_EUR_sup\n" ;
|
||||
print "EUR total TVA sup $total_TVA_EUR_sup\n" ;
|
||||
print "Nb invoice $nb_invoice ( from $first_invoice_paypal to $last_invoice )\n" ;
|
||||
print "Nb invoice refund $nb_invoice_refund\n" ;
|
||||
print "Nb invoice suspended $nb_invoice_suspended\n" ;
|
||||
print "Nb invoice canceled $nb_invoice_canceled @invoice_canceled\n" ;
|
||||
print "Nb invoice suspended $nb_invoice_suspended @invoice_suspended\n" ;
|
||||
print "Nb invoice refund $nb_invoice_refund @invoice_refund\n" ;
|
||||
print "Nb invoice sent $nb_invoice_sent\n" ;
|
||||
print "Have to send invoices @invoice_not_sent\n" if ( @invoice_not_sent ) ;
|
||||
|
||||
|
@ -420,7 +427,6 @@ sub compute_line {
|
|||
and 'EUR' eq $Devise
|
||||
and 'Remboursé' eq $Etat
|
||||
) {
|
||||
#$invoice = $first_invoice + $nb_invoice ;
|
||||
$invoice = next_invoice( ) ;
|
||||
$nb_invoice++ ;
|
||||
$nb_invoice_refund++;
|
||||
|
@ -429,12 +435,24 @@ sub compute_line {
|
|||
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
|
||||
}
|
||||
|
||||
if (
|
||||
'Paiement sur site marchand reçu' eq $Type
|
||||
and 'EUR' eq $Devise
|
||||
and 'Annulé' eq $Etat
|
||||
) {
|
||||
$invoice = next_invoice( ) ;
|
||||
$nb_invoice++ ;
|
||||
$nb_invoice_canceled++;
|
||||
$invoice_canceled{ $invoice }++ ;
|
||||
|
||||
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
|
||||
}
|
||||
|
||||
if (
|
||||
'Paiement sur site marchand reçu' eq $Type
|
||||
and 'EUR' eq $Devise
|
||||
and 'Suspendu' eq $Etat
|
||||
) {
|
||||
#$invoice = $first_invoice + $nb_invoice ;
|
||||
$invoice = next_invoice( ) ;
|
||||
$nb_invoice++ ;
|
||||
$nb_invoice_suspended++;
|
||||
|
@ -448,7 +466,6 @@ sub compute_line {
|
|||
and 'EUR' eq $Devise
|
||||
and 'Non compensé' eq $Etat
|
||||
) {
|
||||
#$invoice = $first_invoice + $nb_invoice ;
|
||||
$invoice = next_invoice( ) ;
|
||||
$nb_invoice++ ;
|
||||
$print_details and print ( "[$invoice] [$Date] [$Heure] [$Fuseau_horaire] [$Nom] [$Type] [$Etat] [$Devise] [$Montant] [$Numero_davis_de_reception] [$Solde]\n" ) ;
|
293
W/paypal_reply/paypal_build_invoice_from_email
Executable file
293
W/paypal_reply/paypal_build_invoice_from_email
Executable file
|
@ -0,0 +1,293 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# $Id: paypal_build_invoice_from_email,v 1.1 2012/03/14 00:24:50 gilles Exp gilles $
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
use Test::More 'no_plan';
|
||||
|
||||
|
||||
my ($msg_id_file, $msg_id);
|
||||
my ($amount, $name, $email);
|
||||
my (
|
||||
$paypal_line, $paypal_info,
|
||||
$buyer, $description, $object,
|
||||
$url, $release, $release_exe,
|
||||
) ;
|
||||
|
||||
my( $day, $month, $year, $hour, $min, $sec, $fuseau, $transaction,
|
||||
$postal_address ) ;
|
||||
|
||||
my ( $help, $debug, $tests ) ;
|
||||
|
||||
my $numopt = scalar( @ARGV ) ;
|
||||
|
||||
my $test_builder = Test::More->builder;
|
||||
$test_builder->no_ending(1);
|
||||
|
||||
my $opt_ret = GetOptions(
|
||||
"help" => \$help,
|
||||
"debug!" => \$debug,
|
||||
"tests!" => \$tests,
|
||||
);
|
||||
|
||||
if ($tests) {
|
||||
$test_builder->no_ending(0);
|
||||
tests();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
usage() and exit if ($help or ! $numopt) ;
|
||||
|
||||
$msg_id_file = $ARGV[1];
|
||||
$msg_id = firstline($msg_id_file);
|
||||
|
||||
$debug and print "Hi!\n" ;
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 1:$_" ;
|
||||
next if ( ! /^(.*Num.+ro de transaction.*)$/ );
|
||||
$paypal_line = $1;
|
||||
$paypal_info = "===== Paypal id =====\n$paypal_line\n";
|
||||
$debug and print "paypal_line: [$paypal_line]\n" ;
|
||||
( $day, $month, $year, $hour, $min, $sec, $fuseau, $transaction )
|
||||
= paypal_infos( $paypal_line ) ;
|
||||
$debug and print "$day, $month, $year, $hour, $min, $sec, $fuseau, $transaction\n" ;
|
||||
last;
|
||||
}
|
||||
while(<>) {
|
||||
$debug and print "LINE 2:$_" ;
|
||||
if ( /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*) \((.*)\)/) {
|
||||
($amount, $name, $email) = ($1, $2, $3);
|
||||
last;
|
||||
}
|
||||
if ( /^Vous avez re.*paiement d'un montant de (.*) de la part de (.*)/) {
|
||||
($amount, $name, $email) = ($1, "", $2);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$release = firstline( '/g/public_html/imapsync/VERSION' ) ;
|
||||
$release_exe = firstline( '/g/public_html/imapsync/VERSION_EXE' ) ;
|
||||
my $path_last = firstline( '/g/public_html/imapsync/dist/path_last.txt' ) ;
|
||||
|
||||
$url = "http://ks.lamiral.info/imapsync/dist/$path_last/" ;
|
||||
|
||||
#print "[$amount] [$name] [$email] [$paypal_line]\n";
|
||||
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 3:$_" ;
|
||||
if ( /^Acheteur/ ) {
|
||||
$buyer .= "===== Acheteur =====\n";
|
||||
last;
|
||||
}
|
||||
if ( /^Informations sur l'acheteur/ ) {
|
||||
$buyer .= "===== Acheteur =====\n";
|
||||
chomp( $name = <> );
|
||||
$buyer .= "$name\n" ;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 4a:$_" ;
|
||||
$buyer .= $_ if ( ! /^Adresse de livraison/ );
|
||||
last if ( /^Adresse de livraison/ );
|
||||
}
|
||||
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 4b:$_" ;
|
||||
$postal_address .= $_ if ( ! /^Instructions .* l'attention du marchand/ and "\n" ne $_ );
|
||||
last if ( /^Instructions .* l'attention du marchand/ );
|
||||
}
|
||||
|
||||
my @postal_address = split( "\n", $postal_address ) ;
|
||||
my $country = $postal_address[-1] ;
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 4c:$_" ;
|
||||
$buyer .= $_ if ( ! /^-----------------------------------/ );
|
||||
last if ( /^-----------------------------------/ );
|
||||
}
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 5:$_" ;
|
||||
next if ( ! /^Description :(.*)/ );
|
||||
$object = $1 ;
|
||||
$description = "===== Details =====\n";
|
||||
$description .= $_;
|
||||
last;
|
||||
}
|
||||
|
||||
|
||||
|
||||
while(<>) {
|
||||
$debug and print "LINE 6:$_" ;
|
||||
$description .= $_;
|
||||
last if ( /^Paiement envoy/ );
|
||||
last if ( /^N.*d'avis de r.*ception/ );
|
||||
}
|
||||
|
||||
|
||||
my $address = 'gilles.lamiral@laposte.net';
|
||||
my $address2 = 'gilles@lamiral.info';
|
||||
my $rcstag = '$Id: paypal_build_invoice_from_email,v 1.1 2012/03/14 00:24:50 gilles Exp gilles $';
|
||||
|
||||
my $download_info = "You will find the latest imapsync.exe binary (release $release_exe)
|
||||
and the latest imapsync source code (release $release) at the following link:
|
||||
$url" ;
|
||||
|
||||
my $next_releases =
|
||||
"Next imapsync releases will be available to you for one year without extra payment.
|
||||
You'll be subscribed to a newsletter [imapsync_update] announcing new releases.
|
||||
Just keep this message and ask for the new links in case you miss the newsletter.
|
||||
Run imapsync without any argument to know if a new release is available." ;
|
||||
|
||||
|
||||
my $thanks_software = "I thank you for buying and using imapsync,
|
||||
I wish you successful transfers!" ;
|
||||
|
||||
my $thanks_support = "I thank you for buying support and using imapsync,
|
||||
I wish you successful transfers, I will help you to succeed." ;
|
||||
|
||||
my $support_info = 'Now you have access to imapsync professional support.
|
||||
|
||||
You can contact me (Gilles LAMIRAL) by email or phone.
|
||||
|
||||
Email address: gilles.lamiral@laposte.net.
|
||||
Professionnal phone number: +33 951 84 42 42 (France)
|
||||
Mobile phone number: +33 620 79 76 06 (France).
|
||||
|
||||
I can call you back for free in many countries on landline telephone numbers
|
||||
and to mobile numbers in the United States and France. So do not hesitate
|
||||
to send me a note if you need vocal support.' ;
|
||||
|
||||
|
||||
my $text_software = "$download_info\n
|
||||
$next_releases\n
|
||||
You will receive an invoice soon.\n
|
||||
$thanks_software" ;
|
||||
|
||||
my $text_support = "$support_info\n
|
||||
You will receive an invoice soon.\n
|
||||
$thanks_support" ;
|
||||
|
||||
my $subject_software = "[imapsync download] imapsync release $release [$email]" ;
|
||||
|
||||
my $subject_support = "[imapsync support] imapsync release $release [$email]" ;
|
||||
|
||||
my $subject ;
|
||||
|
||||
my $text ;
|
||||
if ( 'imapsync support' eq $object ) {
|
||||
$text = $text_support ;
|
||||
$subject = $subject_support ;
|
||||
}else{
|
||||
$text = $text_software ;
|
||||
$subject = $subject_software ;
|
||||
}
|
||||
|
||||
|
||||
my $message = <<EOM
|
||||
X-Comment: $rcstag
|
||||
In-Reply-To: $msg_id
|
||||
From: Gilles LAMIRAL <$address>
|
||||
To: <$email>
|
||||
Bcc: Gilles LAMIRAL <$address>, <$address2>
|
||||
Subject: $subject
|
||||
|
||||
Hello $name,
|
||||
|
||||
$text
|
||||
|
||||
$paypal_info
|
||||
$buyer
|
||||
$description
|
||||
==== Vendeur ====
|
||||
Gilles LAMIRAL
|
||||
4 La Billais
|
||||
35580 Baulon
|
||||
FRANCE
|
||||
|
||||
Tel: +33 951 84 42 42
|
||||
Mob: +33 620 79 76 06
|
||||
Fax: +33 956 84 42 42
|
||||
|
||||
email: $address
|
||||
|
||||
--
|
||||
Au revoir, 09 51 84 42 42
|
||||
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06
|
||||
EOM
|
||||
;
|
||||
|
||||
=pod
|
||||
=cut
|
||||
|
||||
|
||||
#print $message;
|
||||
#print "[$amount] [$name] [$email] [$paypal_line] [$object]\n";
|
||||
print "[$postal_address]
|
||||
@postal_address
|
||||
$country
|
||||
\n" ;
|
||||
|
||||
sub firstline {
|
||||
# extract the first line of a file (without \n)
|
||||
|
||||
my($file) = @_;
|
||||
my $line = "";
|
||||
|
||||
open FILE, $file or die("error [$file]: $! ");
|
||||
chomp($line = <FILE>);
|
||||
close FILE;
|
||||
$line = ($line) ? $line: "error !EMPTY! [$file]";
|
||||
return $line;
|
||||
}
|
||||
|
||||
sub tests {
|
||||
|
||||
SKIP: {
|
||||
skip "No test in normal run" if ( not $tests ) ;
|
||||
tests_paypal_infos() ;
|
||||
}
|
||||
}
|
||||
|
||||
sub paypal_infos {
|
||||
|
||||
my $paypal_infos = shift ;
|
||||
$paypal_infos =~ /(\d{1,2}) (.*) (\d{4}) (\d\d):(\d\d):(\d\d) (.*) \| Num.*ro de transaction : (.*)/ ;
|
||||
my( $day, $month, $year, $hour, $min, $sec, $fuseau, $transaction )
|
||||
= ( $1, $2, $3, $4, $5, $6, $7, $8 ) ;
|
||||
#print "$day, $month, $year, $hour, $min, $sec, $fuseau, $transaction\n" ;
|
||||
return( $day, $month, $year, $hour, $min, $sec, $fuseau, $transaction ) ;
|
||||
|
||||
}
|
||||
|
||||
sub tests_paypal_infos {
|
||||
#ok( 1 == 1 ) ;
|
||||
my( $day, $month, $year, $hour, $min, $sec, $fuseau, $transaction )
|
||||
= paypal_infos( "14 mar 2012 01:47:55 CET | Numéro de transaction : 75E02654YS4206549" ) ;
|
||||
ok( '14' eq $day, 'paypal_infos: day' ) ;
|
||||
ok( 'mar' eq $month, 'paypal_infos: month' ) ;
|
||||
ok( '2012' eq $year, 'paypal_infos: year' ) ;
|
||||
ok( '01' eq $hour, 'paypal_infos: hour' ) ;
|
||||
ok( '47' eq $min, 'paypal_infos: min' ) ;
|
||||
ok( '55' eq $sec, 'paypal_infos: sec' ) ;
|
||||
ok( 'CET' eq $fuseau, 'paypal_infos: fuseau' ) ;
|
||||
ok( '75E02654YS4206549' eq $transaction, 'paypal_infos: transaction' ) ;
|
||||
|
||||
( $day, $month, $year, $hour, $min, $sec, $fuseau, $transaction )
|
||||
= paypal_infos( "1 fév 2012 20:18:10 CET | Numéro de transaction : 5HF11160SD123724S" ) ;
|
||||
ok( '1' eq $day, 'paypal_infos: day' ) ;
|
||||
ok( 'fév' eq $month, 'paypal_infos: month' ) ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id: paypal_build_invoices,v 1.26 2012/02/24 12:32:56 gilles Exp gilles $
|
||||
# $Id: paypal_build_invoices,v 1.29 2012/04/13 10:42:44 gilles Exp gilles $
|
||||
|
||||
# usage: sh paypal_build_invoices /g/var/paypal_invoices/????
|
||||
|
||||
|
@ -22,24 +22,28 @@ set -x
|
|||
#/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
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1335 /g/paypal/paypal_2012_01_complet.csv
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1417 /g/paypal/paypal_2012_02_complet.csv
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1335 /g/paypal/paypal_2012_01_complet.csv
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1417 /g/paypal/paypal_2012_02_complet.csv
|
||||
#/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1508 /g/paypal/paypal_2012_03_complet.csv
|
||||
/g/public_html/imapsync/W/paypal_reply/paypal_bilan --write_invoices --first_in 1575 /g/paypal/paypal_2012_04_complet.csv
|
||||
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 147 /g/paypal/paypal_2010_11_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 214 /g/paypal/paypal_2010_12_complet.csv
|
||||
: /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
|
||||
: /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
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1185 /g/paypal/paypal_2011_11_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1263 /g/paypal/paypal_2011_12_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 382 --usdeur 1.3692 /g/paypal/paypal_2011_02_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 473 --usdeur 1.3809 /g/paypal/paypal_2011_03_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 570 --usdeur 1.4172 /g/paypal/paypal_2011_04_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 645 --usdeur 1.4810 /g/paypal/paypal_2011_05_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 733 --usdeur 1.4395 /g/paypal/paypal_2011_06_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 824 --usdeur 1.4496 /g/paypal/paypal_2011_07_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 917 --usdeur 1.4397 /g/paypal/paypal_2011_08_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1094 --usdeur 1.4380 /g/paypal/paypal_2011_10_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1185 --usdeur 1.3387 /g/paypal/paypal_2011_11_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1263 --usdeur 1.3856 /g/paypal/paypal_2011_12_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1335 /g/paypal/paypal_2012_01_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1417 /g/paypal/paypal_2012_02_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1508 /g/paypal/paypal_2012_03_complet.csv
|
||||
: /g/public_html/imapsync/W/paypal_reply/paypal_bilan --first_in 1575 /g/paypal/paypal_2012_04_complet.csv
|
||||
set +x
|
||||
|
||||
# La totale
|
||||
|
|
|
@ -83,7 +83,7 @@ extract_mail() {
|
|||
|
||||
convert_utf8() {
|
||||
mkdir -p $tmpdir/msg_out_utf8/
|
||||
test -z "`ls $tmpdir/msg_out/`" && echo no mail && return
|
||||
test -z "`ls $tmpdir/msg_out/*_d/*.txt`" && echo no mail && return
|
||||
for f in $tmpdir/msg_out/*_d/*.txt; do
|
||||
b=`basename "$f"`
|
||||
d=`dirname "$f"`
|
||||
|
@ -113,8 +113,9 @@ troncate_last_2_chars() {
|
|||
|
||||
build_reply() {
|
||||
mkdir -p $tmpdir/msg_reply/
|
||||
test -z "`ls $tmpdir/msg_out/`" && echo no mail && return
|
||||
for f in $tmpdir/msg_out_utf8/*/*.txt; do
|
||||
#echo "$f"
|
||||
echo "$f"
|
||||
d=`dirname "$f"`
|
||||
bd=`basename "$d"`
|
||||
file_id=`troncate_last_2_chars $bd`
|
||||
|
@ -122,6 +123,7 @@ build_reply() {
|
|||
test -f "$d_reply/$file_id.txt" && continue
|
||||
mkdir -p "$d_reply"
|
||||
echo building "$d_reply/$file_id.txt"
|
||||
echo paypal_build_reply "$f" "$tmpdir/msg_id/$file_id"
|
||||
paypal_build_reply "$f" "$tmpdir/msg_id/$file_id" > "$d_reply/$file_id.txt"
|
||||
done
|
||||
}
|
||||
|
@ -139,21 +141,38 @@ build_reply_arg() {
|
|||
done
|
||||
}
|
||||
|
||||
|
||||
build_invoice_arg() {
|
||||
for f in "$@"; do
|
||||
#echo "$f"
|
||||
d=`dirname "$f"`
|
||||
bd=`basename "$d"`
|
||||
file_id=`troncate_last_2_chars $bd`
|
||||
d_invoice="$tmpdir/invoices/$file_id"
|
||||
echo building "$d_invoice/imapsync_var.tex"
|
||||
echo paypal_build_invoice_from_email "$f" "$tmpdir/msg_id/$file_id"
|
||||
paypal_build_invoice_from_email "$f" "$tmpdir/msg_id/$file_id"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
debug_mode() {
|
||||
#return 0
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
send_reply() {
|
||||
mkdir -p $tmpdir/msg_sent/
|
||||
test -z "`ls $tmpdir/msg_reply/*/*.txt`" && echo no mail && return
|
||||
for f in $tmpdir/msg_reply/*/*.txt; do
|
||||
b=`basename "$f"`
|
||||
d=`dirname "$f"`
|
||||
bd=`basename "$d"`
|
||||
d_sent="$tmpdir/msg_sent/$bd"
|
||||
debug_mode && echo "paypal_send $f"
|
||||
test -f "$d_sent/$b" && continue
|
||||
mkdir -p "$d_sent"
|
||||
debug_mode && echo "paypal_send $f"
|
||||
test X"--send" = X"$1" && paypal_send --send --subscribe "$f" && touch "$d_sent/$b"
|
||||
#test X"--send" = X"$1" && touch "$d_sent/$b"
|
||||
test X"" = X"$1" && paypal_send "$f"
|
||||
|
@ -218,9 +237,9 @@ paypal_all_dev() {
|
|||
build_reply
|
||||
echo "Done build_reply in $tmpdir/msg_reply/"
|
||||
echo "Will send_reply $@"
|
||||
|
||||
send_reply "$@"
|
||||
echo "Done send_reply $@"
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,24 +5,20 @@
|
|||
set -e
|
||||
#set -x
|
||||
|
||||
|
||||
# Add path to commands at home
|
||||
PATH=$PATH:/g/public_html/imapsync/W/paypal_reply
|
||||
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.28/lib
|
||||
PERL5LIB=/g/public_html/imapsync/Mail-IMAPClient-3.30/lib
|
||||
export PERL5LIB
|
||||
|
||||
test -f /g/public_html/imapsync/W/paypal_reply/paypal_functions \
|
||||
&& . /g/public_html/imapsync/W/paypal_reply/paypal_functions
|
||||
|
||||
|
||||
DATE_1=`date`
|
||||
|
||||
echo "==== paypal_reply_test ===="
|
||||
paypal_reply_petite_dev "$@"
|
||||
echo
|
||||
|
||||
|
||||
|
||||
DATE_2=`date`
|
||||
|
||||
echo "Debut : $DATE_1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue