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

This commit is contained in:
Maxime Kohlhaas 2014-08-05 09:21:31 +02:00
commit fe2f96ab20
68 changed files with 1671 additions and 1468 deletions

View File

@ -164,6 +164,12 @@ source_file = htdocs/langs/en_US/ldap.lang
source_lang = en_US source_lang = en_US
type = MOZILLAPROPERTIES type = MOZILLAPROPERTIES
[dolibarr.link]
file_filter = htdocs/langs/<lang>/link.lang
source_file = htdocs/langs/en_US/link.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.mailmanspip] [dolibarr.mailmanspip]
file_filter = htdocs/langs/<lang>/mailmanspip.lang file_filter = htdocs/langs/<lang>/mailmanspip.lang
source_file = htdocs/langs/en_US/mailmanspip.lang source_file = htdocs/langs/en_US/mailmanspip.lang

View File

@ -5,6 +5,8 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****
For users: For users:
- New: Supervisor is now visible into user list.
- New: Add user of creation and validation on invoice export.
- New: Add info page about browser. - New: Add info page about browser.
- New: Enable feature developed for 3.6 we forgot to enabled: Adding prefix - New: Enable feature developed for 3.6 we forgot to enabled: Adding prefix
on uploaded file names. on uploaded file names.
@ -186,6 +188,8 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
***** ChangeLog for 3.5.5 compared to 3.5.4 ***** ***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: Fusion PDF button on unpaid invoice is no more displayed
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click)
***** ChangeLog for 3.5.4 compared to 3.5.3 ***** ***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled. Fix: Hide title of event when agenda module disabled.

View File

@ -131,19 +131,19 @@ case "$1" in
setup_empty_conf setup_empty_conf
else else
# File already exist. We add params not found. # File already exist. We add params not found.
echo Add new params to overwrite path to use shared libraries/fonts #echo Add new params to overwrite path to use shared libraries/fonts
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config #grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config #grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config ##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config #grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config #grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config ##grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config ##grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config #grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config #grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config #grep -q -c "dolibarr_js_JQUERY_UI" $config || [ ! -d "/usr/share/javascript/jquery-ui" ] || echo "<?php \$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config #grep -q -c "dolibarr_js_JQUERY_FLOT" $config || [ ! -d "/usr/share/javascript/flot" ] || echo "<?php \$dolibarr_js_JQUERY_FLOT='/javascript/flot'; ?>" >> $config
grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; ?>" >> $config #grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "<?php \$dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf'; ?>" >> $config
fi fi
db_get dolibarr/reconfigure-webserver db_get dolibarr/reconfigure-webserver

View File

@ -416,6 +416,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/vagrant`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`;
$ret=`rm -f $BUILDROOT/$PROJECT/dev/dolibarr_changes.txt`; $ret=`rm -f $BUILDROOT/$PROJECT/dev/dolibarr_changes.txt`;
$ret=`rm -f $BUILDROOT/$PROJECT/dev/README`; $ret=`rm -f $BUILDROOT/$PROJECT/dev/README`;

View File

@ -94,7 +94,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
print "Invoice ".$i." for socid ".$socid; print "Invoice ".$i." for socid ".$socid;
$facture = new Facture($db, $socids[$socid]); $facture = new Facture($db);
$facture->date = time(); $facture->date = time();
$facture->cond_reglement_id = 3; $facture->cond_reglement_id = 3;
$facture->mode_reglement_id = 3; $facture->mode_reglement_id = 3;

View File

@ -122,7 +122,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
$soc = new Societe($db); $soc = new Societe($db);
$propal = new Propal($db, $socids[$socid]); $propal = new Propal($db);
$obj = $conf->global->PROPALE_ADDON; $obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj; $modPropale = new $obj;
@ -130,6 +130,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
$propal->ref = $numpr; $propal->ref = $numpr;
$propal->contactid = $contids[$socids[$socid]][0]; $propal->contactid = $contids[$socids[$socid]][0];
$propal->socid = $socids[$socid];
$propal->datep = time(); $propal->datep = time();
$propal->cond_reglement_id = 3; $propal->cond_reglement_id = 3;
$propal->mode_reglement_id = 3; $propal->mode_reglement_id = 3;

View File

