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

Conflicts:
	htdocs/install/mysql/migration/3.2.0-3.3.0.sql
This commit is contained in:
Maxime Kohlhaas 2012-12-01 14:36:51 +01:00
commit e45438994c
93 changed files with 2739 additions and 1922 deletions

View File

@ -30,7 +30,7 @@ For users:
- New: Add link to third party into sells and purchase journal.
- New: Suggest a method to generate a backup file for user with no access
to mysqldump binary.
- New: Can use extrafields on contacts/addresses.
- New: Can also use extrafields on contacts/addresses and users.
- New: Support unique field for extrafields.
- New: Extra fields supports more types (int, string, double, date, datetime).
- New: Can correct stock of a warehouse from warehouse card.
@ -62,10 +62,12 @@ For users:
- New: Can choose menu entry to show with external site module.
- New: Add hidden option MAIN_PDF_MARGIN_LEFT, MAIN_PDF_MARGIN_RIGHT, MAIN_PDF_MARGIN_TOP, MAIN_PDF_MARGIN_BOTTOM
to force margins of generated PDF.
- New: [ task #314 ] Can define if prof id are mandatory or not
New experimental modules:
- New: Add margin management module.
- New: Add commissions management module.
- Fix: [ bug #499 ]: Supplier order input method not translated
- Fix: No images into product description lines as PDF generation does
not work with this.

View File

@ -34,16 +34,6 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
</IfModule>
# OPTIMIZE: To use gzip compressed files (for Dolibarr already compressed files).
# Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set.
#AddType text/javascript .jgz
#AddEncoding gzip .jgz
# OPTIMIZE: To use gzip compression (on the fly).
# Note that you must also enable the module mod_deflate.
# You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set.
#TODO
# OPTIMIZE: To use cache on static pages (A259200 = 1 month).
# Note that you must also enable the module mod_expires.
#ExpiresActive On

View File

@ -161,12 +161,11 @@ $dolibarr_main_authentication='dolibarr';
# $dolibarr_main_auth_ldap_filter = ''; # If defined, two previous parameters are not used to find a user into LDAP. Ex: (uid=%1%) or &(uid=%1%)(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com).
# $dolibarr_main_auth_ldap_admin_login=''; # Required only if anonymous bind disabled. Ex: cn=admin,dc=example,dc=com
# $dolibarr_main_auth_ldap_admin_pass=''; # Required only if anonymous bind disabled. Ex: secret
# $dolibarr_main_auth_ldap_debug='false';
# dolibarr_main_demo
# Login and pass to use in a demo mode
# Login and pass to use in a demo mode.
# Default value: ''
# Examples:
# $dolibarr_main_demo='autologin,autopass'

View File

@ -1,55 +0,0 @@
Package: dolibarr
Version: __VERSION__
Architecture: all
Maintainer: Laurent Destailleur <eldy@users.sourceforge.net>
Installed-Size: 61200
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5,
php5-mysql | php5-mysqli,
php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip,
libphp-adodb,
libnusoap-php,
libphp-pclzip,
libjs-jquery, libjs-jquery-ui, ckeditor,
ttf-dejavu-core,
xdg-utils,
mysql-server
Section: web
Priority: optional
Homepage: http://www.dolibarr.org
Description: Web based software to manage a small company or foundation
Dolibarr ERP & CRM is an easy to use open source/free software for small
and medium companies, foundations or freelances. It includes different
features for Enterprise Resource Planning (ERP) and Customer Relationship
Management (CRM) but also for different other activities.
It's a web software you can install as a standalone program or on any web
hosting provider to use it from anywhere with any web browser.
.
Dolibarr was designed to be easy to use. Only features you need are
visible, depending on which module were activated.
Most common used modules are:
.
Customers, Suppliers or Prospects directory,
Contacts directory,
Orders management,
Commercial proposals management,
Invoices management,
Products and services catalog,
Stock management,
Foundations members management,
Bank accounts management,
Point of Sale,
Payments management,
Commercial actions management,
Contracts management,
Standing orders management,
Shipping management,
Donations management,
Bookmarks management,
Mass Emailings,
Reports,
Wizards to export and import data,
LDAP connectivity,
PDF exports,
And a lot of more modules...
.
You can also add third parties external modules or develop yours.

View File

@ -29,13 +29,14 @@ $force_install_lockinstall='444';
// If we enable/disable libraries declaration during install, we must also check they are
// not removed from package (see in rules file),
// declared into dependencies (see in control file)
$force_dolibarr_lib_TCPDF_PATH='';
$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
$force_dolibarr_lib_GEOIP_PATH='';
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
$force_dolibarr_lib_PHPEXCEL_PATH='';
$force_dolibarr_lib_TCPDF_PATH='';
$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
$force_dolibarr_js_JQUERY='/javascript/jquery';
$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';

View File

@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit')
/*
* Local Taxes
*/
if ($mysoc->country_code=='ES')
if ($mysoc->hasLocalTax(1))
{
// Local Tax 1
print '<br>';
@ -576,7 +576,9 @@ if ($action == 'edit' || $action == 'updateedit')
print "</table>";
print "</td></tr>\n";
print "</table>";
}
if ($mysoc->hasLocalTax(2))
{
// Local Tax 2
print '<br>';
print '<table class="noborder" width="100%">';
@ -921,7 +923,7 @@ else
/*
* Local Taxes
*/
if ($mysoc->country_code=='ES')
if ($mysoc->hasLocalTax(1))
{
// Local Tax 1
print '<br>';
@ -951,7 +953,9 @@ else
print "</td></tr>\n";
print "</table>";
}
if ($mysoc->hasLocalTax(2))
{
// Local Tax 2
print '<br>';
print '<table class="noborder" width="100%">';

View File

@ -27,7 +27,9 @@
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("admin");
$langs->load("members");
@ -35,6 +37,9 @@ $langs->load("users");
if (! $user->admin) accessforbidden();
$extrafields = new ExtraFields($db);
/*
* Action
*/
@ -71,14 +76,17 @@ if (preg_match('/del_(.*)/',$action,$reg))
* View
*/
llxHeader();
$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:M&oacute;dulo_Usuarios';
llxHeader('',$langs->trans("UsersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("UsersSetup"),$linkback,'setup');
print "<br>";
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
$head=user_admin_prepare_head();
dol_fiche_head($head,'card', $langs->trans("User"), 0, 'user');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
@ -114,7 +122,8 @@ else
print '</td></tr>';
print '</table>';
print '<br><br>';
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -1565,21 +1565,19 @@ print '<td align="right" nowrap>'.price($object->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Amount Local Taxes
if ($mysoc->country_code=='ES')
if ($mysoc->localtax1_assuj=="1") //Localtax1
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right" nowrap>'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right" nowrap>'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right" nowrap>'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right" nowrap>'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
// Amount TTC
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>';

View File

@ -1581,18 +1581,16 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
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>";
if ($mysoc->country_code=='ES')
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
}
else
@ -1814,11 +1812,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
if (! empty($conf->projet->enabled)) $nbrow++;
//Local taxes
if ($mysoc->country_code=='ES')
{
if($mysoc->localtax1_assuj=="1") $nbrow++;
if($mysoc->localtax2_assuj=="1") $nbrow++;
}
if($mysoc->localtax1_assuj=="1") $nbrow++;
if($mysoc->localtax2_assuj=="1") $nbrow++;
print '<table class="border" width="100%">';
@ -2075,20 +2070,17 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
// Amount Local Taxes
if ($mysoc->country_code=='ES')
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
}
// Total TTC

View File

@ -757,6 +757,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$object->amount = $_POST['amount'];
$object->remise_absolue = $_POST['remise_absolue'];
$object->remise_percent = $_POST['remise_percent'];
$object->fetch_thirdparty();
// If creation from another object of another module (Example: origin=propal, originid=1)
if ($_POST['origin'] && $_POST['originid'])
@ -2078,17 +2079,14 @@ if ($action == 'create')
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>";
if ($mysoc->pays_code=='ES')
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
}
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
}
print '<tr><td>'.$langs->trans('TotalTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
}
@ -2654,11 +2652,8 @@ else if ($id > 0 || ! empty($ref))
if (! empty($conf->banque->enabled)) $nbcols++;
//Local taxes
if ($mysoc->pays_code=='ES')
{
if($mysoc->localtax1_assuj=="1") $nbrows++;
if($mysoc->localtax2_assuj=="1") $nbrows++;
}
if($mysoc->localtax1_assuj=="1") $nbrows++;
if($mysoc->localtax2_assuj=="1") $nbrows++;
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';

View File

@ -127,6 +127,7 @@ class Contact extends CommonObject
$sql.= ", priv";
$sql.= ", canvas";
$sql.= ", entity";
$sql.= ", import_key";
$sql.= ") VALUES (";
$sql.= "'".$this->db->idate($now)."',";
if ($this->socid > 0) $sql.= " ".$this->socid.",";
@ -136,7 +137,8 @@ class Contact extends CommonObject
$sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= " ".$this->priv.",";
$sql.= " ".($this->canvas?"'".$this->canvas."'":"null").",";
$sql.= " ".$conf->entity;
$sql.= " ".$conf->entity.",";
$sql.= " ".$this->import_key;
$sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql);

View File

@ -1516,27 +1516,49 @@ abstract class CommonObject
$this->total_localtax2 += $obj->total_localtax2;
$this->total_ttc += $obj->total_ttc;
// Define vatrates with totals for each line and for all lines
// TODO $vatrates and $vatrates_alllines not used ?
if (! empty($this->vatrate))
// Check if global invoice tax for this vat rate
if (! empty($obj->vatrate))
{
$vatrates[$this->vatrate][]=array(
'total_ht' =>$obj->total_ht,
'total_tva' =>$obj->total_tva,
'total_ttc' =>$obj->total_ttc,
'total_localtax1'=>$obj->total_localtax1,
'total_localtax2'=>$obj->total_localtax2
);
if (! isset($vatrates_alllines[$this->vatrate]['total_ht'])) $vatrates_alllines[$this->vatrate]['total_ht']=0;
if (! isset($vatrates_alllines[$this->vatrate]['total_tva'])) $vatrates_alllines[$this->vatrate]['total_tva']=0;
if (! isset($vatrates_alllines[$this->vatrate]['total_localtax1'])) $vatrates_alllines[$this->vatrate]['total_localtax1']=0;
if (! isset($vatrates_alllines[$this->vatrate]['total_localtax2'])) $vatrates_alllines[$this->vatrate]['total_localtax2']=0;
if (! isset($vatrates_alllines[$this->vatrate]['total_ttc'])) $vatrates_alllines[$this->vatrate]['total_ttc']=0;
$vatrates_alllines[$this->vatrate]['total_ht'] +=$obj->total_ht;
$vatrates_alllines[$this->vatrate]['total_tva'] +=$obj->total_tva;
$vatrates_alllines[$this->vatrate]['total_localtax1']+=$obj->total_localtax1;
$vatrates_alllines[$this->vatrate]['total_localtax2']+=$obj->total_localtax2;
$vatrates_alllines[$this->vatrate]['total_ttc'] +=$obj->total_ttc;
if ($this->total_localtax1 == 0)
{
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->client->country_code."'";
$sql .= " AND t.taux = ".$obj->vatrate." AND t.active = 1";
dol_syslog("get_localtax sql=".$sql);
$resqlt=$this->db->query($sql);
if ($resqlt)
{
$objt = $this->db->fetch_object($resqlt);
if ($objt->localtax1_type == '7')
{
$this->total_localtax1 += $objt->localtax1;
$this->total_ttc += $objt->localtax1;
}
}
}
if ($this->total_localtax2 == 0)
{
// Search local taxes
$sql = "SELECT t.localtax2, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->client->country_code."'";
$sql .= " AND t.taux = ".$obj->vatrate." AND t.active = 1";
dol_syslog("get_localtax sql=".$sql);
$resqlt=$this->db->query($sql);
if ($resqlt)
{
$objt = $this->db->fetch_object($resqlt);
if ($objt->localtax2_type == '7')
{
$this->total_localtax2 += $objt->localtax2;
$this->total_ttc += $objt->localtax2;
}
}
}
}
$i++;
@ -1544,21 +1566,6 @@ abstract class CommonObject
$this->db->free($resql);
// TODO
if ($roundingadjust)
{
// For each vatrate, calculate if two method of calculation differs
// If it differs
if (1==2)
{
// Adjust a line and update it
}
}
// Now update global field total_ht, total_ttc and tva
$fieldht='total_ht';
$fieldtva='tva';

View File

@ -115,7 +115,8 @@ class HookManager
* @param Object &$object Object to use hooks on
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @return mixed For doActions,formObjectOptions: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO.
* For printSearchForm,printLeftBlock,printTopRightMenu,...: Return HTML string.
* For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints.
* Can also return some values into an array ->results.
* $this->error or this->errors are also defined by class called by this function if error.
*/
function executeHooks($method, $parameters=false, &$object='', &$action='')
@ -127,45 +128,58 @@ class HookManager
// Loop on each hook to qualify modules that declared context
$modulealreadyexecuted=array();
$resaction=0; $resprint='';
$resaction=0; $error=0;
$this->resPrint=''; $this->resArray=array();
foreach($this->hooks as $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context
{
if (! empty($modules))
{
foreach($modules as $module => $actionclassinstance)
{
// test to avoid to run twice a hook, when a module implements several active contexts
// jump to next class if method does not exists
if (! method_exists($actionclassinstance,$method)) continue;
// test to avoid to run twice a hook, when a module implements several active contexts
if (in_array($module,$modulealreadyexecuted)) continue;
$modulealreadyexecuted[$module]=$module;
// Hooks that return int
if (($method == 'doActions' || $method == 'formObjectOptions') && method_exists($actionclassinstance,$method))
if (($method == 'doActions' || $method == 'formObjectOptions'))
{
$resaction+=$actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0))
{
$this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors);
if ($method == 'doActions')
{
if ($action=='add') $action='create'; // TODO this change must be inside the doActions
if ($action=='update') $action='edit'; // TODO this change must be inside the doActions
}
}
$resaction+=$actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0))
{
$error++;
$this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors);
// TODO remove this. Change must be inside the method if required
if ($method == 'doActions')
{
if ($action=='add') $action='create';
if ($action=='update') $action='edit';
}
}
}
// Generic hooks that return a string (printSearchForm, printLeftBlock, formBuilddocOptions, ...)
else if (method_exists($actionclassinstance,$method))
// Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...)
else
{
if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue;
// TODO. this should be done into the method by returning nothing
if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue;
$result = $actionclassinstance->$method($parameters, $object, $action, $this);
if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
else $resprint.=$result;
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
// TODO. remove this. array result must be set into $actionclassinstance->results
if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
// TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string
if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
}
}
}
}
if ($method == 'doActions' || $method == 'formObjectOptions') return $resaction;
return $resprint;
if ($method != 'doActions' && $method != 'formObjectOptions') return $this->resPrint; // TODO remove this. When there is something to print, ->resPrint is filled.
return ($error?-1:$resaction);
}
}

