--- print/print.pl 2001/02/15 08:35:22 1.7 +++ print/print.pl 2002/01/25 14:47:50 1.8 @@ -101,7 +101,7 @@ print "Računa za insprintati: ",$#osoba_id_za_print+1,"\n"; exit if ($#osoba_id_za_print+1 == 0); - +my $server=3; $sth = $dbh->prepare(" select osobe.id,ime,prezime,tel,lokacije.naziv, org_jed.naziv,org_pod_jed.pod_naziv, @@ -111,7 +111,8 @@ where osobe.id in (".join(",",@osoba_id_za_print).") and lokacija_id=lokacije.id and org_jed_id=org_jed.id and org_pod_jed_id=org_pod_jed.pod_id - and racuni.osoba_id=osobe.id and e_mail.osoba_id=osobe.id + and racuni.osoba_id=osobe.id and racuni.server_id=$server + and e_mail.osoba_id=osobe.id ") || die $dbh->errstr(); $sth->execute() || die $sth->errstr(); @@ -123,6 +124,10 @@ $dbh->do("insert into status (osoba_id,kontakt_osoba_id,datum,status_tip_id) values ($arr[0],$ko_id,'now'::datetime,5)") || die $dbh->errstr(); } + my $sth2 = $dbh->prepare("select naziv,mt from sap_osobe,sap_oj where sap_oj.sifra_oj = sap_oj and sap_sifra = $arr[11]"); + $sth2->execute() || die $sth2->errstr(); + my ($sap_org_jed,$mt) = $sth2->fetchrow_array(); + seek(IN,$begin_pos,0); while() { s/--id--/$arr[0]/g; @@ -135,8 +140,8 @@ s/--prezime--/$arr[2]/g; s/--tel--/$arr[3]/g; s/--lok--/$arr[4]/g; - s/--orgjed--/$arr[5]/g; - s/--orgpodjed--/$arr[6]/g; + s/--orgjed--/$sap_org_jed/g; + s/--mt--/$mt/g; s/--lokrac--/$arr[7]/g; s/--login--/$arr[8]/g;