@ -187,7 +187,7 @@ class Adherent extends CommonObject
if (dol_textishtml($text,1)) $msgishtml = 1; if (dol_textishtml($text,1)) $msgishtml = 1;
$infos=''; $infos='';
if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel()."\n";
$infos.= $langs->transnoentities("id").": ".$this->id."\n"; $infos.= $langs->transnoentities("id").": ".$this->id."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
@ -210,7 +210,7 @@ class Adherent extends CommonObject
$substitutionarray=array( $substitutionarray=array(
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
'%CIVILITY%'=>$this->getCivilityLabel($msgishtml?0:1), '%CIVILITY%'=>$this->getCivilityLabel(),
'%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, '%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), '%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
@ -1530,7 +1530,7 @@ class Adherent extends CommonObject
/** /**
* Return civility label of a member * Return civility label of a member
* *
* @return string Translated name of civility * @return string Translated name of civility (translated with transnoentitiesnoconv)
*/ */
function getCivilityLabel() function getCivilityLabel()
{ {

View File

@ -818,7 +818,7 @@ if ($id)
if ($valuetoshow != '') if ($valuetoshow != '')
{ {
print '<td align="'.$align.'">'; print '<td align="'.$align.'">';
if (! empty($tabhelp[$id][$value]) && preg_match('/http:/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.'</a>'; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow; else print $valuetoshow;
print '</td>'; print '</td>';

View File

@ -13,7 +13,6 @@ support/
support/index.php support/index.php
support/online.php support/online.php
support/background.png
support/default.css support/default.css
support/dolibarr_logo2.png support/dolibarr_logo2.png
support/headbg.jpg support/headbg.jpg

View File

@ -514,18 +514,18 @@ if ($action == 'create')
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>';
// Assigned to
$var=false;
print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1);
print '</td></tr>';
print '</table>'; print '</table>';
print '<br><br>'; print '<br><br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Assigned to
$var=false;
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):(! empty($object->usertodo->id) && $object->usertodo->id > 0 ? $object->usertodo->id : $user->id),'affectedto',1);
print '</td></tr>';
// Busy // Busy
print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
print '<input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'>'; print '<input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'>';
@ -764,15 +764,15 @@ if ($id > 0)
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Assigned to // Assigned to
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'affectedto',1); print $form->select_dolusers($object->usertodo->id>0?$object->usertodo->id:-1,'affectedto',1);
print '</td></tr>'; print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Busy // Busy
print '<tr><td class="nowrap">'.$langs->trans("Busy").'</td><td>'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td>';
print '<input id="transparency" type="checkbox" name="transparency"'.($object->transparency?' checked="checked"':'').'">'; print '<input id="transparency" type="checkbox" name="transparency"'.($object->transparency?' checked="checked"':'').'">';
print '</td></tr>'; print '</td></tr>';
@ -939,15 +939,15 @@ if ($id > 0)
// Location // Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Assigned to // Assigned to
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1); if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
print '</table><br><br><table class="border" width="100%">';
// Busy // Busy
print '<tr><td class="nowrap">'.$langs->trans("Busy").'</td><td colspan="3">'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("Busy").'</td><td colspan="3">';
if ($object->usertodo->id > 0) print yn(($object->transparency > 0)?1:0); // We show nothing if event is assigned to nobody if ($object->usertodo->id > 0) print yn(($object->transparency > 0)?1:0); // We show nothing if event is assigned to nobody
print '</td></tr>'; print '</td></tr>';

View File

@ -9,6 +9,7 @@
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -151,7 +152,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -171,7 +172,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -461,7 +462,7 @@ else if ($action == 'add' && $user->rights->propal->creer) {
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -548,11 +549,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Recipient was provided from combo list // Recipient was provided from combo list
if ($_POST ['receiver'] == 'thirdparty') // Id of third party if ($_POST ['receiver'] == 'thirdparty') // Id of third party
{ {
$sendto = $object->client->email; $sendto = $object->thirdparty->email;
$sendtoid = 0; $sendtoid = 0;
} else // Id du contact } else // Id du contact
{ {
$sendto = $object->client->contact_get_property($_POST ['receiver'], 'email'); $sendto = $object->thirdparty->contact_get_property($_POST ['receiver'], 'email');
$sendtoid = $_POST ['receiver']; $sendtoid = $_POST ['receiver'];
} }
} }
@ -656,7 +657,7 @@ if ($action == 'modif' && $user->rights->propal->creer) {
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -742,18 +743,22 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');
// If prices fields are update // If prices fields are update
$tva_tx = get_default_tva($mysoc, $object->client, $prod->id); $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
$tva_npr = get_default_npr($mysoc, $object->client, $prod->id); $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
// On defini prix unitaire // On defini prix unitaire
if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->thirdparty->price_level)
{ {
$pu_ht = $prod->multiprices [$object->client->price_level]; $pu_ht = $prod->multiprices [$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc [$object->client->price_level]; $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level];
$price_min = $prod->multiprices_min [$object->client->price_level]; $price_min = $prod->multiprices_min [$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type [$object->client->price_level]; $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
} }
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{ {
@ -761,12 +766,11 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
$prodcustprice = new Productcustomerprice($db); $prodcustprice = new Productcustomerprice($db);
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) { if ($result) {
if (count($prodcustprice->lines) > 0) { if (count($prodcustprice->lines) > 0) {
$found = true;
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines [0]->price_base_type;
@ -774,13 +778,6 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
} }
} }
} }
else
{
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
}
// if price ht is forced (ie: calculated by margin rate and cost price) // if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) { if (! empty($price_ht)) {
@ -807,7 +804,7 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
if (empty($newlang) && GETPOST('lang_id')) if (empty($newlang) && GETPOST('lang_id'))
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
if (empty($newlang)) if (empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -852,8 +849,8 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
$date_end = dol_mktime(0, 0, 0, GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); $date_end = dol_mktime(0, 0, 0, GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year'));
// Local Taxes // Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->client); $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
$localtax2_tx = get_localtax($tva_tx, 2, $object->client); $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
$info_bits = 0; $info_bits = 0;
if ($tva_npr) if ($tva_npr)
@ -874,7 +871,7 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -933,8 +930,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
// Define vat_rate // Define vat_rate
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
$vat_rate = str_replace('*', '', $vat_rate); $vat_rate = str_replace('*', '', $vat_rate);
$localtax1_rate = get_localtax($vat_rate, 1, $object->client); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty);
$localtax2_rate = get_localtax($vat_rate, 2, $object->client); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
$pu_ht = GETPOST('price_ht'); $pu_ht = GETPOST('price_ht');
// Add buying price // Add buying price
@ -969,8 +966,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$type = $product->type; $type = $product->type;
$price_min = $product->price_min; $price_min = $product->price_min;
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
$price_min = $product->multiprices_min [$object->client->price_level]; $price_min = $product->multiprices_min [$object->thirdparty->price_level];
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
@ -1002,7 +999,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -1044,7 +1041,7 @@ else if ($action == 'builddoc' && $user->rights->propal->creer) {
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -1130,7 +1127,7 @@ else if ($action == 'up' && $user->rights->propal->creer) {
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -1149,7 +1146,7 @@ else if ($action == 'down' && $user->rights->propal->creer) {
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@ -2302,7 +2299,7 @@ if ($action == 'create') {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) if (!empty($newlang))
{ {

View File

@ -764,9 +764,10 @@ class Commande extends CommonOrder
if ($origin == 'propal' && $origin_id) if ($origin == 'propal' && $origin_id)
{ {
// On recupere les differents contact interne et externe // On recupere les differents contact interne et externe
$prop = new Propal($this->db, $this->socid, $origin_id); $prop = new Propal($this->db);
$prop->fetch($origin_id);
// On recupere le commercial suivi propale // We get ids of sales representatives of proposal
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL'); $this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid) if ($this->userid)
@ -775,7 +776,7 @@ class Commande extends CommonOrder
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
} }
// On recupere le contact client suivi propale // We get ids of customer follower of proposal
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER'); $this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
if ($this->contactid) if ($this->contactid)

View File

@ -9,6 +9,7 @@
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -170,7 +171,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id'))
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -476,7 +477,7 @@ else if ($action == 'setconditions' && $user->rights->commande->creer) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -581,18 +582,22 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');
// Update if prices fields are defined // Update if prices fields are defined
$tva_tx = get_default_tva($mysoc, $object->client, $prod->id); $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
$tva_npr = get_default_npr($mysoc, $object->client, $prod->id); $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
// multiprix // multiprix
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
{ {
$pu_ht = $prod->multiprices [$object->client->price_level]; $pu_ht = $prod->multiprices [$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc [$object->client->price_level]; $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level];
$price_min = $prod->multiprices_min [$object->client->price_level]; $price_min = $prod->multiprices_min [$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type [$object->client->price_level]; $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
} }
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{ {
@ -600,12 +605,11 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$prodcustprice = new Productcustomerprice($db); $prodcustprice = new Productcustomerprice($db);
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) { if ($result) {
if (count($prodcustprice->lines) > 0) { if (count($prodcustprice->lines) > 0) {
$found = true;
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines [0]->price_base_type;
@ -613,13 +617,6 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
} }
} }
} }
else
{
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
}
// if price ht is forced (ie: calculated by margin rate and cost price) // if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) { if (! empty($price_ht)) {
@ -646,7 +643,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
if (empty($newlang) && GETPOST('lang_id')) if (empty($newlang) && GETPOST('lang_id'))
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
if (empty($newlang)) if (empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -688,8 +685,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$buyingprice = (GETPOST('buying_price' . $predef) ? GETPOST('buying_price' . $predef) : ''); $buyingprice = (GETPOST('buying_price' . $predef) ? GETPOST('buying_price' . $predef) : '');
// Local Taxes // Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->client); $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
$localtax2_tx = get_localtax($tva_tx, 2, $object->client); $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
$desc = dol_htmlcleanlastbr($desc); $desc = dol_htmlcleanlastbr($desc);
@ -712,7 +709,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -778,8 +775,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
// Define vat_rate // Define vat_rate
$vat_rate = str_replace('*', '', $vat_rate); $vat_rate = str_replace('*', '', $vat_rate);
$localtax1_rate = get_localtax($vat_rate, 1, $object->client); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty);
$localtax2_rate = get_localtax($vat_rate, 2, $object->client); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
// Add buying price // Add buying price
$fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : ''); $fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : '');
@ -805,8 +802,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
$type = $product->type; $type = $product->type;
$price_min = $product->price_min; $price_min = $product->price_min;
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
$price_min = $product->multiprices_min [$object->client->price_level]; $price_min = $product->multiprices_min [$object->thirdparty->price_level];
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
@ -836,7 +833,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id'))
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -902,7 +899,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -947,7 +944,7 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1013,7 +1010,7 @@ else if ($action == 'up' && $user->rights->commande->creer) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1035,7 +1032,7 @@ else if ($action == 'down' && $user->rights->commande->creer) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1064,7 +1061,7 @@ else if ($action == 'builddoc') // In get or post
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1179,11 +1176,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Recipient was provided from combo list // Recipient was provided from combo list
if (GETPOST('receiver') == 'thirdparty') // Id of third party if (GETPOST('receiver') == 'thirdparty') // Id of third party
{ {
$sendto = $object->client->email; $sendto = $object->thirdparty->email;
$sendtoid = 0; $sendtoid = 0;
} else // Id du contact } else // Id du contact
{ {
$sendto = $object->client->contact_get_property(GETPOST('receiver'), 'email'); $sendto = $object->thirdparty->contact_get_property(GETPOST('receiver'), 'email');
$sendtoid = GETPOST('receiver'); $sendtoid = GETPOST('receiver');
} }
} }
@ -2444,7 +2441,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) if (!empty($newlang))
{ {

View File

@ -35,6 +35,7 @@ $langs->load("bills");
$action=GETPOST('action'); $action=GETPOST('action');
$id=GETPOST('id'); $id=GETPOST('id');
$ref=GETPOST('ref');
// Security check // Security check
if (isset($_GET["id"]) || isset($_GET["ref"])) if (isset($_GET["id"]) || isset($_GET["ref"]))
@ -88,8 +89,9 @@ if ($action == 'update' && ! $_POST["cancel"])
if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
{ {
// Modification // Modification
$account = new Account($db, $_GET["id"]); $account = new Account($db);
$account->delete($_GET["id"]); $account->fetch($id);
$account->delete();
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
exit; exit;

View File

@ -57,7 +57,7 @@ if ($_POST["action"] == 'add')
$error=0; $error=0;
// Create account // Create account
$account = new Account($db,0); $account = new Account($db);
$account->ref = dol_sanitizeFileName(trim($_POST["ref"])); $account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
$account->label = trim($_POST["label"]); $account->label = trim($_POST["label"]);
@ -119,7 +119,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
$error=0; $error=0;
// Update account // Update account
$account = new Account($db, $_POST["id"]); $account = new Account($db);
$account->fetch($_POST["id"]); $account->fetch($_POST["id"]);
$account->ref = dol_string_nospecial(trim($_POST["ref"])); $account->ref = dol_string_nospecial(trim($_POST["ref"]));

View File

@ -10,6 +10,7 @@
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr> * Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -182,7 +183,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -393,7 +394,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -468,7 +469,7 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1145,18 +1146,22 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');
// Update if prices fields are defined // Update if prices fields are defined
$tva_tx = get_default_tva($mysoc, $object->client, $prod->id); $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
$tva_npr = get_default_npr($mysoc, $object->client, $prod->id); $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
// We define price for product // We define price for product
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
{ {
$pu_ht = $prod->multiprices [$object->client->price_level]; $pu_ht = $prod->multiprices [$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc [$object->client->price_level]; $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level];
$price_min = $prod->multiprices_min [$object->client->price_level]; $price_min = $prod->multiprices_min [$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type [$object->client->price_level]; $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level];
$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
} }
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{ {
@ -1164,12 +1169,11 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$prodcustprice = new Productcustomerprice($db); $prodcustprice = new Productcustomerprice($db);
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) { if ($result) {
if (count($prodcustprice->lines) > 0) { if (count($prodcustprice->lines) > 0) {
$found = true;
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines [0]->price_base_type;
@ -1177,13 +1181,6 @@ else if ($action == 'addline' && $user->rights->facture->creer)
} }
} }
} }
else
{
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
}
// if price ht is forced (ie: calculated by margin rate and cost price) // if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) { if (! empty($price_ht)) {
@ -1210,7 +1207,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
if (empty($newlang) && GETPOST('lang_id')) if (empty($newlang) && GETPOST('lang_id'))
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
if (empty($newlang)) if (empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1252,8 +1249,8 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$buyingprice = price2num(GETPOST('buying_price' . $predef) ? GETPOST('buying_price' . $predef) : ''); $buyingprice = price2num(GETPOST('buying_price' . $predef) ? GETPOST('buying_price' . $predef) : '');
// Local Taxes // Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->client); $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
$localtax2_tx = get_localtax($tva_tx, 2, $object->client); $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
$info_bits = 0; $info_bits = 0;
if ($tva_npr) if ($tva_npr)
@ -1272,7 +1269,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1342,8 +1339,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
// Define vat_rate // Define vat_rate
$vat_rate = str_replace('*', '', $vat_rate); $vat_rate = str_replace('*', '', $vat_rate);
$localtax1_rate = get_localtax($vat_rate, 1, $object->client); $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty);
$localtax2_rate = get_localtax($vat_rate, 2, $object->client); $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty);
// Add buying price // Add buying price
$fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : '');
@ -1370,8 +1367,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
$type = $product->type; $type = $product->type;
$price_min = $product->price_min; $price_min = $product->price_min;
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
$price_min = $product->multiprices_min [$object->client->price_level]; $price_min = $product->multiprices_min [$object->thirdparty->price_level];
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
@ -1403,7 +1400,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id'))
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1448,7 +1445,7 @@ else if ($action == 'up' && $user->rights->facture->creer) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1470,7 +1467,7 @@ else if ($action == 'down' && $user->rights->facture->creer) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1546,11 +1543,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// Recipient was provided from combo list // Recipient was provided from combo list
if ($_POST['receiver'] == 'thirdparty') // Id of third party if ($_POST['receiver'] == 'thirdparty') // Id of third party
{ {
$sendto = $object->client->email; $sendto = $object->thirdparty->email;
$sendtoid = 0; $sendtoid = 0;
} else // Id du contact } else // Id du contact
{ {
$sendto = $object->client->contact_get_property($_POST['receiver'], 'email'); $sendto = $object->thirdparty->contact_get_property($_POST['receiver'], 'email');
$sendtoid = $_POST['receiver']; $sendtoid = $_POST['receiver'];
} }
} }
@ -1692,7 +1689,7 @@ else if ($action == 'builddoc') // En get ou en post
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
@ -3670,7 +3667,7 @@ if ($action == 'create')
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
$newlang = $_REQUEST['lang_id']; $newlang = $_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if ($conf->global->MAIN_MULTILANGS && empty($newlang))
$newlang = $object->client->default_lang; $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) if (!empty($newlang))
{ {

View File

@ -41,6 +41,7 @@ $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int'));
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$option = GETPOST('option'); $option = GETPOST('option');
$mode=GETPOST('mode'); $mode=GETPOST('mode');
$builddoc_generatebutton=GETPOST('builddoc_generatebutton');
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
@ -230,7 +231,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
} }
if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search')) if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_search') && !empty($builddoc_generatebutton))
{ {
if (is_array($_POST['toGenerate'])) if (is_array($_POST['toGenerate']))
{ {

View File

@ -326,35 +326,32 @@ class Localtax extends CommonObject
*/ */
function localtax_sum_collectee($year = 0) function localtax_sum_collectee($year = 0)
{ {
$sql = "SELECT sum(f.localtax) as amount"; $sql = "SELECT sum(f.localtax) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
if ($year) if ($year)
{ {
$sql .= " AND f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' "; $sql .= " AND f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' ";
} }
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->amount; $ret = $obj->amount;
$this->db->free($result);
return $ret;
} }
else else
{ {
$this->db->free($result);
return 0; return 0;
} }
$this->db->free($result);
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
return -1; return -1;
} }
} }
@ -370,31 +367,30 @@ class Localtax extends CommonObject
$sql = "SELECT sum(f.total_localtax) as total_localtax"; $sql = "SELECT sum(f.total_localtax) as total_localtax";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
if ($year) if ($year)
{ {
$sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' "; $sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' ";
} }
$result = $this->db->query($sql);
$result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->total_localtax; $ret = $obj->total_localtax;
$this->db->free($result);
return $ret;
} }
else else
{ {
$this->db->free($result);
return 0; return 0;
} }
$this->db->free();
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
return -1; return -1;
} }
} }
@ -412,32 +408,30 @@ class Localtax extends CommonObject
$sql = "SELECT sum(f.amount) as amount"; $sql = "SELECT sum(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as f"; $sql .= " FROM ".MAIN_DB_PREFIX."localtax as f";
if ($year) if ($year)
{ {
$sql .= " WHERE f.datev >= '$year-01-01' AND f.datev <= '$year-12-31' "; $sql .= " WHERE f.datev >= '$year-01-01' AND f.datev <= '$year-12-31' ";
} }
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->amount; $ret = $obj->amount;
$this->db->free($result);
return $ret;
} }
else else
{ {
$this->db->free($result);
return 0; return 0;
} }
$this->db->free();
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
return -1; return -1;
} }
} }
@ -543,14 +537,14 @@ class Localtax extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }

