Ejemplo n.º 1
0
            $action = '';
        } else {
            if ($action == "confirm_create") {
                $book = new BookKeeping($db);
                $book->label_compte = '';
                $book->debit = 0;
                $book->credit = 0;
                $book->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth'), GETPOST('doc_dateday'), GETPOST('doc_dateyear'));
                $book->doc_type = GETPOST('doc_type');
                $book->piece_num = GETPOST('next_num_mvt');
                $book->doc_ref = GETPOST('doc_ref');
                $book->code_journal = GETPOST('code_journal');
                $book->fk_doc = 0;
                $book->fk_docdet = 0;
                $book->montant = 0;
                $result = $book->create_std($user);
                if ($result < 0) {
                    setEventMessages($book->error, $book->errors, 'errors');
                } else {
                    setEventMessages($langs->trans('Saved'), null, 'mesgs');
                    $action = '';
                    $piece_num = $book->piece_num;
                }
            }
        }
    }
}
llxHeader();
$html = new Form($db);
/*
 *  Confirmation to delete the command