View File

@ -1541,7 +1541,8 @@ class Form
$num = $this->db->num_rows($result);
$outselect.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">';
//$outselect.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax
$outselect.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
if (! $selected) $outselect.='<option value="0" selected="selected">&nbsp;</option>';
else $outselect.='<option value="0">&nbsp;</option>';

View File

@ -49,8 +49,13 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
// Remove product id before select another product
// use keyup instead change to avoid loosing the product id
$("input#search_'.$htmlname.'").keyup(function() {
$("#'.$htmlname.'").val("").trigger("change");
$("input#search_'.$htmlname.'").keydown(function() {
//console.log(\'purge_id_after_keydown\');
$("#'.$htmlname.'").val("");
});
$("input#search_'.$htmlname.'").change(function() {
//console.log(\'keyup\');
$("#'.$htmlname.'").trigger("change");
});
// Check when keyup
$("input#search_'.$htmlname.'").onDelayedKeyup({ handler: function() {
@ -116,6 +121,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
dataType: "json",
minLength: '.$minLength.',
select: function( event, ui ) {
//console.log(\'set value of id with \'+ui.item.id);
$("#'.$htmlname.'").val(ui.item.id).trigger("change");
// Disable an element
if (options.option_disabled) {

View File

@ -2722,7 +2722,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
}
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax2";
$sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_country."'";
$sql .= " AND t.taux = ".$tva." AND t.active = 1";
@ -2732,9 +2732,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($local==1) return $obj->localtax1;
elseif ($local==2) return $obj->localtax2;
//else return array($obj->localtax1,$obj->localtax2);
if ($local==1 && $obj->localtax1_type != '7') return $obj->localtax1;
elseif ($local==2 && $obj->localtax2_type != '7') return $obj->localtax2;
}
return 0;
@ -4209,6 +4208,35 @@ function getCurrencySymbol($currency_code)
return $currency_sign;
}
/**
* Get type of one localtax
*
* @param int $vatrate VAT Rate
* @param int $number Number of localtax (1 / 2)
* @param int $thirdparty company object
* @return array array(Type of local tax (1 to 7 / 0 if not found), rate or amount of localtax)
*/
function getTypeOfLocalTaxFromRate($vatrate, $number, $thirdparty)
{
global $db;
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
$resql=$db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($number == 1) return array($obj->localtax1_type, $obj->localtax1);
elseif ($number == 2) return array($obj->localtax2_type, $obj->localtax2);
}
return 0;
}
if (! function_exists('getmypid'))
{

View File

@ -80,8 +80,10 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
if (! empty($conf->global->MAIN_USE_FPDF) && ! empty($conf->global->MAIN_DISABLE_FPDI))
return "Error MAIN_USE_FPDF and MAIN_DISABLE_FPDI can't be set together";
// We use by default TCPDF
// We use by default TCPDF else FPDF
if (empty($conf->global->MAIN_USE_FPDF)) require_once TCPDF_PATH.'tcpdf.php';
else require_once FPDF_PATH.'fpdf.php';
// We need to instantiate fpdi object (instead of tcpdf) to use merging features. But we can disable it.
if (empty($conf->global->MAIN_DISABLE_FPDI)) require_once FPDI_PATH.'fpdi.php';
@ -90,7 +92,7 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
//$metric=$arrayformat['unit'];
// Protection et encryption du pdf
if (! empty($conf->global->PDF_SECURITY_ENCRYPTION))
if (empty($conf->global->MAIN_USE_FPDF) && ! empty($conf->global->PDF_SECURITY_ENCRYPTION))
{
/* Permission supported by TCPDF
- print : Print the document;
@ -103,20 +105,11 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
- print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
- owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
*/
if (! empty($conf->global->MAIN_USE_FPDF))
{
require_once FPDI_PATH.'fpdi_protection.php';
$pdf = new FPDI_Protection($pagetype,$metric,$format);
// For FPDF, we specify permission we want to open
$pdfrights = array('print');
}
else
{
if (class_exists('FPDI')) $pdf = new FPDI($pagetype,$metric,$format);
else $pdf = new TCPDF($pagetype,$metric,$format);
// For TCPDF, we specify permission we want to block
$pdfrights = array('modify','copy');
}
if (class_exists('FPDI')) $pdf = new FPDI($pagetype,$metric,$format);
else $pdf = new TCPDF($pagetype,$metric,$format);
// For TCPDF, we specify permission we want to block
$pdfrights = array('modify','copy');
$pdfuserpass = ''; // Mot de passe pour l'utilisateur final
$pdfownerpass = NULL; // Mot de passe du proprietaire, cree aleatoirement si pas defini
$pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass);
@ -126,9 +119,43 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
if (class_exists('FPDI')) $pdf = new FPDI($pagetype,$metric,$format);
else $pdf = new TCPDF($pagetype,$metric,$format);
}
// If we use FPDF class, we may need to add method writeHTMLCell
if (! empty($conf->global->MAIN_USE_FPDF) && ! method_exists($pdf, 'writeHTMLCell'))
{
// Declare here a class to overwrite FPDFI to add method writeHTMLCell
/**
* This class if a enhanced FPDI class that support method writeHTMLCell
*/
class FPDI_DolExtended extends FPDI
{
public function __call($method, $args)
{
if (isset($this->$method)) {
$func = $this->$method;
$func($args);
}
}
public function writeHTMLCell($w, $h, $x, $y, $html = '', $border = 0, $ln = 0, $fill = false, $reseth = true, $align = '', $autopadding = true)
{
$this->SetXY($x,$y);
$val=str_replace('<br>',"\n",$html);
$val=dol_string_nohtmltag($val,false,'ISO-8859-1');
//print 'eee'.$val;exit;
$this->MultiCell($w,$h,$val,$border,$align,$fill);
}
}
$pdf2=new FPDI_DolExtended($pagetype,$metric,$format);
unset($pdf);
$pdf=$pdf2;
}
return $pdf;
}
/**
* Return font name to use for PDF generation
*
@ -691,7 +718,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
{
$pdf->SetFont('','B',7);
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
$pdf->MultiCell($dims['wk']-$dims['rm'], 2, $line1, 0, 'C', 0);
$posy-=3;
$pdf->SetFont('','',7);
}
@ -700,7 +727,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
{
$pdf->SetFont('','B',7);
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
$pdf->MultiCell($dims['wk']-$dims['rm'], 2, $line2, 0, 'C', 0);
$posy-=3;
$pdf->SetFont('','',7);
}
@ -708,22 +735,23 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if (! empty($line3))
{
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line3, 0, 'C', 0);
$pdf->MultiCell($dims['wk']-$dims['rm'], 2, $line3, 0, 'C', 0);
}
if (! empty($line4))
{
$posy-=3;
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell(200, 2, $line4, 0, 'C', 0);
$pdf->MultiCell($dims['wk']-$dims['rm'], 2, $line4, 0, 'C', 0);
}
// Show page nb only on iso languages (so default Helvetica font)
if (pdf_getPDFFont($outputlangs) == 'Helvetica')
{
$pdf->SetXY(-20,-$posy);
$pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
//print 'xxx'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(11, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
else $pdf->MultiCell(11, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
}
return $marginwithfooter;

View File

@ -208,7 +208,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen
//else $labeltoshow.=' ('.$langs->trans("Private").')';
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
{
print '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
print '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.' - '.dol_trunc($obj->title,$maxlength).'</option>';
}
else
{

View File

@ -146,6 +146,43 @@ function group_prepare_head($object)
return $head;
}
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to shoc
*/
function user_admin_prepare_head()
{
global $langs, $conf, $user;
$langs->load("users");
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/admin/user.php';
$head[$h][1] = $langs->trans("Parameters");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin','remove');
return $head;
}
/**
* Prepare array with list of tabs
*

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* 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
@ -138,7 +139,7 @@ class pdf_crabe extends ModelePDFFactures
*/
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{
global $user,$langs,$conf;
global $user,$langs,$conf,$mysoc,$db;
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -365,22 +366,40 @@ class pdf_crabe extends ModelePDFFactures
$tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
$localtax2_rate=$object->lines[$i]->localtax2_tx;
$localtax1_type=$object->lines[$i]->localtax1_type;
$localtax2_type=$object->lines[$i]->localtax2_type;
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getTypeOfLocalTaxFromRate($vatrate,1,$mysoc);
$localtax2_array=getTypeOfLocalTaxFromRate($vatrate,2,$mysoc);
if (empty($localtax1_type))
$localtax1_type = $localtax1_array[0];
if (empty($localtax2_type))
$localtax2_type = $localtax2_array[0];
//end TODO
// retrieve global local tax
if ($localtax1_type == '7')
$localtax1_rate = $localtax1_array[1];
if ($localtax2_type == '7')
$localtax2_rate = $localtax2_array[1];
if ($localtax1ligne != 0 || $localtax1_type == '7')
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2ligne != 0 || $localtax2_type == '7')
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
$this->tva[$vatrate] += $tvaligne;
$this->localtax1[$localtax1rate]+=$localtax1ligne;
$this->localtax2[$localtax2rate]+=$localtax2ligne;
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
@ -822,6 +841,84 @@ class pdf_crabe extends ModelePDFFactures
}
else
{
//Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
//Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
@ -830,6 +927,7 @@ class pdf_crabe extends ModelePDFFactures
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
@ -839,52 +937,31 @@ class pdf_crabe extends ModelePDFFactures
$totalvat =$outputlangs->transnoentities("TotalVAT").' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
if (! $this->atleastoneratenotnull) // If no vat at all
//Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1);
// Total LocalTax1
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_localtax1), $useborder, 'R', 1);
}
// Total LocalTax2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_localtax2), $useborder, 'R', 1);
}
}
else
{
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
//Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval)
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '2':
case '4':
case '6':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey!=0) // On affiche pas taux 0
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
@ -892,27 +969,44 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
//Local tax 2
foreach($this->localtax2 as $tvakey => $tvaval)
}
//Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '2':
case '4':
case '6':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey!=0) // On affiche pas taux 0
// retrieve global local tax
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
@ -920,12 +1014,21 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $tvaval), 0, 'R', 1);
if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
@ -936,11 +1039,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224);
$text=$outputlangs->transnoentities("TotalTTC");
if ($object->type == 2) $text=$outputlangs->transnoentities("TotalTTCToYourCredit");
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $text, $useborder, 'L', 1);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
}
}

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* 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
@ -136,7 +137,7 @@ class pdf_azur extends ModelePDFPropales
*/
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{
global $user,$langs,$conf;
global $user,$langs,$conf,$mysoc,$db;
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -362,22 +363,39 @@ class pdf_azur extends ModelePDFPropales
$tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
$localtax2_rate=$object->lines[$i]->localtax2_tx;
$localtax1_type=$object->lines[$i]->localtax1_type;
$localtax2_type=$object->lines[$i]->localtax2_type;
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getTypeOfLocalTaxFromRate($vatrate,1,$mysoc);
$localtax2_array=getTypeOfLocalTaxFromRate($vatrate,2,$mysoc);
if (empty($localtax1_type))
$localtax1_type = $localtax1_array[0];
if (empty($localtax2_type))
$localtax2_type = $localtax2_array[0];
//end TODO
// retrieve global local tax
if ($localtax1_type == '7')
$localtax1_rate = $localtax1_array[1];
if ($localtax2_type == '7')
$localtax2_rate = $localtax2_array[1];
if ($localtax1ligne != 0 || $localtax1_type == '7')
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2ligne != 0 || $localtax2_type == '7')
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
$this->tva[$vatrate] += $tvaligne;
$this->localtax1[$localtax1rate]+=$localtax1ligne;
$this->localtax2[$localtax2rate]+=$localtax2ligne;
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
@ -735,6 +753,84 @@ class pdf_azur extends ModelePDFPropales
}
else
{
//Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
//Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '1':
case '3':
case '5':
case '7':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
@ -759,48 +855,25 @@ class pdf_azur extends ModelePDFPropales
}
}
if (! $this->atleastoneratenotnull) // If no vat at all
//Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
// Total LocalTax1
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
}
// Total LocalTax2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
}
}
else
{
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
//Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval)
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '2':
case '4':
case '6':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey!=0) // On affiche pas taux 0
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
@ -808,27 +881,43 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' ';
if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
//Local tax 2
foreach($this->localtax2 as $tvakey => $tvaval)
}
//Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
switch ($localtax_type) {
case '2':
case '4':
case '6':
continue 2;
break;
}
foreach( $localtax_rate as $tvakey => $tvaval )
{
if ($tvakey!=0) // On affiche pas taux 0
if ($tvakey>0) // On affiche pas taux 0
{
//$this->atleastoneratenotnull++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
if (preg_match('/\*/',$tvakey))
@ -836,13 +925,21 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
}
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' ';
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
}
else
{
$totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
}
}
}
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -42,15 +42,14 @@
<td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
<?php
$colspan = 4;
if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled))
{
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
?>
<td align="right"><?php echo $langs->trans('BuyingPrice'); ?></td>
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
$colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES))
$colspan++;
}
<?php
}
?>
<td colspan="<?php echo $colspan; ?>">&nbsp;</td>
</tr>
@ -63,7 +62,7 @@ if (! empty($conf->margin->enabled)) {
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#idprod').change(function() {
jQuery('#np_desc').focus();
if (jQuery('#idprod').val() > 0) jQuery('#np_desc').focus();
});
});
</script>
@ -97,17 +96,16 @@ jQuery(document).ready(function() {
<td align="right" nowrap><input type="text" size="1" name="remise_percent" value="<?php echo $buyer->remise_client; ?>">%</td>
<?php
$colspan = 4;
if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled))
{
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
?>
<td align="right">
<select id="fournprice" name="fournprice" style="display: none;"></select>
<input type="text" size="5" id="buying_price" name="buying_price" value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>">
</td>
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
$colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES))
$colspan++;
}
?>
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>">
@ -115,18 +113,17 @@ if (! empty($conf->margin->enabled)) {
</td>
</tr>
<?php if (! empty($conf->service->enabled) && $dateSelector) {
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
$colspan = 10;
else
$colspan = 9;
if (! empty($conf->margin->enabled)) {
$colspan++; // For the buying price
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
$colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES))
$colspan++;
}
<?php
if (! empty($conf->service->enabled) && $dateSelector)
{
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10;
else $colspan = 9;
if (! empty($conf->margin->enabled))
{
$colspan++; // For the buying price
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
}
?>
<tr <?php echo $bcnd[$var]; ?>>
<td colspan="<?php echo $colspan; ?>">
@ -138,11 +135,15 @@ if (! empty($conf->margin->enabled)) {
?>
</td>
</tr>
<?php } ?>
<?php
}
?>
</form>
<?php
if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled))
{
?>
<script type="text/javascript">
$("#idprod").change(function() {
@ -177,5 +178,7 @@ $("#idprod").change(function() {
'json');
});
</script>
<?php } ?>
<?php
}
?>
<!-- END PHP TEMPLATE predefinedproductline_create.tpl.php -->

