Ejemplo n.º 1
0
$socid = GETPOST("socid");
$projectid = GETPOST("projectid");
// Security check
if ($user->societe_id) {
    $socid = $user->societe_id;
}
$result = restrictedArea($user, 'commande_fournisseur', $id, '');
$mesg = '';
$object = new CommandeFournisseur($db);
/*
 * Actions
 */
// conditions de reglement
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) {
    $object->fetch($id);
    $result = $object->cond_reglement($_POST['cond_reglement_id']);
}
// mode de reglement
if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) {
    $object->fetch($id);
    $result = $object->mode_reglement($_POST['mode_reglement_id']);
}
// Set project
if ($action == 'classin') {
    $object->fetch($id);
    $object->setProject($projectid);
}
if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) {
    $object->fetch($id);
    $result = $object->set_remise($user, $_POST['remise_percent']);
}