View File

@ -353,32 +353,30 @@ class Tva extends CommonObject
$sql = "SELECT sum(f.tva) as amount"; $sql = "SELECT sum(f.tva) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
if ($year) if ($year)
{ {
$sql .= " AND f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' "; $sql .= " AND f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' ";
} }
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->amount; $ret = $obj->amount;
$this->db->free($result);
return $ret;
} }
else else
{ {
$this->db->free($result);
return 0; return 0;
} }
$this->db->free($result);
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
return -1; return -1;
} }
} }
@ -394,31 +392,30 @@ class Tva extends CommonObject
$sql = "SELECT sum(f.total_tva) as total_tva"; $sql = "SELECT sum(f.total_tva) as total_tva";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
if ($year) if ($year)
{ {
$sql .= " WHERE f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' "; $sql .= " WHERE f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' ";
} }
$result = $this->db->query($sql);
$result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->total_tva; $ret = $obj->total_tva;
$this->db->free($result);
return $ret;
} }
else else
{ {
$this->db->free($result);
return 0; return 0;
} }
$this->db->free();
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
return -1; return -1;
} }
} }
@ -442,25 +439,24 @@ class Tva extends CommonObject
} }
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows($result)) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->amount; $ret = $obj->amount;
$this->db->free($result);
return $ret;
} }
else else
{ {
$this->db->free($result);
return 0; return 0;
} }
$this->db->free();
} }
else else
{ {
print $this->db->error(); print $this->db->lasterror();
return -1; return -1;
} }
} }

