} if ($action == 'setref' && $user->rights->banque->cheque) { $result = $object->fetch(GETPOST('id', 'int')); if ($result > 0) { $number = GETPOST('number'); $result = $object->set_number($user, $number); if ($result < 0) { $mesg = '<div class="error">' . $object->error . '</div>'; } } else { $mesg = '<div class="error">' . $object->error . '</div>'; } } if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->cheque) { if (is_array($_POST['toRemise'])) { $result = $object->create($user, $_POST["accountid"], 0, $_POST['toRemise']); 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 = $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 // 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); }