Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.7' into 3.8
Browse files Browse the repository at this point in the history
Conflicts:
	build/makepack-dolibarr.pl
	htdocs/accountancy/customer/card.php
	htdocs/accountancy/customer/list.php
	htdocs/accountancy/supplier/card.php
	htdocs/accountancy/supplier/list.php
	htdocs/commande/card.php
	htdocs/commande/class/commande.class.php
	htdocs/fichinter/card.php
	htdocs/societe/rib.php
  • Loading branch information
eldy committed Nov 13, 2015
2 parents 816bacc + bad28c6 commit 93be430
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 46 deletions.
141 changes: 122 additions & 19 deletions ChangeLog
Expand Up @@ -351,25 +351,94 @@ Dolibarr better:
to make difference between creation from contact or not.
- Function get_exdir require now 6 parameters. This is to prepare a future feature.


***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page
FIX [ bug #1852 ] JS error when editing a customer order line
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image
FIX [ bug 1634 ] Error deleting a project when it had many linked objects
FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne
FIX: Not showing delivery date on rouget pdf
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS
FIX: #3009: Better filtering to prevent SQL injection
FIX: #3091 TotalHT amount in supplier order is bold unlike the rest of Dolibarr
FIX: #3262 Webservice getProductsForCategory()
FIX: #3318
FIX: [ #3460 ] Selected bank account was not saved when an error happened when trying to create a customer invoice
FIX: #3530
FIX: #3630 - Wrong balance report when module salaries and donation disabled
FIX: #3679 Error when deleting a Localtax2 special payment
FIX: #3707 Thirdparty bank account page table has a glitch
FIX: #3724 Bug: Blank page after cloning proposal with changed client
FIX: #3836 Unable to upload a document to an invoice under some circunstances
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: Add a protection to not make release if ChangeLog was not generated.
FIX: adjusted test for affecting supplier reference
FIX: Admin fiche inter page do not take good action
FIX: Avoid warning strict mode when hosting server do not have php5_curl installed
FIX: bad calculation for stock value
FIX: Bad condition into invoice export request making reporting too many rows.
FIX: bad stock valorisation
FIX: Bad visualization of suppliers name on Incomes-Expenses mode
FIX: Better management error into the color conversion functions
FIX: [ bug 1634 ] Error deleting a project when it had many linked objects
FIX: [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
FIX: [ bug #3211 ] Error about sold to pay (Montant encours)
FIX: [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
FIX: [ bug #3358 ] Tasks box does not work with PostgreSQL
FIX: [ bug #3383 ] Company name is overlapped with company direction in PDF models
FIX: [ bug #3426 ] Unable to create an invoice from a contract with extrafields
FIX: [ bug #3431 ] Invoice bank account is not respected
FIX: [ bug #3432 ] Spaces should be removed from IBAN when formatting it
FIX: Can create Proposal on close thridparty #3526
FIX: change order date on clone (as everywhere else)
FIX: Close #2835 Customer prices of a product shows incorrect history order
FIX: Close #2837 Product list table column header does not match column body
FIX: Close bug #2855 Wrong translation key in localtax report page
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
FIX: Close bug #2891 Category hooks do not work
FIX: Close bug #2900 Courtesy title is not stored in create thirdparty form
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
FIX: contact country had wrong display if the country dont have translate
FIX: Display country name instead of country id (display country id makes no sense on vcard files)
FIX: display error on extrafields on ficheinter
FIX: double db escape add too quote
FIX: Email selector contact must not include inactive contact
FIX: End log must use same level then start log.
FIX: error in SQL due to a previous fix
FIX: event's data lost on user assign update
FIX: Export of tags for contact and member
FIX: facturestat bad sql when customer view is limited
FIX: if multicompany enabled, call to undifend method _setCookie instead of setCookie
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
FIX: keep filter by category or by not enough stock if we switch page
FIX: Line break display as a block
FIX: load propal langs for availability traduction
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
FIX: Mass Mailing activity don't display all status
FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
FIX: multientity warehouse management
FIX: New adherent from, always redirect on entity
FIX: No check warehouse is provided if module stock is not enabled.
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
FIX [ bug #3431 ] Invoice bank account is not respected
FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it
FIX [ bug #3358 ] Tasks box does not work with PostgreSQL
FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models
FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message
FIX: only active customer should be return into new invoice creation select list
FIX: Payed invoices are showed as canceled FIX: Bad date filter on customer order
FIX: WAP calculation
FIX: Save of filters into export profiles failed.
FIX: supplier rights for orderToInvoice
FIX: Syntax error in Debian Apache configuration
FIX: The hours of date filter aren't correct
FIX: tool export handle the type "select" extrafields and return the value instead of id
FIX: total amount in tpl linked object are not reset
FIX: translate Jabberid on contact page with edit view
FIX: translation for 1 word do not work if product/service module are disabled because the translation search in products.lang
FIX: update2.php test res befre assign it
FIX: When delete actioncomm also delete actioncomm_resources
FIX: when fetch_optionnal_by_label in Extrafields with $this->db cannot work because this->db is never instanciated
FIX: when mailing is deleted, the targets list was kept in database
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
FIX: When we add an user on event in create mode, we lose linked object
FIX: When we automatically creta an order from a proposal with workflow module, if some extrafields of propal don't exist in order object, insertExtraFields() function tries to insert extrafields in unexistant column of commande_extrafields table.
FIX: When we clone a propal, if it has a project which is not assigned to a third, it was not on new propal because fk_project was always set to empty string if new propal is for another third.
FIX: XSS security using the onerror and missing escapement on type of member page.

NEW: Created new ContratLigne::insert function

Expand Down Expand Up @@ -590,9 +659,43 @@ Dolibarr better:
warehouse module and your Point Of Sale module setup if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.


***** ChangeLog for 3.6.5 compared to 3.6.4 *****
- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address
- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS
FIX: #3009: Better filtering to prevent SQL injection
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: #3890 Expected transactions bank account page, shows negative numbers
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
FIX: bad calculation for stock value
FIX: bad stock valo
FIX: bad stock valorisation
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
FIX: button create payment hide if tax amount is less than 1
FIX: change object statut on close shipping and remove erratic db commit
FIX: change order date on clone (as everywhere else)
FIX: Close #2835 Customer prices of a product shows incorrect history order
FIX: Close #2837 Product list table column header does not match column body
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
FIX: Close bug #2891 Category hooks do not work
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
FIX: contact country had wrong display if the country dont have translate
FIX: double db escape add too quote
FIX: End log must use same level then start log.
FIX: error in SQL due to a previous fix
FIX: event for restricted user was restricted if company null
FIX: facturestat bad sql when customer view is limited
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
FIX: keep filter by category or by not enough stock if we switch page
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
FIX: pmp
FIX: send mail, copy sendto don't read the list of contact
FIX: The hours of date filter aren't correct
FIX: tool export handle the type "select" extrafields and return the value instead of id
FIX: top links menu have target attribute with wrong value
FIX: total amount in tpl linked object are not reset
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)

***** ChangeLog for 3.6.4 compared to 3.6.3 *****
- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
Expand Down
5 changes: 2 additions & 3 deletions htdocs/accountancy/customer/card.php
@@ -1,4 +1,4 @@
<?PHP
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
Expand All @@ -19,7 +19,7 @@

/**
* \file htdocs/accountancy/customer/card.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Card customer ventilation
*/

Expand Down Expand Up @@ -88,7 +88,6 @@
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;

if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
Expand Down
23 changes: 17 additions & 6 deletions htdocs/accountancy/customer/list.php
Expand Up @@ -21,7 +21,7 @@

/**
* \file htdocs/accountancy/customer/list.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Ventilation page from customers invoices
*/
require '../../main.inc.php';
Expand Down Expand Up @@ -165,16 +165,27 @@
* Customer Invoice lines
*/

$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod";
$sql .= " , aa.rowid as aarowid";
$sql .= " , l.product_type as type_l, l.tva_tx as tva_tx_line";
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}

$offset = $limit * $page;

$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
$sql .= " aa.rowid as aarowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " WHERE f.fk_statut > 0";
$sql .= " AND fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";

// Add search filter like
Expand Down
3 changes: 1 addition & 2 deletions htdocs/accountancy/supplier/card.php
Expand Up @@ -23,7 +23,7 @@
*/
/**
* \file htdocs/accountancy/supplier/card.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Card supplier ventilation
*/

Expand Down Expand Up @@ -88,7 +88,6 @@
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;

if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
Expand Down
18 changes: 13 additions & 5 deletions htdocs/accountancy/supplier/list.php
Expand Up @@ -21,7 +21,7 @@

/**
* \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Ventilation page from suppliers invoices
*/
require '../../main.inc.php';
Expand Down Expand Up @@ -171,19 +171,27 @@
*
*/

$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.tva_tx as tva_tx_line, ";
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}

$offset = $limit * $page;

$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, f.datef, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, ";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod";
$sql .= " , aa.rowid as aarowid";
$sql .= " , f.datef";
$sql .= " , l.product_type as type_l";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";

// Add search filter like
if (strlen(trim($search_invoice))) {
$sql .= " AND (f.ref like '%" . $search_invoice . "%')";
Expand Down
40 changes: 35 additions & 5 deletions htdocs/commande/card.php
Expand Up @@ -1239,8 +1239,10 @@
if ($socid > 0)
$res = $soc->fetch($socid);

if (! empty($origin) && ! empty($originid))
{
$projectid = 0;
$remise_absolue = 0;

if (! empty($origin) && ! empty($originid)) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
Expand All @@ -1250,6 +1252,20 @@

if ($element == 'project') {
$projectid = $originid;

if (!$cond_reglement_id) {
$cond_reglement_id = $soc->cond_reglement_id;
}
if (!$mode_reglement_id) {
$mode_reglement_id = $soc->mode_reglement_id;
}
if (!$remise_percent) {
$remise_percent = $soc->remise_percent;
}
if (!$dateorder) {
// Do not set 0 here (0 for a date is 1970)
$dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder);
}
} else {
// For compatibility
if ($element == 'order' || $element == 'commande') {
Expand Down Expand Up @@ -1510,9 +1526,23 @@
print '<input type="hidden" name="origin" value="' . $objectsrc->element . '">';
print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">';

$newclassname = $classname;
if ($newclassname == 'Propal')
$newclassname = 'CommercialProposal';
switch ($classname) {
case 'Propal':
$newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
default:
$newclassname = $classname;
}

print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/class/commande.class.php
Expand Up @@ -1188,7 +1188,7 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f
{
global $mysoc, $conf, $langs;

dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type, fk_unit=$fk_unit", LOG_DEBUG);
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit", LOG_DEBUG);

include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

Expand Down
3 changes: 2 additions & 1 deletion htdocs/compta/bank/treso.php
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008-2009 Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
*
* 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
Expand Down Expand Up @@ -309,7 +310,7 @@
print "</td>";
print "<td>".$ref."</td>";
print "<td>".$refcomp."</td>";
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price(abs($total_ttc))."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td align=\"right\">".price($total_ttc)."</td>"; };
print '<td align="right">'.price($solde).'</td>';
print "</tr>";
Expand Down

0 comments on commit 93be430

Please sign in to comment.