View File

@ -207,6 +207,7 @@ define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
// Path to root libraries
if (! defined('ADODB_PATH')) { define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH))?DOL_DOCUMENT_ROOT.'/includes/adodbtime/':(empty($dolibarr_lib_ADODB_PATH)?'':$dolibarr_lib_ADODB_PATH.'/')); }
if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', (!isset($dolibarr_lib_TCPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/tcpdf/':(empty($dolibarr_lib_TCPDF_PATH)?'':$dolibarr_lib_TCPDF_PATH.'/')); }
if (! defined('FPDF_PATH')) { define('FPDF_PATH', (!isset($dolibarr_lib_FPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdf/':(empty($dolibarr_lib_FPDF_PATH)?'':$dolibarr_lib_FPDF_PATH.'/')); } // Used only for package that can't include tcpdf
if (! defined('FPDI_PATH')) { define('FPDI_PATH', (!isset($dolibarr_lib_FPDI_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdfi/':(empty($dolibarr_lib_FPDI_PATH)?'':$dolibarr_lib_FPDI_PATH.'/')); }
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH))?DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/':(empty($dolibarr_lib_NUSOAP_PATH)?'':$dolibarr_lib_NUSOAP_PATH.'/')); }
if (! defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH))?DOL_DOCUMENT_ROOT.'/includes/phpexcel/':(empty($dolibarr_lib_PHPEXCEL_PATH)?'':$dolibarr_lib_PHPEXCEL_PATH.'/')); }

View File

@ -1461,12 +1461,22 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="4">&nbsp;</td>';
print '</tr>';
// TODO Use the predefinedproductline_create.tpl.php file
// Add free products/services form
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'#add" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addline">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
});
});
</script>';
$var=true;
print '<tr '.$bc[$var].'>';
print '<td>';

