当前位置: 首页>>代码示例>>PHP>>正文


PHP dkdecimal函数代码示例

本文整理汇总了PHP中dkdecimal函数的典型用法代码示例。如果您正苦于以下问题:PHP dkdecimal函数的具体用法?PHP dkdecimal怎么用?PHP dkdecimal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dkdecimal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: stykliste

 function stykliste($id, $udskriv, $udvalg)
 {
     global $charset;
     $x = 0;
     $query = db_select("select * from styklister where indgaar_i='{$id}' order by posnr");
     while ($row = db_fetch_array($query)) {
         $x++;
         $vare_id[$x] = $row['vare_id'];
         $antal[$x] = $row['antal'];
         $posnr[$x] = $row['posnr'];
     }
     $vareantal = $x;
     $query = db_select("select varenr, beskrivelse from varer where id={$id}");
     $row = db_fetch_array($query);
     if ($udskriv) {
         print "<table cellpadding=\"1\" cellspacing=\"1\" border=\"1\" width=80% align=center><tbody>";
         print "<tr><td colspan=6 align=center><big><b>Stykliste for <a href=varekort.php?id={$id}>" . htmlentities($row['varenr'], ENT_COMPAT, $charset) . "</a></b></big></td></tr>";
         print "<tr><td align=center> Varenr:</td><td align=center> Beskrivelse</td><td align=center> Kostpris</td><td align=center> Antal</td><td align=center> Sum</td></tr>";
     }
     for ($x = 1; $x <= $vareantal; $x++) {
         $query = db_select("select * from varer where id={$vare_id[$x]}");
         $row = db_fetch_array($query);
         $query2 = db_select("select kostpris from vare_lev where vare_id={$row['id']} order by posnr");
         if ($row2 = db_fetch_array($query2)) {
             $sum = $row2['kostpris'] * $antal[$x];
             $ialt = $ialt + $sum;
             $pris = dkdecimal($row2['kostpris']);
         } else {
             $query2 = db_select("select kostpris from varer where id={$row['id']}");
             $row2 = db_fetch_array($query2);
             $sum = $row2['kostpris'] * $antal[$x];
             $ialt = $ialt + $sum;
             $pris = dkdecimal($row2['kostpris']);
         }
         $sum = dkdecimal($sum);
         if ($udskriv) {
             print "<tr><td>" . htmlentities($row['varenr'], ENT_COMPAT, $charset) . "</td><td>" . htmlentities($row['beskrivelse'], ENT_COMPAT, $charset) . "</td><td align=right> {$pris}</td><td align=right> {$antal[$x]}</td><td align=right> {$sum}</td></tr>";
         }
     }
     #	$ialt=dkdecimal($ialt);
     if ($udskriv) {
         print "<tr><td colspan=5><br></td></tr><tr><td colspan=4> I alt</td></td><td align=right>" . dkdecimal($ialt) . "</td></tr>";
         print "<tbody></table>";
     }
     return $ialt;
 }
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:46,代码来源:stykliste.php

示例2: fopen

print "<table width=\"400\" align=\"center\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\"><tbody>";
#B2
$filnavn = "../temp/" . $db . "/" . $ordre_id . ".csv";
#echo "Filnavn $filnavn<br>";
$fp = fopen($filnavn, "w");
fwrite($fp, "Pos" . chr(9) . "Vores varenummer" . chr(9) . "Deres varenummer" . chr(9) . "Beskrivelse" . chr(9) . "Antal" . chr(9) . "Pris" . chr(9) . "Rabat" . chr(9) . "I alt" . chr(9) . "\n");
$q = db_select("select * from ordrelinjer where ordre_id = {$ordre_id} order by posnr");
while ($r = db_fetch_array($q)) {
    $beskrivelse = str_replace(chr(9), " ", $r['beskrivelse']);
    $varenr = str_replace(chr(9), " ", $r['varenr']);
    $lev_vnr = str_replace(chr(9), " ", $r['lev_vnr']);
    if ($charset == 'UTF-8') {
        $beskrivelse = utf8_decode($beskrivelse);
        $varenr = utf8_decode($varenr);
        $lev_vnr = utf8_decode($lev_vnr);
    }
    $antal = dkdecimal($r['antal']);
    $pris = dkdecimal($r['pris']);
    $rabat = dkdecimal($r['rabat']);
    $ialt = dkdecimal($r['pris'] * $r['antal'] - $r['pris'] * $r['antal'] / 100 * $r['rabat']);
    fwrite($fp, $r[posnr] . chr(9) . $varenr . chr(9) . $lev_vnr . chr(9) . $beskrivelse . chr(9) . $antal . chr(9) . $pris . chr(9) . $rabat . chr(9) . $ialt . "\n");
}
fclose($fp);
print "<tr><td align=center> Klik her: </td><td {$top_bund} title=\"&Aring;bner csv filen. H&oslash;jreklik for at gemme\"> <a href=\"{$filnavn}\">&Aring;ben ordrefil</a></td></tr>";
print "</tbody></table></td></tr>";
#B2 slut
print "</tbody></table>";
#A slut
?>
</body></html>
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:30,代码来源:ordre2csv.php

