From acc9879c7c9b19a5b0932ce2395dfb56fff78e6a Mon Sep 17 00:00:00 2001 From: fmarcet Date: Mon, 1 Feb 2016 13:05:14 +0100 Subject: [PATCH 01/78] FIX: It doesn't check if there is enough stock to update the lines of orders/invoices --- htdocs/commande/class/commande.class.php | 23 ++++++++++++++++++- htdocs/compta/facture/class/facture.class.php | 14 +++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5d2907041b2..d807d67cb1e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Marcos García + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -2372,7 +2373,7 @@ class Commande extends CommonOrder */ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) { - global $conf, $mysoc; + global $conf, $mysoc, $langs; dol_syslog(get_class($this)."::updateline id=$rowid, desc=$desc, pu=$pu, qty=$qty, remise_percent=$remise_percent, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, price_base_type=$price_base_type, info_bits=$info_bits, date_start=$date_start, date_end=$date_end, type=$type, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, special_code=$special_code"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -2426,6 +2427,26 @@ class Commande extends CommonOrder $line = new OrderLine($this->db); $line->fetch($rowid); + if (!empty($line->fk_product)) + { + $product=new Product($this->db); + $result=$product->fetch($line->fk_product); + $product_type=$product->type; + + if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty) + { + $this->error=$langs->trans('ErrorStockIsNotEnough'); + dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR); + $this->db->rollback(); + unset($_POST['productid']); + unset($_POST['tva_tx']); + unset($_POST['price_ht']); + unset($_POST['qty']); + unset($_POST['buying_price']); + return self::STOCK_NOT_ENOUGH_FOR_ORDER; + } + } + $staticline = clone $line; $line->oldline = $staticline; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b1ec15f7536..705a52074c9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2012-2014 Marcos García * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -2199,6 +2200,19 @@ class Facture extends CommonInvoice $line = new FactureLigne($this->db); $line->fetch($rowid); + if (!empty($line->fk_product)) + { + $product=new Product($this->db); + $result=$product->fetch($line->fk_product); + $product_type=$product->type; + + if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) { + $this->error=$langs->trans('ErrorStockIsNotEnough'); + $this->db->rollback(); + return -3; + } + } + $staticline = clone $line; $line->oldline = $staticline; From d6cda60ed1c1f239ee7e76e6fc48430870d1948a Mon Sep 17 00:00:00 2001 From: fmarcet Date: Mon, 1 Feb 2016 13:40:02 +0100 Subject: [PATCH 02/78] FIX: Check stock of product by warehouse if $entrepot_id defined on shippings --- htdocs/expedition/class/expedition.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 4ed4a061358..88d25121ade 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Francis Appels + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -763,13 +764,19 @@ class Expedition extends CommonObject return -1; } - if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) // FIXME Check is done for stock of product, it must be done for stock of product into warehouse if $entrepot_id defined + if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) { $product=new Product($this->db); $result=$product->fetch($fk_product); + if ($entrepot_id > 0) { + $product->load_stock(); + $product_stock = $product->stock_warehouse[$entrepot_id]->real; + } + else + $product_stock = $product->stock_reel; $product_type=$product->type; - if ($product_type == 0 && $product->stock_reel < $qty) + if ($product_type == 0 && $product_stock < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); From a45ffeecca5eba9e050b2c36207fc1c923897a26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Mar 2016 18:21:57 +0100 Subject: [PATCH 03/78] Missing changelog --- ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2144fe54620..dbc858dc1d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,18 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 3.5.8 compared to 3.5.7 ***** +FIX: #4291 Correctly filter external calendar GETPOSTs +FIX: bad calculation for stock value +FIX: bad stock valo +FIX: change order date on clone (as everywhere else) +FIX: CVE CVE-2015-8685 +FIX: The hours of date filter aren't correct +FIX: #3442 Remove useless syslog +FIX: #3448 Pass expected date format +FIX: #3471 3.5 Rounding issue when dispatching non-integer + ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken due to SSL v3 closed. Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers From 32d0f9a8d771685d962e405b9f0c76d9a586df19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Mar 2016 18:27:04 +0100 Subject: [PATCH 04/78] Prepare 3.6.7 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index d1784fb4863..3c1d1fdea0e 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.6'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.7'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From e669dac3980f7da1e11d20a4b16d7ab0484497f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Mar 2016 18:28:39 +0100 Subject: [PATCH 05/78] Prepare 3.6.7 --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index fe638ab3902..9a0da671af3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.6.7 compared to 3.6.6 ***** +FIX: #4291 Correctly filter external calendar GETPOSTs +FIX: CVE CVE-2015-8685 ***** ChangeLog for 3.6.6 compared to 3.6.5 ***** FIX: #3734 Do not show empty links of deleted source objects in stock movement list From 25dcca301f38c986feef2beebc4b3800913da1a8 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 12 Apr 2016 09:47:35 +0200 Subject: [PATCH 06/78] Fix VAT amount on credit note was > 0 when manually entered --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ae368b3870b..333f71806c6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2392,7 +2392,7 @@ class Facture extends CommonInvoice $this->line->date_start = $date_start; $this->line->date_end = $date_end; $this->line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva = $total_tva; + $this->line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); $this->line->total_localtax1 = $total_localtax1; $this->line->total_localtax2 = $total_localtax2; $this->line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); From 2d3b2c08b57e3c156599ec90f1f7413a2cfcf1f2 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Apr 2016 10:56:03 +0200 Subject: [PATCH 07/78] FIX #3815 Call to undefined function local_by_date(). branch 3.7 --- htdocs/compta/localtax/quadri_detail.php | 36 +-- htdocs/core/lib/tax.lib.php | 366 ++++++++++++++++++++++- 2 files changed, 370 insertions(+), 32 deletions(-) diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 7396c625165..73cfdff0659 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier - * Copyright (C) 2014 Rosana Romero + * Copyright (C) 2014-2016 Juanjo Menent * * 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 @@ -116,16 +116,11 @@ $product_static=new Product($db); $payment_static=new Paiement($db); $paymentfourn_static=new PaiementFourn($db); -//print_fiche_titre($langs->trans("VAT"),""); - -//$fsearch.='
'; $fsearch.=' '; $fsearch.=' '; -//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; -//$fsearch.=' '; $calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local; -// Affiche en-tete du rapport + if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services { $nom=$langs->trans($local==1?"LT1ReportByQuartersInDueDebtMode":"LT2ReportByQuartersInDueDebtMode"); @@ -138,14 +133,11 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice $nextyear=$year_start; $nextquarter=$q; if ($nextquarter < 4) $nextquarter++; else { $nextquarter=1; $nextyear++; } - //$periodlink=($prevyear?"".img_previous()." ".img_next()."":""); - //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; $builddate=time(); - //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("ProductOrService"); @@ -170,14 +162,10 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services $nextyear=$year_start; $nextquarter=$q; if ($nextquarter < 4) $nextquarter++; else { $nextquarter=1; $nextyear++; } - //$periodlink=($prevyear?"".img_previous()." ".img_next()."":""); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded"); - //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $builddate=time(); - //$exportlink=$langs->trans("NotYetAvailable"); $elementcust=$langs->trans("CustomersInvoices"); $productcust=$langs->trans("ProductOrService"); @@ -203,15 +191,12 @@ if($local==1){ // VAT Received and paid - - $y = $year_current; $total = 0; $i=0; // Load arrays of datas $x_coll= local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell', $local); -//$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell'); $x_paye = local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy', $local); @@ -230,10 +215,10 @@ if (! is_array($x_coll) || ! is_array($x_paye)) else { $x_both = array(); + //now, from these two arrays, get another array with one rate per line foreach(array_keys($x_coll) as $my_coll_rate) { - //foreach($x_coll[$my_coll_rate][localtax1_list]){ $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht']; $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat']; $x_both[$my_coll_rate]['paye']['totalht'] = 0; @@ -303,9 +288,6 @@ else } //now we have an array (x_both) indexed by rates for coll and paye - - //print table headers for this quadri - incomes first - $x_coll_sum = 0; $x_coll_ht = 0; $x_paye_sum = 0; @@ -313,9 +295,7 @@ else $span=3; if ($modetax == 0) $span+=2; - - //print ''..')'; - + if($conf->global->$calc ==0 || $conf->global->$calc == 2){ // Customers invoices print ''; @@ -345,8 +325,6 @@ else if($rate!=0){ print ""; - //print ''.$langs->trans("Rate").': '.vatrate($rate).'%'; - /**/ print ''.$langs->trans("Rate").': '.vatrate($rate).'%'; print ''."\n"; } @@ -400,9 +378,7 @@ else print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { - //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); - //print ' ('.round($ratiolineinvoice*100,2).'%)'; } print ''; } @@ -413,7 +389,6 @@ else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); print ''; - //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { $payment_static->id=$fields['payment_id']; @@ -491,7 +466,6 @@ else if($conf->global->$calc ==0 || $conf->global->$calc == 1){ echo ''; //print table headers for this quadri - expenses now - //imprime les en-tete de tables pour ce quadri - maintenant les d�penses print ''; print ''; print ''; diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index de705111b9d..ae217004bbf 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -205,6 +205,370 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } } +/** + * Gets LocalTaxes to collect for the given year (and given quarter or month) + * The function gets the LocalTaxes in split results, as the LocalTaxes declaration asks + * to report the amounts for different LocalTaxes rates as different lines. + * + * @param DoliDB $db Database handler object + * @param int $y Year + * @param int $q Quarter + * @param string $date_start Start date + * @param string $date_end End date + * @param int $modetax 0 or 1 (option on debit) + * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) + * @param int $local 1 for LocalTax1, 2 for LocalTax2 + * @param int $m Month + * @return array List of quarters with LocalTaxes + */ +function local_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $local, $m=0) +{ + global $conf; + + $list=array(); + + if ($direction == 'sell') + { + $invoicetable='facture'; + $invoicedettable='facturedet'; + $fk_facture='fk_facture'; + $fk_facture2='fk_facture'; + $fk_payment='fk_paiement'; + $total_tva='total_tva'; + $total_localtax1='total_localtax1'; + $total_localtax2='total_localtax2'; + $paymenttable='paiement'; + $paymentfacturetable='paiement_facture'; + $invoicefieldref='facnumber'; + $localtax_tx=$local==1?'localtax1_tx':'localtax2_tx'; + } + if ($direction == 'buy') + { + $invoicetable='facture_fourn'; + $invoicedettable='facture_fourn_det'; + $fk_facture='fk_facture_fourn'; + $fk_facture2='fk_facturefourn'; + $fk_payment='fk_paiementfourn'; + $total_tva='tva'; + $total_localtax1='total_localtax1'; + $total_localtax2='total_localtax2'; + $paymenttable='paiementfourn'; + $paymentfacturetable='paiementfourn_facturefourn'; + $invoicefieldref='ref'; + $localtax_tx=$local==1?'localtax1_tx':'localtax2_tx'; + } + + // BIENS + + // Define sql request + $sql=''; + if ($modetax == 1) // Option on delivery for goods (payment) and debit invoice for services + { + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) + { + $sql='TODO'; + } + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) + { + // Count on delivery date (use invoice date as delivery is unknown) + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx,"; + $sql.= " d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql.= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; + $sql.= " d.date_start as date_start, d.date_end as date_end,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; + $sql.= " 0 as payment_id, 0 as payment_amount"; + $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; + $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; + $sql.= " WHERE f.entity = " . $conf->entity; + $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + $sql.= " AND f.rowid = d.".$fk_facture; + if ($y && $m) + { + $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; + $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; + } + else if ($y) + { + $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; + $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; + } + if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND (d.product_type = 0"; // Limit to products + $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service + $sql.= " ORDER BY d.rowid, d.".$fk_facture; + } + } + else // Option vat on delivery for goods (payments) and payments for services + { + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) + { + $sql='TODO'; + } + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) + { + // Count on delivery date (use invoice date as delivery is unknown) + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; + $sql.= " d.date_start as date_start, d.date_end as date_end,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; + $sql.= " 0 as payment_id, 0 as payment_amount"; + $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; + $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; + $sql.= " WHERE f.entity = " . $conf->entity; + $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + $sql.= " AND f.rowid = d.".$fk_facture; + if ($y && $m) + { + $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; + $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; + } + else if ($y) + { + $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; + $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; + } + if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND (d.product_type = 0"; // Limit to products + $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service + $sql.= " ORDER BY d.rowid, d.".$fk_facture; + } + } + + if (! $sql) return -1; + if ($sql == 'TODO') return -2; + if ($sql != 'TODO') + { + dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); + + $resql = $db->query($sql); + if ($resql) + { + $lt=-1; + $oldrowid=''; + while($assoc = $db->fetch_array($resql)) + { + if (! isset($list[$assoc['localtax_tx']]['totalht'])) $list[$assoc['localtax_tx']]['totalht']=0; + if (! isset($list[$assoc['localtax_tx']]['vat'])) $list[$assoc['localtax_tx']]['vat']=0; + if (! isset($list[$assoc['localtax_tx']]['localtax1'])) $list[$assoc['localtax_tx']]['localtax1']=0; + if (! isset($list[$assoc['localtax_tx']]['localtax2'])) $list[$assoc['localtax_tx']]['localtax2']=0; + + if ($assoc['rowid'] != $oldrowid) + { + $oldrowid=$assoc['rowid']; + $list[$assoc['localtax_tx']]['totalht'] += $assoc['total_ht']; + $list[$assoc['localtax_tx']]['vat'] += $assoc['total_vat']; + $list[$assoc['localtax_tx']]['localtax1'] += $assoc['total_localtax1']; + $list[$assoc['localtax_tx']]['localtax2'] += $assoc['total_localtax2']; + } + + $list[$assoc['localtax_tx']]['localtax1_tx'] = $assoc['localtax1_tx']; + $list[$assoc['localtax_tx']]['localtax2_tx'] = $assoc['localtax2_tx']; + + $list[$assoc['localtax_tx']]['dtotal_ttc'][] = $assoc['total_ttc']; + $list[$assoc['localtax_tx']]['dtype'][] = $assoc['dtype']; + $list[$assoc['localtax_tx']]['ddate_start'][] = $db->jdate($assoc['date_start']); + $list[$assoc['localtax_tx']]['ddate_end'][] = $db->jdate($assoc['date_end']); + + $list[$assoc['localtax_tx']]['facid'][] = $assoc['facid']; + $list[$assoc['localtax_tx']]['facnum'][] = $assoc['facnum']; + $list[$assoc['localtax_tx']]['type'][] = $assoc['type']; + $list[$assoc['localtax_tx']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; + $list[$assoc['localtax_tx']]['descr'][] = $assoc['descr']; + + $list[$assoc['localtax_tx']]['totalht_list'][] = $assoc['total_ht']; + $list[$assoc['localtax_tx']]['vat_list'][] = $assoc['total_vat']; + $list[$assoc['localtax_tx']]['localtax1_list'][] = $assoc['total_localtax1']; + $list[$assoc['localtax_tx']]['localtax2_list'][] = $assoc['total_localtax2']; + + $list[$assoc['localtax_tx']]['pid'][] = $assoc['pid']; + $list[$assoc['localtax_tx']]['pref'][] = $assoc['pref']; + $list[$assoc['localtax_tx']]['ptype'][] = $assoc['ptype']; + + $list[$assoc['localtax_tx']]['payment_id'][] = $assoc['payment_id']; + $list[$assoc['localtax_tx']]['payment_amount'][] = $assoc['payment_amount']; + + $lt = $assoc['localtax_tx']; + } + } + else + { + dol_print_error($db); + return -3; + } + } + + + //SERVICES + + // Define sql request + $sql=''; + if ($modetax == 1) // Option on delivery for goods (payment) and debit invoice for services + { + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) + { + $sql='TODO'; + } + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) + { + // Count on invoice date + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; + $sql.= " d.date_start as date_start, d.date_end as date_end,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; + $sql.= " 0 as payment_id, 0 as payment_amount"; + $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; + $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; + $sql.= " WHERE f.entity = " . $conf->entity; + $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + $sql.= " AND f.rowid = d.".$fk_facture; + if ($y && $m) + { + $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; + $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; + } + else if ($y) + { + $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; + $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; + } + if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; + if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND (d.product_type = 1"; // Limit to services + $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service + $sql.= " ORDER BY d.rowid, d.".$fk_facture; + } + } + else // Option on delivery for goods (payments) and payments for services + { + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) + { + + $sql='TODO'; + } + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) + { + // Count on payments date + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; + $sql.= " d.date_start as date_start, d.date_end as date_end,"; + $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; + $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; + $sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount"; + $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; + $sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,"; + $sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,"; + $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; + $sql.= " WHERE f.entity = " . $conf->entity; + $sql.= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + $sql.= " AND f.rowid = d.".$fk_facture;; + $sql.= " AND pf.".$fk_facture2." = f.rowid"; + $sql.= " AND pa.rowid = pf.".$fk_payment; + if ($y && $m) + { + $sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; + $sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; + } + else if ($y) + { + $sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'"; + $sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'"; + } + if ($q) $sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")"; + if ($date_start && $date_end) $sql.= " AND pa.datep >= ".$db->idate($date_start)." AND pa.datep <= ".$db->idate($date_end); + $sql.= " AND (d.product_type = 1"; // Limit to services + $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service + $sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid"; + } + } + + if (! $sql) + { + dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR); + return -1; // -1 = Not accountancy module enabled + } + if ($sql == 'TODO') return -2; // -2 = Feature not yet available + if ($sql != 'TODO') + { + dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); + $resql = $db->query($sql); + if ($resql) + { + $lt = -1; + $oldrowid=''; + while($assoc = $db->fetch_array($resql)) + { + if (! isset($list[$assoc['localtax_tx']]['totalht'])) $list[$assoc['localtax_tx']]['totalht']=0; + if (! isset($list[$assoc['localtax_tx']]['vat'])) $list[$assoc['localtax_tx']]['vat']=0; + if (! isset($list[$assoc['localtax_tx']]['localtax1'])) $list[$assoc['localtax_tx']]['localtax1']=0; + if (! isset($list[$assoc['localtax_tx']]['localtax2'])) $list[$assoc['localtax_tx']]['localtax2']=0; + + if ($assoc['rowid'] != $oldrowid) + { + $oldrowid=$assoc['rowid']; + $list[$assoc['localtax_tx']]['totalht'] += $assoc['total_ht']; + $list[$assoc['localtax_tx']]['vat'] += $assoc['total_vat']; + $list[$assoc['localtax_tx']]['localtax1'] += $assoc['total_localtax1']; + $list[$assoc['localtax_tx']]['localtax2'] += $assoc['total_localtax2']; + } + + $list[$assoc['localtax_tx']]['localtax1_tx'] = $assoc['localtax1_tx']; + $list[$assoc['localtax_tx']]['localtax2_tx'] = $assoc['localtax2_tx']; + + $list[$assoc['localtax_tx']]['dtotal_ttc'][] = $assoc['total_ttc']; + $list[$assoc['localtax_tx']]['dtype'][] = $assoc['dtype']; + $list[$assoc['localtax_tx']]['ddate_start'][] = $db->jdate($assoc['date_start']); + $list[$assoc['localtax_tx']]['ddate_end'][] = $db->jdate($assoc['date_end']); + + $list[$assoc['localtax_tx']]['facid'][] = $assoc['facid']; + $list[$assoc['localtax_tx']]['facnum'][] = $assoc['facnum']; + $list[$assoc['localtax_tx']]['type'][] = $assoc['type']; + $list[$assoc['localtax_tx']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; + $list[$assoc['localtax_tx']]['descr'][] = $assoc['descr']; + + $list[$assoc['localtax_tx']]['totalht_list'][] = $assoc['total_ht']; + $list[$assoc['localtax_tx']]['vat_list'][] = $assoc['total_vat']; + $list[$assoc['localtax_tx']]['localtax1_list'][] = $assoc['total_localtax1']; + $list[$assoc['localtax_tx']]['localtax2_list'][] = $assoc['total_localtax2']; + + $list[$assoc['localtax_tx']]['pid'][] = $assoc['pid']; + $list[$assoc['localtax_tx']]['pref'][] = $assoc['pref']; + $list[$assoc['localtax_tx']]['ptype'][] = $assoc['ptype']; + + $list[$assoc['localtax_tx']]['payment_id'][] = $assoc['payment_id']; + $list[$assoc['localtax_tx']]['payment_amount'][] = $assoc['payment_amount']; + + $lt = $assoc['localtax_tx']; + } + } + else + { + dol_print_error($db); + return -3; + } + } + + return $list; + + +} + /** * Gets VAT to collect for the given year (and given quarter or month) From c5ecc46a220b227b5fe46efba9fc76fda55773e1 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Apr 2016 15:42:58 +0200 Subject: [PATCH 08/78] FIX #3815 With higher quality --- htdocs/compta/localtax/quadri_detail.php | 11 +- htdocs/core/lib/tax.lib.php | 338 +---------------------- 2 files changed, 6 insertions(+), 343 deletions(-) diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index a4eaccba35b..175ff6cf98f 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -196,8 +196,8 @@ $total = 0; $i=0; // Load arrays of datas -$x_coll= local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell', $local); -$x_paye = local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy', $local); +$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy'); echo '
'.$elementsup.''.$productsup.'
'; @@ -220,9 +220,9 @@ else foreach(array_keys($x_coll) as $my_coll_rate) { $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht']; - $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat']; + $x_both[$my_coll_rate]['coll']['localtax'.$local] = $x_coll[$my_coll_rate]['localtax'.$local]; $x_both[$my_coll_rate]['paye']['totalht'] = 0; - $x_both[$my_coll_rate]['paye']['vat'] = 0; + $x_both[$my_coll_rate]['paye']['localtax'.$local] = 0; $x_both[$my_coll_rate]['coll']['links'] = ''; $x_both[$my_coll_rate]['coll']['detail'] = array(); foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy) @@ -637,6 +637,5 @@ else $i++; } -$db->close(); - llxFooter(); +$db->close(); diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 6054a32c692..93b4b480dde 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2006-2007 Yannick Warnier * Copyright (C) 2011 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2016 Juanjo Menent * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García @@ -178,342 +178,6 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } } -/** - * Gets LocalTaxes to collect for the given year (and given quarter or month) - * The function gets the LocalTaxes in split results, as the LocalTaxes declaration asks - * to report the amounts for different LocalTaxes rates as different lines. - * - * @param DoliDB $db Database handler object - * @param int $y Year - * @param int $q Quarter - * @param string $date_start Start date - * @param string $date_end End date - * @param int $modetax 0 or 1 (option on debit) - * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) - * @param int $local 1 for LocalTax1, 2 for LocalTax2 - * @param int $m Month - * @return array List of quarters with LocalTaxes - */ -function local_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $local, $m=0) -{ - global $conf; - - $list=array(); - - if ($direction == 'sell') - { - $invoicetable='facture'; - $invoicedettable='facturedet'; - $fk_facture='fk_facture'; - $fk_facture2='fk_facture'; - $fk_payment='fk_paiement'; - $total_tva='total_tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; - $paymenttable='paiement'; - $paymentfacturetable='paiement_facture'; - $invoicefieldref='facnumber'; - $localtax_tx=$local==1?'localtax1_tx':'localtax2_tx'; - } - if ($direction == 'buy') - { - $invoicetable='facture_fourn'; - $invoicedettable='facture_fourn_det'; - $fk_facture='fk_facture_fourn'; - $fk_facture2='fk_facturefourn'; - $fk_payment='fk_paiementfourn'; - $total_tva='tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; - $paymenttable='paiementfourn'; - $paymentfacturetable='paiementfourn_facturefourn'; - $invoicefieldref='ref'; - $localtax_tx=$local==1?'localtax1_tx':'localtax2_tx'; - } - - // BIENS - - // Define sql request - $sql=''; - if ($modetax == 1) // Option on delivery for goods (payment) and debit invoice for services - { - - // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx,"; - $sql.= " d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql.= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " 0 as payment_id, 0 as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.rowid = d.".$fk_facture; - if ($y && $m) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND (d.product_type = 0"; // Limit to products - $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture; - - } - else // Option on delivery for goods (payments) and payments for services - { - // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " 0 as payment_id, 0 as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.rowid = d.".$fk_facture; - if ($y && $m) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND (d.product_type = 0"; // Limit to products - $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture; - - } - - if (! $sql) return -1; - - dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); - - $resql = $db->query($sql); - if ($resql) - { - $lt=-1; - $oldrowid=''; - while($assoc = $db->fetch_array($resql)) - { - if (! isset($list[$assoc['localtax_tx']]['totalht'])) $list[$assoc['localtax_tx']]['totalht']=0; - if (! isset($list[$assoc['localtax_tx']]['vat'])) $list[$assoc['localtax_tx']]['vat']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax1'])) $list[$assoc['localtax_tx']]['localtax1']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax2'])) $list[$assoc['localtax_tx']]['localtax2']=0; - - if ($assoc['rowid'] != $oldrowid) // Si rupture sur d.rowid - { - $oldrowid=$assoc['rowid']; - $list[$assoc['localtax_tx']]['totalht'] += $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat'] += $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1'] += $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2'] += $assoc['total_localtax2']; - } - - $list[$assoc['localtax_tx']]['localtax1_tx'] = $assoc['localtax1_tx']; - $list[$assoc['localtax_tx']]['localtax2_tx'] = $assoc['localtax2_tx']; - - $list[$assoc['localtax_tx']]['dtotal_ttc'][] = $assoc['total_ttc']; - $list[$assoc['localtax_tx']]['dtype'][] = $assoc['dtype']; - $list[$assoc['localtax_tx']]['ddate_start'][] = $db->jdate($assoc['date_start']); - $list[$assoc['localtax_tx']]['ddate_end'][] = $db->jdate($assoc['date_end']); - - $list[$assoc['localtax_tx']]['facid'][] = $assoc['facid']; - $list[$assoc['localtax_tx']]['facnum'][] = $assoc['facnum']; - $list[$assoc['localtax_tx']]['type'][] = $assoc['type']; - $list[$assoc['localtax_tx']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; - $list[$assoc['localtax_tx']]['descr'][] = $assoc['descr']; - - $list[$assoc['localtax_tx']]['totalht_list'][] = $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat_list'][] = $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1_list'][] = $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2_list'][] = $assoc['total_localtax2']; - - $list[$assoc['localtax_tx']]['pid'][] = $assoc['pid']; - $list[$assoc['localtax_tx']]['pref'][] = $assoc['pref']; - $list[$assoc['localtax_tx']]['ptype'][] = $assoc['ptype']; - - $list[$assoc['localtax_tx']]['payment_id'][] = $assoc['payment_id']; - $list[$assoc['localtax_tx']]['payment_amount'][] = $assoc['payment_amount']; - - $lt = $assoc['localtax_tx']; - } - } - else - { - dol_print_error($db); - return -3; - } - - // CAS DES SERVICES - - // Define sql request - $sql=''; - if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services - { - - // Count on invoice date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " 0 as payment_id, 0 as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.rowid = d.".$fk_facture; - if ($y && $m) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND (d.product_type = 1"; // Limit to services - $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture; - - } - else // Option vat on delivery for goods (payments) and payments for services - { - - // Count on payments date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,"; - $sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.rowid = d.".$fk_facture;; - $sql.= " AND pf.".$fk_facture2." = f.rowid"; - $sql.= " AND pa.rowid = pf.".$fk_payment; - if ($y && $m) - { - $sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND pa.datep >= ".$db->idate($date_start)." AND pa.datep <= ".$db->idate($date_end); - $sql.= " AND (d.product_type = 1"; // Limit to services - $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid"; - - } - - if (! $sql) - { - dol_syslog("Tax.lib.php::local_by_date no accountancy module enabled".$sql,LOG_ERR); - return -1; - } - - dol_syslog("Tax.lib.php::local_by_date sql=".$sql); - $resql = $db->query($sql); - if ($resql) - { - $lt = -1; - $oldrowid=''; - while($assoc = $db->fetch_array($resql)) - { - if (! isset($list[$assoc['localtax_tx']]['totalht'])) $list[$assoc['localtax_tx']]['totalht']=0; - if (! isset($list[$assoc['localtax_tx']]['vat'])) $list[$assoc['localtax_tx']]['vat']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax1'])) $list[$assoc['localtax_tx']]['localtax1']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax2'])) $list[$assoc['localtax_tx']]['localtax2']=0; - - if ($assoc['rowid'] != $oldrowid) - { - $oldrowid=$assoc['rowid']; - $list[$assoc['localtax_tx']]['totalht'] += $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat'] += $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1'] += $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2'] += $assoc['total_localtax2']; - } - - $list[$assoc['localtax_tx']]['localtax1_tx'] = $assoc['localtax1_tx']; - $list[$assoc['localtax_tx']]['localtax2_tx'] = $assoc['localtax2_tx']; - - $list[$assoc['localtax_tx']]['dtotal_ttc'][] = $assoc['total_ttc']; - $list[$assoc['localtax_tx']]['dtype'][] = $assoc['dtype']; - $list[$assoc['localtax_tx']]['ddate_start'][] = $db->jdate($assoc['date_start']); - $list[$assoc['localtax_tx']]['ddate_end'][] = $db->jdate($assoc['date_end']); - - $list[$assoc['localtax_tx']]['facid'][] = $assoc['facid']; - $list[$assoc['localtax_tx']]['facnum'][] = $assoc['facnum']; - $list[$assoc['localtax_tx']]['type'][] = $assoc['type']; - $list[$assoc['localtax_tx']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; - $list[$assoc['localtax_tx']]['descr'][] = $assoc['descr']; - - $list[$assoc['localtax_tx']]['totalht_list'][] = $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat_list'][] = $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1_list'][] = $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2_list'][] = $assoc['total_localtax2']; - - $list[$assoc['localtax_tx']]['pid'][] = $assoc['pid']; - $list[$assoc['localtax_tx']]['pref'][] = $assoc['pref']; - $list[$assoc['localtax_tx']]['ptype'][] = $assoc['ptype']; - - $list[$assoc['localtax_tx']]['payment_id'][] = $assoc['payment_id']; - $list[$assoc['localtax_tx']]['payment_amount'][] = $assoc['payment_amount']; - - $lt = $assoc['localtax_tx']; - } - } - else - { - dol_print_error($db); - return -3; - } - - return $list; - - -} - - /** * Gets VAT to collect for the given year (and given quarter or month) * The function gets the VAT in split results, as the VAT declaration asks From 9f4ccfab95760b425951c194241aeba71c9c27a1 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Apr 2016 15:54:51 +0200 Subject: [PATCH 09/78] FIX #3815 With higher quality --- htdocs/compta/localtax/quadri_detail.php | 15 +- htdocs/core/lib/tax.lib.php | 365 ----------------------- 2 files changed, 7 insertions(+), 373 deletions(-) diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 73cfdff0659..b0a103ac514 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -196,8 +196,8 @@ $total = 0; $i=0; // Load arrays of datas -$x_coll= local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell', $local); -$x_paye = local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy', $local); +$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy'); echo '
'; @@ -220,9 +220,9 @@ else foreach(array_keys($x_coll) as $my_coll_rate) { $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht']; - $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat']; + $x_both[$my_coll_rate]['coll']['localtax'.$local] = $x_coll[$my_coll_rate]['localtax'.$local]; $x_both[$my_coll_rate]['paye']['totalht'] = 0; - $x_both[$my_coll_rate]['paye']['vat'] = 0; + $x_both[$my_coll_rate]['paye']['localtax'.$local] = 0; $x_both[$my_coll_rate]['coll']['links'] = ''; $x_both[$my_coll_rate]['coll']['detail'] = array(); foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy) @@ -399,7 +399,7 @@ else print $langs->trans("NotUsedForGoods"); } else { - print $fields['payment_amount']; + print price($fields['payment_amount']); if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)'; } print ''; @@ -559,7 +559,7 @@ else } else { - print $fields['payment_amount']; + print price($fields['payment_amount']); if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)'; } print ''; @@ -637,6 +637,5 @@ else $i++; } -$db->close(); - llxFooter(); +$db->close(); diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index ae217004bbf..b4ae09c6d7d 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -205,371 +205,6 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } } -/** - * Gets LocalTaxes to collect for the given year (and given quarter or month) - * The function gets the LocalTaxes in split results, as the LocalTaxes declaration asks - * to report the amounts for different LocalTaxes rates as different lines. - * - * @param DoliDB $db Database handler object - * @param int $y Year - * @param int $q Quarter - * @param string $date_start Start date - * @param string $date_end End date - * @param int $modetax 0 or 1 (option on debit) - * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) - * @param int $local 1 for LocalTax1, 2 for LocalTax2 - * @param int $m Month - * @return array List of quarters with LocalTaxes - */ -function local_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $local, $m=0) -{ - global $conf; - - $list=array(); - - if ($direction == 'sell') - { - $invoicetable='facture'; - $invoicedettable='facturedet'; - $fk_facture='fk_facture'; - $fk_facture2='fk_facture'; - $fk_payment='fk_paiement'; - $total_tva='total_tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; - $paymenttable='paiement'; - $paymentfacturetable='paiement_facture'; - $invoicefieldref='facnumber'; - $localtax_tx=$local==1?'localtax1_tx':'localtax2_tx'; - } - if ($direction == 'buy') - { - $invoicetable='facture_fourn'; - $invoicedettable='facture_fourn_det'; - $fk_facture='fk_facture_fourn'; - $fk_facture2='fk_facturefourn'; - $fk_payment='fk_paiementfourn'; - $total_tva='tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; - $paymenttable='paiementfourn'; - $paymentfacturetable='paiementfourn_facturefourn'; - $invoicefieldref='ref'; - $localtax_tx=$local==1?'localtax1_tx':'localtax2_tx'; - } - - // BIENS - - // Define sql request - $sql=''; - if ($modetax == 1) // Option on delivery for goods (payment) and debit invoice for services - { - if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) - { - $sql='TODO'; - } - if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) - { - // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx,"; - $sql.= " d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql.= " d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " 0 as payment_id, 0 as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - $sql.= " AND f.rowid = d.".$fk_facture; - if ($y && $m) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND (d.product_type = 0"; // Limit to products - $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture; - } - } - else // Option vat on delivery for goods (payments) and payments for services - { - if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) - { - $sql='TODO'; - } - if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) - { - // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " 0 as payment_id, 0 as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - $sql.= " AND f.rowid = d.".$fk_facture; - if ($y && $m) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND (d.product_type = 0"; // Limit to products - $sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture; - } - } - - if (! $sql) return -1; - if ($sql == 'TODO') return -2; - if ($sql != 'TODO') - { - dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); - - $resql = $db->query($sql); - if ($resql) - { - $lt=-1; - $oldrowid=''; - while($assoc = $db->fetch_array($resql)) - { - if (! isset($list[$assoc['localtax_tx']]['totalht'])) $list[$assoc['localtax_tx']]['totalht']=0; - if (! isset($list[$assoc['localtax_tx']]['vat'])) $list[$assoc['localtax_tx']]['vat']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax1'])) $list[$assoc['localtax_tx']]['localtax1']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax2'])) $list[$assoc['localtax_tx']]['localtax2']=0; - - if ($assoc['rowid'] != $oldrowid) - { - $oldrowid=$assoc['rowid']; - $list[$assoc['localtax_tx']]['totalht'] += $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat'] += $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1'] += $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2'] += $assoc['total_localtax2']; - } - - $list[$assoc['localtax_tx']]['localtax1_tx'] = $assoc['localtax1_tx']; - $list[$assoc['localtax_tx']]['localtax2_tx'] = $assoc['localtax2_tx']; - - $list[$assoc['localtax_tx']]['dtotal_ttc'][] = $assoc['total_ttc']; - $list[$assoc['localtax_tx']]['dtype'][] = $assoc['dtype']; - $list[$assoc['localtax_tx']]['ddate_start'][] = $db->jdate($assoc['date_start']); - $list[$assoc['localtax_tx']]['ddate_end'][] = $db->jdate($assoc['date_end']); - - $list[$assoc['localtax_tx']]['facid'][] = $assoc['facid']; - $list[$assoc['localtax_tx']]['facnum'][] = $assoc['facnum']; - $list[$assoc['localtax_tx']]['type'][] = $assoc['type']; - $list[$assoc['localtax_tx']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; - $list[$assoc['localtax_tx']]['descr'][] = $assoc['descr']; - - $list[$assoc['localtax_tx']]['totalht_list'][] = $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat_list'][] = $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1_list'][] = $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2_list'][] = $assoc['total_localtax2']; - - $list[$assoc['localtax_tx']]['pid'][] = $assoc['pid']; - $list[$assoc['localtax_tx']]['pref'][] = $assoc['pref']; - $list[$assoc['localtax_tx']]['ptype'][] = $assoc['ptype']; - - $list[$assoc['localtax_tx']]['payment_id'][] = $assoc['payment_id']; - $list[$assoc['localtax_tx']]['payment_amount'][] = $assoc['payment_amount']; - - $lt = $assoc['localtax_tx']; - } - } - else - { - dol_print_error($db); - return -3; - } - } - - - //SERVICES - - // Define sql request - $sql=''; - if ($modetax == 1) // Option on delivery for goods (payment) and debit invoice for services - { - if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) - { - $sql='TODO'; - } - if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) - { - // Count on invoice date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " 0 as payment_id, 0 as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - $sql.= " AND f.rowid = d.".$fk_facture; - if ($y && $m) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3)." AND date_format(f.datef,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND (d.product_type = 1"; // Limit to services - $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture; - } - } - else // Option on delivery for goods (payments) and payments for services - { - if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) - { - - $sql='TODO'; - } - if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) - { - // Count on payments date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.".$localtax_tx." as localtax_tx, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; - $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; - $sql.= " d.date_start as date_start, d.date_end as date_end,"; - $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,"; - $sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,"; - $sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount"; - $sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,"; - $sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,"; - $sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,"; - $sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; - $sql.= " WHERE f.entity = " . $conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - $sql.= " AND f.rowid = d.".$fk_facture;; - $sql.= " AND pf.".$fk_facture2." = f.rowid"; - $sql.= " AND pa.rowid = pf.".$fk_payment; - if ($y && $m) - { - $sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'"; - $sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'"; - } - else if ($y) - { - $sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'"; - $sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'"; - } - if ($q) $sql.= " AND (date_format(pa.datep,'%m') > ".(($q-1)*3)." AND date_format(pa.datep,'%m') <= ".($q*3).")"; - if ($date_start && $date_end) $sql.= " AND pa.datep >= ".$db->idate($date_start)." AND pa.datep <= ".$db->idate($date_end); - $sql.= " AND (d.product_type = 1"; // Limit to services - $sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service - $sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid"; - } - } - - if (! $sql) - { - dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR); - return -1; // -1 = Not accountancy module enabled - } - if ($sql == 'TODO') return -2; // -2 = Feature not yet available - if ($sql != 'TODO') - { - dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); - $resql = $db->query($sql); - if ($resql) - { - $lt = -1; - $oldrowid=''; - while($assoc = $db->fetch_array($resql)) - { - if (! isset($list[$assoc['localtax_tx']]['totalht'])) $list[$assoc['localtax_tx']]['totalht']=0; - if (! isset($list[$assoc['localtax_tx']]['vat'])) $list[$assoc['localtax_tx']]['vat']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax1'])) $list[$assoc['localtax_tx']]['localtax1']=0; - if (! isset($list[$assoc['localtax_tx']]['localtax2'])) $list[$assoc['localtax_tx']]['localtax2']=0; - - if ($assoc['rowid'] != $oldrowid) - { - $oldrowid=$assoc['rowid']; - $list[$assoc['localtax_tx']]['totalht'] += $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat'] += $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1'] += $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2'] += $assoc['total_localtax2']; - } - - $list[$assoc['localtax_tx']]['localtax1_tx'] = $assoc['localtax1_tx']; - $list[$assoc['localtax_tx']]['localtax2_tx'] = $assoc['localtax2_tx']; - - $list[$assoc['localtax_tx']]['dtotal_ttc'][] = $assoc['total_ttc']; - $list[$assoc['localtax_tx']]['dtype'][] = $assoc['dtype']; - $list[$assoc['localtax_tx']]['ddate_start'][] = $db->jdate($assoc['date_start']); - $list[$assoc['localtax_tx']]['ddate_end'][] = $db->jdate($assoc['date_end']); - - $list[$assoc['localtax_tx']]['facid'][] = $assoc['facid']; - $list[$assoc['localtax_tx']]['facnum'][] = $assoc['facnum']; - $list[$assoc['localtax_tx']]['type'][] = $assoc['type']; - $list[$assoc['localtax_tx']]['ftotal_ttc'][] = $assoc['ftotal_ttc']; - $list[$assoc['localtax_tx']]['descr'][] = $assoc['descr']; - - $list[$assoc['localtax_tx']]['totalht_list'][] = $assoc['total_ht']; - $list[$assoc['localtax_tx']]['vat_list'][] = $assoc['total_vat']; - $list[$assoc['localtax_tx']]['localtax1_list'][] = $assoc['total_localtax1']; - $list[$assoc['localtax_tx']]['localtax2_list'][] = $assoc['total_localtax2']; - - $list[$assoc['localtax_tx']]['pid'][] = $assoc['pid']; - $list[$assoc['localtax_tx']]['pref'][] = $assoc['pref']; - $list[$assoc['localtax_tx']]['ptype'][] = $assoc['ptype']; - - $list[$assoc['localtax_tx']]['payment_id'][] = $assoc['payment_id']; - $list[$assoc['localtax_tx']]['payment_amount'][] = $assoc['payment_amount']; - - $lt = $assoc['localtax_tx']; - } - } - else - { - dol_print_error($db); - return -3; - } - } - - return $list; - - -} - - /** * Gets VAT to collect for the given year (and given quarter or month) * The function gets the VAT in split results, as the VAT declaration asks From ecbf5996c1b315cd1f0b63f11972e2094f2317b1 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 15 Apr 2016 17:20:37 +0200 Subject: [PATCH 10/78] FIX #4961 --- htdocs/compta/prelevement/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 9dd841e0add..58e7840a7ec 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2010 Laurent Destailleur - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * * 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 @@ -298,7 +298,7 @@ if ($id > 0) $num = $db->num_rows($result); $i = 0; - $urladd = "&id=".$prev_id; + $urladd = "&id=".$id; print_barre_liste("", $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); print"\n\n"; From aa64266c2f0059e679d18db11c5b65cfe26e908b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 16 Apr 2016 18:44:31 +0200 Subject: [PATCH 11/78] FIX #5008 SQL error when editing the reference of a supplier invoice that already exists Close #5008 --- htdocs/fourn/class/fournisseur.facture.class.php | 13 +++++++++++-- htdocs/fourn/facture/card.php | 7 +++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 42418184c4f..a4799bc53fe 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2013 Philippe Grand * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes * * This program is free software; you can redistribute it and/or modify @@ -646,7 +646,16 @@ class FactureFournisseur extends CommonInvoice dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (!$resql) { + $error++; + + if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $this->errors[] = $langs->trans('ErrorRefAlreadyExists'); + } else { + $this->errors[] = "Error ".$this->db->lasterror(); + } + } if (! $error) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f70ca50c902..d8e8cbe39e3 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -238,8 +238,11 @@ if (empty($reshook)) // Set supplier ref if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) { - $result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha')); - if ($result < 0) dol_print_error($db, $object->error); + $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); + + if ($object->update() < 0) { + setEventMessage($object->error, 'errors'); + } } // conditions de reglement From 09528cccaf7d2752efb9af20d7ba4814632f6ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 17 Apr 2016 19:14:48 +0200 Subject: [PATCH 12/78] Update printsheet.php --- htdocs/barcode/printsheet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index bb3934625b6..81533de82ae 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -62,7 +62,7 @@ if (GETPOST('submitproduct') && GETPOST('submitproduct')) { $producttmp->fetch(GETPOST('productid')); $forbarcode=$producttmp->barcode; - $fk_barcode_type=$thirdpartytmp->barcode_type_code; + $fk_barcode_type=$producttmp->barcode_type; if (empty($fk_barcode_type) && ! empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; From 3db34a723d1eaaee2553825e2680579f879535d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Apr 2016 00:55:12 +0200 Subject: [PATCH 13/78] Update style.css.php --- htdocs/theme/eldy/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 0314ce7b928..f474c4463d8 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -103,7 +103,7 @@ $useboldtitle=1; if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody; if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='120,130,170'; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; -if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=='238,246,252'; +if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER='238,246,252'; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; From 0a52abab5df8cca431a71f9f4cecf1f5bd06ad90 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Apr 2016 13:38:32 +0200 Subject: [PATCH 14/78] Fix: broken multicompany transverse mode authentication feature --- htdocs/user/class/user.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 85f340b1cb1..1ee07e0a7af 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -207,7 +207,10 @@ class User extends CommonObject } else // The fetch was forced on an entity { - $sql.= " WHERE u.entity IN (0, ".$conf->entity.")"; + if (!empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode)) + $sql.= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database + else + $sql.= " WHERE u.entity IN (0, ".$conf->entity.")"; } if ($sid) // permet une recherche du user par son SID ActiveDirectory ou Samba From 79f408feebde0f24599c9a9e9ff24acae73f199d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 20 Apr 2016 17:17:03 +0200 Subject: [PATCH 15/78] FIX : When cloning an order the order result from clone must be now --- htdocs/commande/class/commande.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f184e6f6358..af73be2330d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -985,6 +985,7 @@ class Commande extends CommonOrder $this->user_author_id = $user->id; $this->user_valid = ''; $this->date = dol_now(); + $this->date_commande = dol_now(); $this->date_creation = ''; $this->date_validation = ''; $this->ref_client = ''; @@ -1253,7 +1254,7 @@ class Commande extends CommonOrder $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc); $txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate. - + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -1386,7 +1387,7 @@ class Commande extends CommonOrder if (empty($tva_tx)) $tva_npr=0; $localtax1_tx=get_localtax($tva_tx,1,$this->client,$mysoc,$tva_npr); $localtax2_tx=get_localtax($tva_tx,2,$this->client,$mysoc,$tva_npr); - + // multiprix if($conf->global->PRODUIT_MULTIPRICES && $this->client->price_level) $price = $prod->multiprices[$this->client->price_level]; @@ -2481,7 +2482,7 @@ class Commande extends CommonOrder $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); $txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate. - + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -2918,7 +2919,7 @@ class Commande extends CommonOrder function LibStatut($statut,$billed,$mode,$donotshowbilled=0) { global $langs, $conf; - + $billedtext = ''; if (empty($donotshowbilled)) $billedtext .= ($billed?' - '.$langs->trans("Billed"):''); From e1d55d280eab94778ffe3092f2c57a829a01d42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 20 Apr 2016 22:29:27 +0200 Subject: [PATCH 16/78] Update printgcp.modules.php --- .../modules/printing/printgcp.modules.php | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 5177e108f40..610df641deb 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -65,52 +65,52 @@ class printing_printgcp extends PrintingDriver $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - $this->db = $db; - $this->google_id = $conf->global->OAUTH_GOOGLE_ID; - $this->google_secret = $conf->global->OAUTH_GOOGLE_SECRET; - // Token storage - $storage = new DoliStorage($this->db, $this->conf); - //$storage->clearToken('Google'); - // Setup the credentials for the requests - $credentials = new Credentials( - $this->google_id, - $this->google_secret, - $urlwithroot.'/core/modules/oauth/google_oauthcallback.php' - ); - $access = ($storage->hasAccessToken('Google')?'HasAccessToken':'NoAccessToken'); - $serviceFactory = new \OAuth\ServiceFactory(); - $apiService = $serviceFactory->createService('Google', $credentials, $storage, array()); - $token_ok=true; - try { - $token = $storage->retrieveAccessToken('Google'); - } catch (Exception $e) { - $this->errors[] = $e->getMessage(); - $token_ok = false; - } - //var_dump($this->errors);exit; - - $expire = false; - // Is token expired or will token expire in the next 30 seconds - if ($token_ok) { - $expire = ($token->getEndOfLife() !== -9002 && $token->getEndOfLife() !== -9001 && time() > ($token->getEndOfLife() - 30)); - } - - // Token expired so we refresh it - if ($token_ok && $expire) { - try { - // il faut sauvegarder le refresh token car google ne le donne qu'une seule fois - $refreshtoken = $token->getRefreshToken(); - $token = $apiService->refreshAccessToken($token); - $token->setRefreshToken($refreshtoken); - $storage->storeAccessToken('Google', $token); - } catch (Exception $e) { - $this->errors[] = $e->getMessage(); - } - } if (!$conf->oauth->enabled) { $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'ModuleAuthNotActive', 'type'=>'info'); } else { + $this->db = $db; + $this->google_id = $conf->global->OAUTH_GOOGLE_ID; + $this->google_secret = $conf->global->OAUTH_GOOGLE_SECRET; + // Token storage + $storage = new DoliStorage($this->db, $this->conf); + //$storage->clearToken('Google'); + // Setup the credentials for the requests + $credentials = new Credentials( + $this->google_id, + $this->google_secret, + $urlwithroot.'/core/modules/oauth/google_oauthcallback.php' + ); + $access = ($storage->hasAccessToken('Google')?'HasAccessToken':'NoAccessToken'); + $serviceFactory = new \OAuth\ServiceFactory(); + $apiService = $serviceFactory->createService('Google', $credentials, $storage, array()); + $token_ok=true; + try { + $token = $storage->retrieveAccessToken('Google'); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + $token_ok = false; + } + //var_dump($this->errors);exit; + + $expire = false; + // Is token expired or will token expire in the next 30 seconds + if ($token_ok) { + $expire = ($token->getEndOfLife() !== -9002 && $token->getEndOfLife() !== -9001 && time() > ($token->getEndOfLife() - 30)); + } + + // Token expired so we refresh it + if ($token_ok && $expire) { + try { + // il faut sauvegarder le refresh token car google ne le donne qu'une seule fois + $refreshtoken = $token->getRefreshToken(); + $token = $apiService->refreshAccessToken($token); + $token->setRefreshToken($refreshtoken); + $storage->storeAccessToken('Google', $token); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } + } if ($this->google_id != '' && $this->google_secret != '') { $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'GoogleAuthConfigured', 'type'=>'info'); $this->conf[] = array('varname'=>'PRINTGCP_TOKEN_ACCESS', 'info'=>$access, 'type'=>'info', 'renew'=>$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?state=userinfo_email,userinfo_profile,cloud_print&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'), 'delete'=>($storage->hasAccessToken('Google')?$urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/printing/admin/printing.php?mode=setup&driver=printgcp'):'')); From e3e2b8750624063ca92a8ae288e3548df93a5cdc Mon Sep 17 00:00:00 2001 From: Philippe-OpenDSI Date: Wed, 20 Apr 2016 13:59:13 +0200 Subject: [PATCH 17/78] Product supplier list display only one product Last parameter of select_produits_fournisseurs_list is $limit, not $socidif --- htdocs/product/ajax/products.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index c17fdb65aea..05efcc24a0e 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -183,7 +183,7 @@ if (! empty($action) && $action == 'fetch' && ! empty($id)) if (empty($mode) || $mode == 1) { $arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, $finished, $outjson, $socid); } elseif ($mode == 2) { - $arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, $socid); + $arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson); } $db->close(); From d043c9ce80be068239eb010877d5d4f3568f8d15 Mon Sep 17 00:00:00 2001 From: placid0w Date: Wed, 20 Apr 2016 15:43:14 -0300 Subject: [PATCH 18/78] Fix #5054 --- htdocs/webservices/server_productorservice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 2e3314fff12..43facbb24fa 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -374,7 +374,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='' $product->load_stock(); $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output); - $pdir = get_exdir($product->id,2,0,0,$product,'product') . $product->id ."/photos/"; + $pdir = get_exdir($product->id,2,0,0,$product,'product') . $product->ref . "/"; $dir = $dir . '/'. $pdir; if (! empty($product->multilangs[$langs->defaultlang]["label"])) $product->label = $product->multilangs[$langs->defaultlang]["label"]; From fd9fb505b97230bd3514c16e33c4d7d75cc2e9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Apr 2016 07:53:22 +0200 Subject: [PATCH 19/78] Update printgcp.modules.php --- htdocs/core/modules/printing/printgcp.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 610df641deb..3911c4d6be2 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -64,12 +64,12 @@ class printing_printgcp extends PrintingDriver $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + $this->db = $db; if (!$conf->oauth->enabled) { $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'ModuleAuthNotActive', 'type'=>'info'); } else { - $this->db = $db; $this->google_id = $conf->global->OAUTH_GOOGLE_ID; $this->google_secret = $conf->global->OAUTH_GOOGLE_SECRET; // Token storage From 2fc876f60773cc8d49f51f2768bc6634a962d7ca Mon Sep 17 00:00:00 2001 From: Philippe-OpenDSI Date: Thu, 21 Apr 2016 08:41:45 +0200 Subject: [PATCH 20/78] FIX #5048 Product supplier list display only one produc Last parameter of select_produits_fournisseurs_list is $limit, not $socid --- htdocs/product/ajax/products.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index c17fdb65aea..05efcc24a0e 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -183,7 +183,7 @@ if (! empty($action) && $action == 'fetch' && ! empty($id)) if (empty($mode) || $mode == 1) { $arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, $finished, $outjson, $socid); } elseif ($mode == 2) { - $arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, $socid); + $arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson); } $db->close(); From 0ef1be93642d66a110d881ab78cd5852b2526a8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Apr 2016 18:07:34 +0200 Subject: [PATCH 21/78] Prepare 3.9.1 --- ChangeLog | 65 +++++++++++++++++++++++++++++++++++++++++ htdocs/filefunc.inc.php | 2 +- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 84d05ba8ea7..120c19ca5e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,71 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 3.9.1 compared to 3.9.* ***** +FIX: #3815 Call to undefined function local_by_date(). +FIX: #3815 With higher quality +FIX: #4424 Missing email of user popup in supplier orders area +FIX: #4442 Missing translation in Banks menu +FIX: #4737 Bank transacion type selector translation is cropped +FIX: #4742 Able to delete a supplier invoice with a registered payment +FIX: #4743 UI glitch in project summary page +FIX: #4747 Missing UI background when registering a supplier invoice payment +FIX: #4748 Supplier invoice payment confirmation amount is not translated +FIX: #4766 VAT not shown in supplier invoice popup +FIX: #4784 +FIX: #4809 Duplicate functions with different content +FIX: #4812 +FIX: #4839 +FIX: #4851 Project selector in supplier invoices shows the project label twice +FIX: #4870 +FIX: #4874 SQL error when listing users +FIX: #4880 +FIX: #4961 +FIX: #4989 +FIX: A not enabled field for list must not into fields to add +FIX: Bad color of message password changed +FIX: Bad error and style message when changing its own login +FIX: Bad function name call on delete +FIX: Bad include and param for project numbering module call +FIX: bad translation language loaded FIX: When changing thirdparty on event card, the showempty option of contact was lost. FIX: Bad placeholder shown on combo to select a thirdparty. +FIX: Bad vat definition when using POS module +FIX: Box disabled because bugged +FIX: Can not select a commercial on the creation of a third +FIX: Check of EAN13 barcode when mask was set to use 13 digits instead of 12 +FIX: correct display of minimum buying price +FIX: Creation of thumb image for size "small" was not done. +FIX: Damn, where was the project ref ? +FIX: Default vat is not set correctly when an error occured and we use VAT identified by a code. +FIX: dont retrieve new buying price on margin display +FIX: Duplicate records into export +FIX: Each time we edit a line, we loose the unit price. +FIX: Email templates not compatible with Multicompany +FIX: Export must use a left join to not loose lines +FIX: fetchAllEMailTemplate +FIX: Filter/search on extrafields on lists +FIX: finished parameters not used +FIX: Generated thumbs must always use the png format so using thumbs can work. +FIX: Hook resprint be printed +FIX: image extension must be in lower case +FIX: Missing clean of criteria +FIX: Missing database escaping on supplier price insert/update +FIX: Missing function +FIX: Multiprice generator didn't recalculate prices if only the price_base_type property changes +FIX: Not removing code into vatrate. +FIX: Not showing sellprice properly on product list +FIX: Parsing of amount to pay vat +FIX: PHPCS +FIX: PMP is deprecated at warehouse level +FIX: real min buying price +FIX: Same term to create than other objects +FIX: Some records were lost into margin per product report +FIX: systematic rounding causes prices to be updated without reason +FIX: Template email must take care of positino column +FIX: VAT rate can be negative. Example spain selling to morroco. +FIX: When cloning an order the order result from clone must be now +FIX: When using option Price per level, when adding a predefined product, the vat for customer was not correctly set. + + ***** ChangeLog for 3.9.0 compared to 3.8.* ***** For users: NEW: A new and more modern look for "eldy" theme. diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index bf7357fb2e1..db8a5869914 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.0'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.1'); if (! defined('EURO')) define('EURO',chr(128)); From 980f3d522fbfd01d4f67bce8a6cfcd7552f546da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Apr 2016 20:09:42 +0200 Subject: [PATCH 22/78] Prepare 3.9.1 --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 120c19ca5e7..2ab1185a65c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,8 +13,7 @@ make a Dolibarr upgrade. ***** ChangeLog for 3.9.1 compared to 3.9.* ***** -FIX: #3815 Call to undefined function local_by_date(). -FIX: #3815 With higher quality +FIX: #3815 Call to undefined function local_by_date() FIX: #4424 Missing email of user popup in supplier orders area FIX: #4442 Missing translation in Banks menu FIX: #4737 Bank transacion type selector translation is cropped @@ -33,6 +32,7 @@ FIX: #4874 SQL error when listing users FIX: #4880 FIX: #4961 FIX: #4989 +FIX: If oauth has never been activated two tables are missing and printing is not working FIX: A not enabled field for list must not into fields to add FIX: Bad color of message password changed FIX: Bad error and style message when changing its own login From 867649e9224418d384e98773824f94460cc3b312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garc=C3=ADa=20de=20La=20Fuente?= Date: Sat, 23 Apr 2016 13:36:12 +0200 Subject: [PATCH 23/78] FIX #4813 Won translation for the key OppStatusWON instead OppStatusWIN Close #4813 --- htdocs/langs/ar_SA/projects.lang | 2 +- htdocs/langs/bn_BD/projects.lang | 2 +- htdocs/langs/bs_BA/projects.lang | 2 +- htdocs/langs/ca_ES/projects.lang | 2 +- htdocs/langs/cs_CZ/projects.lang | 2 +- htdocs/langs/da_DK/projects.lang | 2 +- htdocs/langs/de_DE/projects.lang | 2 +- htdocs/langs/en_US/projects.lang | 2 +- htdocs/langs/es_ES/projects.lang | 2 +- htdocs/langs/et_EE/projects.lang | 2 +- htdocs/langs/eu_ES/projects.lang | 2 +- htdocs/langs/fi_FI/projects.lang | 2 +- htdocs/langs/fr_FR/projects.lang | 2 +- htdocs/langs/he_IL/projects.lang | 2 +- htdocs/langs/hr_HR/projects.lang | 2 +- htdocs/langs/hu_HU/projects.lang | 2 +- htdocs/langs/id_ID/projects.lang | 2 +- htdocs/langs/is_IS/projects.lang | 2 +- htdocs/langs/it_IT/projects.lang | 2 +- htdocs/langs/ka_GE/projects.lang | 2 +- htdocs/langs/kn_IN/projects.lang | 2 +- htdocs/langs/ko_KR/projects.lang | 2 +- htdocs/langs/lo_LA/projects.lang | 2 +- htdocs/langs/lt_LT/projects.lang | 2 +- htdocs/langs/lv_LV/projects.lang | 2 +- htdocs/langs/mk_MK/projects.lang | 2 +- htdocs/langs/nb_NO/projects.lang | 2 +- htdocs/langs/nl_NL/projects.lang | 2 +- htdocs/langs/pl_PL/projects.lang | 2 +- htdocs/langs/pt_BR/projects.lang | 2 +- htdocs/langs/pt_PT/projects.lang | 2 +- htdocs/langs/ro_RO/projects.lang | 2 +- htdocs/langs/ru_RU/projects.lang | 2 +- htdocs/langs/sk_SK/projects.lang | 2 +- htdocs/langs/sl_SI/projects.lang | 2 +- htdocs/langs/sq_AL/projects.lang | 2 +- htdocs/langs/sr_RS/projects.lang | 2 +- htdocs/langs/sv_SE/projects.lang | 2 +- htdocs/langs/sw_SW/projects.lang | 2 +- htdocs/langs/tr_TR/projects.lang | 2 +- htdocs/langs/uk_UA/projects.lang | 2 +- htdocs/langs/uz_UZ/projects.lang | 2 +- htdocs/langs/vi_VN/projects.lang | 2 +- htdocs/langs/zh_CN/projects.lang | 2 +- htdocs/langs/zh_TW/projects.lang | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/htdocs/langs/ar_SA/projects.lang b/htdocs/langs/ar_SA/projects.lang index bdd7967374a..ab322a4bd05 100644 --- a/htdocs/langs/ar_SA/projects.lang +++ b/htdocs/langs/ar_SA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=المؤهل العلمى OppStatusPROPO=مقترح OppStatusNEGO=Negociation OppStatusPENDING=بانتظار -OppStatusWIN=فاز +OppStatusWON=فاز OppStatusLOST=ضائع Budget=Budget diff --git a/htdocs/langs/bn_BD/projects.lang b/htdocs/langs/bn_BD/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/bn_BD/projects.lang +++ b/htdocs/langs/bn_BD/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/bs_BA/projects.lang b/htdocs/langs/bs_BA/projects.lang index 0b25f6ea67a..fdfcbd408e5 100644 --- a/htdocs/langs/bs_BA/projects.lang +++ b/htdocs/langs/bs_BA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ca_ES/projects.lang b/htdocs/langs/ca_ES/projects.lang index 5c2f18593cb..91c1a7cc9db 100644 --- a/htdocs/langs/ca_ES/projects.lang +++ b/htdocs/langs/ca_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualificació OppStatusPROPO=Pressupost OppStatusNEGO=Negociació OppStatusPENDING=Pendent -OppStatusWIN=Guanyat +OppStatusWON=Guanyat OppStatusLOST=Perdut Budget=Budget diff --git a/htdocs/langs/cs_CZ/projects.lang b/htdocs/langs/cs_CZ/projects.lang index 14b67dbb918..cdc3743aee4 100644 --- a/htdocs/langs/cs_CZ/projects.lang +++ b/htdocs/langs/cs_CZ/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/da_DK/projects.lang b/htdocs/langs/da_DK/projects.lang index 0c7ed16673b..618a6e5dc47 100644 --- a/htdocs/langs/da_DK/projects.lang +++ b/htdocs/langs/da_DK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/de_DE/projects.lang b/htdocs/langs/de_DE/projects.lang index 15fc4080190..c1d58f6d3d6 100644 --- a/htdocs/langs/de_DE/projects.lang +++ b/htdocs/langs/de_DE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualifikation OppStatusPROPO=Angebot OppStatusNEGO=Verhandlung OppStatusPENDING=Anstehend -OppStatusWIN=Gewonnen +OppStatusWON=Gewonnen OppStatusLOST=Verloren Budget=Budget diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 979fd4670bb..c68bd370f5a 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -190,6 +190,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget \ No newline at end of file diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index b0965bd080c..3a9fd407875 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Cualificación OppStatusPROPO=Presupuesto OppStatusNEGO=Negociación OppStatusPENDING=Pendiente -OppStatusWIN=Ganado +OppStatusWON=Ganado OppStatusLOST=Perdido Budget=Budget diff --git a/htdocs/langs/et_EE/projects.lang b/htdocs/langs/et_EE/projects.lang index 7c53e51f80d..31f516ada14 100644 --- a/htdocs/langs/et_EE/projects.lang +++ b/htdocs/langs/et_EE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/eu_ES/projects.lang b/htdocs/langs/eu_ES/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/eu_ES/projects.lang +++ b/htdocs/langs/eu_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/fi_FI/projects.lang b/htdocs/langs/fi_FI/projects.lang index fea93953f69..50177fda449 100644 --- a/htdocs/langs/fi_FI/projects.lang +++ b/htdocs/langs/fi_FI/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index b95fbb3cd56..6389d10abbf 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposition OppStatusNEGO=Négociation OppStatusPENDING=En attente -OppStatusWIN=Gagné +OppStatusWON=Gagné OppStatusLOST=Perdu Budget=Budget diff --git a/htdocs/langs/he_IL/projects.lang b/htdocs/langs/he_IL/projects.lang index fb939aef169..ee8785e6397 100644 --- a/htdocs/langs/he_IL/projects.lang +++ b/htdocs/langs/he_IL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/hr_HR/projects.lang b/htdocs/langs/hr_HR/projects.lang index 7dae3662584..bd83a40224d 100644 --- a/htdocs/langs/hr_HR/projects.lang +++ b/htdocs/langs/hr_HR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/hu_HU/projects.lang b/htdocs/langs/hu_HU/projects.lang index 9ab8ab13b05..20a6f143d2a 100644 --- a/htdocs/langs/hu_HU/projects.lang +++ b/htdocs/langs/hu_HU/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/id_ID/projects.lang b/htdocs/langs/id_ID/projects.lang index 83a284cc58c..13798a28b3c 100644 --- a/htdocs/langs/id_ID/projects.lang +++ b/htdocs/langs/id_ID/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/is_IS/projects.lang b/htdocs/langs/is_IS/projects.lang index d41a345caf3..517ab7e2e84 100644 --- a/htdocs/langs/is_IS/projects.lang +++ b/htdocs/langs/is_IS/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/it_IT/projects.lang b/htdocs/langs/it_IT/projects.lang index 9954fb68fd2..8599f5089b5 100644 --- a/htdocs/langs/it_IT/projects.lang +++ b/htdocs/langs/it_IT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualificazione OppStatusPROPO=Proposta OppStatusNEGO=Negoziazione OppStatusPENDING=In attesa -OppStatusWIN=Vinto +OppStatusWON=Vinto OppStatusLOST=Perso Budget=Budget diff --git a/htdocs/langs/ka_GE/projects.lang b/htdocs/langs/ka_GE/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/ka_GE/projects.lang +++ b/htdocs/langs/ka_GE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/kn_IN/projects.lang b/htdocs/langs/kn_IN/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/kn_IN/projects.lang +++ b/htdocs/langs/kn_IN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ko_KR/projects.lang b/htdocs/langs/ko_KR/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/ko_KR/projects.lang +++ b/htdocs/langs/ko_KR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lo_LA/projects.lang b/htdocs/langs/lo_LA/projects.lang index 56cc02c9e82..52ca66a2763 100644 --- a/htdocs/langs/lo_LA/projects.lang +++ b/htdocs/langs/lo_LA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lt_LT/projects.lang b/htdocs/langs/lt_LT/projects.lang index 6398f58b129..bc9adc0ef7f 100644 --- a/htdocs/langs/lt_LT/projects.lang +++ b/htdocs/langs/lt_LT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lv_LV/projects.lang b/htdocs/langs/lv_LV/projects.lang index d04ece7b84f..000139e853c 100644 --- a/htdocs/langs/lv_LV/projects.lang +++ b/htdocs/langs/lv_LV/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikācija OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/mk_MK/projects.lang b/htdocs/langs/mk_MK/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/mk_MK/projects.lang +++ b/htdocs/langs/mk_MK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/nb_NO/projects.lang b/htdocs/langs/nb_NO/projects.lang index c57648d77d1..c69d3c47ee4 100644 --- a/htdocs/langs/nb_NO/projects.lang +++ b/htdocs/langs/nb_NO/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikasjon OppStatusPROPO=Tilbud OppStatusNEGO=Forhandling OppStatusPENDING=Venter -OppStatusWIN=Vunnet +OppStatusWON=Vunnet OppStatusLOST=Tapt Budget=Budget diff --git a/htdocs/langs/nl_NL/projects.lang b/htdocs/langs/nl_NL/projects.lang index 93514bd4108..8cf1a0d4684 100644 --- a/htdocs/langs/nl_NL/projects.lang +++ b/htdocs/langs/nl_NL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/pl_PL/projects.lang b/htdocs/langs/pl_PL/projects.lang index 1479193a7cc..429a664d293 100644 --- a/htdocs/langs/pl_PL/projects.lang +++ b/htdocs/langs/pl_PL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kwalifikacja OppStatusPROPO=Wniosek OppStatusNEGO=Negocjacje OppStatusPENDING=W oczekiwaniu -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Zagubiony Budget=Budget diff --git a/htdocs/langs/pt_BR/projects.lang b/htdocs/langs/pt_BR/projects.lang index f8ae458330b..ab92118d1e4 100644 --- a/htdocs/langs/pt_BR/projects.lang +++ b/htdocs/langs/pt_BR/projects.lang @@ -125,5 +125,5 @@ OppStatusQUAL=Qualificação OppStatusPROPO=Proposta OppStatusNEGO=Negociação OppStatusPENDING=Pendente -OppStatusWIN=Ganhou +OppStatusWON=Ganhou OppStatusLOST=Perdido diff --git a/htdocs/langs/pt_PT/projects.lang b/htdocs/langs/pt_PT/projects.lang index c6bc715fada..2df744a5013 100644 --- a/htdocs/langs/pt_PT/projects.lang +++ b/htdocs/langs/pt_PT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ro_RO/projects.lang b/htdocs/langs/ro_RO/projects.lang index 301c6242d24..c6fc6cb74e0 100644 --- a/htdocs/langs/ro_RO/projects.lang +++ b/htdocs/langs/ro_RO/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Calificare OppStatusPROPO=Ofertă OppStatusNEGO=Negociere OppStatusPENDING=In asteptarea -OppStatusWIN=Castigat +OppStatusWON=Castigat OppStatusLOST=Pierdut Budget=Budget diff --git a/htdocs/langs/ru_RU/projects.lang b/htdocs/langs/ru_RU/projects.lang index 27c4995d20d..bdee2d2d019 100644 --- a/htdocs/langs/ru_RU/projects.lang +++ b/htdocs/langs/ru_RU/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sk_SK/projects.lang b/htdocs/langs/sk_SK/projects.lang index 6453fec2772..579d69f1323 100644 --- a/htdocs/langs/sk_SK/projects.lang +++ b/htdocs/langs/sk_SK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sl_SI/projects.lang b/htdocs/langs/sl_SI/projects.lang index 81c1c01c46d..38c773a95bb 100644 --- a/htdocs/langs/sl_SI/projects.lang +++ b/htdocs/langs/sl_SI/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sq_AL/projects.lang b/htdocs/langs/sq_AL/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/sq_AL/projects.lang +++ b/htdocs/langs/sq_AL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sr_RS/projects.lang b/htdocs/langs/sr_RS/projects.lang index 8ba6046454e..553b7ec80af 100644 --- a/htdocs/langs/sr_RS/projects.lang +++ b/htdocs/langs/sr_RS/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikacija OppStatusPROPO=Ponuda OppStatusNEGO=Pregovaranje OppStatusPENDING=Na čekanju -OppStatusWIN=Dobijeno +OppStatusWON=Dobijeno OppStatusLOST=Izgubljeno Budget=Budget diff --git a/htdocs/langs/sv_SE/projects.lang b/htdocs/langs/sv_SE/projects.lang index 77be1874eb2..a75da531dd3 100644 --- a/htdocs/langs/sv_SE/projects.lang +++ b/htdocs/langs/sv_SE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sw_SW/projects.lang b/htdocs/langs/sw_SW/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/sw_SW/projects.lang +++ b/htdocs/langs/sw_SW/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/tr_TR/projects.lang b/htdocs/langs/tr_TR/projects.lang index dbdfcadfce7..b4a54871c5a 100644 --- a/htdocs/langs/tr_TR/projects.lang +++ b/htdocs/langs/tr_TR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Nitelendirme OppStatusPROPO=Teklif OppStatusNEGO=Pazarlık OppStatusPENDING=Beklemede -OppStatusWIN=Kazanç +OppStatusWON=Kazanç OppStatusLOST=Kayıp Budget=Budget diff --git a/htdocs/langs/uk_UA/projects.lang b/htdocs/langs/uk_UA/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/uk_UA/projects.lang +++ b/htdocs/langs/uk_UA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/uz_UZ/projects.lang b/htdocs/langs/uz_UZ/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/uz_UZ/projects.lang +++ b/htdocs/langs/uz_UZ/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/vi_VN/projects.lang b/htdocs/langs/vi_VN/projects.lang index 174b4a88dc1..7af08a9a5bc 100644 --- a/htdocs/langs/vi_VN/projects.lang +++ b/htdocs/langs/vi_VN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/zh_CN/projects.lang b/htdocs/langs/zh_CN/projects.lang index bbd8b5cf27d..070c15647e6 100644 --- a/htdocs/langs/zh_CN/projects.lang +++ b/htdocs/langs/zh_CN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/zh_TW/projects.lang b/htdocs/langs/zh_TW/projects.lang index 2599ab48413..2519f38c954 100644 --- a/htdocs/langs/zh_TW/projects.lang +++ b/htdocs/langs/zh_TW/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget From d98e50e6615c9aef3c6eb53ec3d749c3ab21f657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garc=C3=ADa=20de=20La=20Fuente?= Date: Sat, 23 Apr 2016 13:44:43 +0200 Subject: [PATCH 24/78] Little change --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d8e8cbe39e3..1552a1aa0be 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -241,7 +241,7 @@ if (empty($reshook)) $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); if ($object->update() < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } From 1746f8f96cd94aaa94035071476901c3b4d3e561 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Mon, 25 Apr 2016 11:25:49 +0200 Subject: [PATCH 25/78] FIX search on date into supplier invoice list dont work because of status -1 --- htdocs/fourn/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8704e781a30..58a503feec9 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -206,7 +206,7 @@ if ($search_amount_all_tax != '') $sql .= natural_search('fac.total_ttc', $search_amount_all_tax, 1); } -if ($search_status != '') +if ($search_status != '' && $search_status>=0) { $sql.= " AND fac.fk_statut = ".$search_status; } From 2a0c508d475d7a06b9ee6526aa097d39e88dfd01 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 25 Apr 2016 11:26:13 +0200 Subject: [PATCH 26/78] FIX: end of select when no fournprice --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 01c60780074..83b3c389d97 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2160,10 +2160,10 @@ class Form $form.= $opt; $i++; } - $form.= ''; - - $this->db->free($result); } + + $form.= ''; + $this->db->free($result); return $form; } else From bfbb1c20bcc92a383fb64e04a1248e33937e1e9c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 27 Apr 2016 09:27:59 +0200 Subject: [PATCH 27/78] FIX bug on email template --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9af2b3fe0af..f84e1913f1a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -229,7 +229,7 @@ $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[24]= "code,label"; -$tabfield[25]= "label,type_template,position,topic,content"; +$tabfield[25]= "label,type_template,private,position,topic,content"; $tabfield[26]= "code,label,short_label"; $tabfield[27]= "code,libelle"; $tabfield[28]= "code,label,delay,newByMonth,country_id,country"; @@ -261,7 +261,7 @@ $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; $tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[24]= "code,label"; -$tabfieldvalue[25]= "label,type_template,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; $tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27]= "code,libelle"; $tabfieldvalue[28]= "code,label,delay,newByMonth,country"; From 77fcbd3884f93e3131dd033179105882d6380ac6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Apr 2016 12:34:52 +0200 Subject: [PATCH 28/78] FIX: init var at wrong place report incorrect "shippable" flag on draft order. --- htdocs/commande/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d26c5dea5dd..cfb8486be6f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -429,15 +429,15 @@ if ($resql) // Show shippable Icon (create subloop, so may be slow) if ($conf->stock->enabled) { + $notshippable=0; + $warning = 0; + $text_info=''; + $text_warning=''; + $nbprod=0; + $langs->load("stocks"); if (($objp->fk_statut > 0) && ($objp->fk_statut < 3)) { - $notshippable=0; - $warning = 0; - $text_info=''; - $text_warning=''; - $nbprod=0; - $numlines = count($generic_commande->lines); // Loop on each line of order for ($lig=0; $lig < $numlines; $lig++) { From 0a67614e7291a80da711f034da097ea648e79a5f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 28 Apr 2016 09:10:22 +0200 Subject: [PATCH 29/78] Fix wrong qty total in ca by prod/serv report --- htdocs/compta/stats/cabyprodserv.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index e995b06aa6b..07727b02a81 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -177,6 +177,8 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl // SQL request $catotal=0; +$catotal_ht=0; +$qtytotal=0; if ($modecompta == 'CREANCES-DETTES') { @@ -386,6 +388,8 @@ if ($modecompta == 'CREANCES-DETTES') // Total print ''; print ''; + print ''; + print ''; print ''; print ''; print ''; From 73806767171cea2b86181bba075eec3386a4eb42 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 28 Apr 2016 10:25:55 +0200 Subject: [PATCH 30/78] Fix: Not filtering correctly on supplier invoice's list --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index 7e922c7059a..b2a130e7bca 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -440,7 +440,7 @@ if (! empty($conf->fournisseur->enabled) && ! empty($conf->facture->enabled) && $board->load_board($user); $board->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $board->label=$langs->trans("SupplierBillsToPay"); - $board->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=paye:0'; + $board->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=paye:0,fk_statut:1'; $board->img=img_object($langs->trans("Bills"),"bill"); $rowspan++; $dashboardlines[]=$board; From d599261d209b63b1013fe55b33917d3a1f434e01 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Thu, 28 Apr 2016 10:38:50 +0200 Subject: [PATCH 31/78] FIX: Not filtering correctly when come from dashboard --- htdocs/fourn/facture/list.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8704e781a30..ec9d15e12e8 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -81,6 +81,7 @@ $year = GETPOST("year","int"); $day_lim = GETPOST('day_lim','int'); $month_lim = GETPOST('month_lim','int'); $year_lim = GETPOST('year_lim','int'); +$filter = GETPOST("filtre"); if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers { @@ -210,6 +211,15 @@ if ($search_status != '') { $sql.= " AND fac.fk_statut = ".$search_status; } +if ($filter && $filter != -1) +{ + $aFilter = explode(',', $filter); + foreach ($aFilter as $fil) + { + $filt = explode(':', $fil); + $sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]); + } +} $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) From e96e0f637ae50e8967493f82fae5d42749da5c31 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Thu, 28 Apr 2016 10:41:37 +0200 Subject: [PATCH 32/78] FIX: Not filtering correctly when come from dashboard --- htdocs/fourn/facture/list.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index aba66991eec..9c945f01410 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -229,6 +229,15 @@ if ($search_status != '') { $sql.= " AND fac.fk_statut = ".$search_status; } +if ($filter && $filter != -1) +{ + $aFilter = explode(',', $filter); + foreach ($aFilter as $fil) + { + $filt = explode(':', $fil); + $sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]); + } +} $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) From 608c93702d1216e255e5264e26df697a13c075d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Apr 2016 11:05:34 +0200 Subject: [PATCH 33/78] FIX Can't create a stock transfer from product card --- htdocs/product/stock/product.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 42fadf54923..e6477fadf69 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -185,7 +185,7 @@ if ($action == "correct_stock" && ! $cancel) // Transfer stock from a warehouse to another warehouse if ($action == "transfert_stock" && ! $cancel) { - if (! (GETPOST("id_entrepot_source",'int') > 0) || ! (GETPOST("id_entrepot_destination",'int') > 0)) + if (! (GETPOST("id_entrepot",'int') > 0) || ! (GETPOST("id_entrepot_destination",'int') > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; @@ -197,7 +197,7 @@ if ($action == "transfert_stock" && ! $cancel) $error++; $action='transfert'; } - if (GETPOST("id_entrepot_source",'int') == GETPOST("id_entrepot_destination",'int')) + if (GETPOST("id_entrepot",'int') == GETPOST("id_entrepot_destination",'int')) { setEventMessages($langs->trans("ErrorSrcAndTargetWarehouseMustDiffers"), null, 'errors'); $error++; @@ -255,7 +255,7 @@ if ($action == "transfert_stock" && ! $cancel) } else { - $srcwarehouseid=GETPOST('id_entrepot_source','int'); + $srcwarehouseid=GETPOST('id_entrepot','int'); $batch=GETPOST('batch_number'); $eatby=$d_eatby; $sellby=$d_sellby; @@ -292,7 +292,7 @@ if ($action == "transfert_stock" && ! $cancel) // Remove stock $result1=$object->correct_stock( $user, - GETPOST("id_entrepot_source"), + GETPOST("id_entrepot"), GETPOST("nbpiece"), 1, GETPOST("label"), @@ -391,6 +391,7 @@ if ($id > 0 || $ref) { $object = new Product($db); $result = $object->fetch($id,$ref); + $object->load_stock(); $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; @@ -677,7 +678,7 @@ if ((! empty($conf->productbatch->enabled)) && $object->hasbatch()) print ''; } -$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.pmp, ps.rowid as product_stock_id"; +$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.rowid as product_stock_id, p.pmp"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product"; @@ -703,9 +704,10 @@ if ($resql) $entrepotstatic->id=$obj->rowid; $entrepotstatic->libelle=$obj->label; $entrepotstatic->lieu=$obj->lieu; + $stock_real = round($obj->reel, 10); print ''; print ''; - print ''; + print ''; // PMP print ''; // Value purchase From 33499ae6525adefdbbce62140e5d9d77cacfce4d Mon Sep 17 00:00:00 2001 From: fmarcet Date: Thu, 28 Apr 2016 11:14:00 +0200 Subject: [PATCH 34/78] FIX: Compatible with multicompany --- htdocs/compta/bank/class/account.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 9747703c58f..7058647fae6 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -986,6 +987,7 @@ class Account extends CommonObject $sql = "SELECT COUNT(ba.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " WHERE ba.rappro > 0 and ba.clos = 0"; + $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; if (empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) $sql.= " AND ba.courant != 2"; $resql=$db->query($sql); if ($resql) From 44041975970c92e1bbc138f98e05023586e7f296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 28 Apr 2016 11:54:42 +0200 Subject: [PATCH 35/78] Load user personal param at login --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 41dcd6285c5..7b3d7a71db6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -516,7 +516,7 @@ if (! defined('NOLOGIN')) exit; } - $resultFetchUser=$user->fetch('', $login, '', 0, ($entitytotest ? $entitytotest : -1)); + $resultFetchUser=$user->fetch('', $login, '', 1, ($entitytotest ? $entitytotest : -1)); if ($resultFetchUser <= 0) { dol_syslog('User not found, connexion refused'); From b280a700d267f5cd481f39002bafd18a023c8704 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 28 Apr 2016 14:05:56 +0200 Subject: [PATCH 36/78] FIX missing column when module was installed before standard integration --- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 068fbc753cb..89f75c1156d 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -797,6 +797,7 @@ ALTER TABLE llx_societe_remise_except MODIFY COLUMN description text NOT NULL; update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; +ALTER TABLE llx_propal_merge_pdf_product ADD COLUMN lang varchar(5) DEFAULT NULL; --Deal with holidays_user that do not have rowid -- Disabled: too dangerous patch. rowid is a primary key. How is it possible to have no rowid ? From 972e5e571d15c893d6a8f86473c942aeb6e13283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 28 Apr 2016 21:52:23 +0200 Subject: [PATCH 37/78] Update card.php --- htdocs/expensereport/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 48de12a678c..54a67cc6ffc 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1625,7 +1625,7 @@ else $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; - $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid'; $sql.= ' WHERE fde.fk_expensereport = '.$object->id; @@ -1691,7 +1691,7 @@ else } print ''; } - print ''; + print ''; print ''; print ''; print ''; From c743f6cfe5e5624fd4f42d590b2c3e0b6d05b728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 28 Apr 2016 21:56:28 +0200 Subject: [PATCH 38/78] If no project, update line is impossible --- htdocs/expensereport/class/expensereport.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 0a85f720c13..b524850fdb4 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1265,7 +1265,9 @@ class ExpenseReport extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE p.rowid = ".$projet_id; $result = $this->db->query($sql); - $objp_projet = $this->db->fetch_object($result); + if ($result) { + $objp_projet = $this->db->fetch_object($result); + } $ligne->projet_ref = $objp_projet->ref_projet; $ligne->projet_title = $objp_projet->title_projet; From ab63bdd235fd130ea1b664c24f1fc4ef00746a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 28 Apr 2016 22:30:22 +0200 Subject: [PATCH 39/78] keep files attached with PROV status --- .../class/expensereport.class.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 0a85f720c13..e0be6dedea0 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -850,6 +850,7 @@ class ExpenseReport extends CommonObject { global $conf,$langs; + $this->oldref = $this->ref; $expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR; // Sélection du numéro de ref suivant @@ -872,6 +873,36 @@ class ExpenseReport extends CommonObject $this->ref = strtoupper($fuser->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d'); } + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->oldref)) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + // We rename directory in order to avoid losing the attachments + $oldref = dol_sanitizeFileName($this->oldref); + $newref = dol_sanitizeFileName($this->ref); + $dirsource = $conf->expensereport->dir_output.'/'.$oldref; + $dirdest = $conf->expensereport->dir_output.'/'.$newref; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles=dol_dir_list($conf->expensereport->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/')); + foreach($listoffiles as $fileentry) + { + $dirsource=$fileentry['name']; + $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource); + $dirsource=$fileentry['path'].'/'.$dirsource; + $dirdest=$fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } + } + } + if ($this->fk_statut != 2) { $now = dol_now(); From a982f764fe4bd85e6e6cf51a7ca3366a5f20bfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 29 Apr 2016 12:26:41 +0200 Subject: [PATCH 40/78] don't change ref if ref is not prov --- .../class/expensereport.class.php | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index e0be6dedea0..439e6053aff 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -853,10 +853,6 @@ class ExpenseReport extends CommonObject $this->oldref = $this->ref; $expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR; - // Sélection du numéro de ref suivant - $ref_next = $this->getNextNumRef(); - $ref_number_int = ($this->ref+1)-1; - // Sélection de la date de début de la NDF $sql = 'SELECT date_debut'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element; @@ -865,17 +861,23 @@ class ExpenseReport extends CommonObject $objp = $this->db->fetch_object($result); $this->date_debut = $this->db->jdate($objp->date_debut); - // Création du ref_number suivant - if($ref_next) - { - $prefix="ER"; - if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX; - $this->ref = strtoupper($fuser->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d'); - } + $update_number_int = false; + // Create next ref if ref is PROVxx // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->oldref)) + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Sélection du numéro de ref suivant + $ref_next = $this->getNextNumRef(); + $ref_number_int = ($this->ref+1)-1; + $update_number_int = true; + // Création du ref_number suivant + if($ref_next) + { + $prefix="ER"; + if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX; + $this->ref = strtoupper($fuser->login).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d'); + } require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // We rename directory in order to avoid losing the attachments $oldref = dol_sanitizeFileName($this->oldref); @@ -906,10 +908,12 @@ class ExpenseReport extends CommonObject if ($this->fk_statut != 2) { $now = dol_now(); - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql.= " SET ref = '".$this->ref."', fk_statut = 2, fk_user_valid = ".$fuser->id.", date_valid='".$this->db->idate($now)."',"; - $sql.= " ref_number_int = ".$ref_number_int; + $sql.= " SET ref = '".$this->ref."', fk_statut = 2, fk_user_valid = ".$fuser->id.", date_valid='".$this->db->idate($now)."'"; + if ($update_number_int) { + $sql.= ", ref_number_int = ".$ref_number_int; + } $sql.= ' WHERE rowid = '.$this->id; $resql=$this->db->query($sql); From 7e8aef037a078924e787894c7f3f4f45074beb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 29 Apr 2016 13:23:06 +0200 Subject: [PATCH 41/78] Update expensereport.class.php --- htdocs/expensereport/class/expensereport.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 0a85f720c13..0adf59f64c6 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -746,7 +746,7 @@ class ExpenseReport extends CommonObject $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' p.ref as ref_projet, p.title as title_projet'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as de'; - $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON de.fk_c_type_fees = ctf.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON de.fk_projet = p.rowid'; $sql.= ' WHERE de.'.$this->fk_element.' = '.$this->id; @@ -776,7 +776,7 @@ class ExpenseReport extends CommonObject $deplig->total_tva = $objp->total_tva; $deplig->total_ttc = $objp->total_ttc; - $deplig->type_fees_code = $objp->code_type_fees; + $deplig->type_fees_code = empty($objp->code_type_fees)?'TF_OTHER':$objp->code_type_fees; $deplig->type_fees_libelle = $objp->libelle_type_fees; $deplig->tva_tx = $objp->tva_tx; $deplig->vatrate = $objp->tva_tx; From 2a27fe02eb4c6ede19605600ec9e81f585154cf6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Apr 2016 15:12:58 +0200 Subject: [PATCH 42/78] Fix detection if tag already exists --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index fbae52f9726..a3ce6ed76bc 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -376,7 +376,7 @@ if ($nboftargetok) { print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; - if ($ret =~ /already exists/) + if ($ret =~ /(already exists|existe déjà)/) { print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? "; $QUESTIONOVERWRITETAG=; From 3a749462101cf852f33cb4a6d020f865b70e8e5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Apr 2016 18:59:54 +0200 Subject: [PATCH 43/78] Revert "FIX #4813 Won translation for the key OppStatusWON instead OppStatusWIN" --- htdocs/langs/ar_SA/projects.lang | 2 +- htdocs/langs/bn_BD/projects.lang | 2 +- htdocs/langs/bs_BA/projects.lang | 2 +- htdocs/langs/ca_ES/projects.lang | 2 +- htdocs/langs/cs_CZ/projects.lang | 2 +- htdocs/langs/da_DK/projects.lang | 2 +- htdocs/langs/de_DE/projects.lang | 2 +- htdocs/langs/en_US/projects.lang | 2 +- htdocs/langs/es_ES/projects.lang | 2 +- htdocs/langs/et_EE/projects.lang | 2 +- htdocs/langs/eu_ES/projects.lang | 2 +- htdocs/langs/fi_FI/projects.lang | 2 +- htdocs/langs/fr_FR/projects.lang | 2 +- htdocs/langs/he_IL/projects.lang | 2 +- htdocs/langs/hr_HR/projects.lang | 2 +- htdocs/langs/hu_HU/projects.lang | 2 +- htdocs/langs/id_ID/projects.lang | 2 +- htdocs/langs/is_IS/projects.lang | 2 +- htdocs/langs/it_IT/projects.lang | 2 +- htdocs/langs/ka_GE/projects.lang | 2 +- htdocs/langs/kn_IN/projects.lang | 2 +- htdocs/langs/ko_KR/projects.lang | 2 +- htdocs/langs/lo_LA/projects.lang | 2 +- htdocs/langs/lt_LT/projects.lang | 2 +- htdocs/langs/lv_LV/projects.lang | 2 +- htdocs/langs/mk_MK/projects.lang | 2 +- htdocs/langs/nb_NO/projects.lang | 2 +- htdocs/langs/nl_NL/projects.lang | 2 +- htdocs/langs/pl_PL/projects.lang | 2 +- htdocs/langs/pt_BR/projects.lang | 2 +- htdocs/langs/pt_PT/projects.lang | 2 +- htdocs/langs/ro_RO/projects.lang | 2 +- htdocs/langs/ru_RU/projects.lang | 2 +- htdocs/langs/sk_SK/projects.lang | 2 +- htdocs/langs/sl_SI/projects.lang | 2 +- htdocs/langs/sq_AL/projects.lang | 2 +- htdocs/langs/sr_RS/projects.lang | 2 +- htdocs/langs/sv_SE/projects.lang | 2 +- htdocs/langs/sw_SW/projects.lang | 2 +- htdocs/langs/tr_TR/projects.lang | 2 +- htdocs/langs/uk_UA/projects.lang | 2 +- htdocs/langs/uz_UZ/projects.lang | 2 +- htdocs/langs/vi_VN/projects.lang | 2 +- htdocs/langs/zh_CN/projects.lang | 2 +- htdocs/langs/zh_TW/projects.lang | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/htdocs/langs/ar_SA/projects.lang b/htdocs/langs/ar_SA/projects.lang index ab322a4bd05..bdd7967374a 100644 --- a/htdocs/langs/ar_SA/projects.lang +++ b/htdocs/langs/ar_SA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=المؤهل العلمى OppStatusPROPO=مقترح OppStatusNEGO=Negociation OppStatusPENDING=بانتظار -OppStatusWON=فاز +OppStatusWIN=فاز OppStatusLOST=ضائع Budget=Budget diff --git a/htdocs/langs/bn_BD/projects.lang b/htdocs/langs/bn_BD/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/bn_BD/projects.lang +++ b/htdocs/langs/bn_BD/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/bs_BA/projects.lang b/htdocs/langs/bs_BA/projects.lang index fdfcbd408e5..0b25f6ea67a 100644 --- a/htdocs/langs/bs_BA/projects.lang +++ b/htdocs/langs/bs_BA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ca_ES/projects.lang b/htdocs/langs/ca_ES/projects.lang index 91c1a7cc9db..5c2f18593cb 100644 --- a/htdocs/langs/ca_ES/projects.lang +++ b/htdocs/langs/ca_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualificació OppStatusPROPO=Pressupost OppStatusNEGO=Negociació OppStatusPENDING=Pendent -OppStatusWON=Guanyat +OppStatusWIN=Guanyat OppStatusLOST=Perdut Budget=Budget diff --git a/htdocs/langs/cs_CZ/projects.lang b/htdocs/langs/cs_CZ/projects.lang index cdc3743aee4..14b67dbb918 100644 --- a/htdocs/langs/cs_CZ/projects.lang +++ b/htdocs/langs/cs_CZ/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/da_DK/projects.lang b/htdocs/langs/da_DK/projects.lang index 618a6e5dc47..0c7ed16673b 100644 --- a/htdocs/langs/da_DK/projects.lang +++ b/htdocs/langs/da_DK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/de_DE/projects.lang b/htdocs/langs/de_DE/projects.lang index c1d58f6d3d6..15fc4080190 100644 --- a/htdocs/langs/de_DE/projects.lang +++ b/htdocs/langs/de_DE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualifikation OppStatusPROPO=Angebot OppStatusNEGO=Verhandlung OppStatusPENDING=Anstehend -OppStatusWON=Gewonnen +OppStatusWIN=Gewonnen OppStatusLOST=Verloren Budget=Budget diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index c68bd370f5a..979fd4670bb 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -190,6 +190,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget \ No newline at end of file diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index 3a9fd407875..b0965bd080c 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Cualificación OppStatusPROPO=Presupuesto OppStatusNEGO=Negociación OppStatusPENDING=Pendiente -OppStatusWON=Ganado +OppStatusWIN=Ganado OppStatusLOST=Perdido Budget=Budget diff --git a/htdocs/langs/et_EE/projects.lang b/htdocs/langs/et_EE/projects.lang index 31f516ada14..7c53e51f80d 100644 --- a/htdocs/langs/et_EE/projects.lang +++ b/htdocs/langs/et_EE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/eu_ES/projects.lang b/htdocs/langs/eu_ES/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/eu_ES/projects.lang +++ b/htdocs/langs/eu_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/fi_FI/projects.lang b/htdocs/langs/fi_FI/projects.lang index 50177fda449..fea93953f69 100644 --- a/htdocs/langs/fi_FI/projects.lang +++ b/htdocs/langs/fi_FI/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 6389d10abbf..b95fbb3cd56 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposition OppStatusNEGO=Négociation OppStatusPENDING=En attente -OppStatusWON=Gagné +OppStatusWIN=Gagné OppStatusLOST=Perdu Budget=Budget diff --git a/htdocs/langs/he_IL/projects.lang b/htdocs/langs/he_IL/projects.lang index ee8785e6397..fb939aef169 100644 --- a/htdocs/langs/he_IL/projects.lang +++ b/htdocs/langs/he_IL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/hr_HR/projects.lang b/htdocs/langs/hr_HR/projects.lang index bd83a40224d..7dae3662584 100644 --- a/htdocs/langs/hr_HR/projects.lang +++ b/htdocs/langs/hr_HR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/hu_HU/projects.lang b/htdocs/langs/hu_HU/projects.lang index 20a6f143d2a..9ab8ab13b05 100644 --- a/htdocs/langs/hu_HU/projects.lang +++ b/htdocs/langs/hu_HU/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/id_ID/projects.lang b/htdocs/langs/id_ID/projects.lang index 13798a28b3c..83a284cc58c 100644 --- a/htdocs/langs/id_ID/projects.lang +++ b/htdocs/langs/id_ID/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/is_IS/projects.lang b/htdocs/langs/is_IS/projects.lang index 517ab7e2e84..d41a345caf3 100644 --- a/htdocs/langs/is_IS/projects.lang +++ b/htdocs/langs/is_IS/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/it_IT/projects.lang b/htdocs/langs/it_IT/projects.lang index 8599f5089b5..9954fb68fd2 100644 --- a/htdocs/langs/it_IT/projects.lang +++ b/htdocs/langs/it_IT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualificazione OppStatusPROPO=Proposta OppStatusNEGO=Negoziazione OppStatusPENDING=In attesa -OppStatusWON=Vinto +OppStatusWIN=Vinto OppStatusLOST=Perso Budget=Budget diff --git a/htdocs/langs/ka_GE/projects.lang b/htdocs/langs/ka_GE/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/ka_GE/projects.lang +++ b/htdocs/langs/ka_GE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/kn_IN/projects.lang b/htdocs/langs/kn_IN/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/kn_IN/projects.lang +++ b/htdocs/langs/kn_IN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ko_KR/projects.lang b/htdocs/langs/ko_KR/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/ko_KR/projects.lang +++ b/htdocs/langs/ko_KR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lo_LA/projects.lang b/htdocs/langs/lo_LA/projects.lang index 52ca66a2763..56cc02c9e82 100644 --- a/htdocs/langs/lo_LA/projects.lang +++ b/htdocs/langs/lo_LA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lt_LT/projects.lang b/htdocs/langs/lt_LT/projects.lang index bc9adc0ef7f..6398f58b129 100644 --- a/htdocs/langs/lt_LT/projects.lang +++ b/htdocs/langs/lt_LT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lv_LV/projects.lang b/htdocs/langs/lv_LV/projects.lang index 000139e853c..d04ece7b84f 100644 --- a/htdocs/langs/lv_LV/projects.lang +++ b/htdocs/langs/lv_LV/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikācija OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/mk_MK/projects.lang b/htdocs/langs/mk_MK/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/mk_MK/projects.lang +++ b/htdocs/langs/mk_MK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/nb_NO/projects.lang b/htdocs/langs/nb_NO/projects.lang index c69d3c47ee4..c57648d77d1 100644 --- a/htdocs/langs/nb_NO/projects.lang +++ b/htdocs/langs/nb_NO/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikasjon OppStatusPROPO=Tilbud OppStatusNEGO=Forhandling OppStatusPENDING=Venter -OppStatusWON=Vunnet +OppStatusWIN=Vunnet OppStatusLOST=Tapt Budget=Budget diff --git a/htdocs/langs/nl_NL/projects.lang b/htdocs/langs/nl_NL/projects.lang index 8cf1a0d4684..93514bd4108 100644 --- a/htdocs/langs/nl_NL/projects.lang +++ b/htdocs/langs/nl_NL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/pl_PL/projects.lang b/htdocs/langs/pl_PL/projects.lang index 429a664d293..1479193a7cc 100644 --- a/htdocs/langs/pl_PL/projects.lang +++ b/htdocs/langs/pl_PL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kwalifikacja OppStatusPROPO=Wniosek OppStatusNEGO=Negocjacje OppStatusPENDING=W oczekiwaniu -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Zagubiony Budget=Budget diff --git a/htdocs/langs/pt_BR/projects.lang b/htdocs/langs/pt_BR/projects.lang index ab92118d1e4..f8ae458330b 100644 --- a/htdocs/langs/pt_BR/projects.lang +++ b/htdocs/langs/pt_BR/projects.lang @@ -125,5 +125,5 @@ OppStatusQUAL=Qualificação OppStatusPROPO=Proposta OppStatusNEGO=Negociação OppStatusPENDING=Pendente -OppStatusWON=Ganhou +OppStatusWIN=Ganhou OppStatusLOST=Perdido diff --git a/htdocs/langs/pt_PT/projects.lang b/htdocs/langs/pt_PT/projects.lang index 2df744a5013..c6bc715fada 100644 --- a/htdocs/langs/pt_PT/projects.lang +++ b/htdocs/langs/pt_PT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ro_RO/projects.lang b/htdocs/langs/ro_RO/projects.lang index c6fc6cb74e0..301c6242d24 100644 --- a/htdocs/langs/ro_RO/projects.lang +++ b/htdocs/langs/ro_RO/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Calificare OppStatusPROPO=Ofertă OppStatusNEGO=Negociere OppStatusPENDING=In asteptarea -OppStatusWON=Castigat +OppStatusWIN=Castigat OppStatusLOST=Pierdut Budget=Budget diff --git a/htdocs/langs/ru_RU/projects.lang b/htdocs/langs/ru_RU/projects.lang index bdee2d2d019..27c4995d20d 100644 --- a/htdocs/langs/ru_RU/projects.lang +++ b/htdocs/langs/ru_RU/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sk_SK/projects.lang b/htdocs/langs/sk_SK/projects.lang index 579d69f1323..6453fec2772 100644 --- a/htdocs/langs/sk_SK/projects.lang +++ b/htdocs/langs/sk_SK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sl_SI/projects.lang b/htdocs/langs/sl_SI/projects.lang index 38c773a95bb..81c1c01c46d 100644 --- a/htdocs/langs/sl_SI/projects.lang +++ b/htdocs/langs/sl_SI/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sq_AL/projects.lang b/htdocs/langs/sq_AL/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/sq_AL/projects.lang +++ b/htdocs/langs/sq_AL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sr_RS/projects.lang b/htdocs/langs/sr_RS/projects.lang index 553b7ec80af..8ba6046454e 100644 --- a/htdocs/langs/sr_RS/projects.lang +++ b/htdocs/langs/sr_RS/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikacija OppStatusPROPO=Ponuda OppStatusNEGO=Pregovaranje OppStatusPENDING=Na čekanju -OppStatusWON=Dobijeno +OppStatusWIN=Dobijeno OppStatusLOST=Izgubljeno Budget=Budget diff --git a/htdocs/langs/sv_SE/projects.lang b/htdocs/langs/sv_SE/projects.lang index a75da531dd3..77be1874eb2 100644 --- a/htdocs/langs/sv_SE/projects.lang +++ b/htdocs/langs/sv_SE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sw_SW/projects.lang b/htdocs/langs/sw_SW/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/sw_SW/projects.lang +++ b/htdocs/langs/sw_SW/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/tr_TR/projects.lang b/htdocs/langs/tr_TR/projects.lang index b4a54871c5a..dbdfcadfce7 100644 --- a/htdocs/langs/tr_TR/projects.lang +++ b/htdocs/langs/tr_TR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Nitelendirme OppStatusPROPO=Teklif OppStatusNEGO=Pazarlık OppStatusPENDING=Beklemede -OppStatusWON=Kazanç +OppStatusWIN=Kazanç OppStatusLOST=Kayıp Budget=Budget diff --git a/htdocs/langs/uk_UA/projects.lang b/htdocs/langs/uk_UA/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/uk_UA/projects.lang +++ b/htdocs/langs/uk_UA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/uz_UZ/projects.lang b/htdocs/langs/uz_UZ/projects.lang index 982ec36b26b..b4a21befd80 100644 --- a/htdocs/langs/uz_UZ/projects.lang +++ b/htdocs/langs/uz_UZ/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/vi_VN/projects.lang b/htdocs/langs/vi_VN/projects.lang index 7af08a9a5bc..174b4a88dc1 100644 --- a/htdocs/langs/vi_VN/projects.lang +++ b/htdocs/langs/vi_VN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/zh_CN/projects.lang b/htdocs/langs/zh_CN/projects.lang index 070c15647e6..bbd8b5cf27d 100644 --- a/htdocs/langs/zh_CN/projects.lang +++ b/htdocs/langs/zh_CN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/zh_TW/projects.lang b/htdocs/langs/zh_TW/projects.lang index 2519f38c954..2599ab48413 100644 --- a/htdocs/langs/zh_TW/projects.lang +++ b/htdocs/langs/zh_TW/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWON=Won +OppStatusWIN=Won OppStatusLOST=Lost Budget=Budget From 0ed998af035789a5e2ffb0de117e48fc726329e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Apr 2016 19:01:38 +0200 Subject: [PATCH 44/78] Revert "Revert "FIX #4813 Won translation for the key OppStatusWON instead OppStatusWIN"" --- htdocs/langs/ar_SA/projects.lang | 2 +- htdocs/langs/bn_BD/projects.lang | 2 +- htdocs/langs/bs_BA/projects.lang | 2 +- htdocs/langs/ca_ES/projects.lang | 2 +- htdocs/langs/cs_CZ/projects.lang | 2 +- htdocs/langs/da_DK/projects.lang | 2 +- htdocs/langs/de_DE/projects.lang | 2 +- htdocs/langs/en_US/projects.lang | 2 +- htdocs/langs/es_ES/projects.lang | 2 +- htdocs/langs/et_EE/projects.lang | 2 +- htdocs/langs/eu_ES/projects.lang | 2 +- htdocs/langs/fi_FI/projects.lang | 2 +- htdocs/langs/fr_FR/projects.lang | 2 +- htdocs/langs/he_IL/projects.lang | 2 +- htdocs/langs/hr_HR/projects.lang | 2 +- htdocs/langs/hu_HU/projects.lang | 2 +- htdocs/langs/id_ID/projects.lang | 2 +- htdocs/langs/is_IS/projects.lang | 2 +- htdocs/langs/it_IT/projects.lang | 2 +- htdocs/langs/ka_GE/projects.lang | 2 +- htdocs/langs/kn_IN/projects.lang | 2 +- htdocs/langs/ko_KR/projects.lang | 2 +- htdocs/langs/lo_LA/projects.lang | 2 +- htdocs/langs/lt_LT/projects.lang | 2 +- htdocs/langs/lv_LV/projects.lang | 2 +- htdocs/langs/mk_MK/projects.lang | 2 +- htdocs/langs/nb_NO/projects.lang | 2 +- htdocs/langs/nl_NL/projects.lang | 2 +- htdocs/langs/pl_PL/projects.lang | 2 +- htdocs/langs/pt_BR/projects.lang | 2 +- htdocs/langs/pt_PT/projects.lang | 2 +- htdocs/langs/ro_RO/projects.lang | 2 +- htdocs/langs/ru_RU/projects.lang | 2 +- htdocs/langs/sk_SK/projects.lang | 2 +- htdocs/langs/sl_SI/projects.lang | 2 +- htdocs/langs/sq_AL/projects.lang | 2 +- htdocs/langs/sr_RS/projects.lang | 2 +- htdocs/langs/sv_SE/projects.lang | 2 +- htdocs/langs/sw_SW/projects.lang | 2 +- htdocs/langs/tr_TR/projects.lang | 2 +- htdocs/langs/uk_UA/projects.lang | 2 +- htdocs/langs/uz_UZ/projects.lang | 2 +- htdocs/langs/vi_VN/projects.lang | 2 +- htdocs/langs/zh_CN/projects.lang | 2 +- htdocs/langs/zh_TW/projects.lang | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/htdocs/langs/ar_SA/projects.lang b/htdocs/langs/ar_SA/projects.lang index bdd7967374a..ab322a4bd05 100644 --- a/htdocs/langs/ar_SA/projects.lang +++ b/htdocs/langs/ar_SA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=المؤهل العلمى OppStatusPROPO=مقترح OppStatusNEGO=Negociation OppStatusPENDING=بانتظار -OppStatusWIN=فاز +OppStatusWON=فاز OppStatusLOST=ضائع Budget=Budget diff --git a/htdocs/langs/bn_BD/projects.lang b/htdocs/langs/bn_BD/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/bn_BD/projects.lang +++ b/htdocs/langs/bn_BD/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/bs_BA/projects.lang b/htdocs/langs/bs_BA/projects.lang index 0b25f6ea67a..fdfcbd408e5 100644 --- a/htdocs/langs/bs_BA/projects.lang +++ b/htdocs/langs/bs_BA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ca_ES/projects.lang b/htdocs/langs/ca_ES/projects.lang index 5c2f18593cb..91c1a7cc9db 100644 --- a/htdocs/langs/ca_ES/projects.lang +++ b/htdocs/langs/ca_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualificació OppStatusPROPO=Pressupost OppStatusNEGO=Negociació OppStatusPENDING=Pendent -OppStatusWIN=Guanyat +OppStatusWON=Guanyat OppStatusLOST=Perdut Budget=Budget diff --git a/htdocs/langs/cs_CZ/projects.lang b/htdocs/langs/cs_CZ/projects.lang index 14b67dbb918..cdc3743aee4 100644 --- a/htdocs/langs/cs_CZ/projects.lang +++ b/htdocs/langs/cs_CZ/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/da_DK/projects.lang b/htdocs/langs/da_DK/projects.lang index 0c7ed16673b..618a6e5dc47 100644 --- a/htdocs/langs/da_DK/projects.lang +++ b/htdocs/langs/da_DK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/de_DE/projects.lang b/htdocs/langs/de_DE/projects.lang index 15fc4080190..c1d58f6d3d6 100644 --- a/htdocs/langs/de_DE/projects.lang +++ b/htdocs/langs/de_DE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualifikation OppStatusPROPO=Angebot OppStatusNEGO=Verhandlung OppStatusPENDING=Anstehend -OppStatusWIN=Gewonnen +OppStatusWON=Gewonnen OppStatusLOST=Verloren Budget=Budget diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 979fd4670bb..c68bd370f5a 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -190,6 +190,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget \ No newline at end of file diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index b0965bd080c..3a9fd407875 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Cualificación OppStatusPROPO=Presupuesto OppStatusNEGO=Negociación OppStatusPENDING=Pendiente -OppStatusWIN=Ganado +OppStatusWON=Ganado OppStatusLOST=Perdido Budget=Budget diff --git a/htdocs/langs/et_EE/projects.lang b/htdocs/langs/et_EE/projects.lang index 7c53e51f80d..31f516ada14 100644 --- a/htdocs/langs/et_EE/projects.lang +++ b/htdocs/langs/et_EE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/eu_ES/projects.lang b/htdocs/langs/eu_ES/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/eu_ES/projects.lang +++ b/htdocs/langs/eu_ES/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/fi_FI/projects.lang b/htdocs/langs/fi_FI/projects.lang index fea93953f69..50177fda449 100644 --- a/htdocs/langs/fi_FI/projects.lang +++ b/htdocs/langs/fi_FI/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index b95fbb3cd56..6389d10abbf 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposition OppStatusNEGO=Négociation OppStatusPENDING=En attente -OppStatusWIN=Gagné +OppStatusWON=Gagné OppStatusLOST=Perdu Budget=Budget diff --git a/htdocs/langs/he_IL/projects.lang b/htdocs/langs/he_IL/projects.lang index fb939aef169..ee8785e6397 100644 --- a/htdocs/langs/he_IL/projects.lang +++ b/htdocs/langs/he_IL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/hr_HR/projects.lang b/htdocs/langs/hr_HR/projects.lang index 7dae3662584..bd83a40224d 100644 --- a/htdocs/langs/hr_HR/projects.lang +++ b/htdocs/langs/hr_HR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/hu_HU/projects.lang b/htdocs/langs/hu_HU/projects.lang index 9ab8ab13b05..20a6f143d2a 100644 --- a/htdocs/langs/hu_HU/projects.lang +++ b/htdocs/langs/hu_HU/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/id_ID/projects.lang b/htdocs/langs/id_ID/projects.lang index 83a284cc58c..13798a28b3c 100644 --- a/htdocs/langs/id_ID/projects.lang +++ b/htdocs/langs/id_ID/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/is_IS/projects.lang b/htdocs/langs/is_IS/projects.lang index d41a345caf3..517ab7e2e84 100644 --- a/htdocs/langs/is_IS/projects.lang +++ b/htdocs/langs/is_IS/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/it_IT/projects.lang b/htdocs/langs/it_IT/projects.lang index 9954fb68fd2..8599f5089b5 100644 --- a/htdocs/langs/it_IT/projects.lang +++ b/htdocs/langs/it_IT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualificazione OppStatusPROPO=Proposta OppStatusNEGO=Negoziazione OppStatusPENDING=In attesa -OppStatusWIN=Vinto +OppStatusWON=Vinto OppStatusLOST=Perso Budget=Budget diff --git a/htdocs/langs/ka_GE/projects.lang b/htdocs/langs/ka_GE/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/ka_GE/projects.lang +++ b/htdocs/langs/ka_GE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/kn_IN/projects.lang b/htdocs/langs/kn_IN/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/kn_IN/projects.lang +++ b/htdocs/langs/kn_IN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ko_KR/projects.lang b/htdocs/langs/ko_KR/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/ko_KR/projects.lang +++ b/htdocs/langs/ko_KR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lo_LA/projects.lang b/htdocs/langs/lo_LA/projects.lang index 56cc02c9e82..52ca66a2763 100644 --- a/htdocs/langs/lo_LA/projects.lang +++ b/htdocs/langs/lo_LA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lt_LT/projects.lang b/htdocs/langs/lt_LT/projects.lang index 6398f58b129..bc9adc0ef7f 100644 --- a/htdocs/langs/lt_LT/projects.lang +++ b/htdocs/langs/lt_LT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/lv_LV/projects.lang b/htdocs/langs/lv_LV/projects.lang index d04ece7b84f..000139e853c 100644 --- a/htdocs/langs/lv_LV/projects.lang +++ b/htdocs/langs/lv_LV/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikācija OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/mk_MK/projects.lang b/htdocs/langs/mk_MK/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/mk_MK/projects.lang +++ b/htdocs/langs/mk_MK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/nb_NO/projects.lang b/htdocs/langs/nb_NO/projects.lang index c57648d77d1..c69d3c47ee4 100644 --- a/htdocs/langs/nb_NO/projects.lang +++ b/htdocs/langs/nb_NO/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikasjon OppStatusPROPO=Tilbud OppStatusNEGO=Forhandling OppStatusPENDING=Venter -OppStatusWIN=Vunnet +OppStatusWON=Vunnet OppStatusLOST=Tapt Budget=Budget diff --git a/htdocs/langs/nl_NL/projects.lang b/htdocs/langs/nl_NL/projects.lang index 93514bd4108..8cf1a0d4684 100644 --- a/htdocs/langs/nl_NL/projects.lang +++ b/htdocs/langs/nl_NL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/pl_PL/projects.lang b/htdocs/langs/pl_PL/projects.lang index 1479193a7cc..429a664d293 100644 --- a/htdocs/langs/pl_PL/projects.lang +++ b/htdocs/langs/pl_PL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kwalifikacja OppStatusPROPO=Wniosek OppStatusNEGO=Negocjacje OppStatusPENDING=W oczekiwaniu -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Zagubiony Budget=Budget diff --git a/htdocs/langs/pt_BR/projects.lang b/htdocs/langs/pt_BR/projects.lang index f8ae458330b..ab92118d1e4 100644 --- a/htdocs/langs/pt_BR/projects.lang +++ b/htdocs/langs/pt_BR/projects.lang @@ -125,5 +125,5 @@ OppStatusQUAL=Qualificação OppStatusPROPO=Proposta OppStatusNEGO=Negociação OppStatusPENDING=Pendente -OppStatusWIN=Ganhou +OppStatusWON=Ganhou OppStatusLOST=Perdido diff --git a/htdocs/langs/pt_PT/projects.lang b/htdocs/langs/pt_PT/projects.lang index c6bc715fada..2df744a5013 100644 --- a/htdocs/langs/pt_PT/projects.lang +++ b/htdocs/langs/pt_PT/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/ro_RO/projects.lang b/htdocs/langs/ro_RO/projects.lang index 301c6242d24..c6fc6cb74e0 100644 --- a/htdocs/langs/ro_RO/projects.lang +++ b/htdocs/langs/ro_RO/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Calificare OppStatusPROPO=Ofertă OppStatusNEGO=Negociere OppStatusPENDING=In asteptarea -OppStatusWIN=Castigat +OppStatusWON=Castigat OppStatusLOST=Pierdut Budget=Budget diff --git a/htdocs/langs/ru_RU/projects.lang b/htdocs/langs/ru_RU/projects.lang index 27c4995d20d..bdee2d2d019 100644 --- a/htdocs/langs/ru_RU/projects.lang +++ b/htdocs/langs/ru_RU/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sk_SK/projects.lang b/htdocs/langs/sk_SK/projects.lang index 6453fec2772..579d69f1323 100644 --- a/htdocs/langs/sk_SK/projects.lang +++ b/htdocs/langs/sk_SK/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sl_SI/projects.lang b/htdocs/langs/sl_SI/projects.lang index 81c1c01c46d..38c773a95bb 100644 --- a/htdocs/langs/sl_SI/projects.lang +++ b/htdocs/langs/sl_SI/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sq_AL/projects.lang b/htdocs/langs/sq_AL/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/sq_AL/projects.lang +++ b/htdocs/langs/sq_AL/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sr_RS/projects.lang b/htdocs/langs/sr_RS/projects.lang index 8ba6046454e..553b7ec80af 100644 --- a/htdocs/langs/sr_RS/projects.lang +++ b/htdocs/langs/sr_RS/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Kvalifikacija OppStatusPROPO=Ponuda OppStatusNEGO=Pregovaranje OppStatusPENDING=Na čekanju -OppStatusWIN=Dobijeno +OppStatusWON=Dobijeno OppStatusLOST=Izgubljeno Budget=Budget diff --git a/htdocs/langs/sv_SE/projects.lang b/htdocs/langs/sv_SE/projects.lang index 77be1874eb2..a75da531dd3 100644 --- a/htdocs/langs/sv_SE/projects.lang +++ b/htdocs/langs/sv_SE/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/sw_SW/projects.lang b/htdocs/langs/sw_SW/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/sw_SW/projects.lang +++ b/htdocs/langs/sw_SW/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/tr_TR/projects.lang b/htdocs/langs/tr_TR/projects.lang index dbdfcadfce7..b4a54871c5a 100644 --- a/htdocs/langs/tr_TR/projects.lang +++ b/htdocs/langs/tr_TR/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Nitelendirme OppStatusPROPO=Teklif OppStatusNEGO=Pazarlık OppStatusPENDING=Beklemede -OppStatusWIN=Kazanç +OppStatusWON=Kazanç OppStatusLOST=Kayıp Budget=Budget diff --git a/htdocs/langs/uk_UA/projects.lang b/htdocs/langs/uk_UA/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/uk_UA/projects.lang +++ b/htdocs/langs/uk_UA/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/uz_UZ/projects.lang b/htdocs/langs/uz_UZ/projects.lang index b4a21befd80..982ec36b26b 100644 --- a/htdocs/langs/uz_UZ/projects.lang +++ b/htdocs/langs/uz_UZ/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/vi_VN/projects.lang b/htdocs/langs/vi_VN/projects.lang index 174b4a88dc1..7af08a9a5bc 100644 --- a/htdocs/langs/vi_VN/projects.lang +++ b/htdocs/langs/vi_VN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/zh_CN/projects.lang b/htdocs/langs/zh_CN/projects.lang index bbd8b5cf27d..070c15647e6 100644 --- a/htdocs/langs/zh_CN/projects.lang +++ b/htdocs/langs/zh_CN/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget diff --git a/htdocs/langs/zh_TW/projects.lang b/htdocs/langs/zh_TW/projects.lang index 2599ab48413..2519f38c954 100644 --- a/htdocs/langs/zh_TW/projects.lang +++ b/htdocs/langs/zh_TW/projects.lang @@ -199,6 +199,6 @@ OppStatusQUAL=Qualification OppStatusPROPO=Proposal OppStatusNEGO=Negociation OppStatusPENDING=Pending -OppStatusWIN=Won +OppStatusWON=Won OppStatusLOST=Lost Budget=Budget From f5a541d4697892e47c6b981cbbd667874b7b2929 Mon Sep 17 00:00:00 2001 From: esprit libre Date: Wed, 27 Apr 2016 16:42:59 +0200 Subject: [PATCH 45/78] Fix problem about unit buy price fetching To fix a bug encountered at customer shop about margin calculation. In some case, returned buy price is total buy price from provider and not unit buy price. Case opened on forum: http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/55467-calcul-des-marges --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 716a462f440..c3140118745 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4246,7 +4246,7 @@ abstract class CommonObject $productFournisseur = new ProductFournisseur($this->db); if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0) { - $buyPrice = $productFournisseur->fourn_price; + $buyPrice = $productFournisseur->fourn_unitprice; } else if ($result < 0) { From 31a9acc77d86ad8f016f63d6674cabf15ca72d49 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 23 Apr 2016 20:17:45 +0200 Subject: [PATCH 46/78] not present in some select list --- htdocs/core/class/html.formother.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 078dc01d96f..d5ce5679dd3 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -805,6 +805,7 @@ class FormOther $select_week .= ''; } $select_week .= ''; return $select_week; @@ -844,6 +845,7 @@ class FormOther $select_month .= ''; } $select_month .= ''; return $select_month; From 49c3c69e3045a2546e961c6b8e02606d8400c837 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sun, 24 Apr 2016 02:01:29 +0200 Subject: [PATCH 47/78] minor error code --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1939299cf63..e5a70708c8d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3687,7 +3687,7 @@ class Product extends CommonObject } } - if ($size==1 || $size='small') + if ($size==1 || $size=='small') { if ($nbbyrow > 0) { From 755b99475058b9663c1476be42f195e7ff07cad2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Apr 2016 20:40:00 +0200 Subject: [PATCH 48/78] Prepare 3.9.2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index db8a5869914..59c489a957a 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.1'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.2'); if (! defined('EURO')) define('EURO',chr(128)); From 3cf1d891abf936e2f710080b4a71df1b8bd86c6d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 30 Apr 2016 07:05:10 +0200 Subject: [PATCH 49/78] FIX: Accountancy - 3.9 - Chart of accounts are limited on only one country --- htdocs/accountancy/admin/index.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 03cb46adf0d..92b3ec7adc0 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -202,10 +202,9 @@ print ""; print ""; print "
'.$langs->trans("Total").''.price($qtytotal).' '.price($catotal_ht).''.price($catotal).' 
'.$entrepotstatic->getNomUrl(1).''.$obj->reel.($obj->reel<0?' '.img_warning():'').''.$stock_real.($stock_real < 0 ?' '.img_warning():'').''.(price2num($object->pmp)?price2num($object->pmp,'MU'):'').''.$langs->trans("TF_".strtoupper($objp->type_fees_libelle)).''.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).''.$objp->comments.''.vatrate($objp->vatrate,true).''.price($objp->value_unit).'" . $langs->trans("Selectchartofaccounts") . ""; print '" . $langs->trans("Selectchartofaccounts") . ""; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; From 5040fe46b0ce31adaf0dfb6507d480122f0c395d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 May 2016 11:15:53 +0200 Subject: [PATCH 53/78] FIX Missing number total of modules --- htdocs/admin/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 3fbaddd0a3f..aa4c1b85cae 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -223,7 +223,7 @@ asort($orders); //var_dump($modules); $nbofactivatedmodules=count($conf->modules); -$moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1)); +$moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1), count($modules)); if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule")); print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup'); From cb4e569a5fd0cd87104cc27a8eb2d46ddc7c61c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 May 2016 10:48:55 +0200 Subject: [PATCH 54/78] FIX Merge manually PR #5161 - Bad translation key --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 62512562e9a..123189bdc87 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1173,7 +1173,7 @@ if ($id > 0) // Clone event if($action == 'clone') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneEvent', $object->label), 'confirm_clone', $formquestion, 'yes', 1); print $formconfirm; } From 1835caad7b57ba3012176595a7449715d54b9998 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 May 2016 08:53:09 +0200 Subject: [PATCH 55/78] Better translation --- htdocs/adherents/card.php | 21 ++++++++++++--------- htdocs/adherents/card_subscriptions.php | 12 ++++++++++-- htdocs/langs/en_US/members.lang | 1 + 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index f17ca46299f..b3bfce7d9a1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1381,17 +1381,12 @@ else print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1); } - /* - * Confirm add in spip - */ + // Confirm add in spip if ($action == 'add_spip') { print $form->formconfirm("card.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); } - - /* - * Confirm removed from spip - */ + // Confirm removed from spip if ($action == 'del_spip') { print $form->formconfirm("card.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); @@ -1556,8 +1551,16 @@ else } else { - print $langs->trans("SubscriptionNotReceived"); - if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + if (! $adht->cotisation) + { + print $langs->trans("SubscriptionNotRecorded"); + if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + } + else + { + print $langs->trans("SubscriptionNotReceived"); + if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + } } print ''; diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 998dc53d525..784f6d4dea7 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -722,8 +722,16 @@ if ($rowid > 0) } else { - print $langs->trans("SubscriptionNotReceived"); - if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + if (! $adht->cotisation) + { + print $langs->trans("SubscriptionNotRecorded"); + if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + } + else + { + print $langs->trans("SubscriptionNotReceived"); + if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie + } } print ''; diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 1844a22c227..500f25e4ae8 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -124,6 +124,7 @@ Int=Int DateAndTime=Date and time PublicMemberCard=Member public card MemberNotOrNoMoreExpectedToSubscribe=Member not or no more expected to subscribe +SubscriptionNotRecorded=Subscription not recorded AddSubscription=Create subscription ShowSubscription=Show subscription MemberModifiedInDolibarr=Member modified in Dolibarr From 03732fd1aa0cfe75564111883677099b0bb02fad Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 9 May 2016 15:31:44 +0200 Subject: [PATCH 56/78] Fix contract line creation was adding all proposal lines desc --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3fe0530ec77..3c38cdf4421 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -320,7 +320,7 @@ if ($action == 'add' && $user->rights->contrat->creer) } if ($conf->global->PRODUIT_DESC_IN_FORM) - $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; + $desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; } else { $desc = dol_htmlentitiesbr($lines[$i]->desc); From 6278610d0aad44063c20b274bf07e0e4d936ea7f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 9 May 2016 15:32:21 +0200 Subject: [PATCH 57/78] Fix contract line creation should take desc even if not displayed on screen --- htdocs/contrat/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3c38cdf4421..c55defb5ce8 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -319,8 +319,7 @@ if ($action == 'add' && $user->rights->contrat->creer) $label = $lines[$i]->product_label; } - if ($conf->global->PRODUIT_DESC_IN_FORM) - $desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; + $desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; } else { $desc = dol_htmlentitiesbr($lines[$i]->desc); From a8f50283c06de3af9f4e0f0c8db5e9fb64f42e7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 May 2016 19:37:14 +0200 Subject: [PATCH 58/78] Fix bad translation --- htdocs/langs/en_US/bills.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 392050c6cd5..bfbe32b803e 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -321,8 +321,8 @@ PaymentConditionPT_5050=50%% in advance, 50%% on delivery FixAmount=Fix amount VarAmount=Variable amount (%% tot.) # PaymentType -PaymentTypeVIR=Bank deposit -PaymentTypeShortVIR=Bank deposit +PaymentTypeVIR=Bank transfer +PaymentTypeShortVIR=Bank transfer PaymentTypePRE=Bank's order PaymentTypeShortPRE=Bank's order PaymentTypeLIQ=Cash From 3607f1a296b14f8535248cbad5bf15b520a9cc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 May 2016 22:15:00 +0200 Subject: [PATCH 59/78] Correction for Auguria Menu Accounting Expert Entry cause blank windows --- htdocs/core/menus/init_menu_auguria.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 86b8a58e68f..2e37f989b0a 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -206,7 +206,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -- Accounting Expert -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=accounting', 'MenuAccountancy', 0, 'accountancy', '(! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=accounting', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); -- Dispatch insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 2, __ENTITY__); From 84e75eed88371dcc7fdf49dbc785766bc74249ae Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 10 May 2016 09:31:25 +0200 Subject: [PATCH 60/78] FIX : can't fetch by siret or siren because of first "if" --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 864820602c8..efb038a84f0 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1006,7 +1006,7 @@ class Societe extends CommonObject global $langs; global $conf; - if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; + if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4)) return -1; $sql = 'SELECT s.rowid, s.nom as name, s.name_alias, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm'; $sql .= ', s.status'; From a57e0f5fd38f4c5a3a318ef9002f68f9172c6eec Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 10 May 2016 14:27:24 +0200 Subject: [PATCH 61/78] Fix update supplier ref on supplier invoice --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f1de6a68a78..635c9195386 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -240,7 +240,7 @@ if (empty($reshook)) { $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); - if ($object->update() < 0) { + if ($object->update($user) < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } From d3b3e60d82edc38345473f0c4b478ae1c70310d1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 10 May 2016 22:37:30 +0200 Subject: [PATCH 62/78] Fix email template edition --- htdocs/install/mysql/migration/3.7.0-3.8.0.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index 89f75c1156d..068fbc753cb 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -797,7 +797,6 @@ ALTER TABLE llx_societe_remise_except MODIFY COLUMN description text NOT NULL; update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; -ALTER TABLE llx_propal_merge_pdf_product ADD COLUMN lang varchar(5) DEFAULT NULL; --Deal with holidays_user that do not have rowid -- Disabled: too dangerous patch. rowid is a primary key. How is it possible to have no rowid ? From 4cbab1cf47a4d3fcb99acaf7e6f7cad74bdaa0f7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 12 May 2016 16:58:14 +0200 Subject: [PATCH 63/78] FIX PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH --- htdocs/product/document.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 6a8ee778590..766b24a941e 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -247,7 +247,8 @@ if ($object->id) if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs { - $filearray = dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1); + + $filearray = array_merge($filearray,dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1)); } // For each file build select list with PDF extention From 1bba8166f8c2dd69f45899f684f0921a7c86f9fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 May 2016 23:12:53 +0200 Subject: [PATCH 64/78] FIX #5207 --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f1de6a68a78..635c9195386 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -240,7 +240,7 @@ if (empty($reshook)) { $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); - if ($object->update() < 0) { + if ($object->update($user) < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } From 21b639ef168389b2d2a6b92482179b577621f76a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 14 May 2016 00:47:46 +0200 Subject: [PATCH 65/78] Fix issues with entity control --- htdocs/holiday/class/holiday.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 4e5706f94c6..94704451df7 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2012-2014 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2016 Juanjo Menent * * 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 @@ -117,7 +118,7 @@ class Holiday extends CommonObject */ function create($user, $notrigger=0) { - global $conf, $langs; + global $conf; $error=0; $now=dol_now(); @@ -137,7 +138,8 @@ class Holiday extends CommonObject $sql.= "statut,"; $sql.= "fk_validator,"; $sql.= "fk_type,"; - $sql.= "fk_user_create"; + $sql.= "fk_user_create,"; + $sql.= "entity"; $sql.= ") VALUES ("; $sql.= "'".$this->fk_user."',"; $sql.= " '".$this->db->idate($now)."',"; @@ -148,7 +150,8 @@ class Holiday extends CommonObject $sql.= " '1',"; $sql.= " '".$this->fk_validator."',"; $sql.= " '".$this->fk_type."',"; - $sql.= " ".$user->id; + $sql.= " ".$user->id.","; + $sql.= " ".$conf->entity; $sql.= ")"; $this->db->begin(); From b3b064d310312b53133ac4cf234d9b7efc3fa916 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Sat, 14 May 2016 18:58:14 +0200 Subject: [PATCH 66/78] FIX hook on group card called but not initialized --- htdocs/user/group/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 3de421e4f4f..75ad04979b6 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -64,6 +64,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); +$hookmanager->initHooks(array('groupcard','globalcard')); /** * Action remove group From af8608ab7aa2fe8fc188e53cde6290ce35b7dadf Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 16 May 2016 10:49:43 +0200 Subject: [PATCH 67/78] Fix services dispatch on supplier order only if STOCK_SUPPORTS_SERVICES --- htdocs/fourn/commande/dispatch.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index fd992dbeeb1..9d7d2bfeefe 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -386,6 +386,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid"; $sql.= " WHERE l.fk_commande = ".$commande->id; + if(empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND l.product_type = 0"; $sql.= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product $sql.= " ORDER BY p.ref, p.label"; From f7c9f20b16297c41c002a3cb1e915a98a4f83c9b Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 May 2016 17:21:32 +0200 Subject: [PATCH 68/78] Fix: Expensereport not compatible with multicompany. --- htdocs/expensereport/class/expensereport.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 7de680d02f3..cc32f08b0ac 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011 Dimitri Mouillard * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -149,6 +150,7 @@ class ExpenseReport extends CommonObject $sql.= ",paid"; $sql.= ",note_public"; $sql.= ",note_private"; + $sql.= ",entity"; $sql.= ") VALUES("; $sql.= "'(PROV)'"; $sql.= ", ".$this->total_ht; @@ -165,6 +167,7 @@ class ExpenseReport extends CommonObject $sql.= ", 0"; $sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); $sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); + $sql.= ", ".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); From 4a3083a4c12aecb64f906c8e1adbb8c57f26e22f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 May 2016 19:34:24 +0200 Subject: [PATCH 69/78] FIX Remove PHP Warning: Creating default object from empty value. --- htdocs/expensereport/card.php | 45 +++++++++-------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 54a67cc6ffc..f3174935cd5 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -333,7 +333,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id if ($result > 0) { - if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) + if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition { // Send mail @@ -390,6 +390,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id else { $mesg=$mailfile->error; + setEventMessages($mesg, null, 'errors'); } // END - Send mail } @@ -438,7 +439,7 @@ if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $u if ($result > 0) { - if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) + if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition { // Send mail @@ -542,7 +543,7 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user if ($result > 0) { - if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) + if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition { // Send mail @@ -583,7 +584,6 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user else { setEventMessages($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo), null, 'errors'); - $mesg="Impossible d'envoyer l'email."; } // END - Send mail } @@ -627,7 +627,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_ if ($result > 0) { - if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) + if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition { // Send mail @@ -667,6 +667,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_ else { $mesg="Impossible d'envoyer l'email."; + setEventMessages($mesg, null, 'errors'); } // END - Send mail } @@ -756,7 +757,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid) if ($result > 0) { - if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) + if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) // TODO Translate this so we can remove condition { // Send mail @@ -806,9 +807,8 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid) endif; else: - - $mesg="Impossible d'envoyer l'email."; - + $mesg="Impossible d'envoyer l'email."; + setEventMessages($mesg, null, 'errors'); endif; // END - Send mail } @@ -921,7 +921,7 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes") $total_ht = $object_ligne->total_ht; $total_tva = $object_ligne->total_tva; - $result=$object->deleteline(GETPOST("rowid")); + $result=$object->deleteline(GETPOST("rowid"), $user); if ($result >= 0) { if ($result > 0) @@ -961,7 +961,6 @@ if ($action == "updateligne" ) $rowid = $_POST['rowid']; $type_fees_id = GETPOST('fk_c_type_fees'); - $object_ligne->vatrate = price2num(GETPOST('vatrate')); $projet_id = $fk_projet; $comments = GETPOST('comments'); $qty = GETPOST('qty'); @@ -983,6 +982,7 @@ if ($action == "updateligne" ) if (! $error) { + // TODO Use update method of ExpenseReportLine $result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $id); if ($result >= 0) { @@ -1078,29 +1078,6 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); $projecttmp = new Project($db); -if (! empty($conf->global->DEPLACEMENT_TO_CLEAN)) -{ - if(!empty($_GET['mesg'])) - { - $text_mesg = explode(",",$_GET['mesg']); - - foreach($text_mesg as $text) - { - $mesg.= "- ".$langs->trans($text)."
"; - } - - print "
"; - print $langs->trans("LINE_NOT_ADDED")."
"; - print $mesg; - print "
"; - } - else - { - if ($mesg) print "
".$mesg."
"; - } -} - - // Create if ($action == 'create') { From 929787006e43801bdf755294519f07c0918f3f09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 May 2016 22:40:29 +0200 Subject: [PATCH 70/78] Clean data --- htdocs/install/mysql/migration/repair.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 53034338932..2b87303f113 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -55,6 +55,7 @@ delete from llx_product_extrafields where fk_object not in (select rowid from ll --delete from llx_societe_commerciaux where fk_soc not in (select rowid from llx_societe); update llx_product_batch set batch = '' where batch = 'Non défini'; +update llx_product_batch set batch = '' where batch = 'Non défini'; -- Fix: delete category child with no category parent. drop table tmp_categorie; From 94c532dd8a4c99eefa31140929b9dd41b92170e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 May 2016 23:58:06 +0200 Subject: [PATCH 71/78] Clean splitted lines into llx_product_batch --- htdocs/install/mysql/migration/repair.sql | 28 ++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 2b87303f113..43e0ca21ee2 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -54,9 +54,34 @@ delete from llx_adherent_extrafields where fk_object not in (select rowid from l delete from llx_product_extrafields where fk_object not in (select rowid from llx_product); --delete from llx_societe_commerciaux where fk_soc not in (select rowid from llx_societe); + +-- Clean stocks + +-- Reference for qty is llx_product_stock (detail in llx_product_batch may be not complete) +-- qty in llx_product may be not up to date update llx_product_batch set batch = '' where batch = 'Non défini'; update llx_product_batch set batch = '' where batch = 'Non défini'; +DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM llx_product_batch as pb); + +-- Merge splitted lines into one in table llx_product_batch +DROP TABLE tmp_llx_product_batch; +DROP TABLE tmp_llx_product_batch2; +CREATE TABLE tmp_llx_product_batch AS select fk_product_stock, eatby, sellby, batch, SUM(qty) as qty, COUNT(rowid) as nb FROM llx_product_batch GROUP BY fk_product_stock, eatby, sellby, batch HAVING COUNT(rowid) > 1; +CREATE TABLE tmp_llx_product_batch2 AS select pb.rowid, pb.fk_product_stock, pb.eatby, pb.sellby, pb.batch, pb.qty from llx_product_batch as pb, tmp_llx_product_batch as tpb where pb.fk_product_stock = tpb.fk_product_stock and COALESCE(pb.eatby, '') = COALESCE(tpb.eatby,'') and COALESCE(pb.sellby, '') = COALESCE(tpb.sellby, '') and pb.batch = tpb.batch +--select * from tmp_llx_product_batch; +--select * from tmp_llx_product_batch2; +DELETE FROM llx_product_batch WHERE rowid IN (select rowid FROM tmp_llx_product_batch2); +INSERT INTO llx_product_batch(fk_product_stock, eatby, sellby, batch, qty) SELECT fk_product_stock, eatby, sellby, batch, qty FROM tmp_llx_product_batch; + +DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM llx_product_batch as pb); +DELETE FROM llx_product_batch WHERE qty = 0; + + +-- Stock calculation on product +UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid); + + -- Fix: delete category child with no category parent. drop table tmp_categorie; create table tmp_categorie as select * from llx_categorie; @@ -110,9 +135,6 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, position) values insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 50, 'AC_OTH', 'system', 'Other' ,NULL, 5); --- Stock calculation on product -UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid); - -- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid; -- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note); From 63d0710842fdc93dd54b3142845550b2f66242c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 May 2016 10:39:35 +0200 Subject: [PATCH 72/78] FIX Creation of the second ressource type fails. --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 3 +++ htdocs/resource/class/html.formresource.class.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 9d77a87fd7c..74f89441f64 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -607,3 +607,6 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14 INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1482, 148, '7','0','VAT reduced rate',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1483, 148, '5','0','VAT super-reduced rate', 1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1484, 148, '0','0','VAT Rate 0', 1); + +-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT; + diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 4128de6fead..18119b0cf17 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -96,7 +96,7 @@ class FormResource } // Construct $out and $outarray - $out.= ''."\n"; if ($showempty) $out.= ''."\n"; $num = count($resourcestat->lines); From 0e040b166dbe69bd83710e78462b38caa31037c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 May 2016 17:55:41 +0200 Subject: [PATCH 73/78] Fix: When we edit a product to use lot/serial number, we initialize records for unknown lots to generic value 'Undefined'. --- htdocs/product/class/product.class.php | 35 ++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3cc72ac9b97..fce31e31923 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -666,25 +666,45 @@ class Product extends CommonObject $org->fetch($this->id); $this->oldcopy=$org; } - // test if batch management is activated on existing product + + // Test if batch management is activated on existing product + // If yes, we create missing entries into product_batch if ($this->hasbatch() && !$this->oldcopy->hasbatch()) { + $valueforundefinedlot = 'Undefined'; + + dol_syslog("Flag batch of product id=".$this->id." is set to ON, so we will create missing records into product_batch"); + $this->load_stock(); - foreach ($this->stock_warehouse as $idW => $ObjW) + foreach ($this->stock_warehouse as $idW => $ObjW) // For each warehouse where we have stocks defined for this product (for each lines in product_stock) { $qty_batch = 0; - foreach ($ObjW->detail_batch as $detail) + foreach ($ObjW->detail_batch as $detail) // Each lines of detail in product_batch of the current $ObjW = product_stock { + if ($detail->batch == $valueforundefinedlot || $detail->batch == 'Undefined') + { + // We discard this line, we will create it later + $sqlclean="DELETE FROM ".MAIN_DB_PREFIX."product_batch WHERE batch in('Undefined', '".$valueforundefinedlot."') AND fk_product_stock = ".$ObjW->id; + $result = $this->db->query($sqlclean); + if (! $result) + { + dol_print_error($this->db); + exit; + } + continue; + } + $qty_batch += $detail->qty; } - // Quantities in batch details are not same same as stock quantity - // So we add a default batch record + // Quantities in batch details are not same as stock quantity, + // so we add a default batch record to complete and get same qty in parent and child table if ($ObjW->real <> $qty_batch) { $ObjBatch = new Productbatch($this->db); - $ObjBatch->batch = $langs->trans('BatchDefaultNumber'); - $ObjBatch->qty = $ObjW->real - $qty_batch; + $ObjBatch->batch = $valueforundefinedlot; + $ObjBatch->qty = ($ObjW->real - $qty_batch); $ObjBatch->fk_product_stock = $ObjW->id; + if ($ObjBatch->create($user,1) < 0) { $error++; @@ -693,6 +713,7 @@ class Product extends CommonObject } } } + // For automatic creation if ($this->barcode == -1) $this->barcode = $this->get_barcode($this,$this->barcode_type_code); From 7bbb3a7da10e024d78ad4911bf6f7a730f720ebe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 May 2016 19:15:44 +0200 Subject: [PATCH 74/78] Supplier proposal was missing --- htdocs/langs/en_US/other.lang | 2 ++ htdocs/product/class/product.class.php | 37 ++++++++++++++++++++++++++ htdocs/product/stats/card.php | 23 ++++++++++------ 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 278fa9c77b7..329ab278329 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -157,11 +157,13 @@ StatsByNumberOfEntities=Statistics in number of referring entities NumberOfProposals=Number of proposals on last 12 month NumberOfCustomerOrders=Number of customer orders on last 12 month NumberOfCustomerInvoices=Number of customer invoices on last 12 month +NumberOfSupplierProposals=Number of supplier proposals on last 12 month NumberOfSupplierOrders=Number of supplier orders on last 12 month NumberOfSupplierInvoices=Number of supplier invoices on last 12 month NumberOfUnitsProposals=Number of units on proposals on last 12 month NumberOfUnitsCustomerOrders=Number of units on customer orders on last 12 month NumberOfUnitsCustomerInvoices=Number of units on customer invoices on last 12 month +NumberOfUnitsSupplierProposals=Number of units on supplier proposals on last 12 month NumberOfUnitsSupplierOrders=Number of units on supplier orders on last 12 month NumberOfUnitsSupplierInvoices=Number of units on supplier invoices on last 12 month EMailTextInterventionValidated=The intervention %s has been validated. diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fce31e31923..ba2eac00cd9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2280,6 +2280,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.rowid = d.fk_facture"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.entity IN (".getEntity('facture', 1).")"; @@ -2312,6 +2313,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.rowid = d.fk_facture_fourn"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.entity IN (".getEntity('facture_fourn', 1).")"; @@ -2344,6 +2346,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE p.rowid = d.fk_propal"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype; $sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.entity IN (".getEntity('propal', 1).")"; @@ -2355,6 +2358,38 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode); } + /** + * Return nb of units or proposals in which product is included + * + * @param int $socid Limit count on a particular third party id + * @param string $mode 'byunit'=number of unit, 'bynumber'=nb of entities + * @param int $filteronproducttype 0=To filter on product only, 1=To filter on services only + * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 + */ + function get_nb_propalsupplier($socid, $mode, $filteronproducttype=-1) + { + global $conf; + global $user; + + $sql = "SELECT sum(d.qty), date_format(p.date_valid, '%Y%m')"; + if ($mode == 'bynumber') $sql.= ", count(DISTINCT p.rowid)"; + $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposaldet as d, ".MAIN_DB_PREFIX."supplier_proposal as p, ".MAIN_DB_PREFIX."societe as s"; + if ($filteronproducttype >= 0) $sql.=", ".MAIN_DB_PREFIX."product as prod"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE p.rowid = d.fk_supplier_proposal"; + if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; + if ($filteronproducttype >= 0) $sql.= " AND prod.rowid = d.fk_product AND prod.fk_product_type =".$filteronproducttype; + $sql.= " AND p.fk_soc = s.rowid"; + $sql.= " AND p.entity IN (".getEntity('propal', 1).")"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid > 0) $sql.= " AND p.fk_soc = ".$socid; + $sql.= " GROUP BY date_format(p.date_valid,'%Y%m')"; + $sql.= " ORDER BY date_format(p.date_valid,'%Y%m') DESC"; + + return $this->_get_stats($sql,$mode); + } + /** * Return nb of units or orders in which product is included * @@ -2374,6 +2409,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = d.fk_commande"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND c.fk_soc = s.rowid"; $sql.= " AND c.entity IN (".getEntity('commande', 1).")"; @@ -2404,6 +2440,7 @@ class Product extends CommonObject if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.rowid = d.fk_commande"; if ($this->id > 0) $sql.= " AND d.fk_product =".$this->id; + else $sql.=" AND d.fk_product > 0"; if ($filteronproducttype >= 0) $sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype; $sql.= " AND c.fk_soc = s.rowid"; $sql.= " AND c.entity IN (".getEntity('commande_fournisseur', 1).")"; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 49b700b46ca..d98d8ed31c6 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -210,15 +210,20 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') 'propal' =>array('modulepart'=>'productstats_proposals', 'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsProposals"):$langs->transnoentitiesnoconv("NumberOfProposals"))), + 'proposalssuppliers'=>array('modulepart'=>'productstats_proposalssuppliers', + 'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', + 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals"):$langs->transnoentitiesnoconv("NumberOfSupplierProposals"))), + 'orders' =>array('modulepart'=>'productstats_orders', 'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders"):$langs->transnoentitiesnoconv("NumberOfCustomerOrders"))), - 'invoices' =>array('modulepart'=>'productstats_invoices', - 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', - 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))), 'orderssuppliers'=>array('modulepart'=>'productstats_orderssuppliers', 'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders"):$langs->transnoentitiesnoconv("NumberOfSupplierOrders"))), + + 'invoices' =>array('modulepart'=>'productstats_invoices', + 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', + 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices"):$langs->transnoentitiesnoconv("NumberOfCustomerInvoices"))), 'invoicessuppliers'=>array('modulepart'=>'productstats_invoicessuppliers', 'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', 'label' => ($mode=='byunit'?$langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices"):$langs->transnoentitiesnoconv("NumberOfSupplierInvoices"))), @@ -243,11 +248,12 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') } else { - if ($key == 'propal') $graph_data = $object->get_nb_propal($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'orders') $graph_data = $object->get_nb_order($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'invoices') $graph_data = $object->get_nb_vente($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode,((string) $type != '' ? $type : -1)); - if ($key == 'orderssuppliers') $graph_data = $object->get_nb_ordersupplier($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'propal') $graph_data = $object->get_nb_propal($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'orders') $graph_data = $object->get_nb_order($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'invoices') $graph_data = $object->get_nb_vente($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'proposalssuppliers') $graph_data = $object->get_nb_propalsupplier($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'invoicessuppliers') $graph_data = $object->get_nb_achat($socid,$mode,((string) $type != '' ? $type : -1)); + if ($key == 'orderssuppliers') $graph_data = $object->get_nb_ordersupplier($socid,$mode,((string) $type != '' ? $type : -1)); // TODO Save cachefile $graphfiles[$key]['file'] } @@ -289,6 +295,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') if ($graphfiles == 'propal' && ! $user->rights->propale->lire) continue; if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue; if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue; + if ($graphfiles == 'proposals_suppliers' && ! $user->rights->supplier_proposal->lire) continue; if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue; if ($graphfiles == 'orders_suppliers' && ! $user->rights->fournisseur->commande->lire) continue; From c7dda59fbc150eb7c96a7dc7c0e8846af4de5e6f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 May 2016 17:33:51 +0200 Subject: [PATCH 75/78] Fix: doublon (merge problem?) --- htdocs/comm/propal.php | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index fa5619ca204..e1587d30f13 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -562,15 +562,6 @@ if (empty($reshook)) } } - // Reopen proposal - else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) - { - // prevent browser refresh from reopening proposal several times - if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { - $object->reopen($user, 1); - } - } - // Close proposal else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { @@ -591,17 +582,6 @@ if (empty($reshook)) } } - // Classify billed - else if ($action == 'classifybilled' && $user->rights->propal->cloturer) - { - $result=$object->cloture($user, 4, ''); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } - } - // Reopen proposal else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { @@ -617,20 +597,6 @@ if (empty($reshook)) } } - // Close proposal - else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) - { - if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); - $action = 'statut'; - } else { - // prevent browser refresh from closing proposal several times - if ($object->statut == Propal::STATUS_VALIDATED) { - $object->cloture($user, GETPOST('statut'), GETPOST('note')); - } - } - } - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; From 9e5db0f3c61f1abcd8a91b3d9f538a2401bb4d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 21 May 2016 09:18:16 +0200 Subject: [PATCH 76/78] Fix next month or next year in opensurvey http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/55209-bug-calendrier-opensurvey-v3-9 --- htdocs/opensurvey/wizard/choix_date.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index cc08434cd50..ee1aafbebb8 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -227,7 +227,7 @@ if (! isset($_SESSION['mois'])) $_SESSION['mois']= date('n'); if (! isset($_SESSION['annee'])) $_SESSION['annee']= date('Y'); //mise a jour des valeurs de session si bouton retour a aujourd'hui -if ((!issetAndNoEmpty('choixjourajout')) && !issetAndNoEmpty('choixjourretrait') || issetAndNoEmpty('retourmois')){ +if (!issetAndNoEmpty('choixjourajout') && !issetAndNoEmpty('choixjourretrait') && (issetAndNoEmpty('retourmois') || issetAndNoEmpty('retourmois_x'))) { $_SESSION["jour"]=date("j"); $_SESSION["mois"]=date("n"); $_SESSION["annee"]=date("Y"); From b95981a2be1e795e4a8c89c6c24201f66ef2bcf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 May 2016 18:03:13 +0200 Subject: [PATCH 77/78] Fix missing ; at end of sql --- htdocs/install/mysql/migration/repair.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index e38026b726a..6b9ea2a16f7 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -71,7 +71,7 @@ DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product DROP TABLE tmp_llx_product_batch; DROP TABLE tmp_llx_product_batch2; CREATE TABLE tmp_llx_product_batch AS select fk_product_stock, eatby, sellby, batch, SUM(qty) as qty, COUNT(rowid) as nb FROM llx_product_batch GROUP BY fk_product_stock, eatby, sellby, batch HAVING COUNT(rowid) > 1; -CREATE TABLE tmp_llx_product_batch2 AS select pb.rowid, pb.fk_product_stock, pb.eatby, pb.sellby, pb.batch, pb.qty from llx_product_batch as pb, tmp_llx_product_batch as tpb where pb.fk_product_stock = tpb.fk_product_stock and COALESCE(pb.eatby, '') = COALESCE(tpb.eatby,'') and COALESCE(pb.sellby, '') = COALESCE(tpb.sellby, '') and pb.batch = tpb.batch +CREATE TABLE tmp_llx_product_batch2 AS select pb.rowid, pb.fk_product_stock, pb.eatby, pb.sellby, pb.batch, pb.qty from llx_product_batch as pb, tmp_llx_product_batch as tpb where pb.fk_product_stock = tpb.fk_product_stock and COALESCE(pb.eatby, '') = COALESCE(tpb.eatby,'') and COALESCE(pb.sellby, '') = COALESCE(tpb.sellby, '') and pb.batch = tpb.batch; --select * from tmp_llx_product_batch; --select * from tmp_llx_product_batch2; DELETE FROM llx_product_batch WHERE rowid IN (select rowid FROM tmp_llx_product_batch2); From 2355a0c38c6e71794d551b53d02626e89e2138c0 Mon Sep 17 00:00:00 2001 From: Xebax Date: Sun, 22 May 2016 17:15:22 +0200 Subject: [PATCH 78/78] FIX #5236 Cron module activated but "Modules tools" does not appear in the left menu. --- htdocs/core/menus/standard/auguria_menu.php | 3 ++- htdocs/core/menus/standard/eldy.lib.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index ae173504ed6..359faa930b4 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -110,7 +110,8 @@ class MenuManager // Modules system tools // TODO Find a way to add parent menu only if child menu exists. For the moment, no other method than hard coded methods. - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on + // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) || ! empty($conf->cron->enabled) || ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS)) { if (empty($user->societe_id)) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index fafebe3ca18..06e4ceab5b8 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -544,14 +544,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Modules system tools - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on + // TODO We should enabled module system tools entry without hardcoded test, but when at least one modules bringing such entries are on + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled) || ! empty($conf->barcode->enabled) || ! empty($conf->cron->enabled) || ! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS)) // Some external modules may need to force to have this entry on. { if (empty($user->societe_id)) { $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ModulesSystemTools"), 0, $user->admin, '', $mainmenu, 'modulesadmintools'); // Special case: This entry can't be embedded into modules because we need it for both module service and products and we don't want duplicate lines. - if ((empty($leftmenu) || $leftmenu=="modulesadmintools") && $user->admin) + if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && (empty($leftmenu) || $leftmenu=="modulesadmintools") && $user->admin) { $langs->load("products"); $newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
'.$langs->trans('ParentProduct').''.$langs->trans('ParentProducts').''.$langs->trans('Label').''.$langs->trans('Qty').'