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

@ -29,7 +29,7 @@ require '../../main.inc.php';
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');
@ -90,8 +90,8 @@ if ($action == "confirm_update") {
} }
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 ++;
@ -189,14 +189,14 @@ if ($action == 'delete') {
} }
if ($action == 'create') { if ($action == 'create') {
print_fiche_titre($langs->trans("CreateMvts")); print_fiche_titre($langs->trans("CreateMvts"));
$code_journal_array = array ( $code_journal_array = array (
$conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL, $conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL,
$conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_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,
$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
); );
$book = new BookKeeping($db); $book = new BookKeeping($db);
@ -237,14 +237,12 @@ if ($action == 'create') {
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); $book = new BookKeeping($db);
$result = $book->fetch_per_mvt($piece_num); $result = $book->fetch_per_mvt($piece_num);
if ($result < 0) { if ($result < 0) {
@ -319,8 +317,7 @@ else
print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">'; print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">';
print '</form>'; print '</form>';
print '</td>'; print '</td>';
} } else {
else {
print '<td>' . $line->numero_compte . '</td>'; print '<td>' . $line->numero_compte . '</td>';
print '<td>' . $line->code_tiers . '</td>'; print '<td>' . $line->code_tiers . '</td>';
print '<td>' . $line->label_compte . '</td>'; print '<td>' . $line->label_compte . '</td>';

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