Beispiel #1
0
 if ($udskriv_til[$x] == 'oioubl') {
     if ($art == "DO") {
         $oioubl = 'faktura';
     } else {
         $oioubl = 'kreditnota';
     }
 } else {
     $oioubl = NULL;
 }
 $y++;
 transaktion('begin');
 levering($ordreliste[$x], 'on', 'on');
 $svar = bogfor($ordreliste[$x], 'on', 'on');
 if ($svar == 'OK') {
     if ($pbs) {
         pbsfakt($ordreliste[$x]);
         $y--;
         #20130117
     } elseif ($oioubl) {
         $printfilnavn = "doktype-faktura_dokid-" . $ordreliste[$x] . ".xml";
         $fp = fopen("../temp/{$db}/{$printfilnavn}", "w");
         fwrite($fp, oioubldoc_faktura($ordreliste[$x], 'faktura', NULL));
         fclose($fp);
         #echo "'oioubl_dok.php?id=$ordreliste[$x]&doktype=$oioubl&genfakt=1' ,'' ,'$jsvars'<br>";
         #						print "<BODY onLoad=\"JavaScript:window.open('oioubl_dok.php?id=$ordreliste[$x]&doktype=$oioubl&genfakt=1' ,'' ,'$jsvars');\">\n";
         $r = db_fetch_array(db_select("select box8 from grupper where art = 'DIV' and kodenr = '2'", __FILE__ . " linje " . __LINE__));
         if ($r['box8']) {
             list($oiourl, $oiobruger, $oiokode) = explode(chr(9), $r['box8']);
             if ($oiourl && $oiobruger && $oiokode) {
                 $fp = fopen("../temp/{$db}/oioftpscript1.{$ordreliste[$x]}", "w");
                 if ($fp) {
Beispiel #2
0
     exit;
 } else {
     $r = db_fetch_array(db_select("select * from ordrer where id = {$id}", __FILE__ . " linje " . __LINE__));
     if ($r['felt_1'] && $r['felt_3'] && is_numeric($r['felt_2']) && is_numeric($r['felt_4'])) {
         if ($r['felt_2'] * 1 != 0) {
             db_modify("insert into pos_betalinger(ordre_id,betalingstype,amount) values ('{$id}','{$r['felt_1']}','{$r['felt_2']}')", __FILE__ . " linje " . __LINE__);
         }
         if ($r['felt_4'] * 1 != 0) {
             db_modify("insert into pos_betalinger(ordre_id,betalingstype,amount) values ('{$id}','{$r['felt_3']}','{$r['felt_4']}')", __FILE__ . " linje " . __LINE__);
         }
     }
     transaktion('commit');
 }
 if (!$genfakt) {
     if ($pbs) {
         pbsfakt($id);
         print "<BODY onLoad=\"javascript:alert('Faktura er tilf&oslash;jet liste over PBS betalinger')\">";
     } elseif ($oioubl) {
         if ($popup) {
             print "<BODY onLoad=\"JavaScript:window.open('oioubl_dok.php?id={$id}&doktype={$oioubl}' , '' , '{$jsvars}');\">";
         } else {
             print "<meta http-equiv=\"refresh\" content=\"0;URL=oioubl_dok.php?id={$id}&doktype={$oioubl}\">";
             exit;
         }
     } elseif ($oioxml) {
         if ($popup) {
             print "<BODY onLoad=\"JavaScript:window.open('oioxml_dok.php?id={$id}&doktype={$oioxml}' , '' , '{$jsvars}');\">";
         } else {
             print "<meta http-equiv=\"refresh\" content=\"0;URL=oioxml_dok.php?id={$id}&doktype={$oioxml}\">";
             exit;
         }