Ejemplo n.º 1
0
                    $error++;
                }
                if (!$error) {
                    $result = $commande->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), $dDLC, $dDLUO, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger);
                    if ($result < 0) {
                        setEventMessages($commande->error, $commande->errors, 'errors');
                        $error++;
                    }
                }
            }
        }
    }
    if (!$notrigger && !$error) {
        global $conf, $langs, $user;
        // Call trigger
        $result = $commande->call_trigger('ORDER_SUPPLIER_DISPATCH', $user);
        // End call triggers
        if ($result < 0) {
            setEventMessages($commande->error, $commande->errors, 'errors');
            $error++;
        }
    }
    if ($result >= 0 && !$error) {
        $db->commit();
        header("Location: dispatch.php?id=" . $id);
        exit;
    } else {
        $db->rollback();
    }
}
/*