}
$limit = $conf->liste_limit;
$offset = $limit * $page;
$dir = $conf->banque->dir_output . '/bordereau/';
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
$filteraccountid = GETPOST('accountid');
$object = new RemiseCheque($db);
/*
 * Actions
 */
if ($action == 'setdate' && $user->rights->banque->cheque) {
    $result = $object->fetch(GETPOST('id', 'int'));
    if ($result > 0) {
        //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
        $date = dol_mktime(0, 0, 0, $_POST['datecreate_month'], $_POST['datecreate_day'], $_POST['datecreate_year']);
        $result = $object->set_date($user, $date);
        if ($result < 0) {
            setEventMessage($object->error, 'errors');
        }
    } else {
        setEventMessage($object->error, 'errors');
    }
}
/*
 * Actions
 */
if ($action == 'setrefext' && $user->rights->banque->cheque) {
    $result = $object->fetch(GETPOST('id', 'int'));
    if ($result > 0) {
        $ref_ext = GETPOST('ref_ext');
        $result = $object->setValueFrom('ref_ext', $ref_ext);
Example #2
0
$limit = $conf->liste_limit;
$offset = $limit * $page;
$dir = $conf->banque->dir_output . '/bordereau/';
$filterdate = dol_mktime(0, 0, 0, $_POST['fdmonth'], $_POST['fdday'], $_POST['fdyear']);
$filteraccountid = GETPOST('accountid');
//var_dump($_POST);
/*
 * Actions
 */
if ($action == 'setdate' && $user->rights->banque->cheque) {
    $remisecheque = new RemiseCheque($db);
    $result = $remisecheque->fetch(GETPOST('id'));
    if ($result > 0) {
        //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
        $date = dol_mktime(0, 0, 0, $_POST['datecreate_month'], $_POST['datecreate_day'], $_POST['datecreate_year']);
        $result = $remisecheque->set_date($user, $date);
        if ($result < 0) {
            $mesg = '<div class="error">' . $remisecheque->error . '</div>';
        }
    } else {
        $mesg = '<div class="error">' . $remisecheque->error . '</div>';
    }
}
if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->cheque) {
    if (is_array($_POST['toRemise'])) {
        $remisecheque = new RemiseCheque($db);
        $result = $remisecheque->create($user, $_POST["accountid"], 0, $_POST['toRemise']);
        if ($result > 0) {
            if ($remisecheque->statut == 1) {
                $remisecheque->fetch($remisecheque->id);
                // To force to reload all properties in correct property name