Beispiel #1
0
 $internal = $Ledger->insert($_POST);
 /* Save the predefined operation */
 if (isset($_POST['opd_name']) && trim($_POST['opd_name']) != "") {
     $opd = new Pre_op_ach($cn);
     $opd->get_post();
     $opd->save();
 }
 /* Show button  */
 $jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($internal));
 echo '<h1> ' . _('Enregistrement') . ' </h1>';
 /* Save the additional information into jrn_info */
 $obj = new Acc_Ledger_Info($cn);
 $obj->save_extra($Ledger->jr_id, $_POST);
 //printf('<a class="line" style="display:inline" href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(), $internal);
 // Feedback
 echo $Ledger->confirm($_POST, true);
 if (isset($Ledger->doc)) {
     echo '<h2>' . _('Document') . '</h2>';
     echo $Ledger->doc;
 }
 // extourne
 if (isset($_POST['reverse_ck'])) {
     $p_date = HtmlInput::default_value_post('reverse_date', '');
     if (isDate($p_date) == $p_date) {
         // reverse the operation
         try {
             $Ledger->reverse($p_date);
             echo '<p>';
             echo _('Extourné au ') . $p_date;
             echo '</p>';
         } catch (Exception $e) {