Exemplo n.º 1
0
function show_frais_form($id = 0)
{
    global $dbh, $msg;
    global $charset;
    global $frais_form;
    global $ptab;
    global $acquisition_gestion_tva;
    $frais_form = str_replace('!!id!!', $id, $frais_form);
    if (!$id) {
        $frais_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_ajout_frais], ENT_QUOTES, $charset), $frais_form);
        $frais_form = str_replace('!!libelle!!', '', $frais_form);
        $frais_form = str_replace('!!condition!!', '', $frais_form);
        $frais_form = str_replace('!!montant!!', '', $frais_form);
        $frais_form = str_replace('!!cp_compta!!', '', $frais_form);
    } else {
        $frais = new frais($id);
        $frais_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_modif_frais], ENT_QUOTES, $charset), $frais_form);
        $frais_form = str_replace('!!libelle!!', htmlentities($frais->libelle, ENT_QUOTES, $charset), $frais_form);
        $frais_form = str_replace('!!condition!!', htmlentities($frais->condition_frais, ENT_QUOTES, $charset), $frais_form);
        $frais_form = str_replace('!!montant!!', $frais->montant, $frais_form);
        $frais_form = str_replace('!!cp_compta!!', $frais->num_cp_compta, $frais_form);
        $ptab = str_replace('!!id!!', $id, $ptab);
        $ptab = str_replace('!!libelle_suppr!!', addslashes($frais->libelle), $ptab);
        $frais_form = str_replace('<!-- bouton_sup -->', $ptab, $frais_form);
    }
    if ($acquisition_gestion_tva) {
        $form_tva = "<select id='tva_achat' name ='tva_achat' >";
        $q = tva_achats::listTva();
        $res = pmb_mysql_query($q, $dbh);
        while ($row = pmb_mysql_fetch_object($res)) {
            $form_tva .= "<option value='" . $row->id_tva . "' ";
            if ($id) {
                if ($frais->num_tva_achat == $row->id_tva) {
                    $form_tva .= "selected ";
                }
            }
            $form_tva .= ">" . $row->libelle . " - " . $row->taux_tva . " %</option>";
        }
        $form_tva .= "</select>";
        $frais_form = str_replace('!!tva_achat!!', $form_tva, $frais_form);
    }
    print confirmation_delete("./admin.php?categ=acquisition&sub=frais&action=del&id=");
    print $frais_form;
}
Exemplo n.º 2
0
function show_list_tva()
{
    global $dbh, $msg, $charset;
    print "<table>\n\t<tr>\n\t\t<th>" . htmlentities($msg[103], ENT_QUOTES, $charset) . "</th>\n\t\t<th>" . htmlentities($msg[acquisition_tva_taux], ENT_QUOTES, $charset) . "</th>\n\t\t<th>" . htmlentities($msg[acquisition_num_cp_compta], ENT_QUOTES, $charset) . "</th>\n\t</tr>";
    $q = tva_achats::listTva();
    $res = mysql_query($q, $dbh);
    $nbr = mysql_num_rows($res);
    $parity = 1;
    for ($i = 0; $i < $nbr; $i++) {
        $row = mysql_fetch_object($res);
        if ($parity % 2) {
            $pair_impair = "even";
        } else {
            $pair_impair = "odd";
        }
        $parity += 1;
        $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='./admin.php?categ=acquisition&sub=tva&action=modif&id={$row->id_tva}';\" ";
        print "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'><td><i>" . htmlentities($row->libelle, ENT_QUOTES, $charset) . "</i></td><td><i>" . $row->taux_tva . "%</i></td><td><i>" . $row->num_cp_compta . "</i></td>";
        print "</tr>";
    }
    print "</table>\n\t\t<input class='bouton' type='button' value=' " . $msg[acquisition_ajout_tva] . " ' onClick=\"document.location='./admin.php?categ=acquisition&sub=tva&action=add'\" />";
}
Exemplo n.º 3
0
                include_once './acquisition/suggestions/suggestions_empr.inc.php';
                break;
            default:
                include_once './acquisition/suggestions/suggestions.inc.php';
                break;
        }
        break;
    default:
        if (!$nb_bib && !$acquisition_sugg_to_cde) {
            include_once './acquisition/suggestions/suggestions.inc.php';
        } else {
            if (!$nb_bib) {
                //Pas de bibliothèques définies pour l'utilisateur
                $error_msg .= htmlentities($msg["acquisition_err_coord"], ENT_QUOTES, $charset) . "<div class='row'></div>";
                error_message($msg[321], $error_msg . htmlentities($msg["acquisition_err_par"], ENT_QUOTES, $charset), '1', './admin.php?categ=acquisition');
                die;
            }
            //Gestion de la tva
            if ($acquisition_gestion_tva) {
                $nbr = tva_achats::countTva();
                //Gestion de TVA et pas de taux de tva définis
                if (!$nbr) {
                    $error_msg .= htmlentities($msg["acquisition_err_tva"], ENT_QUOTES, $charset) . "<div class='row'></div>";
                    error_message($msg[321], $error_msg . htmlentities($msg["acquisition_err_par"], ENT_QUOTES, $charset), '1', './admin.php?categ=acquisition');
                    die;
                }
            }
            include_once './acquisition/achats/achats.inc.php';
        }
        break;
}