From: Michael R. <mr...@us...> - 2002-03-19 09:09:01
|
Update of /cvsroot/kick/kick In directory usw-pr-cvs1:/tmp/cvs-serv10348 Modified Files: tauszg Log Message: Tools wird nicht mehr gebunden Unterschiedliche JOIN Syntax für MySql und MS Access Quote-Anpassung im Datumsformat (unterschiedliche Behandlung MySql und MS Access) Index: tauszg =================================================================== RCS file: /cvsroot/kick/kick/tauszg,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tauszg 23 Oct 2001 20:38:12 -0000 1.6 --- tauszg 19 Mar 2002 09:08:56 -0000 1.7 *************** *** 10,14 **** use Kick; use GetOption; - use Tools; use Date::Calc qw(check_date Add_Delta_Days); use Text::ParseWords; --- 10,13 ---- *************** *** 107,136 **** # Einzahlungen ! my $sql = "SELECT ! t.id AS teilhaber, ! t.nachname AS nachname, ! t.vorname AS vorname, ! b.datum AS datum, ! a.datum AS wertung, ! a.preis * b.anteile AS einzahlung, ! 0 / 1 AS s_einzahlung, ! 0 / 1 AS auszahlung, ! 0 / 1 AS s_auszahlung, ! a.preis AS preis, ! b.anteile AS anteile, ! 0 / 1 AS s_anteile, ! 0 / 1 AS wert ! INTO ! temp ! FROM ! tbuchungen b, ! teilhaber t, ! abschluss a ! WHERE ! b.xEnde = a.id ! AND b.xTeilhaber = t.id ! AND b.anteile > 0 ! $interval"; ! &Sql ( sql => $sql ); # Auszahlungen --- 106,181 ---- # Einzahlungen ! my $sql; ! if (&DBDriver eq 'mysql') { ! $sql = 'CREATE TABLE temp ( ! teilhaber INT, ! nachname CHAR(50), ! vorname CHAR(50), ! datum DATE, ! wertung DATE, ! einzahlung DOUBLE, ! s_einzahlung DOUBLE, ! auszahlung DOUBLE, ! s_auszahlung DOUBLE, ! preis DOUBLE, ! anteile DOUBLE, ! s_anteile DOUBLE, ! wert DOUBLE ! )'; ! &Sql ( sql => $sql, halt => 1 ); ! $sql = "INSERT INTO temp ! SELECT ! t.id AS teilhaber, ! t.nachname AS nachname, ! t.vorname AS vorname, ! b.datum AS datum, ! a.datum AS wertung, ! a.preis * b.anteile AS einzahlung, ! 0 / 1 AS s_einzahlung, ! 0 / 1 AS auszahlung, ! 0 / 1 AS s_auszahlung, ! a.preis AS preis, ! b.anteile AS anteile, ! 0 / 1 AS s_anteile, ! 0 / 1 AS wert ! FROM ! tbuchungen b, ! teilhaber t, ! abschluss a ! WHERE ! b.xEnde = a.id ! AND b.xTeilhaber = t.id ! AND b.anteile > 0 ! $interval"; ! } ! else { ! $sql = "SELECT ! t.id AS teilhaber, ! t.nachname AS nachname, ! t.vorname AS vorname, ! b.datum AS datum, ! a.datum AS wertung, ! a.preis * b.anteile AS einzahlung, ! 0 / 1 AS s_einzahlung, ! 0 / 1 AS auszahlung, ! 0 / 1 AS s_auszahlung, ! a.preis AS preis, ! b.anteile AS anteile, ! 0 / 1 AS s_anteile, ! 0 / 1 AS wert ! INTO ! temp ! FROM ! tbuchungen b, ! teilhaber t, ! abschluss a ! WHERE ! b.xEnde = a.id ! AND b.xTeilhaber = t.id ! AND b.anteile > 0 ! $interval"; ! } ! ! &Sql ( sql => $sql, halt => 1 ); # Auszahlungen *************** *** 188,192 **** # Saldo nachtragen ! @col = [ qw (name s_einzahlung s_auszahlung s_anteile wert) ]; @felder = qw(dummy dummy s_einzahlung s_auszahlung s_anteile wert); --- 233,237 ---- # Saldo nachtragen ! @col = qw (name s_einzahlung s_auszahlung s_anteile wert); @felder = qw(dummy dummy s_einzahlung s_auszahlung s_anteile wert); *************** *** 247,251 **** if ($opt { kurz }) { ! @col = [ qw (name s_ein s_aus s_anteile wert) ]; @reformat = map { [ substr(&Trim($$_[0]).", ".&Trim($$_[1]),0,50), --- 292,296 ---- if ($opt { kurz }) { ! @col = qw (name s_ein s_aus s_anteile wert); @reformat = map { [ substr(&Trim($$_[0]).", ".&Trim($$_[1]),0,50), *************** *** 271,275 **** elsif ($opt { kurz }) { ! @col = [qw (datum einzahlung auszahlung preis anteile gesamt)]; @reformat = map { [ &ShortDate(&ParseDBDate($$_[0])), --- 316,320 ---- elsif ($opt { kurz }) { ! @col = qw (datum einzahlung auszahlung preis anteile gesamt); @reformat = map { [ &ShortDate(&ParseDBDate($$_[0])), *************** *** 300,307 **** # Ouput ! my @data = (@col, @reformat); if ($opt { csv }) { ! print join "\n", map { (join ";", map { &IsNumber(Trim($_)) ? Trim($_) : '"'.Trim($_).'"' } @{$_}) } (@col, @reformat); print "\n"; } --- 345,352 ---- # Ouput ! my @data = (\@col, @reformat); if ($opt { csv }) { ! print join "\n", map { (join ";", map { &IsNumber(Trim($_)) ? Trim($_) : '"'.Trim($_).'"' } @{$_}) } (\@col, @reformat); print "\n"; } *************** *** 510,513 **** --- 555,564 ---- $Log$ + Revision 1.7 2002/03/19 09:08:56 mrau + + Tools wird nicht mehr gebunden + Unterschiedliche JOIN Syntax für MySql und MS Access + Quote-Anpassung im Datumsformat (unterschiedliche Behandlung MySql und MS Access) + Revision 1.6 2001/10/23 20:38:12 mrau Default Parameter definiert |