View File

@ -6,6 +6,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -276,7 +277,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$srcobject->client->default_lang; if (empty($newlang)) $newlang=$srcobject->thirdparty->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
@ -421,6 +422,10 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
$tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id);
$tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id);
$pu_ht = $prod->price;
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
// On defini prix unitaire // On defini prix unitaire
if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level) if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level)
@ -430,12 +435,23 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
$price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_min = $prod->multiprices_min[$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
} }
else elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{ {
$pu_ht = $prod->price; require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min; $prodcustprice = new Productcustomerprice($db);
$price_base_type = $prod->price_base_type;
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) {
if (count($prodcustprice->lines) > 0) {
$pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$prod->tva_tx = $prodcustprice->lines [0]->tva_tx;
}
}
} }
// On reevalue prix selon taux tva car taux tva transaction peut etre different // On reevalue prix selon taux tva car taux tva transaction peut etre different

View File

@ -113,11 +113,10 @@ class box_graph_propales_permonth extends ModeleBoxes
$nowarray=dol_getdate(dol_now(),true); $nowarray=dol_getdate(dol_now(),true);
if (empty($endyear)) $endyear=$nowarray['year']; if (empty($endyear)) $endyear=$nowarray['year'];
$startyear=$endyear-1; $startyear=$endyear-1;
$mode='customer';
$WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320';
$HEIGHT='192'; $HEIGHT='192';
$stats = new PropaleStats($this->db, $socid, $mode, 0); $stats = new PropaleStats($this->db, $socid, 0);
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb) if ($shownb)
@ -126,8 +125,7 @@ class box_graph_propales_permonth extends ModeleBoxes
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars'); $datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png"; $filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png";
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsnbinyear-'.$endyear.'.png'; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&amp;file=propalsnbinyear-'.$endyear.'.png';
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&amp;file=propalsnbinyear-'.$endyear.'.png';
$px1 = new DolGraph(); $px1 = new DolGraph();
$mesg = $px1->isGraphKo(); $mesg = $px1->isGraphKo();

View File

@ -116,7 +116,6 @@ abstract class CommonObject
$lastname=$this->lastname; $lastname=$this->lastname;
$firstname=$this->firstname; $firstname=$this->firstname;
if (empty($lastname)) $lastname=(isset($this->lastname)?$this->lastname:(isset($this->name)?$this->name:(isset($this->nom)?$this->nom:''))); if (empty($lastname)) $lastname=(isset($this->lastname)?$this->lastname:(isset($this->name)?$this->name:(isset($this->nom)?$this->nom:'')));
if (empty($firstname)) $firstname=$this->firstname;
$ret=''; $ret='';
if ($option && $this->civility_id) if ($option && $this->civility_id)

View File

@ -942,7 +942,7 @@ class ExtraFields
$selectkey="rowid"; $selectkey="rowid";
$keyList='rowid'; $keyList='rowid';
if (count($InfoFieldList)==3) if (count($InfoFieldList)>=3)
{ {
$selectkey = $InfoFieldList[2]; $selectkey = $InfoFieldList[2];
$keyList=$InfoFieldList[2].' as rowid'; $keyList=$InfoFieldList[2].' as rowid';

View File

@ -500,7 +500,7 @@ class FormFile
// Button // Button
$addcolumforpicto=($delallowed || $printer || $morepicto); $addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre">'; $out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre">';
$genbutton = '<input class="button" id="'.$forname.'_generatebutton"'; $genbutton = '<input class="button" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
$genbutton.= ' type="submit" value="'.$buttonlabel.'"'; $genbutton.= ' type="submit" value="'.$buttonlabel.'"';
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled="disabled"'; if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled="disabled"';
$genbutton.= '>'; $genbutton.= '>';
@ -510,7 +510,7 @@ class FormFile
$genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
} }
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
if (empty($modellist) && ! $showempty) $genbutton=''; if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton='';
$out.= $genbutton; $out.= $genbutton;
$out.= '</th>'; $out.= '</th>';

View File

@ -474,7 +474,11 @@ class FormMail
} }
else else
{ {
$out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:0), 1); $defaultvaluefordeliveryreceipt=0;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1;
$out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1);
} }
$out.= "</td></tr>\n"; $out.= "</td></tr>\n";

