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

This commit is contained in:
Neil Orley 2017-11-15 10:42:00 +01:00
commit 8e869688f5
33 changed files with 274 additions and 105 deletions

View File

@ -105,7 +105,7 @@ JQUERYFILETREE:
RESTLER:
--------
* Add 2 lines into function
* Add 2 lines into file AutoLoader.php to complete function
private function alias($className, $currentClass)
{
...

View File

@ -114,10 +114,13 @@ switch($action)
{
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;
$tva_tx = $prodcustprice->lines [0]->tva_tx;
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
else

View File

@ -1324,6 +1324,8 @@ if ($id > 0)
print '</div>';
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
{
//var_dump($object->userassigned);
//var_dump($listofuserid);
print '<div class="myavailability">';
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
print '</div>';

View File

@ -225,11 +225,11 @@ class ActionComm extends CommonObject
if ($this->elementtype=='commande') $this->elementtype='order';
if ($this->elementtype=='contrat') $this->elementtype='contract';
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array
{
$tmpid=$this->userassigned;
$this->userassigned=array();
$this->userassigned[$tmpid]=array('id'=>$tmpid);
$this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
}
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
@ -240,7 +240,7 @@ class ActionComm extends CommonObject
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
$this->userassigned = array($userownerid=>array('id'=>$userownerid));
$this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency));
if (! $this->type_id || ! $this->type_code)
{

View File

@ -808,6 +808,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}

View File

@ -364,42 +364,42 @@ class Propal extends CommonObject
}
}
/**
* Add a proposal line into database (linked to product/service or not)
* The parameters are already supposed to be appropriate and with final values to the call
* of this method. Also, for the VAT rate, it must have already been defined
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
* and desc must already have the right value (it's up to the caller to manage multilanguage)
*
* @param string $desc Description de la ligne
* @param float $pu_ht Prix unitaire
* @param float $qty Quantite
* @param float $txtva Taux de tva
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id du produit/service predefini
* @param float $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC
* @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
* @param int $fk_parent_line Id of parent line
* @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price without tax
* @param string $label ???
* @param int $date_start Start date of the line
* @param int $date_end End date of the line
* @param array $array_options extrafields array
* @param string $fk_unit Code of the unit to use. Null to use the default one
* @param string $origin 'order', ...
* @param int $origin_id Id of origin object
* @param double $pu_ht_devise Unit price in currency
* @param int $fk_remise_except Id discount if line is from a discount
* @return int >0 if OK, <0 if KO
* @see add_product
*/
/**
* Add a proposal line into database (linked to product/service or not)
* The parameters are already supposed to be appropriate and with final values to the call
* of this method. Also, for the VAT rate, it must have already been defined
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
* and desc must already have the right value (it's up to the caller to manage multilanguage)
*
* @param string $desc Description of line
* @param float $pu_ht Unit price
* @param float $qty Quantity
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id du produit/service predefini
* @param float $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC
* @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
* @param int $fk_parent_line Id of parent line
* @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price without tax
* @param string $label ???
* @param int $date_start Start date of the line
* @param int $date_end End date of the line
* @param array $array_options extrafields array
* @param string $fk_unit Code of the unit to use. Null to use the default one
* @param string $origin 'order', ...
* @param int $origin_id Id of origin object
* @param double $pu_ht_devise Unit price in currency
* @param int $fk_remise_except Id discount if line is from a discount
* @return int >0 if OK, <0 if KO
* @see add_product
*/
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise=0, $fk_remise_except=0)
{
global $mysoc, $conf, $langs;
@ -1018,11 +1018,15 @@ class Propal extends CommonObject
$fk_parent_line = 0;
}
// Complete vat rate with code
$vatrate = $this->lines[$i]->tva_tx;
if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')';
$result = $this->addline(
$this->lines[$i]->desc,
$this->lines[$i]->subprice,
$this->lines[$i]->qty,
$this->lines[$i]->tva_tx,
$vatrate,
$this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product,
@ -1234,7 +1238,6 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Create clone
$result=$clonedObj->create($user);
if ($result < 0) $error++;
else

View File

@ -761,10 +761,13 @@ if (empty($reshook))
{
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;
$tva_tx = $prodcustprice->lines [0]->tva_tx;
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
else

View File

@ -824,11 +824,15 @@ class Commande extends CommonOrder
$fk_parent_line = 0;
}
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline(
$line->desc,
$line->subprice,
$line->qty,
$line->tva_tx,
$vatrate,
$line->localtax1_tx,
$line->localtax2_tx,
$line->fk_product,
@ -1215,9 +1219,9 @@ class Commande extends CommonOrder
* @param string $desc Description of line
* @param float $pu_ht Unit price (without tax)
* @param float $qty Quantite
* @param float $txtva Taux de tva force, sinon -1
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of product
* @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes

View File

@ -1655,6 +1655,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}

View File

@ -583,11 +583,15 @@ class Facture extends CommonInvoice
$fk_parent_line = 0;
}
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline(
$line->desc,
$line->subprice,
$line->qty,
$line->tva_tx,
$vatrate,
$line->localtax1_tx,
$line->localtax2_tx,
$line->fk_product,
@ -2486,8 +2490,8 @@ class Facture extends CommonInvoice
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param double $txlocaltax1 Local tax 1 rate (deprecated)
* @param double $txlocaltax2 Local tax 2 rate (deprecated)
* @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line
* @param int $date_start Date start of service

View File

@ -545,6 +545,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}

