Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-09-11 15:43:29 +02:00
commit bf9b8657c3
5 changed files with 103 additions and 2 deletions

View File

@ -43,7 +43,7 @@ For users:
- New: [ task #498 ] Improvement of the block to add products/services lines.
- New: ECM autodir works also for files joined to products and services.
- New: Add a selection module for emailing to enter a recipient from gui.
- New: Allow to search product from barcodes directly from the permanent mini search left box
- New: Allow to search thirds and products from barcodes directly from the permanent mini search left box
- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX
New experimental modules:
- New: Add margin and commissions management module.

View File

@ -3758,14 +3758,18 @@ class Form
{
global $conf;
//Check if barcode is filled in the card
if (empty($object->barcode)) return '';
// Complete object if not complete
if (empty($object->barcode_type_code) || empty($object->barcode_type_coder))
{
$object->fetch_barcode();
$result = $object->fetch_barcode();
}
//Check if fetch_barcode() failed
if ($result < 1) return '';
// Barcode image
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code);
$out ='<!-- url barcode = '.$url.' -->';

View File

@ -0,0 +1,41 @@
# Dolibarr language file - fr_FR - commissions
CHARSET=UTF-8
Module60000Desc=Commissions management
commissionsSetup=Commissions management setup
ProductCommissionRate=Commission rate on products
ServiceCommissionRate=Commission rate on services
ProductCommissionRateDetails=Commission rate on product sales
ServiceCommissionRateDetails=Commission rate on service sales
Commissions=Commissions
CommissionDetails=Commissions details
IncludeUnpayedInvoices=Include overdue invoices
TotalCommission=Commissions subtotal
ProductMargin=Margin / products
ServiceMargin=Margin / services
CommissionRate=Commission rate
ProductCommission=Commission / produics
ServiceCommission=Commission / services
CommissionBase=Commissions base
CommissionBasedOnTurnover=Commissions based on turnover
CommissionBasedOnMargins=Commissions based on margins
CommissionBaseDetails=Define calculation method for commissions
CommissionBasedOnMarginsDetails=Commissions based on margins needs margin module activation.
TurnoverTotal = Total turrnover
ProductTurnover=Product turnover
ServiceTurnover=Service turnover
CommercialAgent=Commercial agent
StartDate=Start date
EndDate=End date
Launch=Start

View File

@ -0,0 +1,49 @@
# Dolibarr language file - en_US - marges
CHARSET=UTF-8
Module59000Name=Margins
Module59000Desc=Profit margins management
Margin=Margin
Margins=Margins
TotalMargin=Total Margin
MarginOnProducts=Margin / Products
MarginOnServices=Margin / Services
MarginRate=Margin rate
MarkRate=Mark rate
DisplayMarginRates=Display margin rates
DisplayMarkRates=Display mark rates
InputPrice=Input price
margin=Profit margins management
margesSetup=Profit margins management setup
MarginDetails=Margin details
ProductMargins=Product margins
CustomerMargins=Customer margins
AgentMargins=Agent margins
ProductService=Product or Service
AllProducts=All products and services
ChooseProduct/Service=Choose product or service
CommercialAgent=Commercial agent
StartDate=Start date
EndDate=End date
Launch=Start
ForceBuyingPriceIfNull=Force buying price if null
ForceBuyingPriceIfNullDetails=if "ON", margin will be zero on line (buying price = selling price), otherwise ("OFF"), marge will be equal to selling price (buying price = 0)
MARGIN_METHODE_FOR_DISCOUNT=Margin method for global discounts
UseDiscountAsProduct=As a product
UseDiscountAsService=As a service
UseDiscountOnTotal=On subtotal
MARGIN_METHODE_FOR_DISCOUNT_DETAILS=Defines if a global discount is treated as a product, a service, or only on subtotal for margin calculation.
MARGIN_TYPE=Margin type
MargeBrute=Raw margin
MargeNette=Net margin
MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price<br/>Net margin : Selling price - Cost price
BuyingCost=Cost price
UnitCharges=Unit charges

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 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
@ -81,6 +82,12 @@ if ($mode == 'search')
$sql.= " OR s.code_client LIKE '%".$db->escape($socname)."%'";
$sql.= " OR s.email LIKE '%".$db->escape($socname)."%'";
$sql.= " OR s.url LIKE '%".$db->escape($socname)."%'";
if (!empty($conf->barcode->enabled))
{
$sql.= "OR s.barcode LIKE '".$db->escape($socname)."'";
}
$sql.= ")";
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;