View File

@ -335,11 +335,12 @@ class Translate
* Return translated value of key. Search in lang file, then into database. * Return translated value of key. Search in lang file, then into database.
* Key must be any complete entry into lang file: CurrencyEUR, ... * Key must be any complete entry into lang file: CurrencyEUR, ...
* If not found, return key. * If not found, return key.
* WARNING: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), getLabelFromKey must * The string return is not formated (translated with transnoentitiesnoconv)
* not be called with same value than input. * NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), if you modify this function,
* check that getLabelFromKey is not called with same value than input.
* *
* @param string $key Key to translate * @param string $key Key to translate
* @return string Translated string * @return string Translated string (translated with transnoentitiesnoconv)
*/ */
private function getTradFromKey($key) private function getTradFromKey($key)
{ {
@ -347,7 +348,6 @@ class Translate
if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly. if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly.
//print 'xx'.$key;
$newstr=$key; $newstr=$key;
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg)) if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
{ {

View File

@ -426,8 +426,13 @@ function actions_prepare_head($object)
$h++; $h++;
} }
// Attached files
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->agenda->dir_output . "/" . $object->id;
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents'); $head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;

View File

@ -434,7 +434,7 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
{ {
$ValidUrl = 1; $ValidUrl = 1;
} }
print $urlregex.' - '.$url.' - '.$ValidUrl; //print $urlregex.' - '.$url.' - '.$ValidUrl;
return $ValidUrl; return $ValidUrl;
} }

View File

@ -739,7 +739,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
// Capital // Capital
if ($fromcompany->capital) if ($fromcompany->capital)
{ {
$line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->currency); $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",price($fromcompany->capital, 0, $outputlangs, 0, 0, 0, $conf->currency));
} }
// Prof Id 1 // Prof Id 1
if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2))

View File

@ -177,11 +177,11 @@ class modFacture extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $this->export_permission[$r]=array(array("facture","facture","export","other"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Add extra fields // Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'";
@ -221,6 +221,8 @@ class modFacture extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
@ -232,10 +234,10 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Add extra fields // Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'";
@ -275,6 +277,8 @@ class modFacture extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid';

View File

@ -583,8 +583,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->contact = $contactforaction; $actioncomm->contact = $contactforaction;
$actioncomm->societe = $societeforaction; $actioncomm->societe = $societeforaction;
$actioncomm->author = $user; // User saving action $actioncomm->author = $user; // User saving action
$actioncomm->usertodo = $user; // User owner of action $actioncomm->usertodo = $user; // User action is assigned to (owner of action)
//$actioncomm->userdone = $user; // User doing action //$actioncomm->userdone = $user; // User doing action (deprecated, not used anymore)
$actioncomm->fk_element = $object->id; $actioncomm->fk_element = $object->id;
$actioncomm->elementtype = $object->element; $actioncomm->elementtype = $object->element;

View File

@ -165,7 +165,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
@ -322,7 +322,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
@ -399,7 +399,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;
@ -576,7 +576,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
$result=$ldap->delete($dn,$info,$user); $result=$ldap->delete($dn);
if ($result < 0) if ($result < 0)
{ {
$this->error="ErrorLDAP ".$ldap->error; $this->error="ErrorLDAP ".$ldap->error;

View File

@ -67,7 +67,7 @@ $sql = "SELECT e.rowid, e.ref";
$sql.= ", s.nom, s.rowid as socid"; $sql.= ", s.nom, s.rowid as socid";
$sql.= ", c.ref as commande_ref, c.rowid as commande_id"; $sql.= ", c.ref as commande_ref, c.rowid as commande_id";
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
if (!$user->rights->societe->client->voir && !$socid) if (!$user->rights->societe->client->voir && !$socid)

View File

@ -52,14 +52,14 @@ if ($_GET["id"])
//on veut supprimer une cat<61>gorie //on veut supprimer une cat<61>gorie
if ($_REQUEST["cat"]) if ($_REQUEST["cat"])
{ {
$cat = new Categorie($db,$_REQUEST["cat"]); $cat = new Categorie($db);
$cat->del_product($product); $cat->del_product($product);
} }
//on veut ajouter une cat<61>gorie //on veut ajouter une cat<61>gorie
if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0) if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0)
{ {
$cat = new Categorie($db,$_REQUEST["add_cat"]); $cat = new Categorie($db);
$cat->add_product($product); $cat->add_product($product);
} }

View File

@ -149,7 +149,7 @@ if ($resql)
if (isset($catid)) if (isset($catid))
{ {
print "<div id='ways'>"; print "<div id='ways'>";
$c = new Categorie($db, $catid); $c = new Categorie($db);
$ways = $c->print_all_ways(' &gt; ','fourn/product/liste.php'); $ways = $c->print_all_ways(' &gt; ','fourn/product/liste.php');
print " &gt; ".$ways[0]."<br>\n"; print " &gt; ".$ways[0]."<br>\n";
print "</div><br>"; print "</div><br>";

View File

@ -1070,7 +1070,7 @@ else
// Liste des utiliseurs du groupes choisi dans la config // Liste des utiliseurs du groupes choisi dans la config
$idGroupValid = $cp->getConfCP('userGroup'); $idGroupValid = $cp->getConfCP('userGroup');
$validator = new UserGroup($db,$idGroupValid); $validator = new UserGroup($db);
$valideur = $validator->listUsersForGroup('',1); $valideur = $validator->listUsersForGroup('',1);
print '<td>'; print '<td>';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

View File

@ -57,7 +57,7 @@ pHeader('',''); // No next step for navigation buttons. Next step is defined
//print "<br>\n"; //print "<br>\n";
//print $langs->trans("InstallEasy")."<br><br>\n"; //print $langs->trans("InstallEasy")."<br><br>\n";
print '<b>'.$langs->trans("MiscellaneousChecks")."</b>:<br>\n"; print '<h3>'.$langs->trans("MiscellaneousChecks").":</h3>\n";
// Check browser // Check browser
$useragent=$_SERVER['HTTP_USER_AGENT']; $useragent=$_SERVER['HTTP_USER_AGENT'];
@ -440,7 +440,7 @@ else
} }
} }
$choice .= '<tr class="listofchoices" '.($recommended_choice ? 'style="background-color:lightyellow"' : '').'>'; $choice .= '<tr class="listofchoices '.($recommended_choice ? 'choiceselected' : '').'">';
$choice .= '<td class="listofchoices nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>'; $choice .= '<td class="listofchoices nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>';
$choice .= '<td class="listofchoices">'; $choice .= '<td class="listofchoices">';
$choice .= $langs->trans("UpgradeDesc"); $choice .= $langs->trans("UpgradeDesc");

View File