示例3: db_select

 #cho "$qtxt<br>";
 $q = db_select($qtxt, __FILE__ . " linje " . __LINE__);
 while ($r = db_fetch_array($q)) {
     if (!in_array($r['id'], $shop_saldi_id)) {
         $forslag_id[$x] = $r['id'];
         $forslag_vnr[$x] = $r['varenr'];
         $forslag_besk[$x] = $r['beskrivelse'];
         $forslag_grp[$x] = $r['gruppe'];
         $x++;
     }
 }
 print "<tr><td>Shop vare ID:</td><td>{$shop_id}</td></tr>";
 print "<tr><td>Shop vare nr:</td><td>{$shop_vnr}</td></tr>";
 print "<tr><td>Beskrivelse:</td><td>{$beskrivelse}</td></tr>";
 print "<tr><td>Pris:</td><td>" . dkdecimal($pris) . "</td></tr>";
 print "<tr><td>Tilbudspris:</td><td>" . dkdecimal($specialpris) . "</td></tr>";
 if (count($forslag_id) >= 1) {
     print "<form name=\"hent_varer\" action=\"hent_varer.php?shop_id={$shop_id}&shop_vnr={$shop_vnr}&beskrivelse={$beskrivelse}&pris={$pris}&specialpris={$specialpris}\" method=post autocomplete=\"off\">\n";
     print "<tr><td>Varen er ikke bundet til nogen vare i Saldi, men vi har følgende forslag:</td>";
     print "<td><select name=\"saldi_id\">";
     for ($x = 0; $x < count($forslag_id); $x++) {
         print "<option value=\"{$forslag_id[$x]}\">{$forslag_vnr[$x]},{$forslag_besk[$x]}</option>";
     }
     print "</select></td></tr>";
     print "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\"name=\"tilknyt\" value=\"Tilknyt\">&nbsp;<a href={$url}&next_id={$shop_id}><input type=\"button\" value=\"Spring over\"></td></tr>";
     print "</form>";
     if (count($forslag_vnr) == 1 && $forslag_vnr[0] == $shop_id) {
         $qtxt = "select id from shop_varer where saldi_id='{$forslag_id['0']}'";
         $r = db_fetch_array(db_select($qtxt, __FILE__ . " linje " . __LINE__));
         if ($r['id']) {
             $qtxt = "update shop_varer set shop_id='{$shop_id}' where id ='{$r['id']}'";
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:hent_varer.php

示例4: dkdecimal

            if ($valuta == $valuta_kode[$x]) {
                print "<option value='{$valuta_kode[$x]}'>{$valuta_kode[$x]} : {$valuta_navn[$x]}</option>";
            }
        }
        for ($x = 0; $x < count($valuta_kode); $x++) {
            if ($valuta != $valuta_kode[$x]) {
                print "<option value='{$valuta_kode[$x]}'>{$valuta_kode[$x]} : {$valuta_navn[$x]}</option>";
            }
        }
        print "</select></td></tr>";
    } else {
        print "<input type=\"hidden\" name=\"{$valuta_kode[$x]}\" value='DKK'>";
    }
}
if ($kontotype == 'Drift' || $kontotype == 'Status') {
    print "<tr><td colspan=\"2\">Saldo</td><td>{$valuta}: " . dkdecimal($saldo * 100 / $valutakurs) . "</td><tr>";
}
if ($lukket == 'on') {
    $lukket = "checked";
}
print "<tr><td colspan=\"2\">Lukket</td>";
print "<td><input type=checkbox name=lukket {$lukket}></td></tr>\n";
print "<tr><td><br></td></tr>\n";
print "<tr><td><br></td></tr>\n";
print "<tr><td colspan=4 align=center>";
print "<table width=\"100%\" cellpadding=\"0\" cellspaci ng=\"0\" border=\"0\"><tbody>";
print "<td align=center><input type=submit accesskey=\"g\" value=\"Gem/opdat&eacute;r\" name=\"gem\"></td>";
if ($slet == 1) {
    print "<td align = center><input type=submit accesskey=\"s\" value=\"&nbsp;&nbsp;&nbsp;&nbsp;Slet&nbsp;&nbsp;&nbsp;&nbsp;\" name=\"slet\" onclick=\"return confirm('Vil du slette konto {$kontonr}?')\" ></td>";
}
print "</tr>\n</tbody></table>";
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:kontokort.php

示例5: find_kassesalg