View File

@ -517,6 +517,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}

View File

@ -346,6 +346,83 @@ class Contracts extends DolibarrApi
return false;
}
/**
* Activate a service line of a given contract
*
* @param int $id Id of contract to activate
* @param int $lineid Id of line to activate
* @param string $datestart {@from body} Date start {@type timestamp}
* @param string $datend {@from body} Date end {@type timestamp}
* @param string $comment {@from body} Comment
*
* @url PUT {id}/lines/{lineid}/activate
*
* @return object
*/
function activateLine($id, $lineid, $datestart, $dateend = NULL, $comment = NULL) {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
$result = $this->contract->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Contrat not found');
}
if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$updateRes = $this->contract->active_line(DolibarrApiAccess::$user, $lineid, $datestart, $dateend, $comment);
if ($updateRes > 0) {
$result = $this->get($id);
unset($result->line);
return $this->_cleanObjectDatas($result);
}
return false;
}
/**
* Unactivate a service line of a given contract
*
* @param int $id Id of contract to activate
* @param int $lineid Id of line to activate
* @param string $datestart {@from body} Date start {@type timestamp}
* @param string $comment {@from body} Comment
*
* @url PUT {id}/lines/{lineid}/unactivate
*
* @return object
*/
function unactivateLine($id, $lineid, $datestart, $comment = NULL) {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
$result = $this->contract->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Contrat not found');
}
if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$request_data = (object) $request_data;
$updateRes = $this->contract->close_line(DolibarrApiAccess::$user, $lineid, $datestart, $comment);
if ($updateRes > 0) {
$result = $this->get($id);
unset($result->line);
return $this->_cleanObjectDatas($result);
}
return false;
}
/**
* Delete a line to given contract
*

View File

@ -3878,9 +3878,10 @@ abstract class CommonObject
$this->tpl['description'] = '&nbsp;';
}
// VAT Rate
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')';
// VAT Rate
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
$this->tpl['vat_rate'] .= (($line->info_bits & 1) == 1) ? '*' : '';
if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')';
$this->tpl['price'] = price($line->subprice);
$this->tpl['multicurrency_price'] = price($line->multicurrency_subprice);

View File

@ -615,7 +615,10 @@ class FormFile
$modelselected=$arraykeys[0];
}
$out.= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100');
$out.= ajax_combobox('model');
if ($conf->use_javascript_ajax)
{
$out.= ajax_combobox('model');
}
}
else
{

View File

@ -1023,7 +1023,11 @@ class FormOther
$selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1);
if (empty($conf->use_javascript_ajax)) $selectboxlist.=' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
$selectboxlist.='</form>';
$selectboxlist.=ajax_combobox("boxcombo");
if (! empty($conf->use_javascript_ajax))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$selectboxlist.=ajax_combobox("boxcombo");
}
}
// Javascript code for dynamic actions

View File

@ -5850,7 +5850,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb
// If inline message with no format, we add it.
if ((empty($conf->use_javascript_ajax) || ! empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) || $keepembedded) && ! preg_match('/<div class=".*">/i',$out))
{
$divstart='<div class="'.$style.'">';
$divstart='<div class="'.$style.' clearboth">';
$divend='</div>';
}

View File

@ -298,7 +298,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
print '</div>'."\n";
}
if (is_array($moredata) && ! empty($moredata['searchform']))
if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page
{
print "\n";
print "<!-- Begin SearchForm -->\n";

View File

@ -484,7 +484,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
print '</div>'."\n";
}
if (is_array($moredata) && ! empty($moredata['searchform']) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page
{
print "\n";
print "<!-- Begin SearchForm -->\n";
@ -711,7 +711,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->propal->enabled))
{
$langs->load("propal");
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100);
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals', 100);
$newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire);
if ($usemenuhider || empty($leftmenu) || $leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);

View File

@ -20,9 +20,9 @@
*/
/**
* \file htdocs/core/modules/import/import_csv.modules.php
* \file htdocs/core/modules/import/import_xlsx.modules.php
* \ingroup import
* \brief File to load import files with CSV format
* \brief File to load import files with Excel format
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php';

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This file is a modified version of datepicker.php from phpBSM to fix some
* bugs, to add new features and to dramatically increase speed.
@ -20,7 +20,7 @@
/**
* \file htdocs/core/search_page.php
* \brief File to return search box
* \brief File to return a page with search boxes
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
@ -78,7 +78,8 @@ if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile
else
{
$usedbyinclude = 1; // Used into next include
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
$showtitlebefore = GETPOST('showtitlebefore','int');
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
$accesskeyalreadyassigned=array();
foreach($arrayresult as $key => $val)
@ -94,7 +95,7 @@ else
$accesskey=$val['label'][0];
$accesskeyalreadyassigned[$accesskey]=$accesskey;
}
$searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('',$val['img'],'', 0, 1));
$searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('',$val['img'],'', 0, 1), $showtitlebefore);
}
}
@ -112,11 +113,9 @@ print "\n";
print "<!-- Begin SearchForm -->\n";
print '<div class="center" align="center"><div align="center" style="padding: 6px;">';
print '<style>.menu_titre { padding-top: 7px; }</style>';
//print '<div id="distance"></div><div id="container" class="center">';
print '<div id="blockvmenusearch">'."\n";
print $searchform;
print '</div>'."\n";
//print '</div></div>';
print '</div></div>';
print "\n<!-- End SearchForm -->\n";

View File

@ -320,7 +320,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
{
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $langs->load("products"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }

View File

@ -104,7 +104,7 @@ $rowspan=0;
$sectionauto=array();
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByOrders")); }

View File

@ -1291,7 +1291,7 @@ class Expedition extends CommonObject
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type";
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
$sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.info_bits, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
$sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc";
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
@ -1389,6 +1389,7 @@ class Expedition extends CommonObject
$line->tva_tx = $obj->tva_tx;
$line->localtax1_tx = $obj->localtax1_tx;
$line->localtax2_tx = $obj->localtax2_tx;
$line->info_bits = $obj->info_bits;
$line->price = $obj->price;
$line->subprice = $obj->subprice;
$line->remise_percent = $obj->remise_percent;

View File

@ -382,6 +382,8 @@ ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_tx d
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_customer_price_log ADD COLUMN default_vat_code varchar(10);
UPDATE llx_contrat SET ref = rowid WHERE ref IS NULL OR ref = '';
ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT '';

View File

@ -918,9 +918,9 @@ if ($ok && GETPOST('force_disable_of_modules_not_found','alpha'))
// clean_linked_elements: Check and clean linked elements
if ($ok && GETPOST('force_utf8_on_tables','alpha'))
{
print '<tr><td colspan="2"><br>*** Force page code and collation of tables into utf8 (for mysql/mariadb only)</td></tr>';
print '<tr><td colspan="2"><br>*** Force page code and collation of tables into utf8/utf8_unicode_ci (for mysql/mariadb only)</td></tr>';
if ($db->type == "mysql")
if ($db->type == "mysql" || $db->type == "mysqli")
{
$listoftables = $db->DDLListTables($db->database_name);

View File

@ -77,7 +77,7 @@ BoxTitleLastModifiedSupplierBills=Latest %s modified supplier bills
BoxTitleLatestModifiedSupplierOrders=Latest %s modified supplier orders
BoxTitleLastModifiedCustomerBills=Latest %s modified customer bills
BoxTitleLastModifiedCustomerOrders=Latest %s modified customer orders
BoxTitleLastModifiedPropals=Latest %s modified propals
BoxTitleLastModifiedPropals=Latest %s modified proposals
ForCustomersInvoices=Customers invoices
ForCustomersOrders=Customers orders
ForProposals=Proposals

View File

@ -374,6 +374,7 @@ TotalLT1IN=Total CGST
TotalLT2IN=Total SGST
HT=Net of tax
TTC=Inc. tax
INCVATONLY=Inc. VAT
INCT=Inc. all taxes
VAT=Sales tax
VATIN=IGST

View File

@ -4,7 +4,6 @@ Proposal=Commercial proposal
ProposalShort=Proposal
ProposalsDraft=Draft commercial proposals
ProposalsOpened=Open commercial proposals
Prop=Commercial proposals
CommercialProposal=Commercial proposal
PdfCommercialProposalTitle=Commercial proposal
ProposalCard=Proposal card

View File

@ -135,7 +135,7 @@ DateMovement=Date of movement
InventoryCode=Movement or inventory code
IsInPackage=Contained into package
WarehouseAllowNegativeTransfer=Stock can be negative
qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse
qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse and your setup does not allow negative stocks.
ShowWarehouse=Show warehouse
MovementCorrectStock=Stock correction for product %s
MovementTransferStock=Stock transfer of product %s into another warehouse

View File

@ -1589,9 +1589,9 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
print "\n".'<!-- Begin side-nav id-left -->'."\n".'<div class="side-nav"><div id="id-left">'."\n";
print "\n";
if ($conf->browser->layout == 'phone') $conf->global->MAIN_USE_OLD_SEARCH_FORM=1; // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ?
if ($conf->browser->layout == 'phone') $conf->global->MAIN_USE_OLD_SEARCH_FORM=1; // Select into select2 is awfull on smartphone
print "\n";
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM))
{
if (! is_object($form)) $form=new Form($db);
@ -1621,7 +1621,13 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
}
else $searchform=$hookmanager->resPrint;
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_USE_OLD_SEARCH_FORM))
// Force special value for $searchform
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax))
{
$urltosearch=DOL_URL_ROOT.'/core/search_page.php?showtitlebefore=1';
$searchform='<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>';
}
elseif ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_USE_OLD_SEARCH_FORM))
{
$searchform='<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.'</div>';
$searchform.='<script type="text/javascript">
@ -1814,9 +1820,10 @@ function getHelpParamFor($helppagename,$langs)
* @param string $accesskey Accesskey
* @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page
* @param string $img Image to use
* @param string $showtitlebefore Show title before input text instead of into placeholder. This can be set when output is dedicated for text browsers.
* @return string
*/
function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='',$img='')
function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='',$img='', $showtitlebefore=0)
{
global $conf,$langs,$user;
@ -1829,6 +1836,7 @@ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinpu
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.='<input type="hidden" name="mode" value="search">';
$ret.='<input type="hidden" name="savelogin" value="'.dol_escape_htmltag($user->login).'">';
if ($showtitlebefore) $ret.=$title.' ';
$ret.='<input type="text" class="flat '.$htmlmorecss.'"';
$ret.=' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"';
$ret.=($accesskey?' accesskey="'.$accesskey.'"':'');

View File

@ -1801,8 +1801,15 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
print '<td align="right">' . $langs->trans("DefaultTaxRate") . '</td>';
print '<td align="right">' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("TTC") . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . $langs->trans("INCT") . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . $langs->trans("INCVATONLY") . '</td>';
print '<td align="right">' . $langs->trans("INCT") . '</td>';
}
else
{
print '<td align="right">' . $langs->trans("TTC") . '</td>';
}
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>';
print '<td align="right">' . $langs->trans("ChangedBy") . '</td>';
@ -1844,20 +1851,28 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
print '<td align="right">';
var_dump($prodcustprice);exit;
$positiverates='';
if (price2num($objp->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($objp->tva_tx);
if (price2num($objp->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax1_tx);
if (price2num($objp->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax2_tx);
if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx);
if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx);
if (empty($positiverates)) $positiverates='0';
echo vatrate($positiverates.($objp->default_vat_code?' ('.$objp->default_vat_code.')':''), '%', $objp->tva_npr);
echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', ($line->tva_npr?$line->tva_npr:$line->recuperableonly));
//. vatrate($tva_tx, true, $line->recuperableonly) .
print "</td>";
print '<td align="right">' . price($line->price) . "</td>";
print '<td align="right">' . price($line->price_ttc) . "</td>";
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . price($resultarray[2]) . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . price($line->price_ttc) . "</td>";
print '<td align="right">' . price($resultarray[2]) . '</td>';
}
else
{
print '<td align="right">' . price($line->price_ttc) . "</td>";
}
print '<td align="right">' . price($line->price_min) . '</td>';
print '<td align="right">' . price($line->price_min_ttc) . '</td>';
@ -1903,7 +1918,7 @@ var_dump($prodcustprice);exit;
if (count($prodcustprice->lines) > 0 || $search_soc)
{
$colspan=8;
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++;
//if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") $colspan++;
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
@ -1922,8 +1937,16 @@ var_dump($prodcustprice);exit;
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
print '<td align="right">' . $langs->trans("DefaultTaxRate") . '</td>';
print '<td align="right">' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("TTC") . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . $langs->trans("INCT") . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . $langs->trans("INCVATONLY") . '</td>';
print '<td align="right">' . $langs->trans("INCT") . '</td>';
}
else
{
print '<td align="right">' . $langs->trans("TTC") . '</td>';
}
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>';
print '<td align="right">' . $langs->trans("ChangedBy") . '</td>';
@ -1970,9 +1993,17 @@ var_dump($prodcustprice);exit;
print "</td>";
print '<td align="right">' . price($object->price) . "</td>";
print '<td align="right">' . price($object->price_ttc) . "</td>";
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . price($resultarray[2]) . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . price($object->price_ttc) . "</td>";
print '<td align="right">' . price($resultarray[2]) . '</td>';
}
else
{
print '<td align="right">' . price($object->price_ttc) . "</td>";
}
print '<td align="right">' . price($object->price_min) . '</td>';
print '<td align="right">' . price($object->price_min_ttc) . '</td>';
@ -1993,7 +2024,6 @@ var_dump($prodcustprice);exit;
}
print "</tr>\n";
if (count($prodcustprice->lines) > 0)
{
foreach ($prodcustprice->lines as $line)
@ -2038,13 +2068,20 @@ var_dump($prodcustprice);exit;
if (price2num($line->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
if (price2num($line->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx);
if (empty($positiverates)) $positiverates='0';
echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', $line->tva_npr);
echo vatrate($positiverates.($line->default_vat_code?' ('.$line->default_vat_code.')':''), '%', ($line->tva_npr?$line->tva_npr:$line->recuperableonly));
print "</td>";
print '<td align="right">' . price($line->price) . "</td>";
print '<td align="right">' . price($line->price_ttc) . "</td>";
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") print '<td align="right">' . price($resultarray[2]) . '</td>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1")
{
//print '<td align="right">' . price($line->price_ttc) . "</td>";
print '<td align="right">' . price($resultarray[2]) . '</td>';
}
else
{
print '<td align="right">' . price($line->price_ttc) . "</td>";
}
print '<td align="right">' . price($line->price_min) . '</td>';
print '<td align="right">' . price($line->price_min_ttc) . '</td>';

View File

@ -2960,6 +2960,12 @@ span.boxstatstext {
opacity: 0.8;
line-height: 18px;
}
span.boxstatstext img, a.dashboardlineindicatorlate img {
border: 0;
}
a img {
border: 0;
}
span.boxstatsindicator {
font-size: 130%;
font-weight: normal;
@ -3515,7 +3521,7 @@ table.cal_month td:last-child { border-right: 0px; }
.cal_today_peruser { background: #FDFDF0; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today_peruser_peruserleft { background: #FDFDF0; border-left: solid 2px #6C7C7B; border-right: solid 1px #E0E0E0; border-bottom: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_past { }
.cal_peruser { padding: 0px; }
.cal_peruser { padding-top: 0 !important; padding-bottom: 0 !important; padding-<?php print $left; ?>: 1px !important; padding-<?php print $right; ?>: 1px !important; }
.cal_impair { background: #F8F8F8; }
.cal_today_peruser_impair { background: #F8F8F0; }
.peruser_busy { background: #CC8888; }