Ejemplo n.º 1
0
 * Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) {
    $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier', 'alpha'));
    if ($result < 0) {
        dol_print_error($db, $object->error);
    }
}
// conditions de reglement
if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) {
    $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} else {
    if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) {
        $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
    }
}
// date de livraison
if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) {
    $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
    $result = $object->set_date_livraison($user, $datelivraison);
    if ($result < 0) {
        setEventMessage($object->error, 'errors');
    }
} else {
    if ($action == 'classin' && $user->rights->fournisseur->commande->creer) {
        $object->setProject($projectid);
    } else {
        if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) {
            $result = $object->set_remise($user, $_POST['remise_percent']);