View File

@ -466,10 +466,19 @@ elseif ($action == 'addline')
}
$ret=$object->fetch_thirdparty();
if ($_POST['idprodfournprice']) // > 0 or -1
if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or ''
{
$product=new Product($db);
$idprod=$product->get_buyprice($_POST['idprodfournprice'], $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat
$idprod=0;
$product=new Product($db);
if (GETPOST('idprodfournprice') == '')
{
$idprod=-1;
}
if (GETPOST('idprodfournprice') > 0)
{
$idprod=$product->get_buyprice(GETPOST('idprodfournprice'), $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat
}
if ($idprod > 0)
{
@ -1805,10 +1814,20 @@ else
print '<td colspan="4">&nbsp;</td>';
print '</tr>';
// TODO Use the predefinedproductline_create.tpl.php file
print '<form name="addline_predef" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=addline" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'. $object->socid .'">';
print '<input type="hidden" name="facid" value="'.$object->id.'">';
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
});
});
</script>';
$var=! $var;
print '<tr '.$bc[$var].'>';
print '<td colspan="4">';

View File

@ -874,6 +874,15 @@ function write_conf_file($conffile)
// Write params to overwrites default lib path
fputs($fp,"\n");
if (empty($force_dolibarr_lib_TCPDF_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_TCPDF_PATH=''; }
fputs($fp, '$dolibarr_lib_TCPDF_PATH=\''.$force_dolibarr_lib_TCPDF_PATH.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_lib_FPDF_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_FPDF_PATH=''; }
fputs($fp, '$dolibarr_lib_FPDF_PATH=\''.$force_dolibarr_lib_FPDF_PATH.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_lib_FPDI_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_FPDI_PATH=''; }
fputs($fp, '$dolibarr_lib_FPDI_PATH=\''.$force_dolibarr_lib_FPDI_PATH.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_lib_ADODB_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_ADODB_PATH=''; }
fputs($fp, '$dolibarr_lib_ADODB_PATH=\''.$force_dolibarr_lib_ADODB_PATH.'\';');
fputs($fp,"\n");
@ -883,9 +892,6 @@ function write_conf_file($conffile)
if (empty($force_dolibarr_lib_NUSOAP_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_NUSOAP_PATH=''; }
fputs($fp, '$dolibarr_lib_NUSOAP_PATH=\''.$force_dolibarr_lib_NUSOAP_PATH.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_lib_FPDI_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_FPDI_PATH=''; }
fputs($fp, '$dolibarr_lib_FPDI_PATH=\''.$force_dolibarr_lib_FPDI_PATH.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_lib_PHPEXCEL_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_PHPEXCEL_PATH=''; }
fputs($fp, '$dolibarr_lib_PHPEXCEL_PATH=\''.$force_dolibarr_lib_PHPEXCEL_PATH.'\';');
fputs($fp,"\n");
@ -895,9 +901,6 @@ function write_conf_file($conffile)
if (empty($force_dolibarr_lib_ODTPHP_PATHTOPCLZIP)) { fputs($fp, '//'); $force_dolibarr_lib_ODTPHP_PATHTOPCLZIP=''; }
fputs($fp, '$dolibarr_lib_ODTPHP_PATHTOPCLZIP=\''.$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_lib_TCPDF_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_TCPDF_PATH=''; }
fputs($fp, '$dolibarr_lib_TCPDF_PATH=\''.$force_dolibarr_lib_TCPDF_PATH.'\';');
fputs($fp,"\n");
if (empty($force_dolibarr_js_CKEDITOR)) { fputs($fp, '//'); $force_dolibarr_js_CKEDITOR=''; }
fputs($fp, '$dolibarr_js_CKEDITOR=\''.$force_dolibarr_js_CKEDITOR.'\';');
fputs($fp,"\n");

View File

@ -857,3 +857,13 @@ INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active)
-- increase field size
ALTER TABLE llx_bank_account MODIFY COLUMN code_banque varchar(8);
create table llx_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;
ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object);

View File

@ -0,0 +1,23 @@
-- ===================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
-- Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
-- Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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 2 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/>.
--
-- ===================================================================
ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object);

View File

@ -0,0 +1,27 @@
-- ===================================================================
-- Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
-- Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr>
--
-- 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 2 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/>.
--
-- ===================================================================
create table llx_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;

View File

@ -14,7 +14,6 @@ Supplier=المورد
AddSupplier=إضافة مورد
SupplierRemoved=إزالة المورد
SuppliersInvoice=فاتورة الموردين
SuppliersInvoices=فواتير الموردين
NewSupplier=مورد جديد
History=التاريخ
ListOfSuppliers=قائمة الموردين

View File

@ -13,7 +13,6 @@ Supplier=Снабдител
AddSupplier=Добави доставчик
SupplierRemoved=Изтрити доставчик
SuppliersInvoice=Фактура
SuppliersInvoices=Фактури
NewSupplier=Нов доставчик
History=Исторически
ListOfSuppliers=Списък на доставчиците

View File

