Exemplo n.º 1
0
$langs->load('commercial');
$action = GETPOST('action');
// Security check
$id = GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int');
if ($user->societe_id) {
    $id = $user->societe_id;
}
$result = restrictedArea($user, 'societe&fournisseur', $id, '');
$object = new Fournisseur($db);
/*
 * Action
 */
if ($action == 'setsupplieraccountancycode') {
    $result = $object->fetch($id);
    $object->code_compta_fournisseur = $_POST["supplieraccountancycode"];
    $result = $object->update($object->id, $user, 1, 0, 1);
    if ($result < 0) {
        $mesg = join(',', $object->errors);
    }
    $action = "";
}
/*
 * View
 */
$contactstatic = new Contact($db);
$form = new Form($db);
if ($object->fetch($id)) {
    llxHeader('', $langs->trans('SupplierCard'));
    /*
     * Affichage onglets
     */