Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7

This commit is contained in:
Laurent Destailleur 2015-01-25 22:30:05 +01:00
commit da9f13bca9
22 changed files with 199 additions and 102 deletions

View File

@ -376,7 +376,7 @@ $cfg['DefaultConnectionCollation'] = 'utf8_unicode_ci';
// libraries/select_lang.lib.php
// $cfg['Lang'] = 'en-iso-8859-1';
// Regullar expression to limit listed languages, eg. '^(cs|en)' for Czech and
// Regular expression to limit listed languages, eg. '^(cs|en)' for Czech and
// English only
$cfg['FilterLanguages'] = '';

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -44,7 +44,13 @@ $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTING_*
$list = array (
'ACCOUNTING_SEPARATORCSV'
'ACCOUNTING_EXPORT_SEPARATORCSV',
'ACCOUNTING_EXPORT_DATE',
'ACCOUNTING_EXPORT_PIECE',
'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
'ACCOUNTING_EXPORT_LABEL',
'ACCOUNTING_EXPORT_AMOUNT',
'ACCOUNTING_EXPORT_DEVISE'
);
/*
@ -57,7 +63,7 @@ if ($action == 'update') {
if (! empty($modelcsv)) {
if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
} else {
@ -112,12 +118,12 @@ print "<td>" . $langs->trans("Selectmodelcsv") . "</td>";
print "<td>";
print '<select class="flat" name="modelcsv" id="modelcsv">';
print '<option value="0"';
if ($conf->global->ACCOUNTING_MODELCSV == 0) {
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 0) {
print ' selected="selected"';
}
print '>' . $langs->trans("Modelcsv_normal") . '</option>';
print '<option value="1"';
if ($conf->global->ACCOUNTING_MODELCSV == 1) {
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
print ' selected="selected"';
}
print '>' . $langs->trans("Modelcsv_CEGID") . '</option>';
@ -128,8 +134,7 @@ print "</table>";
print "<br>\n";
/*
* Params
*
* Parameters
*/
$num = count($list);

View File