@ -949,6 +949,7 @@ DocumentModelOdt=Generació des dels documents amb format OpenDocument (Arxiu .O
WatermarkOnDraft=Marca d'aigua en els documents esborrany
CompanyIdProfChecker=Id Professional únic
MustBeUnique=Ha de ser únic?
MustBeMandatory=Ha de ser obligatori?
Miscellanous=Miscel·lània
##### Webcal setup #####
WebCalSetup=Configuració d'enllaç amb el calendari webcalendar

View File

@ -47,7 +47,7 @@ InvoiceCustomer=Factura a client
CustomerInvoice=Factura a client
CustomersInvoices=Factures a clientes
SupplierInvoice=Factura de proveïdor
SuppliersInvoices=Factures de proveïdors
SuppliersInvoices=Factures proveïdors
SupplierBill=Factura de proveïdor
SupplierBills=Factures de proveïdors
Payment=Pagament

View File

@ -108,42 +108,49 @@ ProfId2AR=Ingressos bruts
ProfId3AR=-
ProfId4AR=-
ProfId5AR=-
ProfId6AR=-
ProfId1AU=ABN
ProfId2AU=-
ProfId3AU=-
ProfId4AU=-
ProfId5AU=-
ProfId6AU=-
ProfId1BE=N° col·legiat
ProfId2BE=-
ProfId3BE=-
ProfId4BE=-
ProfId5BE=-
ProfId1BR=CNPJ
ProfId6BE=-
ProfId1BR=-
ProfId2BR=IE (Inscricao Estadual)
ProfId3BR=IM (Inscricao Municipal)
ProfId4BR=CPF
#ProfId5BR=CNAE=
#ProfId6BR=INSS=
#ProfId5BR=CNAE
#ProfId6BR=INSS
ProfId1CH=-
ProfId2CH=-
ProfId3CH=Número federat
ProfId4CH=Num registre de comerç
ProfId5CH=-
ProfId6CH=-
ProfId1CL=R.U.T.
ProfId2CL=-
ProfId3CL=-
ProfId4CL=-
ProfId5CL=-
ProfId6CL=-
ProfId1CO=R.U.T.
ProfId2CO=-
ProfId3CO=-
ProfId4CO=-
ProfId5CO=-
ProfId6CO=-
ProfId1DE=Id prof. 1 (USt.-IdNr)
ProfId2DE=Id prof. 2 (USt.-Nr)
ProfId3DE=Id prof. 3 (Handelsregister-Nr.)
ProfId4DE=-
ProfId5DE=-
ProfId6DE=-
ProfId1ES=CIF/NIF
ProfId2ES=Núm seguretat social
ProfId3ES=CNAE
@ -161,51 +168,61 @@ ProfId2GB=-
ProfId3GB=SIC
ProfId4GB=-
ProfId5GB=-
ProfId6GB=-
ProfId1HN=RTN
ProfId2HN=-
ProfId3HN=-
ProfId4HN=-
ProfId5HN=-
ProfId6HN=-
ProfId1IN=Id prof. 1 (TIN)
ProfId2IN=Id prof. 2
ProfId3IN=Id prof. 3
ProfId2IN=Id prof. 2 (PAN)
ProfId3IN=Id prof. 3 (SRVC TAX)
ProfId4IN=Id prof. 4
ProfId5IN=Id prof. 5
ProfId6IN=-
ProfId1MA=Id prof. 1 (R.C.)
ProfId2MA=Id prof. 2 (Patente)
ProfId3MA=Id prof. 3 (I.F.)
ProfId4MA=Id prof. 4 (C.N.S.S.)
ProfId5MA=-
ProfId6MA=-
ProfId1MX=R.F.C.
ProfId2MX=Registre Patronal IMSS
ProfId3MX=Cèdula Professional
ProfId4MX=-
ProfId5MX=-
ProfId6MX=-
ProfId1NL=Número KVK
ProfId2NL=-
ProfId3NL=-
ProfId4NL=-
ProfId5NL=-
ProfId6NL=-
ProfId1PT=NIPC
ProfId2PT=Núm seguretat social
ProfId3PT=Num reg. comercial
ProfId4PT=Conservatori
ProfId5PT=-
ProfId6PT=-
ProfId1RU=OGRN
ProfId2RU=INN
ProfId3RU=KPP
ProfId4RU=OKPO
ProfId5RU=-
ProfId6RU=-
ProfId1SN=RC
ProfId2SN=NINEA
ProfId3SN=-
ProfId4SN=-
ProfId5SN=-
ProfId6SN=-
ProfId1TN=RC
ProfId2TN=Matrícula fiscal
ProfId3TN=Codi en aduana
ProfId4TN=CCC
ProfId5TN=-
ProfId6TN=-
VATIntra=NIF intracomunitari
VATIntraShort=NIF intra.
VATIntraVeryShort=NIF intra.

View File

@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Aquest contacte ja està definit com
ErrorCashAccountAcceptsOnlyCashMoney=Aquesta compte bancari és de tipus caixa i només accepta el mètode de pagament de tipus <b>espècie</b>.
ErrorFromToAccountsMustDiffers=El compte origen i destinació han de ser diferents.
ErrorBadThirdPartyName=Nom de tercer incorrecte
ErrorProdIdIsMandatory=El %s es obligatori
ErrorBadCustomerCodeSyntax=La sintaxi del codi client és incorrecta
ErrorCustomerCodeRequired=Codi client obligatori
ErrorCustomerCodeAlreadyUsed=Codi de client ja utilitzat

View File

@ -46,4 +46,8 @@ MargeNette=Marge net
MARGIN_TYPE_DETAILS=Marge brut: Preu de venda sense IVA - Preu de compra sense IVA <br/> Marge net: Preu de venda sense IVA - Costos
BuyingCost=Costos
UnitCharges=Càrrega unitària
UnitCharges=Càrrega unitària
Charges=Càrreges
AgentContactType=Tipus de contacte comissionat
AgentContactTypeDetails=Indica el tipus de contacte enllaçat a les factures que seran associats als agents comercials

View File

@ -146,6 +146,8 @@ ProductSpecial=Especial
QtyMin=Quantitat mínima
PriceQty=Preu per la quantitat
PriceQtyMin=Preu quantitat min.
DiscountQtyMin=Descompte per defecte quantitat min.
VATRateForSupplierProduct=Taxa IVA (per aquest producte/proveïdor)
NoPriceDefinedForThisSupplier=Cap preu/quant. definit per a aquest proveïdor/producte
NoSupplierPriceDefinedForThisProduct=Cap preu/quant. proveïdor definit per a aquest producte
RecordedProducts=Productes en venda

View File

@ -5,7 +5,6 @@ Supplier=Proveïdor
AddSupplier=Afegir proveïdor
SupplierRemoved=Proveïdor eliminat
SuppliersInvoice=Factura proveïdor
SuppliersInvoices=Factures proveïdors
NewSupplier=Nou proveïdor
History=Històric
ListOfSuppliers=Llistat de proveïdors

View File

@ -16,7 +16,6 @@ Supplier=Leverandør
AddSupplier=Tilføj en leverandør
SupplierRemoved=Leverandør fjernet
SuppliersInvoice=Leverandører faktura
SuppliersInvoices=Leverandører fakturaer
NewSupplier=Ny leverandør
History=Historie
ListOfSuppliers=Liste over leverandører

View File

@ -12,7 +12,6 @@ Supplier=Lieferant
AddSupplier=Lieferanten hinzufügen
SupplierRemoved=Lieferant entfernt
SuppliersInvoice=Lieferantenrechnung
SuppliersInvoices=Lieferantenrechnungen
NewSupplier=Neuer Lieferant
History=Verlauf
ListOfSuppliers=Lieferantenliste

View File

@ -12,7 +12,6 @@ Supplier=Lieferant
AddSupplier=Lieferanten hinzufügen
SupplierRemoved=Lieferant entfernt
SuppliersInvoice=Lieferantenrechnung
SuppliersInvoices=Lieferantenrechnungen
NewSupplier=Neuer Lieferant
History=Verlauf
ListOfSuppliers=Lieferantenliste

View File

@ -5,7 +5,6 @@ Supplier=Προμηθευτής
AddSupplier=Προσθήκη προμηθευτή
SupplierRemoved=Ο προμηθευτής αφαιρέθηκε
SuppliersInvoice=Τιμολόγιο προμηθευτή
SuppliersInvoices=Τιμολόγια προμηθευτών
NewSupplier=Νέος προμηθευτής
History=Ιστορικό
ListOfSuppliers=Λίστα προμηθευτών

View File

@ -0,0 +1,17 @@
# Dolibarr language file - en_WW - main
CHARSET=UTF-8
DIRECTION=ltr
FONTFORPDF=DejaVuSans
FONTSIZEFORPDF=9
SeparatorDecimal=.
SeparatorThousand=,
FormatDateShort=%d/%m/%Y
FormatDateShortJava=dd/MM/yyyy
FormatDateShortJQuery=dd/mm/yy
FormatHourShort=%I:%M %p
FormatHourShortDuration=%H:%M
FormatDateTextShort=%b %d, %Y
FormatDateText=%B %d, %Y
FormatDateHourShort=%d/%m/%Y %I:%M %p
FormatDateHourTextShort=%b %d, %Y, %I:%M %p
FormatDateHourText=%B %d, %Y, %I:%M %p

View File

@ -939,6 +939,7 @@ DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for
WatermarkOnDraft=Watermark on draft document
CompanyIdProfChecker=Professional Id unique
MustBeUnique=Must be unique ?
MustBeMandatory=Must be mandatory ?
Miscellanous=Miscellaneous
##### Webcal setup #####
WebCalSetup=Webcalendar link setup

View File

@ -49,9 +49,9 @@ Invoices=Invoices
InvoiceLine=Invoice line
InvoiceCustomer=Customer invoice
CustomerInvoice=Customer invoice
CustomersInvoices=Customer's invoices
CustomersInvoices=Customers invoices
SupplierInvoice=Supplier invoice
SuppliersInvoices=Supplier's invoices
SuppliersInvoices=Suppliers invoices
SupplierBill=Supplier invoice
SupplierBills=suppliers invoices
Payment=Payment

View File

@ -25,6 +25,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=This contact is already defined as co
ErrorCashAccountAcceptsOnlyCashMoney=This bank account is a cash account, so it accepts payments of type cash only.
ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be different.
ErrorBadThirdPartyName=Bad value for third party name
ErrorProdIdIsMandatory=The %s is mandatory
ErrorBadCustomerCodeSyntax=Bad syntax for customer code
ErrorCustomerCodeRequired=Customer code required
ErrorCustomerCodeAlreadyUsed=Customer code already used

View File

@ -14,6 +14,7 @@ Language_en_AU=English (Australia)
Language_en_GB=English (United Kingdom)
Language_en_IN=English (India)
Language_en_NZ=English (New Zealand)
Language_en_SA=English (Saudi Arabia)
Language_en_US=English (United States)
Language_es_ES=Spanish
Language_es_AR=Spanish (Argentina)

View File

@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price<br/>Net margin : S
BuyingCost=Cost price
UnitCharges=Unit charges
Charges=Charges
AgentContactType=Contact type used for commissioning
AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents

View File

@ -5,7 +5,6 @@ Supplier=Supplier
AddSupplier=Add a supplier
SupplierRemoved=Supplier removed
SuppliersInvoice=Suppliers invoice
SuppliersInvoices=Suppliers invoices
NewSupplier=New supplier
History=History
ListOfSuppliers=List of suppliers

View File

@ -952,6 +952,7 @@ DocumentModelOdt=Generación desde los documentos OpenDocument (Archivo .ODT Ope
WatermarkOnDraft=Marca de agua en los documentos borrador
CompanyIdProfChecker=Id Profesional único
MustBeUnique=¿Debe ser único?
MustBeMandatory=¿Debe ser obligatorio?
Miscellanous=Miscelánea
##### Webcal setup #####
WebCalSetup=Configuración de enlace con el calendario Webcalendar

View File

@ -47,7 +47,7 @@ InvoiceCustomer=Factura a cliente
CustomerInvoice=Factura a cliente
CustomersInvoices=Facturas a clientes
SupplierInvoice=Factura de proveedor
SuppliersInvoices=Facturas de proveedores
SuppliersInvoices=Facturas proveedores
SupplierBill=Factura de proveedor
SupplierBills=Facturas de proveedores
Payment=Pago

View File

@ -109,17 +109,20 @@ ProfId2AR=Ingresos brutos
ProfId3AR=-
ProfId4AR=-
ProfId5AR=-
ProfId6AR=-
ProfId1AU=ABN
ProfId2AU=-
ProfId3AU=-
ProfId4AU=-
ProfId5AU=-
ProfId6AU=-
ProfId1BE=N° colegiado
ProfId2BE=-
ProfId3BE=-
ProfId4BE=-
ProfId5BE=-
ProfId1BR=CNPJ
ProfId6BE=-
ProfId1BR=-
ProfId2BR=IE (Inscricao Estadual)
ProfId3BR=IM (Inscricao Municipal)
ProfId4BR=CPF
@ -130,21 +133,25 @@ ProfId2CH=-
ProfId3CH=Número federado
ProfId4CH=Num registro de comercio
ProfId5CH=-
ProfId6CH=-
ProfId1CL=R.U.T.
ProfId2CL=-
ProfId3CL=-
ProfId4CL=-
ProfId5CL=-
ProfId6CL=-
ProfId1CO=R.U.T.
ProfId2CO=-
ProfId3CO=-
ProfId4CO=-
ProfId5CO=-
ProfId6CO=-
ProfId1DE=Id prof. 1 (USt.-IdNr)
ProfId2DE=Id prof. 2 (USt.-Nr)
ProfId3DE=Id prof. 3 (Handelsregister-Nr.)
ProfId4DE=-
ProfId5DE=-
ProfId6DE=-
ProfId1ES=CIF/NIF
ProfId2ES=Núm seguridad social
ProfId3ES=CNAE
@ -162,51 +169,61 @@ ProfId2GB=-
ProfId3GB=SIC
ProfId4GB=-
ProfId5GB=-
ProfId6GB=-
ProfId1HN=RTN
ProfId2HN=-
ProfId3HN=-
ProfId4HN=-
ProfId5HN=-
ProfId6HN=-
ProfId1IN=Id prof. 1 (TIN)
ProfId2IN=Id prof. 2
ProfId3IN=Id prof. 3
ProfId4IN=Id prof. 4
ProfId5IN=Id prof. 5
ProfId6IN=-
ProfId1MA=Id prof. 1 (R.C.)
ProfId2MA=Id prof. 2 (Patente)
ProfId3MA=Id prof. 3 (I.F.)
ProfId4MA=Id prof. 4 (C.N.S.S.)
ProfId5MA=Id prof. 5
ProfId5MA=-
ProfId6MA=-
ProfId1MX=R.F.C.
ProfId2MX=Registro Patronal IMSS
ProfId3MX=Cédula Profesional
ProfId4MX=-
ProfId5MX=-
ProfId6MX=-
ProfId1NL=Número KVK
ProfId2NL=-
ProfId3NL=-
ProfId4NL=-
ProfId5NL=-
ProfId6NL=-
ProfId1PT=NIPC
ProfId2PT=Núm. seguridad social
ProfId3PT=Num reg. comercial
ProfId4PT=Conservatorio
ProfId5PT=-
ProfId6PT=-
ProfId1RU=OGRN
ProfId2RU=INN
ProfId3RU=KPP
ProfId4RU=OKPO
ProfId5RU=-
ProfId6RU=-
ProfId1SN=RC
ProfId2SN=NINEA
ProfId3SN=-
ProfId4SN=-
ProfId5SN=-
ProfId6SN=-
ProfId1TN=RC
ProfId2TN=Matrícula fiscal
ProfId3TN=Código en aduana
ProfId4TN=CCC
ProfId5TN=-
ProfId6TN=-
VATIntra=NIF intracomunitario
VATIntraShort=NIF intra.
VATIntraVeryShort=NIF intra.

View File

@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Este contacto ya está definido como
ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y solo acepta el método de pago de tipo <b>especie</b>.
ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes.
ErrorBadThirdPartyName=Nombre de tercero incorrecto
ErrorProdIdIsMandatory=El %s es obligatorio
ErrorBadCustomerCodeSyntax=La sintaxis del código cliente es incorrecta
ErrorCustomerCodeRequired=Código cliente obligatorio
ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado

View File

@ -46,4 +46,8 @@ MargeNette=Margen neto
MARGIN_TYPE_DETAILS=Margen bruto : Precio de venta sin IVA - Precio de compra sin IVA<br/>Margen neto : Precio de venta sin IVA - Costos
BuyingCost=Costos
UnitCharges=Carga unitaria
UnitCharges=Carga unitaria
Charges=Cargas
AgentContactType=Tipo de contacto comisionado
AgentContactTypeDetails=Indica el tipo de contacto enlazado a las facturas que serán asociados a los agentes comerciales

View File

@ -146,6 +146,8 @@ ProductSpecial=Especial
QtyMin=Cantidad mínima
PriceQty=Precio para la cantidad
PriceQtyMin=Precio cantidad mín.
DiscountQtyMin=Descuento por defecto cantidad mín.
VATRateForSupplierProduct=Tasa IVA (para este producto/proveedor)
NoPriceDefinedForThisSupplier=Ningún precio/cant. definido para este proveedor/producto
NoSupplierPriceDefinedForThisProduct=Ningún precio/cant. proveedor definida para este producto
RecordedProducts=Productos en venta

View File

@ -5,7 +5,6 @@ Supplier=Proveedor
AddSupplier=Añadir proveedor
SupplierRemoved=Proveedor eliminado
SuppliersInvoice=Factura proveedor
SuppliersInvoices=Facturas proveedores
NewSupplier=Nuevo proveedor
History=Histórico
ListOfSuppliers=Listado de proveedores

View File

@ -13,7 +13,6 @@ Supplier=Tarnija
AddSupplier=Lisa tarnija
SupplierRemoved=Tarnija välja
SuppliersInvoice=Tarnijate arve
SuppliersInvoices=Tarnijate arvete
NewSupplier=New tarnija
History=Ajalugu
ListOfSuppliers=Tarnijate

View File

@ -14,7 +14,6 @@ Supplier=المورد
AddSupplier=إضافة مورد
SupplierRemoved=إزالة المورد
SuppliersInvoice=فاتورة الموردين
SuppliersInvoices=فواتير الموردين
NewSupplier=مورد جديد
History=التاريخ
ListOfSuppliers=قائمة الموردين

View File

@ -14,7 +14,6 @@ Supplier=Toimittaja
AddSupplier=Lisää toimittaja
SupplierRemoved=Toimittaja poistettu
SuppliersInvoice=Tavarantoimittajat lasku
SuppliersInvoices=Tavarantoimittajat laskut
NewSupplier=Uuden toimittajan
History=Historia
ListOfSuppliers=Luettelo toimittajat

View File

@ -946,6 +946,7 @@ DocumentModelOdt=Genération depuis des modèles OpenDocument (Fichier .ODT Open
WatermarkOnDraft=Filigrane sur les documents brouillons
CompanyIdProfChecker=Id professionel unique
MustBeUnique=Doit être unique ?
MustBeMandatory=Doit être obligatoire?
Miscellanous=Divers
##### Webcal setup #####
WebCalSetup= Configuration du lien vers le calendrier Webcalendar

View File

@ -47,7 +47,6 @@ InvoiceCustomer=Facture client
CustomerInvoice=Facture client
CustomersInvoices=Factures clients
SupplierInvoice=Facture fournisseur
SuppliersInvoices=Factures fournisseurs
SupplierBill=Facture fournisseur
SupplierBills=Factures fournisseurs
Payment=Règlement

View File

@ -26,6 +26,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Ce contact est déjà défini comme c
ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que les mode de règlement de type <b>espèce</b>.
ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents.
ErrorBadThirdPartyName=Nom de tiers incorrect
ErrorProdIdIsMandatory=Le %s est obligatoire
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
ErrorCustomerCodeRequired=Code client obligatoire
ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé

View File

@ -14,6 +14,7 @@ Language_en_AU=Anglais (Australie)
Language_en_GB=Anglais (Royaume-Uni)
Language_en_IN=Anglais (Inde)
Language_en_NZ=Anglais (Nouvelle Zeland)
Language_en_SA=Anglais (Arabie Saoudite)
Language_en_US=Anglais (Etats-Unis)
Language_es_ES=Espagnol
Language_es_AR=Espagnol (Argentine)

View File

@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT<br/>Marge n
BuyingCost=Coût 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

View File

@ -5,7 +5,6 @@ Supplier=Fournisseur
AddSupplier=Ajouter un fournisseur
SupplierRemoved=Fournisseur supprimé
SuppliersInvoice=Facture fournisseur
SuppliersInvoices=Factures fournisseurs
NewSupplier=Nouveau fournisseur
History=Historique
ListOfSuppliers=Liste des fournisseurs

View File

@ -13,7 +13,6 @@ Supplier=ספק
AddSupplier=הוסף הספק
SupplierRemoved=הספק הוסר
SuppliersInvoice=ספקים חשבונית
SuppliersInvoices=חשבוניות ספקים
NewSupplier=חדש הספק
History=היסטוריה
ListOfSuppliers=רשימת הספקים

View File

@ -5,7 +5,6 @@ Supplier=Beszállító
AddSupplier=Beszállító hozzáadása
SupplierRemoved=Beszállító eltávolítva
SuppliersInvoice=Beszállító számla
SuppliersInvoices=Beszállítók számlái
NewSupplier=Új beszállító
History=Történet
ListOfSuppliers=Beszállító listája

View File

@ -13,7 +13,6 @@ Supplier=Birgir
AddSupplier=Bæta við birgja
SupplierRemoved=Birgir fjarri
SuppliersInvoice=Birgjar Reikningar
SuppliersInvoices=Birgjar reikningum
NewSupplier=New birgir
History=Saga
ListOfSuppliers=Listi yfir birgja

View File

@ -39,4 +39,3 @@ SupplierRemoved =Fornitore rimosso
SuppliersArea =Area fornitori
Suppliers =Fornitori
SuppliersInvoice =Fattura Fornitore
SuppliersInvoices =Fatture fornitori

View File

@ -13,7 +13,6 @@ Supplier=サプライヤー
AddSupplier=サプライヤーを追加します。
SupplierRemoved=サプライヤーは、削除
SuppliersInvoice=仕入先の請求書
SuppliersInvoices=仕入先の請求書
NewSupplier=新しいサプライヤー
History=歴史
ListOfSuppliers=サプライヤーのリスト

View File

@ -5,7 +5,6 @@ Supplier=Leverandør
AddSupplier=Legg til en leverandør
SupplierRemoved=Leverandør slettet
SuppliersInvoice=Leverandørfaktura
SuppliersInvoices=Leverandørfakturaer
NewSupplier=Ny leverandør
History=Historikk
ListOfSuppliers=Leverandøroversikt

View File

@ -5,7 +5,6 @@ Supplier=Leverancier
AddSupplier=Voeg een leverancier toe
SupplierRemoved=Leverancier verwijderd
SuppliersInvoice=Leveranciers factuur
SuppliersInvoices=Leveranciers facturen
NewSupplier=Nieuwe leverancier
History=Geschiedenis
ListOfSuppliers=Lijst van de leveranciers

View File

@ -5,7 +5,6 @@ Supplier = Leverancier
AddSupplier = Voeg een leverancier toe
SupplierRemoved = Leverancier verwijderd
SuppliersInvoice = Leveranciersfactuur
SuppliersInvoices = Leveranciersfacturen
NewSupplier = Nieuwe leverancier
History = Geschiedenis
ListOfSuppliers = Leverancierslijst

View File

@ -16,7 +16,6 @@ Supplier=Dostawca
AddSupplier=Dodaj dostawcy
SupplierRemoved=Dostawca usunięte
SuppliersInvoice=Dostawcy faktury
SuppliersInvoices=Dostawcy faktur
NewSupplier=Nowy dostawca
History=Historia
ListOfSuppliers=Lista dostawców

View File

@ -5,7 +5,6 @@ Supplier=Fornecedor
AddSupplier=Adicionar Fornecedor
SupplierRemoved=Fornecedor Eliminado
SuppliersInvoice=Faturas do Fornecedor
SuppliersInvoices=Faturas de Fornecedores
NewSupplier=Novo Fornecedor
History=Histórico
ListOfSuppliers=Lista de Fornecedores

View File

@ -5,7 +5,6 @@ Supplier=Fornecedor
AddSupplier=Adicionar Fornecedor
SupplierRemoved=Fornecedor Eliminado
SuppliersInvoice=Facturas do Fornecedor
SuppliersInvoices=Facturas de Fornecedores
NewSupplier=Novo Fornecedor
History=Histórico
ListOfSuppliers=Lista de Fornecedores

View File

@ -14,7 +14,6 @@ Supplier=Furnizor
AddSupplier=Adauga un furnizor
SupplierRemoved=Furnizor eliminat
SuppliersInvoice=Furnizori de factură
SuppliersInvoices=Furnizori facturi
NewSupplier=New furnizor
History=Istorie
ListOfSuppliers=Lista de furnizori

View File

@ -14,7 +14,6 @@ Supplier=Поставщик
AddSupplier=Добавить поставщиком
SupplierRemoved=Поставщик удален
SuppliersInvoice=Поставщики счета
SuppliersInvoices=Поставщики счета
NewSupplier=Новый поставщик
History=История
ListOfSuppliers=Список поставщиков

View File

@ -5,7 +5,6 @@ Supplier = Dobavitelj
AddSupplier = Dodaj dobavitelja
SupplierRemoved = Dobavitelj odstranjen
SuppliersInvoice = Računi dobavitelja
SuppliersInvoices = Računi dobaviteljev
NewSupplier = Nov dobavitelj
History = Zgodovina
ListOfSuppliers = Seznam dobaviteljev

View File

@ -13,7 +13,6 @@ Supplier=Leverantör
AddSupplier=Lägg till en leverantör
SupplierRemoved=Leverantör bort
SuppliersInvoice=Leverantörer faktura
SuppliersInvoices=Leverantörer fakturor
NewSupplier=Ny leverantör
History=Historia
ListOfSuppliers=Lista över leverantörer

View File

@ -12,7 +12,6 @@ Supplier=Tedarikçi
AddSupplier=Bir tedarikçi ekle
SupplierRemoved=Tedarikçi kaldırıldı
SuppliersInvoice=Tedarikçi faturası
SuppliersInvoices=Tedarikçi faturaları
NewSupplier=Yeni tedarikçi
History=Geçmiş
ListOfSuppliers=Tedarikçiler listesi

View File

@ -13,7 +13,6 @@ Supplier=供应商
AddSupplier=新增供应商
SupplierRemoved=供应商删除
SuppliersInvoice=供应商发票
SuppliersInvoices=供应商发票
NewSupplier=新供应商
History=历史
ListOfSuppliers=供应商名单

View File

@ -13,7 +13,6 @@ Supplier=供應商
AddSupplier=新增供應商
SupplierRemoved=供應商刪除
SuppliersInvoice=供應商的發票
SuppliersInvoices=供應商的發票
NewSupplier=新供應商
History=歷史
ListOfSuppliers=供應商名單

View File

@ -1380,7 +1380,7 @@ print "\n</div><br>\n";
* All the "Add to" areas
*/
if ($id && ($action == '' || $action == 'view') && $object->status)
if ($object->id && ($action == '' || $action == 'view') && $object->status)
{
print '<table width="100%" class="noborder">';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -34,6 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$langs->load("products");
$langs->load("suppliers");
$langs->load("bills");
// Charges ????
if (! empty($conf->margin->enabled)) $langs->load("margins");
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');

View File

@ -165,8 +165,7 @@ if ($id > 0 || ! empty($ref))
print "<td align=\"center\">";
print dol_print_date($db->jdate($objp->datef))."</td>";
print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
$fac=new Facture($db);
print '<td align="right">'.$fac->LibStatut($objp->paye,$objp->statut,5).'</td>';
print '<td align="right">'.$supplierinvoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
print "</tr>\n";
$i++;
}

View File

@ -195,6 +195,23 @@ if ($action == 'setprofid')
}
}
//Activate ProfId
if ($action == 'setprofidmandatory')
{
$status = GETPOST('status','alpha');
$idprof="SOCIETE_IDPROF".$value."_MANDATORY";
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
/*
* View
@ -522,6 +539,7 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center">'.$langs->trans("MustBeUnique").'</td>';
print '<td align="center">'.$langs->trans("MustBeMandatory").'</td>';
print "</tr>\n";
$profid[0][0]=$langs->trans("ProfId1");
@ -532,6 +550,10 @@ $profid[2][0]=$langs->trans("ProfId3");
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code);
$profid[3][0]=$langs->trans("ProfId4");
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code);
$profid[4][0]=$langs->trans("ProfId5");
$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code);
$profid[5][0]=$langs->trans("ProfId6");
$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code);
$var = true;
$i=0;
@ -539,42 +561,47 @@ $i=0;
$nbofloop=count($profid);
while ($i < $nbofloop)
{
$var = !$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$profid[$i][0]."</td><td>\n";
print $profid[$i][1];
print '</td>';
switch($i)
if ($profid[$i][1]!='-')
{
case 0:
$verif=(empty($conf->global->SOCIETE_IDPROF1_UNIQUE)?false:true);
break;
case 1:
$verif=(empty($conf->global->SOCIETE_IDPROF2_UNIQUE)?false:true);
break;
case 2:
$verif=(empty($conf->global->SOCIETE_IDPROF3_UNIQUE)?false:true);
break;
case 3:
$verif=(empty($conf->global->SOCIETE_IDPROF4_UNIQUE)?false:true);
break;
$var = !$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$profid[$i][0]."</td><td>\n";
print $profid[$i][1];
print '</td>';
$idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE';
$idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY';
$verif=(empty($conf->global->$idprof_unique)?false:true);
$mandatory=(empty($conf->global->$idprof_mandatory)?false:true);
if ($verif)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
if ($mandatory)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print "</tr>\n";
}
if ($verif)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print "</tr>\n";
$i++;
}

View File

@ -2569,6 +2569,43 @@ class Societe extends CommonObject
$this->idprof5='idprof5';
$this->idprof6='idprof6';
}
/**
* Check if localtax define for company
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @param localTaxNum $localTaxNum 1 or 2
* @return boolean true / false
*/
function hasLocalTax($localTaxNum) {
global $user,$langs,$conf;
// check parameter
if ($localTaxNum != 1 && $localTaxNum != 2)
return false;
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax2";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->country_code."'";
$sql .= " AND t.active = 1";
if ($localTaxNum == 1)
$sql .= " AND t.localtax1 <> 0";
elseif ($localTaxNum == 2)
$sql .= " AND t.localtax2 <> 0";
dol_syslog("get_localtax sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
return ($this->db->num_rows($resql) > 0);
}
else
return false;
}
}

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -202,9 +202,18 @@ if (empty($reshook))
$error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled");
$action = ($action=='add'?'create':'edit');
}
// We set country_id, country_code and country for the selected country
$object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
if ($object->country_id)
{
$tmparray=getCountry($object->country_id,'all');
$object->country_code=$tmparray['code'];
$object->country=$tmparray['label'];
}
// Check for duplicate prof id
for ($i = 1; $i < 3; $i++)
// Check for duplicate or mandatory prof id
for ($i = 1; $i < 5; $i++)
{
$slabel="idprof".$i;
$_POST[$slabel]=trim($_POST[$slabel]);
@ -218,8 +227,18 @@ if (empty($reshook))
$action = ($action=='add'?'create':'edit');
}
}
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
{
$langs->load("errors");
$error++;
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
$action = ($action=='add'?'create':'edit');
}
}
}
if (! $error)
{
if ($action == 'add')
@ -293,7 +312,7 @@ if (empty($reshook))
// Gestion du logo de la société
}
else
{
{
$error=$object->error; $errors=$object->errors;
}
@ -834,7 +853,13 @@ else
if ($idprof!='-')
{
if (($j % 2) == 0) print '<tr>';
print '<td>'.$idprof.'</td><td>';
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
if(empty($conf->global->$idprof_mandatory))
print '<td>'.$idprof.'</td><td>';
else
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
$key='idprof'.$i;
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
print '</td>';
@ -907,30 +932,26 @@ else
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$object->capital.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Local Taxes
// TODO add specific function by country
if($mysoc->country_code=='ES')
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
print $form->selectyesno('localtax1assuj_value',0,1);
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
print $form->selectyesno('localtax1assuj_value',0,1);
print '</td><td>'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print $form->selectyesno('localtax1assuj_value',0,1);
print '</td><tr>';
}
elseif($mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><tr>';
}
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print $form->selectyesno('localtax1assuj_value',0,1);
print '</td><tr>';
}
elseif($mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><tr>';
}
if (! empty($conf->global->MAIN_MULTILANGS))
@ -1121,7 +1142,7 @@ else
print '<table class="border" width="100%">';
// Name
print '<tr><td><span class="fieldrequired">'.$langs->trans('ThirdPartyName').'</span></td><td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="'.$object->name.'"></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans('ThirdPartyName').'</span></td><td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="'.dol_escape_htmltag($object->name).'"></td></tr>';
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
@ -1130,12 +1151,12 @@ else
// It does not change the prefix mode using the auto numbering prefix
if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm)
{
print '<input type="hidden" name="prefix_comm" value="'.$object->prefix_comm.'">';
print '<input type="hidden" name="prefix_comm" value="'.dol_escape_htmltag($object->prefix_comm).'">';
print $object->prefix_comm;
}
else
{
print '<input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$object->prefix_comm.'">';
print '<input type="text" size="5" maxlength="5" name="prefix_comm" value="'.dol_escape_htmltag($object->prefix_comm).'">';
}
print '</td>';
}
@ -1275,7 +1296,13 @@ else
if ($idprof!='-')
{
if (($j % 2) == 0) print '<tr>';
print '<td>'.$idprof.'</td><td>';
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
if(empty($conf->global->$idprof_mandatory))
print '<td>'.$idprof.'</td><td>';
else
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
$key='idprof'.$i;
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
print '</td>';
@ -1322,31 +1349,27 @@ else
print '</tr>';
// Local Taxes
// TODO add specific function by country
if($mysoc->country_code=='ES')
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
print '</td><td>'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
print '</td></tr>';
}
elseif($mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>';
}
}
elseif($mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>';
}
// Type - Size
@ -1642,30 +1665,26 @@ else
print '</tr>';
// Local Taxes
// TODO add specific function by country
if($mysoc->country_code=='ES')
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
print yn($object->localtax1_assuj);
print '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
print yn($object->localtax2_assuj);
print '</td></tr>';
print '<tr><td>'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
print yn($object->localtax1_assuj);
print '</td><td>'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
print yn($object->localtax2_assuj);
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print yn($object->localtax1_assuj);
print '</td><tr>';
}
elseif($mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
print yn($object->localtax2_assuj);
print '</td><tr>';
}
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print yn($object->localtax1_assuj);
print '</td><tr>';
}
elseif($mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print yn($object->localtax2_assuj);
print '</td><tr>';
}
// Type + Staff

