From a9ba2f317986ca4542dbdcdda07504ad0691d98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 2 Feb 2015 11:48:57 +0100 Subject: [PATCH 1/6] Fix: [ bug #1810 ] [pgsql] Error while upgrading from 3.6 to 3.7 --- htdocs/core/db/pgsql.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 7381fd77b93..58e79da87b9 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Yann Droneaud * Copyright (C) 2012 Florian Henry + * Copyright (C) 2015 Marcos GarcĂ­a * * 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 @@ -255,7 +256,7 @@ class DoliDBPgsql extends DoliDB $newreg3=preg_replace('/ NOT NULL/i','',$newreg3); $newreg3=preg_replace('/ NULL/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; // TODO Add alter to set default value or null/not null if there is this in $reg[3] } From ba78b4c5e95cfd5b815ec479d33d4068b2a3a4fa Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 7 Feb 2015 14:18:02 +0100 Subject: [PATCH 2/6] FIXED Missing language file --- htdocs/compta/tva/clients.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index c2620fd34df..5d8dce0fd73 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -35,6 +35,7 @@ $langs->load("bills"); $langs->load("compta"); $langs->load("companies"); $langs->load("products"); +$langs->load("other"); // Date range $year=GETPOST("year"); From ace524056e221372d198b3a975eea7a01bb75889 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 7 Feb 2015 14:34:04 +0100 Subject: [PATCH 3/6] Same problem --- htdocs/compta/tva/quadri_detail.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 681448e901e..f551e92cb9d 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -41,6 +41,7 @@ $langs->load("bills"); $langs->load("compta"); $langs->load("companies"); $langs->load("products"); +$langs->load("other"); // Date range $year=GETPOST("year"); From f23212eb22082b7e8ce933d4ba4ee0ed35b6e9bb Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 7 Feb 2015 14:55:56 +0100 Subject: [PATCH 4/6] Center title column & modify language key --- htdocs/compta/resultat/index.php | 8 ++++---- htdocs/langs/en_US/compta.lang | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index b586241c11e..83ad1495a9f 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/resultat/index.php - * \brief Page reporting resultat + * \brief Page reporting result */ require '../../main.inc.php'; @@ -570,8 +570,8 @@ print ''; print ''.$langs->trans("Month").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''.$langs->trans("Outcome").''; - print ''.$langs->trans("Income").''; + print ''.$langs->trans("Outcome").''; + print ''.$langs->trans("Income").''; } print ''; @@ -634,7 +634,7 @@ print "\n"; // Balance $var=!$var; -print ''.$langs->trans("Profit").''; +print ''.$langs->trans("AccountingResult").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ' '; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 89a32876dc3..65b5c1c1bb9 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -29,6 +29,7 @@ ReportTurnover=Turnover PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party PaymentsNotLinkedToUser=Payments not linked to any user Profit=Profit +AccountingResult=Accounting Result Balance=Balance Debit=Debit Credit=Credit From 63dd237b850001c10eee5abaf3cd062832d33fab Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 7 Feb 2015 15:21:30 +0100 Subject: [PATCH 5/6] Typo --- htdocs/langs/en_US/compta.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 65b5c1c1bb9..116b2c52fa8 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -29,7 +29,7 @@ ReportTurnover=Turnover PaymentsNotLinkedToInvoice=Payments not linked to any invoice, so not linked to any third party PaymentsNotLinkedToUser=Payments not linked to any user Profit=Profit -AccountingResult=Accounting Result +AccountingResult=Accounting result Balance=Balance Debit=Debit Credit=Credit From 0ca6661e6916e06e38a2f5873a8d91e2363d8d31 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Sat, 7 Feb 2015 23:33:37 +0100 Subject: [PATCH 6/6] FIX empty discount where created if amount is null for a line with a different tva --- htdocs/compta/facture.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8e74c674084..67ba28b4e47 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -563,10 +563,12 @@ if (empty($reshook)) // Boucle sur chaque taux de tva $i = 0; foreach ($object->lines as $line) { - $amount_ht [$line->tva_tx] += $line->total_ht; - $amount_tva [$line->tva_tx] += $line->total_tva; - $amount_ttc [$line->tva_tx] += $line->total_ttc; - $i ++; + if($line->total_ht!=0) { // no need to create discount if amount is null + $amount_ht [$line->tva_tx] += $line->total_ht; + $amount_tva [$line->tva_tx] += $line->total_tva; + $amount_ttc [$line->tva_tx] += $line->total_ttc; + $i ++; + } } // Insert one discount by VAT rate category @@ -583,6 +585,7 @@ if (empty($reshook)) $discount->fk_facture_source = $object->id; $error = 0; + foreach ($amount_ht as $tva_tx => $xxx) { $discount->amount_ht = abs($amount_ht [$tva_tx]); $discount->amount_tva = abs($amount_tva [$tva_tx]);