Ejemplo n.º 1
0
            setEventMessage($object->errors, 'errors');
        }
    }
} elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->facture->supprimer) {
    $object->fetch($id);
    $object->fetch_thirdparty();
    $result = $object->delete($id);
    if ($result > 0) {
        header('Location: list.php');
        exit;
    } else {
        $mesg = '<div class="error">' . $object->error . '</div>';
    }
} elseif ($action == 'confirm_delete_line' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) {
    $object->fetch($id);
    $ret = $object->deleteline(GETPOST('lineid'));
    if ($ret > 0) {
        header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
        exit;
    } else {
        $mesg = '<div class="error">' . $object->error . '</div>';
        /* Fix bug 1485 : Reset action to avoid asking again confirmation on failure */
        $action = '';
    }
} elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) {
    $object->fetch($id);
    $result = $object->set_paid($user);
    if ($result < 0) {
        setEventMessage($object->error, 'errors');
    }
}
Ejemplo n.º 2
0
            $_GET['action']='create';
            $_GET['socid']=$_POST['socid'];
        }
        else
        {
            $db->commit();
            header('Location: fiche.php?facid='.$facid);
            exit;
        }
    }
}

if ($_GET['action'] == 'del_ligne')
{
    $facfou = new FactureFournisseur($db,'',$_GET['facid']);
    $facfou->deleteline($_GET['lineid']);
    $_GET['action'] = 'edit';
}

// Modification d'une ligne
if ($_REQUEST['action'] == 'update_line')
{
   if ($_REQUEST['etat'] == '1' && ! $_REQUEST['cancel']) // si on valide la modification
    {
        $facfou = new FactureFournisseur($db);
        $facfou->fetch($_GET['facid']);

        if ($_POST['puht'])
        {
            $pu=$_POST['puht'];
            $price_base_type='HT';