View File

@ -0,0 +1,157 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* 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 2 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/adherents/admin/adherent_extrafields.php
* \ingroup member
* \brief Page to setup extra fields of members
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("users");
$langs->load("admin");
$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
$type2label=array('');
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha');
$elementtype='user';
if (!$user->admin) accessforbidden();
/*
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
/*
* View
*/
$textobject=$langs->transnoentitiesnoconv("Users");
$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:M&oacute;dulo_Usuarios';
llxHeader('',$langs->trans("UsersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("UsersSetup"),$linkback,'setup');
$head = user_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("User"), 0, 'user');
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
print '<br>';
dol_htmloutput_errors($mesg);
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
print "<table summary=\"listofattributes\" class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("AttributeCode").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="center">'.$langs->trans("Unique").'</td>';
print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$extrafields->attribute_label[$key]."</td>\n";
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=".$key."\">".img_delete()."</a></td>\n";
print "</tr>";
// $i++;
}
print "</table>";
dol_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit')
{
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
print "</div>";
}
/* ************************************************************************** */
/* */
/* Creation d'un champ optionnel
/* */
/* ************************************************************************** */
if ($action == 'create')
{
print "<br>";
print_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
/* ************************************************************************** */
/* */
/* Edition d'un champ optionnel */
/* */
/* ************************************************************************** */
if ($action == 'edit' && ! empty($attrname))
{
print "<br>";
print_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
llxFooter();
$db->close();
?>

View File

@ -1189,6 +1189,25 @@ class User extends CommonObject
}
}
// Actions on extra fields (by external module or standard code)
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
$hookmanager->initHooks(array('userdao'));
$parameters=array('socid'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
}
else if ($reshook < 0) $error++;
if (! $error && ! $notrigger)
{
// Appel des triggers

File diff suppressed because it is too large Load Diff