function find_kassesalg($kasse, $optalt)
{
    global $regnaar;
    global $straksbogfor;
    $dd = date("Y-m-d");
    $r = db_fetch_array(db_select("select * from grupper where art = 'RA' and kodenr = '{$regnaar}'", __FILE__ . " linje " . __LINE__));
    $startmd = $r['box1'];
    $startaar = $r['box2'];
    #cho "startmd $startmd startaar $startaar<br>\n";
    $regnstart = $startaar . "-" . $startmd . "-01";
    $r = db_fetch_array(db_select("select * from grupper where art = 'POS' and kodenr = '1'", __FILE__ . " linje " . __LINE__));
    $kassekonti = explode(chr(9), $r['box2']);
    $kortantal = $r['box4'] * 1;
    $kortnavne = $r['box5'];
    $kortnavn = explode(chr(9), $kortnavne);
    $kortkonti = $r['box6'];
    $kortkonto = explode(chr(9), $kortkonti);
    $straksbogfor = $r['box9'];
    for ($x = 0; $x < count($kortnavn); $x++) {
        $kortsum[$x] = 0;
    }
    $r = db_fetch_array(db_select("select * from grupper where art = 'POS' and kodenr = '2'", __FILE__ . " linje " . __LINE__));
    $byttepenge = $r['box1'];
    #cho "byt $byttepenge<br>\n";
    #$byttepenge='';
    $k = $kasse - 1;
    #cho "select primo from kontoplan where regnskabsaar = '$regnaar' and kontonr = '$kassekonti[$k]'<br>\n";
    if (!$byttepenge) {
        $r = db_fetch_array(db_select("select primo from kontoplan where regnskabsaar = '{$regnaar}' and kontonr = '{$kassekonti[$k]}'", __FILE__ . " linje " . __LINE__));
        $byttepenge = $r['primo'];
        #cho "select sum(debet) as debet,sum(kredit) as kredit from transaktioner where transdate < '$dd' and transdate >= '$regnstart' and kontonr = '$kassekonti[$k]'<br>\n";
        $r = db_fetch_array(db_select("select sum(debet) as debet,sum(kredit) as kredit from transaktioner where transdate < '{$dd}' and transdate >= '{$regnstart}' and kontonr = '{$kassekonti[$k]}' and kasse_nr='{$kasse}'", __FILE__ . " linje " . __LINE__));
        $byttepenge += $r['debet'] - $r['kredit'];
        #cho "byt $byttepenge<br>\n";
    }
    $r = db_fetch_array(db_select("select sum(debet) as debet,sum(kredit) as kredit from transaktioner where transdate = '{$dd}' and kontonr = '{$kassekonti[$k]}' and kasse_nr='{$kasse}'", __FILE__ . " linje " . __LINE__));
    $tilgang = $r['debet'] - $r['kredit'];
    if (!$straksbogfor) {
        #cho "select sum(sum+moms) as sum from ordrer where  status = '3' and art = 'PO' and fakturadate <= '$dd' and felt_5='$kasse'<br>";
        $q = db_select("select * from ordrer where  status = '3' and art = 'PO' and fakturadate <= '{$dd}' and felt_5='{$kasse}'", __FILE__ . " linje " . __LINE__);
        while ($r = db_fetch_array($q)) {
            $retur = $r['felt_2'] + $r['felt_4'] - ($r['sum'] + $r['moms']);
            if ($r['felt_1'] == 'Kontant') {
                $tilgang += $r['felt_2'] - $retur;
            }
            if ($r['felt_3'] == 'Kontant') {
                $tilgang += $r['felt_4'] - $retur;
            }
            for ($x = 0; $x < count($kortnavn); $x++) {
                if ($r['felt_1'] == $kortnavn[$x]) {
                    $kortsum[$x] += $r['felt_2'];
                }
                if ($r['felt_3'] == $kortnavn[$x]) {
                    $kortsum[$x] += $r['felt_4'];
                }
            }
        }
    }
    if ($kortantal) {
        #		$kortsum[]=0;
        #		fwrite($fp,"\n\nSalg paa kort\n\n");
        for ($x = 0; $x < $kortantal; $x++) {
            if ($kortkonto[$x]) {
                #cho "select sum(debet) as debet,sum(kredit) as kredit from transaktioner where transdate = '$dd' and kontonr = '$kortkonto[$x]' and kasse_nr = '$kasse'<br>\n";
                $r = db_fetch_array(db_select("select sum(debet) as debet,sum(kredit) as kredit from transaktioner where transdate = '{$dd}' and kontonr = '{$kortkonto[$x]}' and kasse_nr = '{$kasse}'", __FILE__ . " linje " . __LINE__));
                $kortsum[$x] += dkdecimal($r['debet'] - $r['kredit']);
            }
        }
    }
    #	$kassesum=dkdecimal($byttepenge+$tilgang);
    #	$byttepenge=dkdecimal($byttepenge);
    #	$tilgang=dkdecimal($tilgang);
    $diff = $optalt - ($byttepenge + $tilgang);
    $diff < 0 ? $prefix = NULL : ($prefix = "+");
    $kortsummer = $kortsum[0];
    for ($x = 1; $x < $kortantal; $x++) {
        $kortsummer .= chr(9) . $kortsum[$x];
    }
    return array($byttepenge, $tilgang, $diff, $kortantal, $kortkonti, $kortnavne, $kortsummer);
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:80,代码来源:pos_ordre_xx.php

示例6: trim

include "../includes/online.php";
include "../includes/std_func.php";
$returside = "../diverse.php";
$filnavn = "../temp/" . trim($db . "_debitorer_" . date("Y-m-d") . ".csv");
$fp = fopen($filnavn, "w");
if (fwrite($fp, "kontonr" . chr(9) . "firmanavn" . chr(9) . "addr1" . chr(9) . "addr2" . chr(9) . "postnr" . chr(9) . "bynavn" . chr(9) . "land" . chr(9) . "kontakt" . chr(9) . "tlf" . chr(9) . "fax" . chr(9) . "email" . chr(9) . "web" . chr(9) . "notes" . chr(9) . "kreditmax" . chr(9) . "betalingsbet" . chr(9) . "betalingsdage" . chr(9) . "cvrnr" . chr(9) . "ean" . chr(9) . "institution" . chr(9) . "gruppe" . chr(9) . "kontoansvarlig" . chr(9) . "oprettet" . chr(9) . "kontakt_navn" . chr(9) . "kontakt_addr1" . chr(9) . "kontakt_addr2" . chr(9) . "kontakt_postnr" . chr(9) . "kontakt_bynavn" . chr(9) . "kontakt_tlf" . chr(9) . "kontakt_fax" . chr(9) . "kontakt_email" . chr(9) . "kontakt_notes]\r\n")) {
    $q = db_select("select * from adresser where art='D' order by kontonr", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        $ansatte = 0;
        if ($r['kontoansvarlig']) {
            $r2 = db_fetch_array(db_select("select initialer from ansatte where id='{$r['kontoansvarlig']}'", __FILE__ . " linje " . __LINE__));
            $kontoansvarlig = $r2['initialer'];
        } else {
            $kontoansvarlig = '';
        }
        $kreditmax = dkdecimal($r['kreditmax']);
        $oprettet = dkdato($r['oprettet']);
        $tmp1 = str_replace("\n", "\\n", $r[kontonr] . chr(9) . chr(32) . $r[firmanavn] . chr(32) . chr(9) . chr(32) . $r[addr1] . chr(32) . chr(9) . chr(32) . $r[addr2] . chr(32) . chr(9) . chr(32) . $r[postnr] . chr(32) . chr(9) . chr(32) . $r[bynavn] . chr(32) . chr(9) . chr(32) . $r[land] . chr(32) . chr(9) . chr(32) . $r[kontakt] . chr(32) . chr(9) . chr(32) . $r[tlf] . chr(32) . chr(9) . chr(32) . $r[fax] . chr(32) . chr(9) . chr(32) . $r[email] . chr(32) . chr(9) . chr(32) . $r[web] . chr(32) . chr(9) . chr(32) . $r[notes] . chr(32) . chr(9) . $kreditmax . chr(9) . chr(32) . $r[betalingsbet] . chr(32) . chr(9) . $r[betalingsdage] . chr(9) . chr(32) . $r[cvrnr] . chr(32) . chr(9) . chr(32) . $r[ean] . chr(32) . chr(9) . chr(32) . $r[institution] . chr(32) . chr(9) . $r[gruppe] . chr(9) . chr(32) . $kontoansvarlig . chr(32) . chr(9) . chr(32) . $oprettet);
        $tmp1 = str_replace("\r", "\\r", $tmp1);
        if ($charset == 'UTF-8') {
            $tmp1 = utf8_decode($tmp1);
        }
        $q2 = db_select("select * from ansatte where konto_id='{$r['id']}' order by navn", __FILE__ . " linje " . __LINE__);
        while ($r2 = db_fetch_array($q2)) {
            $ansatte++;
            $tmp2 = str_replace("\n", "\\n", $r2[navn] . chr(32) . chr(9) . chr(32) . $r2[addr1] . chr(32) . chr(9) . chr(32) . $r2[addr2] . chr(32) . chr(9) . chr(32) . $r2[postnr] . chr(32) . chr(9) . chr(32) . $r2[bynavn] . chr(32) . chr(9) . chr(32) . $r2[tlf] . chr(32) . chr(9) . chr(32) . $r2[fax] . chr(32) . chr(9) . chr(32) . $r2[email] . chr(32) . chr(9) . chr(32) . $r2[notes]);
            $tmp2 = str_replace("\r", "\\r", $tmp2);
            if ($charset == 'UTF-8') {
                $tmp2 = utf8_decode($tmp2);
            }
            $linje = $tmp1 . chr(32) . chr(9) . chr(32) . $tmp2;
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:exporter_debitor.php

示例7: vis_data


//.........这里部分代码省略.........
        if (!in_array('Eget varenr.', $feltnavn) && !in_array('Begge varenr.', $feltnavn)) {
            print "<option>Eget varenr.</option>\n";
        }
        if (!in_array('Lev. varenr.', $feltnavn) && !in_array('Begge varenr.', $feltnavn)) {
            print "<option>Lev. varenr.</option>\n";
        }
        if (!in_array('Eget varenr.', $feltnavn) && !in_array('Lev. varenr.', $feltnavn) && !in_array('Begge varenr.', $feltnavn)) {
            print "<option>Begge varenr.</option>\n";
        } elseif ($feltnavn[$y] == 'Eget varenr.' && !in_array('Lev. varenr.', $feltnavn) && !in_array('Begge varenr.', $feltnavn)) {
            print "<option>Begge varenr.</option>\n";
        } elseif ($feltnavn[$y] == 'Begge varenr.') {
            print "<option>Eget varenr.</option>\n";
            print "<option>Lev. varenr.</option>\n";
        }
        if (!in_array('Beskrivelse', $feltnavn)) {
            print "<option>Beskrivelse</option>\n";
        }
        if (!in_array('Salgspris', $feltnavn)) {
            print "<option>Salgspris</option>\n";
        }
        if (!in_array('Kostpris', $feltnavn) && !$rabat) {
            print "<option>Kostpris</option>\n";
        }
        if (!in_array('Enhed', $feltnavn)) {
            print "<option>Enhed</option>\n";
        }
        if (!in_array('Varegrp.', $feltnavn) && !$varegrp) {
            print "<option>Varegrp.</option>\n";
        }
        if ($feltnavn[$y]) {
            print "<option></option>\n";
        }
        print "</select>";
        if ($feltnavn[$y] == 'Salgspris' && $rabat) {
            print "</td><td>{$font} Kostpris\n";
        }
        print "</td>";
    }
    print "</form>";
    $fp = fopen("../temp/" . $filnavn, "r");
    if ($fp) {
        $x = 0;
        while (!feof($fp)) {
            $x++;
            $linje = fgets($fp);
            $felt = array();
            if ($splitter == 'Brdr. Dahl') {
                print "<tr>";
                $felt[0] = substr($linje, 1, 10);
                $felt[1] = substr($linje, 12, 35);
                $felt[2] = substr($linje, 47, 10);
                $felt[3] = substr($linje, 58, 3);
                $felt[4] = substr($linje, 61, 3);
                $felt[5] = substr($linje, 64, 1);
                $felt[6] = substr($linje, 65, 3);
                $felt[1] = str_replace(chr(145), "æ", $felt[1]);
                $felt[1] = str_replace(chr(155), "ø", $felt[1]);
                $felt[1] = str_replace(chr(134), "å", $felt[1]);
                $felt[1] = str_replace(chr(146), "Æ", $felt[1]);
                $felt[1] = str_replace(chr(157), "Ø", $felt[1]);
                $felt[1] = str_replace(chr(143), "Å", $felt[1]);
            } else {
                $felt = split($splitter, $linje);
            }
            for ($y = 0; $y < $feltantal; $y++) {
                if ($feltnavn[$y] == 'Varegrp.' && !in_array($felt[$y], $feltnavn)) {
                    $linjefarve[$x] = 'red';
                }
            }
            for ($y = 0; $y < $feltantal; $y++) {
                if (substr($felt[$y], 0, 1) == '"' && substr($felt[$y], -1) == '"') {
                    $felt[$y] = substr($felt[$y], 1, strlen($felt[$y]) - 2);
                }
                if ($linjefarve[$x] == 'red' && $feltnavn[$y]) {
                    print "<td><FONT COLOR=#FF0000><small>{$felt[$y]}&nbsp;</small></td>";
                } elseif ($feltnavn[$y]) {
                    if ($feltnavn[$y] == 'Salgspris') {
                        $tmp = dkdecimal($felt[$y] / 100);
                        print "<td><FONT COLOR=#000000><small>{$tmp}&nbsp;</small></td>";
                        if ($rabat) {
                            $tmp = dkdecimal($felt[$y] / 100 - $felt[$y] / 10000 * $rabat);
                            print "<td><FONT COLOR=#000000><small>{$tmp}&nbsp;</small></td>";
                        }
                    } else {
                        print "<td><FONT COLOR=#000000><small>{$felt[$y]}&nbsp;</small></td>";
                    }
                } else {
                    print "<td><FONT COLOR=#999999><small>{$felt[$y]}&nbsp;</small></td>";
                }
            }
            print "</tr>";
        }
        if ($linjefarve) {
            print "<BODY onLoad=\"javascript:alert('Røde linjer vil ikke blive importeret - varegruppe findes ikke')\">";
        }
    }
    fclose($fp);
    print "</tbody></table>";
    print "</td></tr>";
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:101,代码来源:vareimport.php

示例8: utf8_decode

if ($charset == "UTF-8") {
    $overskrift = utf8_decode($overskrift);
}
if (fwrite($fp, "{$overskrift}\r\n")) {
    $z = 0;
    $q = db_select("select varer.id,varer.varenr,varer.beskrivelse,variant_varer.variant_stregkode,variant_varer.variant_type,variant_varer.variant_salgspris,variant_varer.variant_kostpris,variant_varer.variant_vejlpris from varer,variant_varer where varer.id=variant_varer.vare_id order by varer.varenr,variant_varer.variant_stregkode", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        $z++;
        if ($z >= $start && $z <= $slut) {
            $vare_id = $r['id'];
            $varenr = $r['varenr'];
            $beskrivelse = $r['beskrivelse'];
            $variant_stregkode = $r['variant_stregkode'];
            $variant_type = explode(chr(9), $r['variant_type']);
            #			$variant_lager=$r['lager'];
            $linje = '"' . $varenr . '"' . chr(9) . '"' . $beskrivelse . '"' . chr(9) . '"' . $variant_stregkode . '"' . chr(9) . dkdecimal($r['variant_kostpris']) . chr(9) . dkdecimal($r['variant_salgspris']) . chr(9) . dkdecimal($r['variant_vejlpris']);
            for ($x = 0; $x < count($varianter_id); $x++) {
                #			$linje.=chr(9)."$varianter_beskrivelse[$x]";
                $tmp = NULL;
                for ($y = 0; $y < count($varianttyper_id); $y++) {
                    #20140526
                    if (isset($varianttyper_id[$y]) && isset($variant_type[$x]) && $varianttyper_id[$y] == $variant_type[$x]) {
                        $tmp = $varianttyper_beskrivelse[$y];
                    }
                }
                $linje .= chr(9) . '"' . "{$tmp}" . '"';
            }
            $linje = str_replace("\n", "", $linje);
            if ($charset == "UTF-8") {
                $linje = utf8_decode($linje);
            }
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:exporter_variantvarer.php

示例9: dkdecimal

if (!$start) {
    $start = 1;
}
if ($slut > $vareantal) {
    $slut = $vareantal;
}
for ($x = $start; $x <= $slut; $x++) {
    $href = "prislister.php?ordre_id={$ordre_id}&prisliste={$prisliste}&indset={$varenr[$x]}&fokus={$fokus}";
    print "<tr>";
    print "<td><a href=\"{$href}\">{$varenr[$x]}</a></td>";
    print "<td>{$ean[$x]}</td>";
    print "<td>{$prisgruppe[$x]}</td>";
    print "<td>{$beskrivelse[$x]}</td>";
    print "<td>{$enhed[$x]}</td>";
    print "<td align=\"right\">" . dkdecimal($salgspris[$x]) . "</td>";
    print "<td align=\"right\">" . dkdecimal($kostpris[$x]) . "</td>";
    print "<td></td>";
    print "</tr>";
}
print "</tbody></table>";
print "</td></tr>";
function udvaelg($x, $a, $b)
{
    $a = trim(strtolower($a));
    $b = trim(strtolower($b));
    #	if (substr($b,0,1)=='f') #echo "$b - ";
    if (substr($a, 0, 1) == '*' && substr($a, -1) == '*') {
        $a = substr($a, 1, strlen($a) - 2);
        if (!strstr($b, $a)) {
            $x--;
        }
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:prislister.php

示例10: elseif

     $erh = "ERH351";
 } else {
     $erh = "ERH356";
 }
 if ($erh == "ERH351" || $erh == "ERH357" || $erh == "ERH358" || $erh == "SDCK020") {
     $modt_konto = $r['modt_fi'];
     $kort_ref = $r['betal_id'];
 } elseif ($r['faktnr']) {
     $kort_ref = "Fakt: " . $r['faktnr'];
 }
 if ($r['forfaldsdate']) {
     $forfaldsdag = str_replace("-", "", dkdato($r['forfaldsdate']));
 } else {
     $forfaldsdag = str_replace("-", "", forfaldsdag($r['transdate'], $r['betalingsbet'], $r['betalingsdage']));
 }
 $belob = dkdecimal($r['amount'] * -1);
 $valuta = $r['valuta'];
 if (!$valuta) {
     $valuta = 'DKK';
 }
 if ($r['betal_id']) {
     if (substr($r['betal_id'], 0, 1) == "+") {
         $betal_id = substr($r['betal_id'], 1);
         list($tmp, $tmp2) = explode("<", $betal_id);
         if ($tmp == '04' || $tmp == '15') {
             $erh = 'ERH352';
         } elseif ($tmp == '71') {
             $erh = 'ERH351';
         } elseif ($tmp == '73') {
             $erh = 'ERH357';
         } elseif ($tmp == '75') {
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:betalinger.php

示例11: inset_ordrer


//.........这里部分代码省略.........
            $beskrivelse = utf8_decode($beskrivelse);
        }
        while (strlen($recordnr) < 5) {
            $recordnr = "0" . $recordnr;
        }
        while (strlen($beskrivelse) < 35) {
            $beskrivelse = $beskrivelse . " ";
        }
        while (strlen($antal) < 5) {
            $antal = " " . $antal;
        }
        while (strlen($pris) < 10) {
            $pris = " " . $pris;
        }
        while (strlen($belob) < 10) {
            $belob = " " . $belob;
        }
        $lnr++;
        $linje[$lnr] = "BS052" . $pbs_nr[0] . "0241" . $recordnr . $debitorgruppe . $kontonr . $pbs_nr[$x] . " " . addslashes($beskrivelse) . $antal . $pris . $belob . "\n";
        $linjeoid[$lnr] = "{$ordre_id[$x]}";
        if ($afslut) {
            if ($charset == "UTF-8") {
                $linje[$lnr] = utf8_encode($linje[$lnr]);
            }
            db_modify("insert into pbs_linjer (liste_id,linje) values ('{$id}','{$linje[$lnr]}')", __FILE__ . " linje " . __LINE__);
        }
        $y = 0;
        $q = db_select("select * from ordrelinjer where ordre_id='{$ordre_id[$x]}' order by posnr", __FILE__ . " linje " . __LINE__);
        while ($r = db_fetch_array($q)) {
            $y++;
            $r052lin++;
            $beskrivelse = var2str($r['beskrivelse'], $ordre_id[$x]);
            $antal = $r['antal'] * 1;
            $pris = dkdecimal($r['pris']);
            $belob = dkdecimal($r['pris'] * $r['antal']);
            $recordnr++;
            if ($charset == "UTF-8") {
                $beskrivelse = utf8_decode($beskrivelse);
            }
            while (strlen($recordnr) < 5) {
                $recordnr = "0" . $recordnr;
            }
            if (strlen($beskrivelse) > 35) {
                $beskrivelse = substr($beskrivelse, 0, 35);
            }
            while (strlen($beskrivelse) < 35) {
                $beskrivelse = $beskrivelse . " ";
            }
            while (strlen($antal) < 5) {
                $antal = " " . $antal;
            }
            while (strlen($pris) < 10) {
                $pris = " " . $pris;
            }
            while (strlen($belob) < 10) {
                $belob = " " . $belob;
            }
            $lnr++;
            $linje[$lnr] = "BS052" . $pbs_nr[0] . "0241" . $recordnr . $debitorgruppe . $kontonr . $pbs_nr[$x] . " " . addslashes(addslashes($beskrivelse)) . $antal . $pris . $belob . "\n";
            $linjeoid[$lnr] = "{$ordre_id[$x]}";
            if ($afslut) {
                if ($charset == "UTF-8") {
                    $linje[$lnr] = utf8_encode($linje[$lnr]);
                }
                db_modify("insert into pbs_linjer (liste_id,linje) values ('{$id}','{$linje[$lnr]}')", __FILE__ . " linje " . __LINE__);
            }
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:67,代码来源:pbsfile.php

示例12: elseif

    if ($row['kontotype'] == 'H') {
        print "<td><span style=\"color:{$color};\"><br></span></td>\n";
    } elseif ($row['kontotype'] == 'D') {
        print "<td><span style=\"color:{$color};\">Drift<br></span></td>\n";
    } elseif ($row['kontotype'] == 'S') {
        print "<td><span style=\"color:{$color};\">Status<br></span></td>\n";
    } elseif ($row['kontotype'] == 'Z') {
        print "<td><span style=\"color:{$color};\">Sum {$row['fra_kto']} - {$row['til_kto']}<br></span></td>\n";
    } elseif ($row['kontotype'] == 'R') {
        print "<td><span style=\"color:{$color};\">Resultat = {$row['fra_kto']}<br></span></td>\n";
    } else {
        print "<td><span style=\"color:{$color};\">Sideskift<br></span></td>\n";
    }
    print "<td align=\"center\"><span style=\"color:{$color};\">{$row['moms']}<br></span></td>\n";
    if ($row['kontotype'] != 'H' && $row['kontotype'] != 'X') {
        print "<td align=\"right\" title=\"DKK " . dkdecimal($row['saldo'] * 1) . "\"><span style=\"color:{$color};\">" . dkdecimal($row['saldo'] * 100 / $row['valutakurs']) . "<br></span></td>\n";
    } else {
        print "<td><br></td>\n";
    }
    print "<td align=\"center\"><span style=\"color:{$color};\">{$valutanavn[$valuta]}<br></span></td>\n";
    print "<td align=\"center\"><span style=\"color:{$color};\">{$row['genvej']}<br></span></td>\n";
    print "</tr>\n";
    if ($row['kontotype'] == 'H') {
        $linjebg = $bgcolor4;
        $color = '#000000';
    }
}
if (!$menu == 'T') {
    print "</tbody>\n</table>\n\t</td></tr>\n</tbody></table>";
} else {
    print "</tbody></table></div><!-- end of rightContent --></div><!-- end of maincontentLargeHolder -->";
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:31,代码来源:kontoplan.php

示例13: varegruppe


//.........这里部分代码省略.........
                } else {
                    if (!$k_ordre_id[$y]) {
                        $t_regul += $k_antal[$y];
                        $tt_regul += $k_antal[$y];
                    }
                    $ok = 0;
                }
                if ($ok) {
                    $t_kobt += $k_antal[$y];
                    $t_k_pris += $pris[$y] * $k_antal[$y];
                    $tt_kobt += $k_antal[$y];
                    $tt_k_pris += $pris[$y] * $k_antal[$y];
                    $t_moms += $moms[$y];
                }
                $y++;
            } else {
                #				if ($r['ordre_id']) $tt_kobt=$r['antal'];
                #				else $tt_regul+=$r['antal'];
            }
        }
        if ($detaljer) {
            print "<tr><td colspan=\"{$cols}\"><hr></td></tr>";
            print "<tr><td><br></td></tr>";
            print "<tr><td><br></td></tr>";
            print "<tr><td colspan=\"3\">{$varenr[$x]}</td></tr>";
            print "<tr><td colspan=\"3\">{$enhed[$x]}</td></tr>";
            print "<tr><td colspan=\"3\">{$beskrivelse[$x]}</td></tr>";
            print "<tr><td><br></td></tr>";
            print "<tr><td>Købsdato</td><td align=\"right\">Antal</td><td align=\"right\">Pris</td><td align=\"right\">Moms</td><td align=\"right\">Incl. moms</td><td align=\"right\">Ordre</td></tr>";
            print "<tr><td colspan=\"{$cols}\"><hr></td></tr>";
            for ($y = 0; $y < count($k_antal); $y++) {
                if ($k_ordre_id[$y]) {
                    if ($detaljer) {
                        print "<tr><td>" . dkdato($fakturadate[$y]) . "</td><td align=\"right\">" . dkdecimal($k_antal[$y], 2) . "</td>";
                    }
                    $linjepris = $pris[$y] * $k_antal[$y];
                    $kobssum += $t_kobt;
                    print "<td align=\"right\">" . dkdecimal($pris[$y], 2) . "</td><td align=\"right\">" . dkdecimal($moms[$y], 2) . "</td><td align=\"right\">" . dkdecimal($pris[$y] + $moms[$y], 2) . "</td>";
                    print "<td align=right onClick=\"javascript:k_ordre=window.open('../kreditor/ordre.php?id={$k_ordre_id[$y]}&returside=../includes/luk.php','k_ordre','width=800,height=400,{$jsvars}')\"> <u>Se</u></td></tr>";
                }
            }
            print "<tr><td colspan=\"{$cols}\"><hr></td></tr>";
            print "<tr><td></td><td align=\"right\"><b>" . dkdecimal($t_kobt, 2) . "</b></td><td align=\"right\"><b>" . dkdecimal($t_k_pris, 2) . "</b></td><td align=\"right\"><b>" . dkdecimal($t_moms, 2) . "</b></td><td align=\"right\"><b>" . dkdecimal($t_k_pris + $t_moms, 2) . "</b></td></tr>";
            print "<tr><td colspan=\"{$cols}\"><hr></td></tr>";
        }
        $fakturadate = array();
        $bs_id = array();
        $linje_id = array();
        $s_ordre_id = array();
        $s_antal = array();
        $pris = array();
        $t_solgt = 0;
        #		$t_regul=0;
        $t_s_pris = 0;
        $t_kost = 0;
        $t_moms = 0;
        $t_db = 0;
        $y = 0;
        $qtxt = "select * from batch_salg";
        if ($afd) {
            $qtxt .= ",ordrer";
        }
        $qtxt .= " where batch_salg.vare_id='{$v_id[$x]}'";
        if ($afd) {
            $qtxt .= " and batch_salg.ordre_id=ordrer.id and ordrer.afd={$afd}";
        }
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:67,代码来源:rapport.php

示例14: db_select

}
print "<tr><td align = center colspan=2><input type=submit accesskey=\"g\" value=\"Gem/opdat&eacute;r\" name=\"enheder\"></td></tr>";
print "</tbody></table border=1>";
print "<td width=50% valign=top><table cellpadding=\"1\" cellspacing=\"1\" border=\"1\"><tbody>";
print "<form name=materialer action=enheder.php method=post>";
print "<tr><td align=center valign=top> Materiale</td><td align=center valign=top> Densitet</td></tr>";
for ($x = 1; $x <= $max_antal; $x++) {
    if ($mat_id[$x]) {
        print "<tr><td> {$mat_beskrivelse[$x]}</td><td><a href=enheder.php?mat_id={$mat_id[$x]}> {$mat_densitet[$x]}</a></td></tr>";
    } else {
        print "<tr><td><br></td></tr>";
    }
}
if ($mat_ret_id) {
    $query = db_select("select * from materialer where id = {$mat_ret_id}");
    $row = db_fetch_array($query);
    $mat_beskrivelse[$mat_ret_id] = $row['beskrivelse'];
    $mat_densitet[$mat_ret_id] = dkdecimal($row['densitet']);
    print "<input type=hidden name=mat_id value={$mat_ret_id}>";
    print "<tr><td><input type=text size=25 name=mat_beskrivelse[{$mat_ret_id}] value='{$mat_beskrivelse[$mat_ret_id]}'></td><td><input type=text size=3 name=mat_densitet[{$mat_ret_id}] value={$mat_densitet[$mat_ret_id]}\t></td><tr>";
} else {
    print "<tr><td><input type=text size=25 name=mat_beskrivelse[0]></td><td><input type=text size=3 name=mat_densitet[0]></td><tr>";
}
print "<tr><td align = center colspan=2><input type=submit accesskey=\"g\" value=\"Gem/opdat&eacute;r\" name=\"materialer\"></td></tr>";
print "</tbody></table>";
print "</tbody></table>";
?>
</td></tr>
</tbody></table>
</body></html>
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:30,代码来源:enheder.php

示例15: vareopslag


//.........这里部分代码省略.........
        $r = db_fetch_array(db_select("select afd from ansatte where navn = '{$ref}' or initialer = '{$ref}'", __FILE__ . " linje " . __LINE__));
        $afd = $r['afd'];
        $x = 0;
        $q = db_select("select max(kodenr) as lagerantal from grupper where art='LG'", __FILE__ . " linje " . __LINE__);
        while ($r = db_fetch_array($q)) {
            $lagernavn[$x] = $r['beskrivelse'];
            $lagernr[$x] = $r['kodenr'];
            $x++;
        }
        $r = db_fetch_array(db_select("select kodenr from grupper where box1='{$afd}' and art='LG'", __FILE__ . " linje " . __LINE__));
        $lager = $r['kodenr'] * 1;
    }
    if (!$sort) {
        $sort = 'varenr';
    }
    if ($find) {
        $qtxt = "select * from varer where lukket != '1' and lower({$fokus}) like '{$find}' order by {$sort}";
    } else {
        $qtxt = "select * from varer where lukket != '1' order by {$sort}";
    }
    if ($art == 'PO') {
        if ($linjebg != $bgcolor) {
            $linjebg = $bgcolor;
            $color = '#000000';
        } else {
            $linjebg = $bgcolor5;
            $color = '#000000';
        }
        print "<tr bgcolor=\"{$linjebg}\"  onclick=\"window.document.location='{$href}?id={$id}&bordnr={$bordnr}';\">";
        print "<td colspan=\"5\" {$rowheight} align=\"center\"><big><big>Tilbage</big></big></td></tr>\n";
    }
    $x = 0;
    #cho "$qtxt<br>";
    $q = db_select($qtxt, __FILE__ . " linje " . __LINE__);
    while ($row = db_fetch_array($q)) {
        $vare_id = $row['id'] * 1;
        $beholdning = $row['beholdning'] * 1;
        #		if ($row['samlevare']) $beholdning=find_samlebeholdning($vare_id);
        $x++;
        if ($linjebg != $bgcolor) {
            $linjebg = $bgcolor;
            $color = '#000000';
        } else {
            $linjebg = $bgcolor5;
            $color = '#000000';
        }
        print "<tr  bgcolor=\"{$linjebg}\">";
        #onclick=\"window.document.location='$href?vare_id=$row[id]&fokus=$fokus&id=$id&bordnr=$bordnr';\"
        #		($art=='PO')?$hreftxt="$href?vare_id=$row[id]&fokus=$fokus&id=$id&bordnr=$bordnr":$hreftxt="";
        $hreftxt = "{$href}?vare_id={$row['id']}&fokus={$fokus}&id={$id}&bordnr={$bordnr}";
        #"$href?vare_id=$row[id]&fokus=$fokus&id=$id&bordnr=$bordnr";
        print "<td {$rowheight} ><a onfocus=\"this.style.fontSize = '20px';\" onblur=\"this.style.fontSize = '12px';\" id=\"opslag_{$x}\" href=\"{$hreftxt}\">{$row['varenr']}</a></td>";
        print "<td>{$row['enhed']}<br></td>";
        print "<td>{$row['beskrivelse']}<br></td>";
        if ($incl_moms && !in_array($row['gruppe'], $momsfri)) {
            $salgspris = $row['salgspris'] + $row['salgspris'] * $momssats / 100;
        } else {
            $salgspris = $row['salgspris'];
        }
        print "<td align=right>" . dkdecimal($salgspris) . "<br></td>";
        if ($vis_kost == 'on') {
            $query2 = db_select("select kostpris from vare_lev where vare_id = '{$vare_id}' order by posnr", __FILE__ . " linje " . __LINE__);
            $row2 = db_fetch_array($query2);
            $kostpris = dkdecimal($row2['kostpris']);
            print "<td align=right>{$kostpris}<br></td>";
        }
        $reserveret = 0;
        if ($lager >= 1) {
            $q2 = db_select("select * from batch_kob where vare_id='{$vare_id}' and rest>0 and lager={$lager}", __FILE__ . " linje " . __LINE__);
            while ($r2 = db_fetch_array($q2)) {
                $q3 = db_select("select * from reservation where batch_kob_id={$r2['id']}", __FILE__ . " linje " . __LINE__);
                while ($r3 = db_fetch_array($q3)) {
                    $reserveret = $reserveret + $r3['antal'];
                }
            }
            $linjetext = "<span title= 'Reserveret: {$reserveret}'>";
            $lager <= 1 ? $l = "and lager<='{$lager}'" : ($l = "and lager='{$lager}'");
            $r2 = db_fetch_array(db_select("select beholdning from lagerstatus where vare_id='{$vare_id}' {$l}", __FILE__ . " linje " . __LINE__));
            $beholdning = $r2['beholdning'] * 1;
            print "<td align=right>{$linjetext} " . dkdecimal($beholdning) . "</span></td>";
        } else {
            $q2 = db_select("select * from batch_kob where vare_id='{$vare_id}' and rest > 0", __FILE__ . " linje " . __LINE__);
            while ($r2 = db_fetch_array($q2)) {
                $q3 = db_select("select * from reservation where batch_kob_id={$r2['id']}", __FILE__ . " linje " . __LINE__);
                while ($r3 = db_fetch_array($q3)) {
                    $reserveret = $reserveret + $r3['antal'];
                }
            }
            $linjetext = "<span title= 'Reserveret: {$reserveret}'>";
            print "<td align=right>{$linjetext} " . dkdecimal($beholdning) . "</span></td>";
        }
        print "</tr>\n";
    }
    print "</tbody></table>\n";
    print "<body onload=\"document.links['opslag_1'].focus();\" >\n";
    #	print "<script language=\"javascript\">
    #		document.getElementById[\"opslag_1\"].focus();
    #	</script>";
    exit;
}
开发者ID:nielsrune,项目名称:saldi_ce,代码行数:101,代码来源:ordrefunc.php


注:本文中的dkdecimal函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。