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

This commit is contained in:
Laurent Destailleur 2015-02-10 21:02:23 +01:00
commit abcf4480de
6 changed files with 16 additions and 9 deletions

View File

@ -563,10 +563,12 @@ if (empty($reshook))
// Boucle sur chaque taux de tva // Boucle sur chaque taux de tva
$i = 0; $i = 0;
foreach ($object->lines as $line) { foreach ($object->lines as $line) {
$amount_ht [$line->tva_tx] += $line->total_ht; if($line->total_ht!=0) { // no need to create discount if amount is null
$amount_tva [$line->tva_tx] += $line->total_tva; $amount_ht [$line->tva_tx] += $line->total_ht;
$amount_ttc [$line->tva_tx] += $line->total_ttc; $amount_tva [$line->tva_tx] += $line->total_tva;
$i ++; $amount_ttc [$line->tva_tx] += $line->total_ttc;
$i ++;
}
} }
// Insert one discount by VAT rate category // Insert one discount by VAT rate category
@ -583,6 +585,7 @@ if (empty($reshook))
$discount->fk_facture_source = $object->id; $discount->fk_facture_source = $object->id;
$error = 0; $error = 0;
foreach ($amount_ht as $tva_tx => $xxx) { foreach ($amount_ht as $tva_tx => $xxx) {
$discount->amount_ht = abs($amount_ht [$tva_tx]); $discount->amount_ht = abs($amount_ht [$tva_tx]);
$discount->amount_tva = abs($amount_tva [$tva_tx]); $discount->amount_tva = abs($amount_tva [$tva_tx]);

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/compta/resultat/index.php * \file htdocs/compta/resultat/index.php
* \brief Page reporting resultat * \brief Page reporting result
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -570,8 +570,8 @@ print '</tr>';
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>'; print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++) for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{ {
print '<td align="right">'.$langs->trans("Outcome").'</td>'; print '<td align="center">'.$langs->trans("Outcome").'</td>';
print '<td align="right" class="borderrightlight">'.$langs->trans("Income").'</td>'; print '<td align="center" class="borderrightlight">'.$langs->trans("Income").'</td>';
} }
print '</tr>'; print '</tr>';
@ -634,7 +634,7 @@ print "</tr>\n";
// Balance // Balance
$var=!$var; $var=!$var;
print '<tr class="liste_total"><td>'.$langs->trans("Profit").'</td>'; print '<tr class="liste_total"><td>'.$langs->trans("AccountingResult").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++) for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{ {
print '<td align="right" colspan="2" class="borderrightlight"> '; print '<td align="right" colspan="2" class="borderrightlight"> ';

View File

@ -35,6 +35,7 @@ $langs->load("bills");
$langs->load("compta"); $langs->load("compta");
$langs->load("companies"); $langs->load("companies");
$langs->load("products"); $langs->load("products");
$langs->load("other");
// Date range // Date range
$year=GETPOST("year"); $year=GETPOST("year");

View File

@ -41,6 +41,7 @@ $langs->load("bills");
$langs->load("compta"); $langs->load("compta");
$langs->load("companies"); $langs->load("companies");
$langs->load("products"); $langs->load("products");
$langs->load("other");
// Date range // Date range
$year=GETPOST("year"); $year=GETPOST("year");

View File

@ -7,6 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Yann Droneaud <yann@droneaud.fr> * Copyright (C) 2012 Yann Droneaud <yann@droneaud.fr>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@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
@ -255,7 +256,7 @@ class DoliDBPgsql extends DoliDB
$newreg3=preg_replace('/ NOT NULL/i','',$newreg3); $newreg3=preg_replace('/ NOT NULL/i','',$newreg3);
$newreg3=preg_replace('/ NULL/i','',$newreg3); $newreg3=preg_replace('/ NULL/i','',$newreg3);
$newreg3=preg_replace('/ DEFAULT 0/i','',$newreg3); $newreg3=preg_replace('/ DEFAULT 0/i','',$newreg3);
$newreg3=preg_replace('/ DEFAULT \'[0-9a-zA-Z_@]*\'/i','',$newreg3); $newreg3=preg_replace('/ DEFAULT \'?[0-9a-zA-Z_@]*\'?/i','',$newreg3);
$line.= "ALTER TABLE ".$reg[1]." ALTER COLUMN ".$reg[2]." TYPE ".$newreg3; $line.= "ALTER TABLE ".$reg[1]." ALTER COLUMN ".$reg[2]." TYPE ".$newreg3;
// TODO Add alter to set default value or null/not null if there is this in $reg[3] // TODO Add alter to set default value or null/not null if there is this in $reg[3]
} }

View File

@ -29,6 +29,7 @@ ReportTurnover=Turnover
PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party
PaymentsNotLinkedToUser=Payments not linked to any user PaymentsNotLinkedToUser=Payments not linked to any user
Profit=Profit Profit=Profit
AccountingResult=Accounting result
Balance=Balance Balance=Balance
Debit=Debit Debit=Debit
Credit=Credit Credit=Credit