@ -18,9 +18,8 @@
body { body {
font-size:13px; font-size:13px;
font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; background: #f6f6f6;
/* background-color: #F4F4F4; */
margin: 15px 30px 10px; margin: 15px 30px 10px;
} }
@ -33,8 +32,8 @@ span.titre {
font-size: 1.1em; font-size: 1.1em;
font-weight: bold; font-weight: bold;
background: #FFFFFF; background: #FFFFFF;
color: #4965B3; color: #444;
border: 1px solid #8CACBB; border: 1px solid #999;
padding: 5px 5px 5px 5px; padding: 5px 5px 5px 5px;
margin: 0 0 0 0; margin: 0 0 0 0;
} }
@ -45,8 +44,8 @@ font-weight: bold;
color: #4965B3; color: #4965B3;
padding: 0 1.2em 0.5em 2em; padding: 0 1.2em 0.5em 2em;
margin: 1.2em 1.2em 1.2em 1.2em; margin: 1.2em 1.2em 1.2em 1.2em;
border-bottom: 1px solid #8CACBB; border-bottom: 1px solid #999;
border-right: 1px solid #8CACBB; border-right: 1px solid #999;
text-align: right; text-align: right;
} }
@ -71,10 +70,13 @@ input:-webkit-autofill {
} }
table.main { table.main {
background: #F0F0F0 url(background.png) repeat-x; background: #FfFfFf;
text-align: left; text-align: left;
border: 1px solid #8CACBB; border: 1px solid #999;
color: #000000; color: #000000;
-webkit-box-shadow: 3px 3px 4px #DDD !important;
-moz-box-shadow: 3px 3px 4px #DDD !important;
box-shadow: 3px 3px 4px #DDD !important;
} }
table.main-inside { table.main-inside {
@ -89,7 +91,7 @@ table.listofchoices, tr.listofchoices, td.listofchoices {
border-collapse: collapse; border-collapse: collapse;
padding: 4px; padding: 4px;
color: #000000; color: #000000;
border: 1px solid #888888 !important; border: 1px solid #999 !important;
} }
tr.listofchoices { tr.listofchoices {
@ -104,8 +106,8 @@ tr.listofchoices {
.installchoices table tr td { .installchoices table tr td {
margin-left: 2px; margin-left: 2px;
margin-right: 2px; margin-right: 2px;
border-bottom: 1px solid #8CACBB; border-bottom: 1px solid #999;
border-right: 1px solid #8CACBB; border-right: 1px solid #999;
color: #000000; color: #000000;
} }
@ -178,6 +180,7 @@ margin-top: 10px;
font-size:16px; font-size:16px;
font-weight: normal; font-weight: normal;
color: #4965B3; color: #4965B3;
text-shadow: 2px 1px 2px #c0c0c0;
} }
tr.bg1 { tr.bg1 {
@ -212,7 +215,7 @@ font-size: 12px;
.install .install
{ {
border: 1px solid #8CACBB; border: 1px solid #999;
padding: 4px 4px 4px 4px; padding: 4px 4px 4px 4px;
} }
@ -246,3 +249,9 @@ ul {
a.button:hover { a.button:hover {
text-decoration:none; text-decoration:none;
} }
.choiceselected {
background-color: #dfd;
background-repeat: repeat-x;
background-position: top left;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -32,7 +32,7 @@
-- Regions -- Regions
-- --
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1,0,0,'0',0,'-'); insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (0,0,0,'0',0,'-');
-- Regions France (id country=1) -- Regions France (id country=1)
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 101, 1, 1,'97105',3,'Guadeloupe'); insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 101, 1, 1,'97105',3,'Guadeloupe');

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@ create table llx_c_email_templates
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
type_template varchar(32), -- template for wich type of email (send invoice by email, send order, ...) type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
datec datetime, datec datetime,
label varchar(255), label varchar(255),
content text content text
@ -1682,3 +1682,6 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype,
-- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_mode_reglement DROP NOT NULL; -- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_mode_reglement DROP NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_cond_reglement DROP NOT NULL; -- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_cond_reglement DROP NOT NULL;
UPDATE llx_actioncomm set fk_user_action = fk_user_done where fk_user_done > 0 and (fk_user_action is null or fk_user_action = 0);
UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author > 0 and (fk_user_action is null or fk_user_action = 0);

File diff suppressed because it is too large Load Diff

View File

@ -108,14 +108,6 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps
-- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); -- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS');
-- Requests to clean old tables or fields
-- DROP TABLE llx_c_methode_commande_fournisseur;
-- DROP TABLE llx_c_source;
-- DROP TABLE llx_cond_reglement;
-- DROP TABLE llx_expedition_methode;
-- DROP TABLE llx_product_fournisseur;
-- ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;
ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur;
@ -150,3 +142,39 @@ drop table tmp_societe_double;
UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid
UPDATE llx_actioncomm set fk_user_action = fk_user_done where fk_user_done > 0 and (fk_user_action is null or fk_user_action = 0);
UPDATE llx_actioncomm set fk_user_action = fk_user_author where fk_user_author > 0 and (fk_user_action is null or fk_user_action = 0);
-- Requests to clean old tables or external modules tables
-- DROP TABLE llx_c_methode_commande_fournisseur;
-- DROP TABLE llx_c_source;
-- DROP TABLE llx_congespayes;
-- DROP TABLE llx_congespayes_config;
-- DROP TABLE llx_congespayes_log;
-- DROP TABLE llx_congespayes_events;
-- DROP TABLE llx_congespayes_users;
-- DROP TABLE llx_compta;
-- DROP TABLE llx_compta_compte_generaux;
-- DROP TABLE llx_compta_account;
-- DROP TABLE llx_cabinetmed*;
-- DROP TABLE llx_cond_reglement;
-- DROP TABLE llx_expedition_methode;
-- DROP TABLE llx_product_fournisseur;
-- DROP TABLE llx_element_rang;
-- DROP TABLE llx_dolicloud_customers;
-- DROP TABLE llx_dolicloud_emailstemplates;
-- DROP TABLE llx_dolicloud_stats;
-- DROP TABLE llx_submitew_message;
-- DROP TABLE llx_submitew_targets;
-- DROP TABLE llx_submitew_targets_param;
-- DROP TABLE llx_pos_cash;
-- DROP TABLE llx_pos_control_cash;
-- DROP TABLE llx_pos_facture;
-- DROP TABLE llx_pos_moviments;
-- DROP TABLE llx_pos_ticketdet;

View File

@ -45,9 +45,9 @@ create table llx_actioncomm
fk_parent integer NOT NULL default 0, fk_parent integer NOT NULL default 0,
fk_user_action integer, -- user id of owner of action (currently also user id of actor that must do action. In future, actors assigned to action will be an array into table llx_actioncomm_resources) fk_user_action integer, -- user id of owner of action (currently also user id of actor that must do action. In future, actors assigned to action will be an array into table llx_actioncomm_resources)
transparency integer, -- transparency (ical standard). used to say if user assigned to event are busy or not by event (in future version, this field is deprecated and will be stored into table llx_actioncomm_resources)
transparency integer, -- transparency (ical standard). used to say if people assigned to event are busy or not by event (in future version, this field is deprecated and will be stored into table llx_actioncomm_resources) fk_user_done integer, -- user id of user that has made action (deprecated)
fk_user_done integer, -- user id of people that has made action (deprecated)
priority smallint, priority smallint,
fulldayevent smallint NOT NULL default 0, fulldayevent smallint NOT NULL default 0,

View File

@ -19,5 +19,7 @@
ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_region); ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_region);
ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region); ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region);
ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid);

View File

