Ejemplo n.º 1
0
        if ($result > 0) {
            if ($object->statut == 1) {
                $object->fetch($object->id);
                // To force to reload all properties in correct property name
                // Define output language
                $outputlangs = $langs;
                $newlang = '';
                if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) {
                    $newlang = $_REQUEST['lang_id'];
                }
                //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
                if (!empty($newlang)) {
                    $outputlangs = new Translate("", $conf);
                    $outputlangs->setDefaultLang($newlang);
                }
                $result = $object->generatePdf($_POST["model"], $outputlangs);
            }
            header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id);
            exit;
        } else {
            setEventMessage($object->error, 'errors');
        }
    } else {
        setEventMessage($langs->trans("ErrorSelectAtLeastOne"));
        $action = 'new';
    }
}
if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banque->cheque) {
    $object->id = $id;
    $result = $object->removeCheck($_GET["lineid"]);
    if ($result === 0) {
Ejemplo n.º 2
0
    $result = $remisecheque->fetch($_GET["id"]);
    /*if ($_REQUEST['model'])
    	{
    		$remisecheque->setDocModel($user, $_REQUEST['model']);
    	}*/
    $outputlangs = $langs;
    $newlang = '';
    if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) {
        $newlang = $_REQUEST['lang_id'];
    }
    //if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
    if (!empty($newlang)) {
        $outputlangs = new Translate("", $conf);
        $outputlangs->setDefaultLang($newlang);
    }
    $result = $remisecheque->generatePdf($_POST["model"], $outputlangs);
    if ($result <= 0) {
        dol_print_error($db, $remisecheque->error);
        exit;
    } else {
        Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $remisecheque->id . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
        exit;
    }
}
/*
 * View
 */
if (GETPOST('removefilter')) {
    $filterdate = '';
    $filteraccountid = 0;
}