Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.3' into 3.4
Browse files Browse the repository at this point in the history
Conflicts:
	ChangeLog
	htdocs/comm/propal.php
	htdocs/core/class/commonobject.class.php
	htdocs/core/tpl/freeproductline_create.tpl.php
	htdocs/core/tpl/predefinedproductline_create.tpl.php
  • Loading branch information
eldy committed May 20, 2013
2 parents e00df58 + 416cdd2 commit 71e14df
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 85 deletions.
54 changes: 27 additions & 27 deletions ChangeLog
Expand Up @@ -92,33 +92,33 @@ WARNING: If you used external modules, some of them may need to be upgraded due

***** ChangeLog for 3.3.2 compared to 3.3.1 *****

- Fix: Dutch (nl_NL) translation.
- Generalize fix: file with a specific mask not found, again.
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger.
- Fix: Can't reset payment due date.
- Fix: Orderstoinvoice didn't act as expected when no order was checked.
- Fix: Bad link to all proposals into Third party card if customer is prospect.
- Fix: Some bugs on withdrawal rejects.
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed.
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment.
- Fix: [ bug #789 ] VAT not being calculated in POS.
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated.
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list.
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price.
- Fix: [ bug #810 ] Cannot update ODT template path.
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes.
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes.
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary.
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres).
- Fix: [ bug #855 ] Holiday approval email in French.
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email.
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount.
- Fix: [ bug #861 ] Impossible to create a new event in agenda.
- Fix: [ bug #827 ] AJAX search does not respect multiprice level.
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work.
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay.
- Fix: [ bug #788 ] Date of linked interventions are not shown.

- Fix: Dutch (nl_NL) translation
- Generalize fix: file with a specific mask not found, again
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
- Fix: Can't reset payment due date
- Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: Some bugs on withdrawal rejects
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
- Fix: [ bug #855 ] Holiday approval email in French
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
- Fix: [ bug #861 ] Impossible to create a new event in agenda
- Fix: [ bug #827 ] AJAX search does not respect multiprice level
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay
- Fix: [ bug #788 ] Date of linked interventions are not shown
- Fix: external users should not see costprice and margin infos

***** ChangeLog for 3.3.1 compared to 3.3 *****

Expand Down
52 changes: 26 additions & 26 deletions htdocs/comm/propal.php
@@ -1,34 +1,34 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* \file htdocs/comm/propal.php
* \ingroup propale
* \brief Page of commercial proposals card and list
*/
* \ingroup propale
* \brief Page of commercial proposals card and list
*/

require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
Expand Down Expand Up @@ -2283,4 +2283,4 @@
// End of page
llxFooter();
$db->close();
?>
?>
23 changes: 14 additions & 9 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -44,7 +44,7 @@ abstract class CommonObject
public $civility_id;

public $array_options=array();

public $linkedObjectsIds;
public $linkedObjects;

Expand Down Expand Up @@ -2027,7 +2027,7 @@ function fetch_optionals($rowid,$optionsArray='')
$optionsArray = $extrafields->fetch_name_optionals_label($this->table_element);
}


// Request to get complementary values
if (count($optionsArray) > 0)
{
Expand Down Expand Up @@ -2057,7 +2057,7 @@ function fetch_optionals($rowid,$optionsArray='')
}
}
}

$this->db->free($resql);
}
else
Expand Down Expand Up @@ -2712,7 +2712,7 @@ function formAddObjectLine($dateSelector,$seller,$buyer)
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0)
{
global $conf,$langs,$hookmanager;
global $conf,$langs,$user,$hookmanager;

print '<tr class="liste_titre nodrag nodrop">';

Expand All @@ -2735,7 +2735,8 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
// Reduction short
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';

if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled) && empty($user->societe_id))
{
if ($conf->global->MARGIN_TYPE == "1")
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
else
Expand Down Expand Up @@ -3159,11 +3160,16 @@ function getMarginInfos($force_price=false) {
}

/**
* displayMarginInfos
*
* @param string $force_price
* @param string $force_price Force price
* @return void
*/
function displayMarginInfos($force_price=false) {
global $langs, $conf;
function displayMarginInfos($force_price=false)
{
global $langs, $conf, $user;

if (! empty($user->societe_id)) return;

$marginInfo = $this->getMarginInfos($force_price);

Expand Down Expand Up @@ -3215,6 +3221,5 @@ function displayMarginInfos($force_price=false) {
print '</tr>';
print '</table>';
}

}
?>
2 changes: 1 addition & 1 deletion htdocs/core/modules/modMargin.class.php
Expand Up @@ -80,7 +80,7 @@ function __construct($db)
// New pages on tabs
$this->tabs = array(
'product:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/productMargins.php?id=__ID__',
'thirdparty:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/thirdpartyMargins.php?socid=__ID__'
'thirdparty:+margin:Margins:margins:$conf->margin->enabled && empty($user->societe_id):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
);


Expand Down
16 changes: 8 additions & 8 deletions htdocs/core/tpl/freeproductline_create.tpl.php
Expand Up @@ -26,7 +26,7 @@

$usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;

?>

<!-- BEGIN PHP TEMPLATE freeproductline_create.tpl.php -->
Expand Down Expand Up @@ -118,13 +118,13 @@
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>"><input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline"></td>
</tr>

<?php
if (! empty($conf->service->enabled) && $dateSelector)
<?php
if (! empty($conf->service->enabled) && $dateSelector)
{
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10;
else $colspan = 9;
if (! empty($usemargins))

if (! empty($usemargins))
{
$colspan++; // For the buying price
if($conf->global->DISPLAY_MARGIN_RATES) $colspan++;
Expand All @@ -142,7 +142,7 @@
$form->select_date('',"date_end_sl",$usehm,$usehm,1,"addline_sl");
}
else
{
{
echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
echo $form->select_date('','date_start',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct");
echo ' '.$langs->trans('to').' ';
Expand All @@ -151,9 +151,9 @@
?>
</td>
</tr>
<?php
<?php
}
?>

</form>
<!-- END PHP TEMPLATE freeproductline_create.tpl.php -->
<!-- END PHP TEMPLATE freeproductline_create.tpl.php -->
2 changes: 1 addition & 1 deletion htdocs/core/tpl/objectline_view.tpl.php
Expand Up @@ -119,7 +119,7 @@
<td>&nbsp;</td>
<?php }

if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
?>
<td align="right" class="nowrap"><?php echo price($line->pa_ht); ?></td>
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>
Expand Down
20 changes: 10 additions & 10 deletions htdocs/core/tpl/predefinedproductline_create.tpl.php
Expand Up @@ -60,7 +60,7 @@
<td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
<?php
$colspan = 4;
if (! empty($usemargins))
if (! empty($usemargins))
{
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
Expand All @@ -74,7 +74,7 @@
?>
</td>
<?php
}
}
?>
<td colspan="<?php echo $colspan; ?>">&nbsp;</td>
</tr>
Expand Down Expand Up @@ -110,7 +110,7 @@
<td align="right" nowrap><input type="text" size="1" class="flat" name="remise_percent" value="<?php echo $buyer->remise_client; ?>"><span class="hideonsmartphone">%</span></td>
<?php
$colspan = 4;
if (! empty($usemargins))
if (! empty($usemargins))
{
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
Expand All @@ -127,8 +127,8 @@
</td>
</tr>

<?php
if (! empty($conf->service->enabled) && $dateSelector)
<?php
if (! empty($conf->service->enabled) && $dateSelector)
{
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10;
else $colspan = 9;
Expand All @@ -148,7 +148,7 @@
print $langs->trans("DateStartPlanned").' ';
$form->select_date('',"date_start",$usehm,$usehm,1,"addline");
print ' &nbsp; '.$langs->trans("DateEndPlanned").' ';
$form->select_date('',"date_end",$usehm,$usehm,1,"addline");
$form->select_date('',"date_end",$usehm,$usehm,1,"addline");
}
else
{
Expand All @@ -161,13 +161,13 @@
</td>
</tr>
<?php
}
}
?>

</form>

<?php
if (! empty($usemargins))
if (! empty($usemargins))
{
?>
<script type="text/javascript">
Expand Down Expand Up @@ -204,6 +204,6 @@
});
</script>
<?php
}
}
?>
<!-- END PHP TEMPLATE predefinedproductline_create.tpl.php -->
<!-- END PHP TEMPLATE predefinedproductline_create.tpl.php -->
6 changes: 3 additions & 3 deletions htdocs/langs/fr_FR/margins.lang
Expand Up @@ -43,10 +43,10 @@ MargeBrute=Marge brute
MargeNette=Marge nette
MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT<br/>Marge nette : Prix de vente HT - Coût de revient

CostPrice=Prix ​​d'achat
BuyingCost=Coût de revient
BuyingPrice=Prix ​​d'achat
CostPrice=Prix de revient
UnitCharges=Charge unitaire
Charges=Charges

AgentContactType=Type de contact commissionné
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux

0 comments on commit 71e14df

Please sign in to comment.