@ -21,8 +21,15 @@ create table llx_c_email_templates
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
type_template varchar(32), -- template for wich type of email (send invoice by email, send order, ...) module varchar(32), -- Nom du module en rapport avec le modele
type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
sortorder smallint, -- Ordre affichage
private smallint DEFAULT 0 NOT NULL, -- Template public or private
fk_user integer, -- Id utilisateur si modele prive, sinon null
datec datetime, datec datetime,
tms timestamp,
label varchar(255), label varchar(255),
content text content text
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -1,34 +0,0 @@
-- ============================================================================
-- Copyright (C) 2007-2009 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 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ============================================================================
create table llx_texts
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
module varchar(32), -- Nom du module en rapport avec le modele
typemodele varchar(32), -- Type du modele
sortorder smallint, -- Ordre affichage
private smallint DEFAULT 0 NOT NULL, -- Modele publique ou prive
fk_user integer, -- Id utilisateur si modele prive, sinon null
title varchar(128), -- Titre du modele
filename varchar(128), -- Nom fichier si modele fichier
content text, -- Texte si modele texte
tms timestamp
)ENGINE=innodb;

View File

@ -28,6 +28,8 @@ create table llx_user
datec datetime, datec datetime,
tms timestamp, tms timestamp,
fk_user_creat integer,
fk_user_modif integer,
login varchar(24) NOT NULL, login varchar(24) NOT NULL,
pass varchar(32), pass varchar(32),
pass_crypted varchar(128), pass_crypted varchar(128),

View File

@ -1412,7 +1412,7 @@ function migrate_price_propal($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$propalligne->update_total($rowid); $propalligne->update_total();
/* On touche pas a propal mere /* On touche pas a propal mere
@ -1521,7 +1521,7 @@ function migrate_price_contrat($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$contratligne->update_total($rowid); $contratligne->update_total();
$i++; $i++;
} }
@ -1606,7 +1606,7 @@ function migrate_price_commande($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$commandeligne->update_total($rowid); $commandeligne->update_total();
/* On touche pas a facture mere /* On touche pas a facture mere
$commande = new Commande($db); $commande = new Commande($db);
@ -1720,7 +1720,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf)
dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc");
print ". "; print ". ";
$commandeligne->update_total($rowid); $commandeligne->update_total();
/* On touche pas a facture mere /* On touche pas a facture mere
$commande = new Commande($db); $commande = new Commande($db);

View File

@ -62,7 +62,7 @@ LastProspectContactDone=Contact done
DateActionPlanned=Date event planned for DateActionPlanned=Date event planned for
DateActionDone=Date event done DateActionDone=Date event done
ActionAskedBy=Event reported by ActionAskedBy=Event reported by
ActionAffectedTo=Event assigned to ActionAffectedTo=Event owned by
ActionDoneBy=Event done by ActionDoneBy=Event done by
ActionUserAsk=Reported by ActionUserAsk=Reported by
ErrorStatusCantBeZeroIfStarted=If field '<b>Date done</b>' is filled, action is started (or finished), so field '<b>Status</b>' can't be 0%%. ErrorStatusCantBeZeroIfStarted=If field '<b>Date done</b>' is filled, action is started (or finished), so field '<b>Status</b>' can't be 0%%.

View File

@ -80,6 +80,16 @@ ModifiedBy=Modified by %s
ValidatedBy=Validated by %s ValidatedBy=Validated by %s
CanceledBy=Canceled by %s CanceledBy=Canceled by %s
ClosedBy=Closed by %s ClosedBy=Closed by %s
CreatedById=User id who created
ModifiedById=User id who made last change
ValidatedById=User id who validated
CanceledById=User id who canceled
ClosedById=User id who closed
CreatedByLogin=User login who created
ModifiedByLogin=User login who made last change
ValidatedByLogin=User login who validated
CanceledByLogin=User login who canceled
ClosedByLogin=User login who closed
FileWasRemoved=File %s was removed FileWasRemoved=File %s was removed
DirWasRemoved=Directory %s was removed DirWasRemoved=Directory %s was removed
FeatureNotYetAvailableShort=Available in a next version FeatureNotYetAvailableShort=Available in a next version

View File

@ -114,7 +114,7 @@ YourRole=Your roles
YourQuotaOfUsersIsReached=Your quota of active users is reached ! YourQuotaOfUsersIsReached=Your quota of active users is reached !
NbOfUsers=Nb of users NbOfUsers=Nb of users
DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin
HierarchicalResponsible=Hierarchical responsible HierarchicalResponsible=Supervisor
HierarchicView=Hierarchical view HierarchicView=Hierarchical view
UseTypeFieldToChange=Use field Type to change UseTypeFieldToChange=Use field Type to change
OpenIDURL=OpenID URL OpenIDURL=OpenID URL

View File

@ -411,7 +411,7 @@ if (! defined('NOLOGIN'))
// Call of triggers // Call of triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST('entity','int')); $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -514,10 +514,11 @@ if (! defined('NOLOGIN'))
$_SESSION["dol_loginmesg"]=$user->error; $_SESSION["dol_loginmesg"]=$user->error;
} }
// TODO We should use a hook here, not a trigger.
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,$_POST["entity"]); $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -556,10 +557,11 @@ if (! defined('NOLOGIN'))
$_SESSION["dol_loginmesg"]=$user->error; $_SESSION["dol_loginmesg"]=$user->error;
} }
// TODO We should use a hook here, not a trigger.
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,(isset($_POST["entity"])?$_POST["entity"]:0)); $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -572,10 +574,11 @@ if (! defined('NOLOGIN'))
{ {
if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default (triggers are time consuming) if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default (triggers are time consuming)
{ {
// TODO We should use a hook here, not a trigger.
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf,$conf->entity); $result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
@ -588,7 +591,7 @@ if (! defined('NOLOGIN'))
// If we are here, this means authentication was successfull. // If we are here, this means authentication was successfull.
if (! isset($_SESSION["dol_login"])) if (! isset($_SESSION["dol_login"]))
{ {
// New session for this login. // New session for this login has started.
$error=0; $error=0;
// Store value into session (values always stored) // Store value into session (values always stored)
@ -617,10 +620,11 @@ if (! defined('NOLOGIN'))
$user->update_last_login_date(); $user->update_last_login_date();
// TODO We should use a hook here, not a trigger
// Call triggers // Call triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf,GETPOST('entity','int')); $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }

View File

@ -80,7 +80,7 @@ print '<table class="border" width="100%">';
$client = false; $client = false;
if ($socid > 0) { if ($socid > 0) {
$soc = new Societe($db, $socid); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
if ($soc->client) if ($soc->client)

View File

@ -62,7 +62,7 @@ llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_ur
if ($socid > 0) if ($socid > 0)
{ {
$societe = new Societe($db, $socid); $societe = new Societe($db);
$societe->fetch($socid); $societe->fetch($socid);
/* /*

View File

@ -5,11 +5,12 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Auguria SARL <info@auguria.org> * Copyright (C) 2006 Auguria SARL <info@auguria.org>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -513,6 +514,24 @@ if (empty($reshook))
$pu_ttc = $object->multiprices_ttc[$soc->price_level]; $pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level];
} }
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
$prodcustprice = new Productcustomerprice($db);
$filter = array('t.fk_product' => $object->id,'t.fk_soc' => $soc->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) {
if (count($prodcustprice->lines) > 0) {
$pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$prod->tva_tx = $prodcustprice->lines [0]->tva_tx;
}
}
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different // On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
@ -586,7 +605,24 @@ if (empty($reshook))
$pu_ttc = $object->multiprices_ttc[$soc->price_level]; $pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level];
} }
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
$prodcustprice = new Productcustomerprice($db);
$filter = array('t.fk_product' => $object->id,'t.fk_soc' => $soc->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) {
if (count($prodcustprice->lines) > 0) {
$pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$prod->tva_tx = $prodcustprice->lines [0]->tva_tx;
}
}
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different // On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($tva_tx != $object->tva_tx) if ($tva_tx != $object->tva_tx)
@ -659,7 +695,24 @@ if (empty($reshook))
$pu_ttc = $object->multiprices_ttc[$soc->price_level]; $pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level];
} }
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
$prodcustprice = new Productcustomerprice($db);
$filter = array('t.fk_product' => $object->id,'t.fk_soc' => $soc->id);
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
if ($result) {
if (count($prodcustprice->lines) > 0) {
$pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$prod->tva_tx = $prodcustprice->lines [0]->tva_tx;
}
}
}
// On reevalue prix selon taux tva car taux tva transaction peut etre different // On reevalue prix selon taux tva car taux tva transaction peut etre different
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($tva_tx != $object->tva_tx) if ($tva_tx != $object->tva_tx)

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -816,7 +817,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans('ThirdParty') . '</td>'; print '<td>' . $langs->trans('ThirdParty') . '</td>';
print '<td>'; print '<td>';
print $form->select_company('', 'socid', 's.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price)', 1); print $form->select_company('', 'socid', 's.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price WHERE fk_product='.$object->id.')', 1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -68,7 +68,7 @@ if ($action == 'setstocklimit')
$product = new Product($db); $product = new Product($db);
$result=$product->fetch($id); $result=$product->fetch($id);
$product->seuil_stock_alerte=$stocklimit; $product->seuil_stock_alerte=$stocklimit;
$result=$product->update($product->id,$user,1,0,1); $result=$product->update($product->id,$user,0,'update');
if ($result < 0) if ($result < 0)
setEventMessage($product->error, 'errors'); setEventMessage($product->error, 'errors');
$action=''; $action='';
@ -80,7 +80,7 @@ if ($action == 'setdesiredstock')
$product = new Product($db); $product = new Product($db);
$result=$product->fetch($id); $result=$product->fetch($id);
$product->desiredstock=$desiredstock; $product->desiredstock=$desiredstock;
$result=$product->update($product->id,$user,1,0,1); $result=$product->update($product->id,$user,0,'update');
if ($result < 0) if ($result < 0)
setEventMessage($product->error, 'errors'); setEventMessage($product->error, 'errors');
$action=''; $action='';

View File

@ -251,7 +251,7 @@ if ($action == 'add')
$extralabels=$extrafields->fetch_name_optionals_label($adh->table_element); $extralabels=$extrafields->fetch_name_optionals_label($adh->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$adh); $ret = $extrafields->setOptionalsFromPost($extralabels,$adh);
$result=$adh->create($user->id); $result=$adh->create($user);
if ($result > 0) if ($result > 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';

View File

@ -147,4 +147,4 @@ background: #DDDFDD;
} }
table { font-size: 12px; } table { font-size: 12px; }
table.login { border: 1px solid #C0C0C0; background: #F0F0F0 url(background.png) repeat-x; font-size: 12px; } table.login { border: 1px solid #C0C0C0; background: #F0F0F0; font-size: 12px; }

View File

@ -28,7 +28,7 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224); $theme_bordercolor = array(235,235,224);
$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); $theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170), array(190,170,190), array(170,190,190), array(150,135,125));
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));

View File

@ -2068,6 +2068,44 @@ div.titre {
#tablesubscribe { width: 100%; } #tablesubscribe { width: 100%; }
/*
* Effect Postit
*/
.effectpostit
{
position: relative;
}
.effectpostit:before, .effectpostit:after
{
z-index: -1;
position: absolute;
content: "";
bottom: 15px;
left: 10px;
width: 50%;
top: 80%;
max-width:300px;
background: #777;
-webkit-box-shadow: 0 15px 10px #777;
-moz-box-shadow: 0 15px 10px #777;
box-shadow: 0 15px 10px #777;
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.effectpostit:after
{
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-o-transform: rotate(3deg);
-ms-transform: rotate(3deg);
transform: rotate(3deg);
right: 10px;
left: auto;
}
/* ============================================================================== */ /* ============================================================================== */

View File

@ -1880,6 +1880,8 @@ else
print "</tr>\n"; print "</tr>\n";
// Accountancy code // Accountancy code
if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared.
{
print "<tr>"; print "<tr>";
print '<td valign="top">'.$langs->trans("AccountancyCode").'</td>'; print '<td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td>'; print '<td>';
@ -1893,6 +1895,8 @@ else
print $object->accountancy_code; print $object->accountancy_code;
} }
print '</td>'; print '</td>';
print "</tr>";
}
// Status // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';

