Update bookkeeping

This commit is contained in:
aspangaro 2015-07-08 07:19:23 +02:00
parent f084a9472a
commit 4c72567c6b
3 changed files with 313 additions and 310 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,23 +18,23 @@
*/ */
/** /**
* \file htdocs/accountancy/bookkeeping/card.php * \file htdocs/accountancy/bookkeeping/card.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page to show account * \brief Page to show account
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
// Langs // Langs
$langs->load("accounting"); $langs->load("accountancy");
// Security check // Security check
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
$action = GETPOST('action'); $action = GETPOST('action');
$piece_num = GETPOST("piece_num"); $piece_num = GETPOST("piece_num");
@ -48,132 +48,132 @@ $debit = price2num(GETPOST('debit'));
$credit = price2num(GETPOST('credit')); $credit = price2num(GETPOST('credit'));
if ($action == "confirm_update") { if ($action == "confirm_update") {
$error = 0; $error = 0;
if ((intval($debit) != 0) && (intval($credit) != 0)) { if ((intval($debit) != 0) && (intval($credit) != 0)) {
setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); setEventMessage($langs->trans('ErrorDebitCredit'), 'errors');
$error ++; $error ++;
} }
if (empty($error)) { if (empty($error)) {
$book = new BookKeeping($db); $book = new BookKeeping($db);
$result = $book->fetch($id); $result = $book->fetch($id);
if ($result < 0) { if ($result < 0) {
setEventMessage($book->errors, 'errors'); setEventMessage($book->errors, 'errors');
} else { } else {
$book->numero_compte = $numero_compte; $book->numero_compte = $numero_compte;
$book->code_tiers = $code_tiers; $book->code_tiers = $code_tiers;
$book->label_compte = $label_compte; $book->label_compte = $label_compte;
$book->debit = $debit; $book->debit = $debit;
$book->credit = $credit; $book->credit = $credit;
if (! empty($debit)) { if (! empty($debit)) {
$book->montant = $debit; $book->montant = $debit;
$book->sens = 'D'; $book->sens = 'D';
} }
if (! empty($credit)) { if (! empty($credit)) {
$book->montant = $credit; $book->montant = $credit;
$book->sens = 'C'; $book->sens = 'C';
} }
$result = $book->update(); $result = $book->update();
if ($result < 0) { if ($result < 0) {
setEventMessage($book->errors, 'errors'); setEventMessage($book->errors, 'errors');
} else { } else {
setEventMessage($langs->trans('Saved'), 'mesgs'); setEventMessage($langs->trans('Saved'), 'mesgs');
$action = ''; $action = '';
} }
} }
} }
} }
else if ($action == "add") { else if ($action == "add") {
$error = 0;
$error = 0;
if ((intval($debit) != 0) && (intval($credit) != 0)) { if ((intval($debit) != 0) && (intval($credit) != 0)) {
setEventMessage($langs->trans('ErrorDebitCredit'), 'errors'); setEventMessage($langs->trans('ErrorDebitCredit'), 'errors');
$error ++; $error ++;
} }
if (empty($error)) { if (empty($error)) {
$book = new BookKeeping($db); $book = new BookKeeping($db);
$book->numero_compte = $numero_compte; $book->numero_compte = $numero_compte;
$book->code_tiers = $code_tiers; $book->code_tiers = $code_tiers;
$book->label_compte = $label_compte; $book->label_compte = $label_compte;
$book->debit = $debit; $book->debit = $debit;
$book->credit = $credit; $book->credit = $credit;
$book->doc_date = GETPOST('doc_date'); $book->doc_date = GETPOST('doc_date');
$book->doc_type = GETPOST('doc_type'); $book->doc_type = GETPOST('doc_type');
$book->piece_num = $piece_num; $book->piece_num = $piece_num;
$book->doc_ref = GETPOST('doc_ref'); $book->doc_ref = GETPOST('doc_ref');
$book->code_journal = GETPOST('code_journal'); $book->code_journal = GETPOST('code_journal');
$book->fk_doc = GETPOST('fk_doc'); $book->fk_doc = GETPOST('fk_doc');
$book->fk_docdet = GETPOST('fk_docdet'); $book->fk_docdet = GETPOST('fk_docdet');
if (! empty($debit)) { if (! empty($debit)) {
$book->montant = $debit; $book->montant = $debit;
$book->sens = 'D'; $book->sens = 'D';
} }
if (! empty($credit)) { if (! empty($credit)) {
$book->montant = $credit; $book->montant = $credit;
$book->sens = 'C'; $book->sens = 'C';
} }
$result = $book->create_std($user); $result = $book->create_std($user);
if ($result < 0) { if ($result < 0) {
setEventMessage($book->errors, 'errors'); setEventMessage($book->errors, 'errors');
} else { } else {
setEventMessage($langs->trans('Saved'), 'mesgs'); setEventMessage($langs->trans('Saved'), 'mesgs');
$action = ''; $action = '';
} }
} }
} }
else if ($action == "confirm_delete") { else if ($action == "confirm_delete") {
$book = new BookKeeping($db); $book = new BookKeeping($db);
$result = $book->fetch($id); $result = $book->fetch($id);
$piece_num = $book->piece_num; $piece_num = $book->piece_num;
if ($result < 0) { if ($result < 0) {
setEventMessage($book->errors, 'errors'); setEventMessage($book->errors, 'errors');
} else { } else {
$result = $book->delete($user); $result = $book->delete($user);
if ($result < 0) { if ($result < 0) {
setEventMessage($book->errors, 'errors'); setEventMessage($book->errors, 'errors');
} }
} }
$action = ''; $action = '';
} }
else if ($action == "confirm_create") { else if ($action == "confirm_create") {
$book = new BookKeeping($db); $book = new BookKeeping($db);
$book->label_compte = ''; $book->label_compte = '';
$book->debit = 0; $book->debit = 0;
$book->credit = 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_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth'), GETPOST('doc_dateday'), GETPOST('doc_dateyear'));
$book->doc_type = GETPOST('doc_type'); $book->doc_type = GETPOST('doc_type');
$book->piece_num = GETPOST('next_num_mvt'); $book->piece_num = GETPOST('next_num_mvt');
$book->doc_ref = GETPOST('doc_ref'); $book->doc_ref = GETPOST('doc_ref');
$book->code_journal = GETPOST('code_journal'); $book->code_journal = GETPOST('code_journal');
$book->fk_doc = 0; $book->fk_doc = 0;
$book->fk_docdet = 0; $book->fk_docdet = 0;
$book->montant = 0; $book->montant = 0;
$result = $book->create_std($user); $result = $book->create_std($user);
if ($result < 0) { if ($result < 0) {
setEventMessage($book->errors, 'errors'); setEventMessage($book->errors, 'errors');
} else { } else {
setEventMessage($langs->trans('Saved'), 'mesgs'); setEventMessage($langs->trans('Saved'), 'mesgs');
$action = ''; $action = '';
$piece_num = $book->piece_num; $piece_num = $book->piece_num;
} }
} }
llxHeader(); llxHeader();
@ -181,197 +181,194 @@ llxHeader();
$html = new Form($db); $html = new Form($db);
/* /*
* Confirmation to delete the command * Confirmation to delete the command
*/ */
if ($action == 'delete') { if ($action == 'delete') {
$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1); $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1);
print $formconfirm; print $formconfirm;
} }
if ($action == 'create') { if ($action == 'create') {
print_fiche_titre($langs->trans("CreateMvts"));
print_fiche_titre($langs->trans("CreateMvts"));
$code_journal_array = array (
$conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL,
$conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_JOURNAL,
$conf->global->ACCOUNTING_BANK_JOURNAL => $conf->global->ACCOUNTING_BANK_JOURNAL,
$conf->global->ACCOUNTING_SOCIAL_JOURNAL => $conf->global->ACCOUNTING_SOCIAL_JOURNAL
);
$book = new BookKeeping($db);
$next_num_mvt = $book->getNextNumMvt();
print '<form action="' . $_SERVER["PHP_SELF"] . '" name="create_mvt" method="POST">';
print '<input type="hidden" name="action" value="confirm_create">' . "\n";
print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n";
dol_fiche_head(); $code_journal_array = array (
$conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL,
$conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_JOURNAL,
$conf->global->ACCOUNTING_SOCIAL_JOURNAL => $conf->global->ACCOUNTING_SOCIAL_JOURNAL,
$conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL => $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL,
$conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL => $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL
);
print '<table class="border" width="100%">'; $book = new BookKeeping($db);
print '<tr>'; $next_num_mvt = $book->getNextNumMvt();
print '<td>' . $langs->trans("NumMvts") . '</td>';
print '<td>' . $next_num_mvt . '</td>'; print '<form action="' . $_SERVER["PHP_SELF"] . '" name="create_mvt" method="POST">';
print '</tr>'; print '<input type="hidden" name="action" value="confirm_create">' . "\n";
print '<tr>'; print '<input type="hidden" name="next_num_mvt" value="' . $next_num_mvt . '">' . "\n";
print '<td>' . $langs->trans("Docdate") . '</td>';
print '<td>'; dol_fiche_head();
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '</td>'; print '<table class="border" width="100%">';
print '<tr>';
print '</tr>'; print '<td>' . $langs->trans("NumMvts") . '</td>';
print '<tr>'; print '<td>' . $next_num_mvt . '</td>';
print '<td>' . $langs->trans("Codejournal") . '</td>'; print '</tr>';
print '<tr>';
print '<td>' . $html->selectarray('code_journal', $code_journal_array) . '</td>'; print '<td>' . $langs->trans("Docdate") . '</td>';
print '</tr>'; print '<td>';
print '<tr>'; print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '<td>' . $langs->trans("Docref") . '</td>'; print '</td>';
print '<td><input type="text" size="20" name="doc_ref" value=""/></td>';
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("Doctype") . '</td>'; print '<td>' . $langs->trans("Codejournal") . '</td>';
print '<td><input type="text" size="20" name="doc_type" value=""/></td>';
print '</tr>'; print '<td>' . $html->selectarray('code_journal', $code_journal_array) . '</td>';
print '</table>'; print '</tr>';
print '<tr>';
print '<td>' . $langs->trans("Docref") . '</td>';
print '<td><input type="text" size="20" name="doc_ref" value=""/></td>';
print '</tr>';
print '<tr>';
print '<td>' . $langs->trans("Doctype") . '</td>';
print '<td><input type="text" size="20" name="doc_type" value=""/></td>';
print '</tr>';
print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Save") . '">'; print '<div align="center"><input type="submit" class="button" value="' . $langs->trans("Create") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
} } else {
else $book = new BookKeeping($db);
{ $result = $book->fetch_per_mvt($piece_num);
$book = new BookKeeping($db); if ($result < 0) {
$result = $book->fetch_per_mvt($piece_num); setEventMessage($book->errors, 'errors');
if ($result < 0) { }
setEventMessage($book->errors, 'errors'); if (! empty($book->piece_num)) {
}
if (! empty($book->piece_num)) {
print_fiche_titre($langs->trans("UpdateMvts"));
print '<table class="border" width="100%">';
print '<tr class="pair">';
print '<td>' . $langs->trans("NumMvts") . '</td>';
print '<td>' . $book->piece_num . '</td>';
print '</tr>';
print '<tr class="impair">';
print '<td>' . $langs->trans("Docdate") . '</td>';
print '<td>' . dol_print_date($book->doc_date, 'daytextshort') . '</td>';
print '</tr>';
print '<tr class="pair">';
print '<td>' . $langs->trans("Codejournal") . '</td>';
print '<td>' . $book->code_journal . '</td>';
print '</tr>';
print '<tr class="impair">';
print '<td>' . $langs->trans("Docref") . '</td>';
print '<td>' . $book->doc_ref . '</td>';
print '</tr>';
print '<tr class="pair">';
print '<td>' . $langs->trans("Doctype") . '</td>';
print '<td>' . $book->doc_type . '</td>';
print '</tr>';
print '</table>';
$result = $book->fetch_all_per_mvt($piece_num);
if ($result < 0) {
setEventMessage($book->errors, 'errors');
} else {
print_fiche_titre($langs->trans("ListeMvts"));
print "<table class=\"noborder\" width=\"100%\">";
if (count($book->linesmvt) > 0) {
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Numerocompte"));
print_liste_field_titre($langs->trans("Code_tiers"));
print_liste_field_titre($langs->trans("Labelcompte"));
print_liste_field_titre($langs->trans("Debit"));
print_liste_field_titre($langs->trans("Credit"));
print_liste_field_titre($langs->trans("Amount"));
print_liste_field_titre($langs->trans("Sens"));
print_liste_field_titre('');
print "</tr>\n"; print_fiche_titre($langs->trans("UpdateMvts"));
foreach ( $book->linesmvt as $line ) { print '<table class="border" width="100%">';
$var = ! $var; print '<tr class="pair">';
print "<tr $bc[$var]>"; print '<td>' . $langs->trans("NumMvts") . '</td>';
print '<td>' . $book->piece_num . '</td>';
if ($action == 'update' && $line->id == $id) { print '</tr>';
print '<tr class="impair">';
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">'; print '<td>' . $langs->trans("Docdate") . '</td>';
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n"; print '<td>' . dol_print_date($book->doc_date, 'daytextshort') . '</td>';
print '<input type="hidden" name="action" value="confirm_update">' . "\n"; print '</tr>';
print '<td><input type="text" size="6" name="numero_compte" value="' . $line->numero_compte . '"/></td>'; print '<tr class="pair">';
print '<td><input type="text" size="15" name="code_tiers" value="' . $line->code_tiers . '"/></td>'; print '<td>' . $langs->trans("Codejournal") . '</td>';
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>'; print '<td>' . $book->code_journal . '</td>';
print '<td><input type="text" size="6" name="debit" value="' . price($line->debit) . '"/></td>'; print '</tr>';
print '<td><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>'; print '<tr class="impair">';
print '<td>' . $line->montant . '</td>'; print '<td>' . $langs->trans("Docref") . '</td>';
print '<td>' . $line->sens . '</td>'; print '<td>' . $book->doc_ref . '</td>';
print '<td>'; print '</tr>';
print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">'; print '<tr class="pair">';
print '</form>'; print '<td>' . $langs->trans("Doctype") . '</td>';
print '</td>'; print '<td>' . $book->doc_type . '</td>';
} print '</tr>';
else { print '</table>';
print '<td>' . $line->numero_compte . '</td>';
print '<td>' . $line->code_tiers . '</td>'; $result = $book->fetch_all_per_mvt($piece_num);
print '<td>' . $line->label_compte . '</td>'; if ($result < 0) {
print '<td>' . $line->debit . '</td>'; setEventMessage($book->errors, 'errors');
print '<td>' . $line->credit . '</td>'; } else {
print '<td>' . $line->montant . '</td>';
print '<td>' . $line->sens . '</td>'; print_fiche_titre($langs->trans("ListeMvts"));
print "<table class=\"noborder\" width=\"100%\">";
print '<td>'; if (count($book->linesmvt) > 0) {
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
print img_edit(); print '<tr class="liste_titre">';
print '</a>&nbsp;';
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">'; print_liste_field_titre($langs->trans("Numerocompte"));
print img_delete(); print_liste_field_titre($langs->trans("Code_tiers"));
print '</a>'; print_liste_field_titre($langs->trans("Labelcompte"));
print_liste_field_titre($langs->trans("Debit"));
print '</td>'; print_liste_field_titre($langs->trans("Credit"));
} print_liste_field_titre($langs->trans("Amount"));
print "</tr>\n"; print_liste_field_titre($langs->trans("Sens"));
} print_liste_field_titre('');
if ($action == "" || $action == 'add') { print "</tr>\n";
$var = ! $var;
print "<tr $bc[$var]>"; foreach ( $book->linesmvt as $line ) {
$var = ! $var;
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">'; print "<tr $bc[$var]>";
print '<input type="hidden" name="action" value="add">' . "\n";
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n"; if ($action == 'update' && $line->id == $id) {
print '<input type="hidden" name="doc_type" value="' . $book->doc_type . '">' . "\n";
print '<input type="hidden" name="doc_ref" value="' . $book->doc_ref . '">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
print '<input type="hidden" name="code_journal" value="' . $book->code_journal . '">' . "\n"; print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n"; print '<input type="hidden" name="action" value="confirm_update">' . "\n";
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n"; print '<td><input type="text" size="6" name="numero_compte" value="' . $line->numero_compte . '"/></td>';
print '<td><input type="text" size="6" name="numero_compte" value="' . $numero_compte . '"/></td>'; print '<td><input type="text" size="15" name="code_tiers" value="' . $line->code_tiers . '"/></td>';
print '<td><input type="text" size="15" name="code_tiers" value="' . $code_tiers . '"/></td>'; print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
print '<td><input type="text" size="15" name="label_compte" value="' . $label_compte . '"/></td>'; print '<td><input type="text" size="6" name="debit" value="' . price($line->debit) . '"/></td>';
print '<td><input type="text" size="6" name="debit" value="' . price($debit) . '"/></td>'; print '<td><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>';
print '<td><input type="text" size="6" name="credit" value="' . price($credit) . '"/></td>'; print '<td>' . $line->montant . '</td>';
print '<td></td>'; print '<td>' . $line->sens . '</td>';
print '<td></td>'; print '<td>';
print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>'; print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">';
print '</tr>'; print '</form>';
} print '</td>';
print '</table>'; } else {
print '</form>'; print '<td>' . $line->numero_compte . '</td>';
} print '<td>' . $line->code_tiers . '</td>';
} print '<td>' . $line->label_compte . '</td>';
} print '<td>' . $line->debit . '</td>';
else { print '<td>' . $line->credit . '</td>';
print_fiche_titre($langs->trans("NoRecords")); print '<td>' . $line->montant . '</td>';
} print '<td>' . $line->sens . '</td>';
print '<td>';
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
print img_edit();
print '</a>&nbsp;';
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
print img_delete();
print '</a>';
print '</td>';
}
print "</tr>\n";
}
if ($action == "" || $action == 'add') {
$var = ! $var;
print "<tr $bc[$var]>";
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
print '<input type="hidden" name="action" value="add">' . "\n";
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n";
print '<input type="hidden" name="doc_type" value="' . $book->doc_type . '">' . "\n";
print '<input type="hidden" name="doc_ref" value="' . $book->doc_ref . '">' . "\n";
print '<input type="hidden" name="code_journal" value="' . $book->code_journal . '">' . "\n";
print '<input type="hidden" name="fk_doc" value="' . $book->fk_doc . '">' . "\n";
print '<input type="hidden" name="fk_docdet" value="' . $book->fk_docdet . '">' . "\n";
print '<td><input type="text" size="6" name="numero_compte" value="' . $numero_compte . '"/></td>';
print '<td><input type="text" size="15" name="code_tiers" value="' . $code_tiers . '"/></td>';
print '<td><input type="text" size="15" name="label_compte" value="' . $label_compte . '"/></td>';
print '<td><input type="text" size="6" name="debit" value="' . price($debit) . '"/></td>';
print '<td><input type="text" size="6" name="credit" value="' . price($credit) . '"/></td>';
print '<td></td>';
print '<td></td>';
print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
print '</tr>';
}
print '</table>';
print '</form>';
}
}
}
else {
print_fiche_titre($langs->trans("NoRecords"));
}
} }
llxFooter(); llxFooter();

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
// Langs
$langs->load("accountancy");
$page = GETPOST("page"); $page = GETPOST("page");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
@ -155,8 +157,6 @@ else {
print '</form>'; print '</form>';
print '<a href="./card.php?action=create" class="butAction">' . $langs->trans("NewAccountingMvt") . '</a></div>';
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="export_csv">'; print '<input type="hidden" name="action" value="export_csv">';
@ -209,7 +209,7 @@ else {
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>' . $obj->doc_type . '</td>'; print '<td>' . $obj->doc_type . '</td>';
print '<td>' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>'; print '<td align="center">' . dol_print_date($db->jdate($obj->doc_date), 'day') . '</td>';
print '<td>' . $obj->doc_ref . '</td>'; print '<td>' . $obj->doc_ref . '</td>';
print '<td>' . length_accountg($obj->numero_compte) . '</td>'; print '<td>' . length_accountg($obj->numero_compte) . '</td>';
print '<td>' . length_accounta($obj->code_tiers) . '</td>'; print '<td>' . length_accounta($obj->code_tiers) . '</td>';
@ -224,6 +224,11 @@ else {
$i ++; $i ++;
} }
print "</table>"; print "</table>";
print '<div class="tabsAction">';
print '<a class="butAction" href="./card.php?action=create">'.$langs->trans("NewAccountingMvt").'</a>';
print '</div>';
$db->free($resql); $db->free($resql);
} else { } else {
dol_print_error($db); dol_print_error($db);

View File

@ -48,6 +48,7 @@ NewAccount=New accounting account
Update=Update Update=Update
List=List List=List
Create=Create Create=Create
CreateMvts=Create movement
UpdateAccount=Modification of an accounting account UpdateAccount=Modification of an accounting account
UpdateMvts=Modification of a movement UpdateMvts=Modification of a movement
WriteBookKeeping=Record accounts in general ledger WriteBookKeeping=Record accounts in general ledger