Ejemplo n.º 1
0
function samlevare($v_id, $ny_v_beholdning)
{
    include "../includes/fuld_stykliste.php";
    list($vare_id, $stk_antal, $antal) = fuld_stykliste($v_id, '', 'basisvarer');
    $id[0] = $v_id;
    $ny_beholdning[0] = $ny_v_beholdning;
    $r = db_fetch_array(db_select("select beholdning from varer where id='{$v_id}'", __FILE__ . " linje " . __LINE__));
    $diff = $ny_v_beholdning - $r['beholdning'];
    for ($x = 1; $x <= $antal; $x++) {
        if ($r = db_fetch_array(db_select("select beholdning from varer where id='{$vare_id[$x]}'", __FILE__ . " linje " . __LINE__))) {
            $id[$x] = $vare_id[$x];
            $ny_beholdning[$x] = $r['beholdning'] - $stk_antal[$x] * $diff;
        }
    }
    return array($x, $id, $ny_beholdning);
}
Ejemplo n.º 2
0
function samlevare($id, $art, $linje_id, $v_id, $leveres)
{
    # Denne funktion bruges (vist) ikke!
    if ($art == 'DO' || $art == 'PO') {
        include "../includes/fuld_stykliste.php";
        list($vare_id, $stk_antal, $antal) = fuld_stykliste($v_id, '', 'basisvarer');
        for ($x = 1; $x <= $antal; $x++) {
            #cho "select * from varer where id='$vare_id[$x]'<br>";
            if ($r = db_fetch_array(db_select("select * from varer where id='{$vare_id[$x]}'", __FILE__ . " linje " . __LINE__))) {
                $stk_antal[$x] = $stk_antal[$x] * $leveres;
                #cho "insert into ordrelinjer (ordre_id, varenr, vare_id, beskrivelse, antal, leveres, pris, samlevare, posnr) values ('$id', '$r[varenr]', '$vare_id[$x]', '$r[beskrivelse]', '$stk_antal[$x]', '$stk_antal[$x]', '0', '$linje_id', '100' )<br>";
                db_modify("insert into ordrelinjer (ordre_id, varenr, vare_id, beskrivelse, antal, leveres, pris, samlevare, posnr) values ('{$id}', '{$r['varenr']}', '{$vare_id[$x]}', '{$r['beskrivelse']}', '{$stk_antal[$x]}', '{$stk_antal[$x]}', '0', '{$linje_id}', '100' )", __FILE__ . " linje " . __LINE__);
            }
        }
    } else {
        #cho "select antal,posnr from ordrelinjer where id='$linje_id'<br>";
        $r = db_fetch_array(db_select("select antal,posnr,kred_linje_id from ordrelinjer where id='{$linje_id}'", __FILE__ . " linje " . __LINE__));
        $antal = $r['antal'] * 1;
        $posnr = $r['posnr'] * 1;
        $kred_linje_id = $r['kred_linje_id'] * 1;
        #cho "$antal select id,antal from ordrelinjer where id='$kred_linje_id'<br>";
        if ($antal && ($r = db_fetch_array(db_select("select id,antal from ordrelinjer where id='{$kred_linje_id}'", __FILE__ . " linje " . __LINE__)))) {
            $org_antal = $r['antal'];
            #cho "select * from ordrelinjer where samlevare='$r[id]'<br>";
            $q = db_select("select * from ordrelinjer where samlevare='{$r['id']}'", __FILE__ . " linje " . __LINE__);
            while ($r = db_fetch_array($q)) {
                $ny_antal = afrund($r['antal'] * $org_antal / $antal, 2);
                #cho "insert into ordrelinjer (ordre_id, varenr, vare_id, beskrivelse, antal, leveres, pris, samlevare, posnr)
                #					values
                #				('$id', '$r[varenr]', '$r[vare_id]', '$r[beskrivelse]', '$ny_antal', '$ny_antal', 0, $linje_id, '$r[posnr]' )<br>";
                db_modify("insert into ordrelinjer (ordre_id, varenr, vare_id, beskrivelse, antal, leveres, pris, samlevare, posnr) \n\t\t\t\t\tvalues \n\t\t\t\t('{$id}', '{$r['varenr']}', '{$r['vare_id']}', '{$r['beskrivelse']}', '{$ny_antal}', '{$ny_antal}', 0, {$linje_id}, '{$r['posnr']}' )", __FILE__ . " linje " . __LINE__);
            }
        }
    }
    #exit;
}
Ejemplo n.º 3
0
function samlevare($linje_id, $v_id, $leveres)
{
    global $id;
    list($vare_id, $stk_antal, $antal) = fuld_stykliste($v_id, '', 'basisvarer');
    for ($x = 1; $x <= $antal; $x++) {
        if ($r = db_fetch_array(db_select("select * from varer where id={$vare_id[$x]}", __FILE__ . " linje " . __LINE__))) {
            $stk_antal[$x] = $stk_antal[$x] * $leveres;
            db_modify("insert into ordrelinjer (ordre_id, varenr, vare_id, beskrivelse, antal, leveres, pris, samlevare, posnr) values ('{$id}', '{$r['varenr']}', '{$vare_id[$x]}', '{$r['beskrivelse']}', '{$stk_antal[$x]}', '{$stk_antal[$x]}', 0, {$linje_id}, '100' )", __FILE__ . " linje " . __LINE__);
        }
    }
}
Ejemplo n.º 4
0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>SALDI - varekort</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head>
<?php 
// ----------------------------------------------------------------------050306----------
// LICENS
//
// Dette program er fri software. Du kan gendistribuere det og / eller
// modificere det under betingelserne i GNU General Public License (GPL)
// som er udgivet af The Free Software Foundation; enten i version 2
// af denne licens eller en senere version efter eget valg
//
// Dette program er udgivet med haab om at det vil vaere til gavn,
// men UDEN NOGEN FORM FOR REKLAMATIONSRET ELLER GARANTI. Se
// GNU General Public Licensen for flere detaljer.
//
// En dansk oversaettelse af licensen kan laeses her:
// http://www.fundanemt.com/gpl_da.html
//
// Copyright (c) 2004-2006 DANOSOFT ApS
// ----------------------------------------------------------------------
@session_start();
$s_id = session_id();
$modulnr = 9;
include "../includes/connect.php";
include "../includes/online.php";
include "../includes/dkdecimal.php";
include "../includes/fuld_stykliste.php";
fuld_stykliste($_GET['id'], 'udskriv', '');
Ejemplo n.º 5
0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>SALDI - varekort</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></head>
<?php 
// ----------------------------------------------------------------------050306----------
// LICENS
//
// Dette program er fri software. Du kan gendistribuere det og / eller
// modificere det under betingelserne i GNU General Public License (GPL)
// som er udgivet af The Free Software Foundation; enten i version 2
// af denne licens eller en senere version efter eget valg
//
// Dette program er udgivet med haab om at det vil vaere til gavn,
// men UDEN NOGEN FORM FOR REKLAMATIONSRET ELLER GARANTI. Se
// GNU General Public Licensen for flere detaljer.
//
// En dansk oversaettelse af licensen kan laeses her:
// http://www.fundanemt.com/gpl_da.html
//
// Copyright (c) 2004-2006 DANOSOFT ApS
// ----------------------------------------------------------------------
@session_start();
$s_id = session_id();
$modulnr = 9;
include "../includes/connect.php";
include "../includes/online.php";
include "../includes/dkdecimal.php";
include "../includes/fuld_stykliste.php";
list($vare_id, $vare_antal, $antal) = fuld_stykliste($_GET[id], '', 'basisvarer');
for ($x = 1; $x <= $antal; $x++) {
    echo "ID {$vare_id[$x]}, antal {$vare_antal[$x]}<br>";
}
# fuld_stykliste($_GET[id], 'udskriv', 'basisvarer')