View File

@ -72,9 +72,11 @@ $sql.= " u.datec,";
$sql.= " u.tms as datem,"; $sql.= " u.tms as datem,";
$sql.= " u.datelastlogin,"; $sql.= " u.datelastlogin,";
$sql.= " u.ldap_sid, u.statut, u.entity,"; $sql.= " u.ldap_sid, u.statut, u.entity,";
$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,";
$sql.= " s.nom, s.canvas"; $sql.= " s.nom, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity)))) if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
{ {
$sql.= " WHERE u.entity IS NOT NULL"; $sql.= " WHERE u.entity IS NOT NULL";
@ -108,19 +110,20 @@ if ($result)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Login"),"index.php","u.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LastName"),"index.php","u.lastname",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("FirstName"),"index.php","u.firstname",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),"index.php","u.fk_societe",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_societe",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),"index.php","u.datec",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER['PHP_SELF'],"u.datec",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("LastConnexion"),"index.php","u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="center"',$sortfield,$sortorder);
print '<td width="1%">&nbsp;</td>'; print '<td width="1%">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
//SearchBar //SearchBar
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="6">&nbsp;</td>'; print '<td colspan="7">&nbsp;</td>';
// Status // Status
print '<td>'; print '<td>';
@ -132,6 +135,9 @@ if ($result)
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
$user2=new User($db);
$var=True; $var=True;
while ($i < $num) while ($i < $num)
{ {
@ -192,6 +198,19 @@ if ($result)
// Date last login // Date last login
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>'; print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>';
// Resp
print '<td class="nowrap" align="center">';
if ($obj->login2)
{
$user2->login=$obj->login2;
//$user2->lastname=$obj->lastname2;
//$user2->firstname=$obj->firstname2;
$user2->lastname=$user2->login;
$user2->firstname='';
print $user2->getNomUrl(1);
}
print '</td>';
// Statut // Statut
$userstatic->statut=$obj->statut; $userstatic->statut=$obj->statut;
print '<td width="100" align="center">'.$userstatic->getLibStatut(5).'</td>'; print '<td width="100" align="center">'.$userstatic->getLibStatut(5).'</td>';

View File

@ -42,7 +42,7 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse
// Appel des triggers // Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf,$conf->entity); $result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// Fin appel triggers // Fin appel triggers

View File

@ -279,6 +279,7 @@ if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivat
if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'<br><br>'."\n"; if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'<br><br>'."\n";
// For multicompany transversal mode // For multicompany transversal mode
// TODO Place a hook here
if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode))
{ {
$aEntities=array_keys($permsgroupbyentity); $aEntities=array_keys($permsgroupbyentity);
@ -422,6 +423,12 @@ if ($result)
else dol_print_error($db); else dol_print_error($db);
print '</table>'; print '</table>';
// For multicompany transversal mode
// TODO Place a hook here
if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode))
{
dol_fiche_end();
}
dol_fiche_end(); dol_fiche_end();