@ -50,10 +50,10 @@ if ($year == 0) {
/*
* View
*/
llxHeader('', $langs->trans("CustomersVentilation"));
llxHeader('', $langs->trans("Bookkeeping"));
$textprevyear = "<a href=\"balancebymonth.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
$textnextyear = " <a href=\"balancebymonth.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear);

View File

@ -151,7 +151,7 @@ else {
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" />';
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
print '</form>';
@ -231,4 +231,4 @@ else {
}
llxFooter();
$db->close();
$db->close();

View File

@ -56,12 +56,11 @@ $offset = $conf->liste_limit * $page;
llxHeader('', $langs->trans("Bookkeeping"));
$textprevyear = "<a href=\"listbyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
$textnextyear = " <a href=\"listbyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
/*
* Mode Liste
*
* Mode List
*/
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal";

View File

@ -53,7 +53,6 @@ class AccountingAccount
* @param DoliDB $db Database handle
*/
function __construct($db)
{
$this->db = $db;
}

View File

@ -128,7 +128,7 @@ class FormVentilation extends Form
$label = $obj->account_number . ' - ' . $obj->label;
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number
// Bacause same account_number can be share between different accounting_system and do have the same meaning
// Because same account_number can be share between different accounting_system and do have the same meaning
if (($selectid != '') && $selectid == $obj->rowid) {
// $out .= '<option value="' . $obj->account_number . '" selected="selected">' . $label . '</option>';
$out .= '<option value="' . $obj->rowid . '" selected="selected">' . $label . '</option>';

View File

@ -45,8 +45,7 @@ if ($user->societe_id > 0)
* Actions
*/
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
{
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
if (! GETPOST('cancel', 'alpha'))
{
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
@ -127,8 +126,8 @@ if (! empty($id)) {
print '</td></tr>';
print '</table>';
print '<br><center><input class="button" type="submit" value="' . $langs->trans("Save") . '"> &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '"></center';
print '<br><div align="center"><input class="button" type="submit" value="' . $langs->trans("Save") . '">&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '"></div>';
print '</form>';
} else {

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/accountancy/customer/index.php
* \ingroup Accounting Expert
* \brief Page accueil clients ventilation comptable
* \brief Home customer ventilation
*/
require '../../main.inc.php';
@ -75,6 +75,8 @@ if ($action == 'validatehistory') {
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@ -93,7 +95,7 @@ if ($action == 'validatehistory') {
llxHeader('', $langs->trans("CustomersVentilation"));
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
$textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
@ -105,6 +107,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$row = $db->fetch_row($result);
@ -160,6 +163,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " GROUP BY fd.fk_code_ventilation";
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
@ -194,7 +198,7 @@ print "</table>\n";
print "<br>\n";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
@ -232,6 +236,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
@ -303,7 +308,8 @@ if (! empty($conf->margin->enabled)) {
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$i = 0;

View File

@ -133,7 +133,7 @@ if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
}
$sql .= $db->plimit($limit + 1, $offset);
dol_syslog("/accountancy/customer/linges.php sql=" . $sql, LOG_DEBUG);
dol_syslog("/accountancy/customer/lines.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
@ -220,5 +220,5 @@ if ($result) {
print "</table></form>";
$db->close();
llxFooter();
llxFooter();
$db->close();

View File

@ -52,9 +52,25 @@ $formventilation = new FormVentilation($db);
llxHeader('', $langs->trans("Ventilation"));
print '<script type="text/javascript">
$(function () {
$(\'#select-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = true;
});
});
$(\'#unselect-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = false;
});
});
});
</script>';
/*
* Action
*/
*/
if ($action == 'ventil') {
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
@ -113,8 +129,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
@ -147,7 +163,7 @@ if ($result) {
print '<td align="right">' . $langs->trans("Amount") . '</td>';
print '<td align="right">' . $langs->trans("AccountAccounting") . '</td>';
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>'.'</td>';
print '</tr>';
$facture_static = new Facture($db);

View File

@ -404,14 +404,14 @@ if ($action == 'writeBookKeeping')
// export csv
if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_banque.csv');
$companystatic = new Client($db);
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');

View File

@ -367,12 +367,12 @@ if ($action == 'writeBookKeeping') {
}
// export csv
if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition:attachment;filename=journal_caisse.csv');
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');

View File

@ -185,8 +185,8 @@ if ($action == 'writebookkeeping') {
foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) {
// get compte id and label
$compte = new AccountingAccount($db);
if ($compte->fetch(null, $k)) {
$accountingaccount = new AccountingAccount($db);
if ($accountingaccount->fetch(null, $k)) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@ -195,7 +195,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
$bookkeeping->code_tiers = '';
$bookkeeping->label_compte = dol_trunc($val["description"], 128);
$bookkeeping->label_compte = $accountingaccount->label;
$bookkeeping->numero_compte = $k;
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
@ -213,7 +213,6 @@ if ($action == 'writebookkeeping') {
foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) {
// get compte id and label
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@ -246,12 +245,12 @@ $companystatic = new Societe($db);
// export csv
if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.csv');
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -314,11 +313,13 @@ if ($action == 'export_csv')
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . dol_trunc($val["description"], 32) . '"' . $sep;
print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
@ -418,12 +419,15 @@ if ($action == 'export_csv')
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) {
print "<tr " . $bc[$var] . " >";
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $invoicestatic->description . "</td>";
print "<td>" . $accountingaccount->label . "</td>";
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>";

View File

@ -140,7 +140,7 @@ if ($result) {
$tabfac[$obj->rowid]["date"] = $obj->df;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
$tabfac[$obj->rowid]["type"] = $obj->type;
$tabfac[$obj->rowid]["description"] = $obj->description;
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
if (! isset($tabttc[$obj->rowid][$compta_soc]))
$tabttc[$obj->rowid][$compta_soc] = 0;
@ -196,8 +196,8 @@ if ($action == 'writebookkeeping') {
foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) {
// get compte id and label
$compte = new AccountingAccount($db);
if ($compte->fetch(null, $k)) {
$accountingaccount = new AccountingAccount($db);
if ($accountingaccount->fetch(null, $k)) {
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"];
@ -207,7 +207,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_docdet = $val["fk_facturedet"];
$bookkeeping->code_tiers = '';
$bookkeeping->numero_compte = $k;
$bookkeeping->label_compte = dol_trunc($val["description"], 128);
$bookkeeping->label_compte = $accountingaccount->label;
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
@ -247,14 +247,14 @@ if ($action == 'writebookkeeping') {
}
// export csv
if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv');
$companystatic = new Client($db);
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{
foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id'];
@ -324,11 +324,14 @@ if ($action == 'export_csv') {
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . dol_trunc($val["description"], 32) . '"' . $sep;
print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
print "\n";
@ -436,12 +439,15 @@ if ($action == 'export_csv') {
// Product / Service
foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) {
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $invoicestatic->description . "</td>";
print "<td>" . $accountingaccount->label . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "</tr>";
@ -467,8 +473,8 @@ if ($action == 'export_csv') {
}
print "</table>";
// End of page
llxFooter();
}
// End of page
llxFooter();
$db->close();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent s<jmenent@2byte.es>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
*
* 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

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/supplier/index.php
* \ingroup Accounting Expert
* \brief Page accueil ventilation
* \brief Home supplier ventilation
*/
require '../../main.inc.php';
@ -93,9 +93,9 @@ if ($action == 'validatehistory') {
llxHeader('', $langs->trans("SuppliersVentilation"));
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
$textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
print_fiche_titre($langs->trans("SuppliersVentilation") . "&nbsp;" . $textprevyear . "&nbsp;" . $langs->trans("Year") . "&nbsp;" . $year_start . "&nbsp;" . $textnextyear);
print '<b>' . $langs->trans("DescVentilSupplier") . '</b>';
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>';
@ -105,7 +105,7 @@ $y = $year_current;
$var = true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';

View File

@ -1,7 +1,5 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
@ -48,6 +46,7 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden();
$formventilation = new FormVentilation($db);
$changeaccount = GETPOST('changeaccount');
@ -107,7 +106,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql .= " AND aa.rowid = l.fk_code_ventilation";
if (strlen(trim($_GET["search_facture"]))) {
$sql .= " AND f.facnumber like '%" . $_GET["search_facture"] . "%'";
$sql .= " AND f.ref like '%" . $_GET["search_facture"] . "%'";
}
if (strlen(trim($_GET["search_ref"]))) {
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
@ -218,7 +217,8 @@ if ($result) {
print $db->error();
}
print "</table></form>";
$db->close();
llxFooter();
llxFooter();
$db->close();

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert
* \brief Page de ventilation des lignes de facture
* \brief Ventilation page from suppliers invoices
*/
require '../../main.inc.php';
@ -53,6 +53,22 @@ $formventilation = new FormVentilation($db);
llxHeader('', $langs->trans("Ventilation"));
print '<script type="text/javascript">
$(function () {
$(\'#select-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = true;
});
});
$(\'#unselect-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = false;
});
});
});
</script>';
/*
* Action
*/
@ -115,8 +131,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
@ -150,7 +166,7 @@ if ($result) {
print '<td align="right">' . $langs->trans("Amount") . '</td>';
print '<td align="right">' . $langs->trans("Compte") . '</td>';
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>'.'</td>';
print "</tr>\n";
$facturefourn_static = new FactureFournisseur($db);
@ -161,6 +177,23 @@ if ($result) {
while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);
$var = ! $var;
// product_type: 0 = service ? 1 = product
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
$code_buy_notset = '';
if (empty($objp->code_buy)) {
$code_buy_notset = 'color:red';
if ($objp->type == 1) {
$objp->code_buy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
} else {
$objp->code_buy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
}
}else {
$code_buy_notset = 'color:blue';
}
print "<tr $bc[$var]>";
// Ref facture
@ -191,7 +224,7 @@ if ($result) {
print price($objp->price);
print '</td>';
print '<td align="right">';
print '<td align="center" style="' . $code_buy_notset . '">';
print $objp->code_buy;
print '</td>';
@ -216,4 +249,4 @@ if ($result) {
}
llxFooter();
$db->close();
$db->close();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
*
@ -19,14 +19,14 @@
*/
/**
* \file accountingex/core/modules/modAccounting.class.php
* \file htdocs/core/modules/modAccounting.class.php
* \ingroup Accounting Expert
* \brief Module to activate Accounting Expert module
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modAccountingExpert
* \class modAccounting
* \brief Description and activation class for module accounting expert
*/
class modAccounting extends DolibarrModules
@ -68,7 +68,7 @@ class modAccounting extends DolibarrModules
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
$this->phpmin = array(5, 2); // Minimum version of PHP required by module
$this->phpmin = array(5, 3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module
$this->langfiles = array("accountancy");
@ -87,7 +87,7 @@ class modAccounting extends DolibarrModules
"With this constants on, bank account number is always required"
);
$this->const[1] = array(
"ACCOUNTING_SEPARATORCSV",
"ACCOUNTING_EXPORT_SEPARATORCSV",
"string",
","
);
@ -112,60 +112,85 @@ class modAccounting extends DolibarrModules
"SOC"
);
$this->const[6] = array(
"ACCOUNTING_CASH_JOURNAL",
"chaine",
"CAI"
);
$this->const[7] = array(
"ACCOUNTING_MISCELLANEOUS_JOURNAL",
"chaine",
"OD"
);
$this->const[8] = array(
"ACCOUNTING_BANK_JOURNAL",
"chaine",
"BQ"
); // Deprecated Move into llx_bank_account
$this->const[9] = array(
$this->const[7] = array(
"ACCOUNTING_ACCOUNT_TRANSFER_CASH",
"chaine",
"58"
);
$this->const[10] = array(
$this->const[8] = array(
"CHARTOFACCOUNTS",
"chaine",
"2"
);
$this->const[11] = array(
"ACCOUNTING_MODELCSV",
$this->const[9] = array(
"ACCOUNTING_EXPORT_MODELCSV",
"chaine",
"0"
);
$this->const[12] = array(
$this->const[10] = array(
"ACCOUNTING_LENGTH_GACCOUNT",
"chaine",
""
);
$this->const[13] = array(
$this->const[11] = array(
"ACCOUNTING_LENGTH_AACCOUNT",
"chaine",
""
);
$this->const[14] = array(
$this->const[12] = array(
"ACCOUNTING_LIMIT_LIST_VENTILATION",
"chaine",
"50"
);
$this->const[15] = array(
$this->const[13] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
"yesno",
"1"
);
$this->const[16] = array(
$this->const[14] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
"yesno",
"1"
);
$this->const[15] = array (
"ACCOUNTING_GROUPBYACCOUNT",
"yesno",
"1"
);
$this->const[16] = array (
"ACCOUNTING_EXPORT_DATE",
"chaine",
"%d%m%Y"
);
$this->const[17] = array (
"ACCOUNTING_EXPORT_PIECE",
"yesno",
"1"
);
$this->const[18] = array (
"ACCOUNTING_EXPORT_GLOBAL_ACCOUNT",
"yesno",
"1"
);
$this->const[19] = array (
"ACCOUNTING_EXPORT_LABEL",
"yesno",
"1"
);
$this->const[20] = array (
"ACCOUNTING_EXPORT_AMOUNT",
"yesno",
"1"
);
$this->const[21] = array (
"ACCOUNTING_EXPORT_DEVISE",
"yesno",
"1"
);
// Tabs
$this->tabs = array();

View File

@ -106,15 +106,20 @@ UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_AC
UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT';
-- Compatibility with module Accounting Expert
UPDATE llx_const SET name = 'ACCOUNTING_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DATE' WHERE name = 'ACCOUNTINGEX_EXP_DATE';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_PIECE' WHERE name = 'ACCOUNTINGEX_EXP_PIECE';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT' WHERE name = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_LABEL' WHERE name = 'ACCOUNTINGEX_EXP_LABEL';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_AMOUNT' WHERE name = 'ACCOUNTINGEX_EXP_AMOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DEVISE' WHERE name = 'ACCOUNTINGEX_EXP_DEVISE';
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE';
UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_CASH_JOURNAL' WHERE name = 'ACCOUNTINGEX_CASH_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH';
UPDATE llx_const SET name = 'ACCOUNTING_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION';