Merge branch '11.0' of https://github.com/dolibarr/dolibarr into 11.0
This commit is contained in:
commit
2b393d04e1
@ -8,6 +8,7 @@ ALL:
|
||||
Check "@CHANGE"
|
||||
|
||||
|
||||
|
||||
PrestaShopWebservice:
|
||||
---------------------
|
||||
Replace
|
||||
@ -27,6 +28,19 @@ With
|
||||
|
||||
|
||||
|
||||
DEBUGBAR:
|
||||
---------
|
||||
|
||||
Move
|
||||
this.options = {
|
||||
bodyMarginBottom: true,
|
||||
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
|
||||
};
|
||||
few line lower in the
|
||||
initialize: function() {
|
||||
|
||||
|
||||
|
||||
ESCPOS:
|
||||
-------
|
||||
Replace
|
||||
|
||||
@ -254,7 +254,9 @@ if ($result) {
|
||||
} else {
|
||||
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
|
||||
}
|
||||
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
||||
|
||||
// Load of url links to the line into llx_bank
|
||||
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
||||
|
||||
//var_dump($i);
|
||||
//var_dump($tabpay);
|
||||
@ -319,7 +321,8 @@ if ($result) {
|
||||
$chargestatic->id = $links[$key]['url_id'];
|
||||
$chargestatic->ref = $links[$key]['url_id'];
|
||||
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
|
||||
$reg = array();
|
||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||
if ($reg[1] == 'socialcontribution')
|
||||
$reg[1] = 'SocialContribution';
|
||||
@ -331,12 +334,14 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
||||
|
||||
// Retreive the accounting code of the social contribution of the payment from link of payment.
|
||||
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
||||
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'";
|
||||
$sqlmid .= " WHERE bkurl.fk_bank=".$obj->rowid;
|
||||
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
|
||||
@ -302,7 +302,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
|
||||
print '<br>';
|
||||
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>';
|
||||
print '<input type="checkbox" name="nobin_drop"'.((! isset($_GET["nobin_drop"]) && ! isset($_POST["nobin_drop"])) || GETPOST('nobin_drop'))?' checked':''.' id="checkbox_dump_drop" />';
|
||||
print '<input type="checkbox" name="nobin_drop"'.(((! isset($_GET["nobin_drop"]) && ! isset($_POST["nobin_drop"])) || GETPOST('nobin_drop'))?' checked':'').' id="checkbox_dump_drop" />';
|
||||
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
|
||||
print '<br>';
|
||||
print '</fieldset>';
|
||||
|
||||
@ -1014,7 +1014,7 @@ class Commande extends CommonOrder
|
||||
// Complete vat rate with code
|
||||
$vatrate = $line->tva_tx;
|
||||
if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')';
|
||||
|
||||
$origin = (!empty($line->origin) ? $line->origin : $this->element);
|
||||
$result = $this->addline(
|
||||
$line->desc,
|
||||
$line->subprice,
|
||||
@ -1039,7 +1039,7 @@ class Commande extends CommonOrder
|
||||
$line->label,
|
||||
$line->array_options,
|
||||
$line->fk_unit,
|
||||
$this->element,
|
||||
$origin,
|
||||
$line->id
|
||||
);
|
||||
if ($result < 0)
|
||||
|
||||
@ -1442,7 +1442,7 @@ if (empty($reshook))
|
||||
if ($_POST['type'] == Facture::TYPE_DEPOSIT)
|
||||
{
|
||||
$typeamount = GETPOST('typedeposit', 'alpha');
|
||||
$valuedeposit = GETPOST('valuedeposit', 'int');
|
||||
$valuedeposit = price2num(GETPOST('valuedeposit', 'alpha'), 'MU');
|
||||
|
||||
$amountdeposit = array();
|
||||
if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA))
|
||||
|
||||
@ -416,7 +416,7 @@ class Facture extends CommonInvoice
|
||||
$this->brouillon = 1;
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
|
||||
@ -53,6 +53,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inv
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
// Security check
|
||||
$id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
@ -151,6 +153,11 @@ if ($socid > 0) {
|
||||
}
|
||||
|
||||
|
||||
if ($socid > 0) {
|
||||
$tmpthirdparty = new Societe($db);
|
||||
$res = $tmpthirdparty->fetch($socid);
|
||||
if ($res > 0) $search_societe = $tmpthirdparty->name;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -499,7 +499,7 @@ elseif ($modecompta == "BOOKKEEPING")
|
||||
}
|
||||
|
||||
/*
|
||||
* Charges sociales non deductibles
|
||||
* Social contributions
|
||||
*/
|
||||
|
||||
$subtotal_ht = 0;
|
||||
@ -512,7 +512,6 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND c.deductible = 0";
|
||||
if (!empty($date_start) && !empty($date_end))
|
||||
$sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
@ -524,7 +523,6 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
|
||||
$sql .= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
$sql .= " WHERE p.fk_charge = cs.rowid";
|
||||
$sql .= " AND cs.fk_type = c.id";
|
||||
$sql .= " AND c.deductible = 0";
|
||||
if (!empty($date_start) && !empty($date_end))
|
||||
$sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
@ -532,69 +530,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
|
||||
$sql .= " AND cs.entity = ".$conf->entity;
|
||||
$sql .= " GROUP BY c.libelle, dm";
|
||||
|
||||
dol_syslog("get social contributions deductible=0 ", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0;
|
||||
$decaiss[$obj->dm] += $obj->amount;
|
||||
|
||||
if (!isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm] = 0;
|
||||
$decaiss_ttc[$obj->dm] += $obj->amount;
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
elseif ($modecompta == "BOOKKEEPING")
|
||||
{
|
||||
// Nothing from this table
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Charges sociales deductibles
|
||||
*/
|
||||
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES"))
|
||||
{
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND c.deductible = 1";
|
||||
if (!empty($date_start) && !empty($date_end))
|
||||
$sql .= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
elseif ($modecompta == "RECETTES-DEPENSES")
|
||||
{
|
||||
$sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
$sql .= " WHERE p.fk_charge = cs.rowid";
|
||||
$sql .= " AND cs.fk_type = c.id";
|
||||
$sql .= " AND c.deductible = 1";
|
||||
if (!empty($date_start) && !empty($date_end))
|
||||
$sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
|
||||
$sql .= " AND cs.entity = ".$conf->entity;
|
||||
$sql .= " GROUP BY c.libelle, dm";
|
||||
|
||||
dol_syslog("get social contributions paid deductible=1", LOG_DEBUG);
|
||||
dol_syslog("get social contributions", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
@ -734,7 +670,7 @@ elseif ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
|
||||
/*
|
||||
* Donation get dunning paiement
|
||||
* Donation get dunning payments
|
||||
*/
|
||||
|
||||
if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES"))
|
||||
|
||||
@ -410,8 +410,8 @@ else
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
{
|
||||
$page = 0;
|
||||
@ -421,14 +421,14 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
@ -784,7 +784,7 @@ $i = 0;
|
||||
$totalarray = array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
|
||||
$contactstatic->lastname = $obj->lastname;
|
||||
@ -984,7 +984,7 @@ while ($i < min($num, $limit))
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -513,7 +513,7 @@ abstract class CommonDocGenerator
|
||||
// Retrieve extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options))
|
||||
{
|
||||
$extrafieldkey = $object->element;
|
||||
$extrafieldkey = $object->table_element;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
|
||||
@ -7543,18 +7543,17 @@ abstract class CommonObject
|
||||
$now = dol_now();
|
||||
|
||||
$fieldvalues = $this->setSaveQuery();
|
||||
|
||||
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
|
||||
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
|
||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
||||
if (array_key_exists('ref', $fieldvalues)) $fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data
|
||||
|
||||
$keys = array();
|
||||
$values = array();
|
||||
$values = array(); // Array to store string forged for SQL syntax
|
||||
foreach ($fieldvalues as $k => $v) {
|
||||
$keys[$k] = $k;
|
||||
$value = $this->fields[$k];
|
||||
$values[$k] = $this->quote($v, $value);
|
||||
$values[$k] = $this->quote($v, $value); // May return string 'NULL' if $value is null
|
||||
}
|
||||
|
||||
// Clean and check mandatory
|
||||
@ -7564,8 +7563,7 @@ abstract class CommonObject
|
||||
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && $values[$key] == '-1') $values[$key] = '';
|
||||
if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = '';
|
||||
|
||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default']))
|
||||
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && (!isset($values[$key]) || $values[$key] === 'NULL') && is_null($this->fields[$key]['default']))
|
||||
{
|
||||
$error++;
|
||||
$this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||
|
||||
@ -5842,7 +5842,7 @@ class Form
|
||||
}
|
||||
elseif ($typehour == 'text' || $typehour == 'textselect')
|
||||
{
|
||||
$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" size="1" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
|
||||
$retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">';
|
||||
}
|
||||
else return 'BadValueForParameterTypeHour';
|
||||
|
||||
@ -5866,7 +5866,7 @@ class Form
|
||||
}
|
||||
elseif ($typehour == 'text')
|
||||
{
|
||||
$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" size="1" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
|
||||
$retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">';
|
||||
}
|
||||
|
||||
if ($typehour != 'text') $retstring .= ' '.$langs->trans('MinuteShort');
|
||||
@ -5953,7 +5953,7 @@ class Form
|
||||
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
|
||||
|
||||
// No immediate load of all database
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter).($moreparams ? $moreparams : '');
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
|
||||
@ -25,25 +25,26 @@
|
||||
|
||||
|
||||
/**
|
||||
* Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
|
||||
* The HTML field must be an input text with id=search_$htmlname.
|
||||
* This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method.
|
||||
* Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
|
||||
* The HTML field must be an input text with id=search_$htmlname.
|
||||
* This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method.
|
||||
*
|
||||
* @param string $selected Preselected value
|
||||
* @param string $htmlname HTML name of input field
|
||||
* @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
|
||||
* @param string $urloption More parameters on URL request
|
||||
* @param int $minLength Minimum number of chars to trigger that Ajax search
|
||||
* @param int $autoselect Automatic selection if just one value
|
||||
* @param array $ajaxoptions Multiple options array
|
||||
* @param string $selected Preselected value
|
||||
* @param string $htmlname HTML name of input field
|
||||
* @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
|
||||
* @param string $urloption More parameters on URL request
|
||||
* @param int $minLength Minimum number of chars to trigger that Ajax search
|
||||
* @param int $autoselect Automatic selection if just one value
|
||||
* @param array $ajaxoptions Multiple options array
|
||||
* - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done
|
||||
* - Ex: array('disabled'=> )
|
||||
* - Ex: array('show'=> )
|
||||
* - Ex: array('update_textarea'=> )
|
||||
* - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
|
||||
* @return string Script
|
||||
* @param string $moreparams More params provided to ajax call
|
||||
* @return string Script
|
||||
*/
|
||||
function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array())
|
||||
function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array(), $moreparams = '')
|
||||
{
|
||||
if (empty($minLength)) $minLength=1;
|
||||
|
||||
@ -55,7 +56,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
||||
|
||||
// Input search_htmlname is original field
|
||||
// Input htmlname is a second input field used when using ajax autocomplete.
|
||||
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" />';
|
||||
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" '.($moreparams ? $moreparams : '').' />';
|
||||
|
||||
$script.= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n";
|
||||
$script.= '<script>'."\n";
|
||||
|
||||
@ -24,114 +24,131 @@
|
||||
|
||||
|
||||
/**
|
||||
* Function to return number in text.
|
||||
* Function to return a number into a text.
|
||||
* May use module NUMBERWORDS if found.
|
||||
*
|
||||
*
|
||||
* @param float $num Number to convert
|
||||
* @param float $num Number to convert (must be a numeric value, like reported by price2num())
|
||||
* @param Translate $langs Language
|
||||
* @param boolean $currency 0=number to translate | 1=currency to translate
|
||||
* @param boolean $centimes 0=no centimes | 1=centimes to translate
|
||||
* @param boolean $centimes 0=no cents/centimes | 1=there is cents/centimes to translate
|
||||
* @return string|false Text of the number
|
||||
*/
|
||||
function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$num = str_replace(array(',', ' '), '', trim($num));
|
||||
if (! $num) {
|
||||
return false;
|
||||
}
|
||||
//$num = str_replace(array(',', ' '), '', trim($num)); This should be useless since $num MUST be a php numeric value
|
||||
if (!$num) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($centimes && strlen($num) == 1) {
|
||||
$num = $num*10;
|
||||
}
|
||||
$TNum = explode('.', $num);
|
||||
$num = (int) $TNum[0];
|
||||
$words = array();
|
||||
$list1 = array(
|
||||
'',
|
||||
$langs->transnoentitiesnoconv('one'),
|
||||
$langs->transnoentitiesnoconv('two'),
|
||||
$langs->transnoentitiesnoconv('three'),
|
||||
$langs->transnoentitiesnoconv('four'),
|
||||
$langs->transnoentitiesnoconv('five'),
|
||||
$langs->transnoentitiesnoconv('six'),
|
||||
$langs->transnoentitiesnoconv('seven'),
|
||||
$langs->transnoentitiesnoconv('eight'),
|
||||
$langs->transnoentitiesnoconv('nine'),
|
||||
$langs->transnoentitiesnoconv('ten'),
|
||||
$langs->transnoentitiesnoconv('eleven'),
|
||||
$langs->transnoentitiesnoconv('twelve'),
|
||||
$langs->transnoentitiesnoconv('thirteen'),
|
||||
$langs->transnoentitiesnoconv('fourteen'),
|
||||
$langs->transnoentitiesnoconv('fifteen'),
|
||||
$langs->transnoentitiesnoconv('sixteen'),
|
||||
$langs->transnoentitiesnoconv('seventeen'),
|
||||
$langs->transnoentitiesnoconv('eighteen'),
|
||||
$langs->transnoentitiesnoconv('nineteen')
|
||||
);
|
||||
$list2 = array(
|
||||
'',
|
||||
$langs->transnoentitiesnoconv('ten'),
|
||||
$langs->transnoentitiesnoconv('twenty'),
|
||||
$langs->transnoentitiesnoconv('thirty'),
|
||||
$langs->transnoentitiesnoconv('forty'),
|
||||
$langs->transnoentitiesnoconv('fifty'),
|
||||
$langs->transnoentitiesnoconv('sixty'),
|
||||
$langs->transnoentitiesnoconv('seventy'),
|
||||
$langs->transnoentitiesnoconv('eighty'),
|
||||
$langs->transnoentitiesnoconv('ninety'),
|
||||
$langs->transnoentitiesnoconv('hundred')
|
||||
);
|
||||
$list3 = array(
|
||||
'',
|
||||
$langs->transnoentitiesnoconv('thousand'),
|
||||
$langs->transnoentitiesnoconv('million'),
|
||||
$langs->transnoentitiesnoconv('billion'),
|
||||
$langs->transnoentitiesnoconv('trillion'),
|
||||
$langs->transnoentitiesnoconv('quadrillion')
|
||||
);
|
||||
|
||||
$num_length = strlen($num);
|
||||
$levels = (int) (($num_length + 2) / 3);
|
||||
$max_length = $levels * 3;
|
||||
$num = substr('00' . $num, -$max_length);
|
||||
$num_levels = str_split($num, 3);
|
||||
$nboflevels = count($num_levels);
|
||||
for ($i = 0; $i < $nboflevels; $i++) {
|
||||
$levels--;
|
||||
$hundreds = (int) ($num_levels[$i] / 100);
|
||||
$hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' '.$langs->transnoentities('hundred') . ( $hundreds == 1 ? '' : 's' ) . ' ': '');
|
||||
$tens = (int) ($num_levels[$i] % 100);
|
||||
$singles = '';
|
||||
if ( $tens < 20 ) {
|
||||
$tens = ($tens ? ' ' . $list1[$tens] . ' ' : '' );
|
||||
} else {
|
||||
$tens = (int) ($tens / 10);
|
||||
$tens = ' ' . $list2[$tens] . ' ';
|
||||
$singles = (int) ($num_levels[$i] % 10);
|
||||
$singles = ' ' . $list1[$singles] . ' ';
|
||||
}
|
||||
$words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );
|
||||
} //end for loop
|
||||
$commas = count($words);
|
||||
if ($commas > 1) {
|
||||
$commas = $commas - 1;
|
||||
}
|
||||
$concatWords = implode(' ', $words);
|
||||
// Delete multi whitespaces
|
||||
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
||||
|
||||
if(!empty($currency)) {
|
||||
$concatWords .= ' '.$currency;
|
||||
$num = $num * 10;
|
||||
}
|
||||
|
||||
// If we need to write cents call again this function for cents
|
||||
if(!empty($TNum[1])) {
|
||||
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
||||
$concatWords .= ' '.dol_convertToWord($TNum[1], $langs, $currency, true);
|
||||
if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
|
||||
if (!empty($conf->global->MAIN_MODULE_NUMBERWORDS)) {
|
||||
if ($currency) {
|
||||
$type = 1;
|
||||
} else {
|
||||
$type = 0;
|
||||
}
|
||||
|
||||
$concatWords = $langs->getLabelFromNumber($num, $type);
|
||||
return $concatWords;
|
||||
} else {
|
||||
$TNum = explode('.', $num);
|
||||
$num = (int) $TNum[0];
|
||||
$words = array();
|
||||
$list1 = array(
|
||||
'',
|
||||
$langs->transnoentitiesnoconv('one'),
|
||||
$langs->transnoentitiesnoconv('two'),
|
||||
$langs->transnoentitiesnoconv('three'),
|
||||
$langs->transnoentitiesnoconv('four'),
|
||||
$langs->transnoentitiesnoconv('five'),
|
||||
$langs->transnoentitiesnoconv('six'),
|
||||
$langs->transnoentitiesnoconv('seven'),
|
||||
$langs->transnoentitiesnoconv('eight'),
|
||||
$langs->transnoentitiesnoconv('nine'),
|
||||
$langs->transnoentitiesnoconv('ten'),
|
||||
$langs->transnoentitiesnoconv('eleven'),
|
||||
$langs->transnoentitiesnoconv('twelve'),
|
||||
$langs->transnoentitiesnoconv('thirteen'),
|
||||
$langs->transnoentitiesnoconv('fourteen'),
|
||||
$langs->transnoentitiesnoconv('fifteen'),
|
||||
$langs->transnoentitiesnoconv('sixteen'),
|
||||
$langs->transnoentitiesnoconv('seventeen'),
|
||||
$langs->transnoentitiesnoconv('eighteen'),
|
||||
$langs->transnoentitiesnoconv('nineteen')
|
||||
);
|
||||
$list2 = array(
|
||||
'',
|
||||
$langs->transnoentitiesnoconv('ten'),
|
||||
$langs->transnoentitiesnoconv('twenty'),
|
||||
$langs->transnoentitiesnoconv('thirty'),
|
||||
$langs->transnoentitiesnoconv('forty'),
|
||||
$langs->transnoentitiesnoconv('fifty'),
|
||||
$langs->transnoentitiesnoconv('sixty'),
|
||||
$langs->transnoentitiesnoconv('seventy'),
|
||||
$langs->transnoentitiesnoconv('eighty'),
|
||||
$langs->transnoentitiesnoconv('ninety'),
|
||||
$langs->transnoentitiesnoconv('hundred')
|
||||
);
|
||||
$list3 = array(
|
||||
'',
|
||||
$langs->transnoentitiesnoconv('thousand'),
|
||||
$langs->transnoentitiesnoconv('million'),
|
||||
$langs->transnoentitiesnoconv('billion'),
|
||||
$langs->transnoentitiesnoconv('trillion'),
|
||||
$langs->transnoentitiesnoconv('quadrillion')
|
||||
);
|
||||
|
||||
$num_length = strlen($num);
|
||||
$levels = (int) (($num_length + 2) / 3);
|
||||
$max_length = $levels * 3;
|
||||
$num = substr('00'.$num, -$max_length);
|
||||
$num_levels = str_split($num, 3);
|
||||
$nboflevels = count($num_levels);
|
||||
for ($i = 0; $i < $nboflevels; $i++) {
|
||||
$levels--;
|
||||
$hundreds = (int) ($num_levels[$i] / 100);
|
||||
$hundreds = ($hundreds ? ' '.$list1[$hundreds].' '.$langs->transnoentities('hundred').($hundreds == 1 ? '' : 's').' ' : '');
|
||||
$tens = (int) ($num_levels[$i] % 100);
|
||||
$singles = '';
|
||||
if ($tens < 20) {
|
||||
$tens = ($tens ? ' '.$list1[$tens].' ' : '');
|
||||
} else {
|
||||
$tens = (int) ($tens / 10);
|
||||
$tens = ' '.$list2[$tens].' ';
|
||||
$singles = (int) ($num_levels[$i] % 10);
|
||||
$singles = ' '.$list1[$singles].' ';
|
||||
}
|
||||
$words[] = $hundreds.$tens.$singles.(($levels && (int) ($num_levels[$i])) ? ' '.$list3[$levels].' ' : '');
|
||||
} //end for loop
|
||||
$commas = count($words);
|
||||
if ($commas > 1) {
|
||||
$commas = $commas - 1;
|
||||
}
|
||||
$concatWords = implode(' ', $words);
|
||||
// Delete multi whitespaces
|
||||
$concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords));
|
||||
|
||||
if (!empty($currency)) {
|
||||
$concatWords .= ' '.$currency;
|
||||
}
|
||||
|
||||
// If we need to write cents call again this function for cents
|
||||
$decimalpart = $TNum[1];
|
||||
$decimalpart = preg_replace('/0+$/', '', $decimalpart);
|
||||
|
||||
if ($decimalpart) {
|
||||
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and');
|
||||
|
||||
$concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true);
|
||||
if (!empty($currency)) $concatWords .= ' '.$langs->transnoentities('centimes');
|
||||
}
|
||||
return $concatWords;
|
||||
}
|
||||
return $concatWords;
|
||||
}
|
||||
|
||||
|
||||
@ -146,41 +163,43 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
|
||||
*/
|
||||
function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
{
|
||||
// If the number is negative convert to positive and return -1 if is too long
|
||||
// If the number is negative convert to positive and return -1 if it is too long
|
||||
if ($numero < 0) $numero *= -1;
|
||||
if ($numero >= 1000000000001)
|
||||
if ($numero >= 1000000000001) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Get 2 decimals to cents, another functions round or truncate
|
||||
$strnumber = number_format($numero, 10);
|
||||
$len=strlen($strnumber);
|
||||
for ($i=0; $i<$len; $i++)
|
||||
$len = strlen($strnumber);
|
||||
for ($i = 0; $i < $len; $i++)
|
||||
{
|
||||
if ($strnumber[$i]=='.') {
|
||||
$parte_decimal = $strnumber[$i+1].$strnumber[$i+2];
|
||||
if ($strnumber[$i] == '.') {
|
||||
$parte_decimal = $strnumber[$i + 1].$strnumber[$i + 2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and
|
||||
in case exist why ask $lang like a parameter?*/
|
||||
if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
||||
in case exist why ask $lang like a parameter?*/
|
||||
if (((is_object($langs) && $langs->default == 'es_MX') || (!is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency')
|
||||
{
|
||||
if ($numero>=1 && $numero<2) {
|
||||
if ($numero >= 1 && $numero < 2) {
|
||||
return ("UN PESO ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=0 && $numero<1){
|
||||
elseif ($numero >= 0 && $numero < 1) {
|
||||
return ("CERO PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=1000000 && $numero<1000001){
|
||||
elseif ($numero >= 1000000 && $numero < 1000001) {
|
||||
return ("UN MILLÓN DE PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
elseif ($numero>=1000000000000 && $numero<1000000000001){
|
||||
elseif ($numero >= 1000000000000 && $numero < 1000000000001) {
|
||||
return ("UN BILLÓN DE PESOS ".$parte_decimal." / 100 M.N.");
|
||||
}
|
||||
else {
|
||||
$entexto ="";
|
||||
$entexto = "";
|
||||
$number = $numero;
|
||||
if ($number >= 1000000000){
|
||||
if ($number >= 1000000000) {
|
||||
$CdMMillon = (int) ($numero / 100000000000);
|
||||
$numero = $numero - $CdMMillon * 100000000000;
|
||||
$DdMMillon = (int) ($numero / 10000000000);
|
||||
@ -190,7 +209,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
$entexto .= hundreds2text($CdMMillon, $DdMMillon, $UdMMillon);
|
||||
$entexto .= " MIL ";
|
||||
}
|
||||
if ($number >= 1000000){
|
||||
if ($number >= 1000000) {
|
||||
$CdMILLON = (int) ($numero / 100000000);
|
||||
$numero = $numero - $CdMILLON * 100000000;
|
||||
$DdMILLON = (int) ($numero / 10000000);
|
||||
@ -198,7 +217,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
$udMILLON = (int) ($numero / 1000000);
|
||||
$numero = $numero - $udMILLON * 1000000;
|
||||
$entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON);
|
||||
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1)
|
||||
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON == 1)
|
||||
$entexto .= " MILLÓN ";
|
||||
else
|
||||
$entexto .= " MILLONES ";
|
||||
@ -219,7 +238,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
$d = (int) ($numero / 10);
|
||||
$u = (int) $numero - $d * 10;
|
||||
$entexto .= hundreds2text($c, $d, $u);
|
||||
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000)
|
||||
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number > 1000000)
|
||||
$entexto .= " DE";
|
||||
$entexto .= " PESOS ".$parte_decimal." / 100 M.N.";
|
||||
}
|
||||
@ -237,40 +256,40 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
|
||||
*/
|
||||
function hundreds2text($hundreds, $tens, $units)
|
||||
{
|
||||
if ($hundreds==1 && $tens==0 && $units==0){
|
||||
if ($hundreds == 1 && $tens == 0 && $units == 0) {
|
||||
return "CIEN";
|
||||
}
|
||||
$centenas = array("CIENTO","DOSCIENTOS","TRESCIENTOS","CUATROCIENTOS","QUINIENTOS","SEISCIENTOS","SETECIENTOS","OCHOCIENTOS","NOVECIENTOS");
|
||||
$decenas = array("","","TREINTA ","CUARENTA ","CINCUENTA ","SESENTA ","SETENTA ","OCHENTA ","NOVENTA ");
|
||||
$veintis = array("VEINTE","VEINTIUN","VEINTIDÓS","VEINTITRÉS","VEINTICUATRO","VEINTICINCO","VEINTISÉIS","VEINTISIETE","VEINTIOCHO","VEINTINUEVE");
|
||||
$diecis = array("DIEZ","ONCE","DOCE","TRECE","CATORCE","QUINCE","DIECISÉIS","DIECISIETE","DIECIOCHO","DIECINUEVE");
|
||||
$unidades = array("UN","DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE");
|
||||
$centenas = array("CIENTO", "DOSCIENTOS", "TRESCIENTOS", "CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS", "SETECIENTOS", "OCHOCIENTOS", "NOVECIENTOS");
|
||||
$decenas = array("", "", "TREINTA ", "CUARENTA ", "CINCUENTA ", "SESENTA ", "SETENTA ", "OCHENTA ", "NOVENTA ");
|
||||
$veintis = array("VEINTE", "VEINTIUN", "VEINTIDÓS", "VEINTITRÉS", "VEINTICUATRO", "VEINTICINCO", "VEINTISÉIS", "VEINTISIETE", "VEINTIOCHO", "VEINTINUEVE");
|
||||
$diecis = array("DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISÉIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE");
|
||||
$unidades = array("UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE");
|
||||
$entexto = "";
|
||||
if ($hundreds!=0){
|
||||
$entexto .= $centenas[$hundreds-1];
|
||||
if ($hundreds != 0) {
|
||||
$entexto .= $centenas[$hundreds - 1];
|
||||
}
|
||||
if ($tens>2){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
$entexto .= $decenas[$tens-1];
|
||||
if ($units!=0){
|
||||
if ($tens > 2) {
|
||||
if ($hundreds != 0) $entexto .= " ";
|
||||
$entexto .= $decenas[$tens - 1];
|
||||
if ($units != 0) {
|
||||
$entexto .= " Y ";
|
||||
$entexto .= $unidades[$units-1];
|
||||
$entexto .= $unidades[$units - 1];
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
elseif ($tens==2){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
elseif ($tens == 2) {
|
||||
if ($hundreds != 0) $entexto .= " ";
|
||||
$entexto .= " ".$veintis[$units];
|
||||
return $entexto;
|
||||
}
|
||||
elseif ($tens==1){
|
||||
if ($hundreds!=0) $entexto .= " ";
|
||||
elseif ($tens == 1) {
|
||||
if ($hundreds != 0) $entexto .= " ";
|
||||
$entexto .= $diecis[$units];
|
||||
return $entexto;
|
||||
}
|
||||
if ($units!=0) {
|
||||
if ($hundreds!=0 || $tens!=0) $entexto .= " ";
|
||||
$entexto .= $unidades[$units-1];
|
||||
if ($units != 0) {
|
||||
if ($hundreds != 0 || $tens != 0) $entexto .= " ";
|
||||
$entexto .= $unidades[$units - 1];
|
||||
}
|
||||
return $entexto;
|
||||
}
|
||||
|
||||
@ -1859,7 +1859,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
|
||||
}
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($object->lines[$i]->special_code == 3) return '';
|
||||
if (empty($hidedetails) || $hidedetails > 1) $result .= $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
|
||||
}
|
||||
return $result;
|
||||
|
||||
@ -309,6 +309,10 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
elseif ($feature == 'cheque')
|
||||
{
|
||||
if (!$user->rights->banque->cheque) { $createok = 0; $nbko++; }
|
||||
} elseif ($feature == 'import') {
|
||||
if (!$user->rights->import->run) { $createok = 0; $nbko++; }
|
||||
} elseif ($feature == 'ecm') {
|
||||
if (!$user->rights->ecm->upload) { $createok = 0; $nbko++; }
|
||||
}
|
||||
elseif (!empty($feature2)) // This is for permissions on one level
|
||||
{
|
||||
|
||||
@ -234,12 +234,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
!empty($conf->ficheinter->enabled)
|
||||
) ? 1 : 0,
|
||||
'perms'=>(!empty($user->rights->propal->lire) ||
|
||||
!empty($user->rights->commande->lire) ||
|
||||
!empty($user->rights->fournisseur->lire) ||
|
||||
!empty($user->rights->supplier_proposal->lire) ||
|
||||
!empty($user->rights->supplier_order->lire) ||
|
||||
!empty($user->rights->contrat->lire) ||
|
||||
!empty($user->rights->ficheinter->lire)
|
||||
!empty($user->rights->commande->lire) ||
|
||||
!empty($user->rights->fournisseur->lire) ||
|
||||
!empty($user->rights->supplier_proposal->lire) ||
|
||||
!empty($user->rights->supplier_order->lire) ||
|
||||
!empty($user->rights->contrat->lire) ||
|
||||
!empty($user->rights->ficheinter->lire) ||
|
||||
!empty($user->rights->supplier_order->lire) ||
|
||||
!empty($user->rights->fournisseur->commande->lire)
|
||||
),
|
||||
'module'=>'propal|commande|supplier_proposal|supplier_order|contrat|ficheinter'
|
||||
);
|
||||
@ -1704,7 +1706,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
// Project affected to user
|
||||
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks');
|
||||
$newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
|
||||
$newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire);
|
||||
$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
|
||||
|
||||
@ -777,7 +777,9 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
|
||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact))?$object->contact:null), $usecontact, 'target', $object);
|
||||
$usecontact = 0;
|
||||
|
||||
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact))?$object->contact:null), $usecontact, 'target', $object);
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=90;
|
||||
|
||||
@ -131,6 +131,21 @@ if ($action == 'presend')
|
||||
{
|
||||
$formmail->fromid = $user->id;
|
||||
}
|
||||
if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) {
|
||||
$formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER;
|
||||
$formmail->fromname = '';
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) {
|
||||
$formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER;
|
||||
$formmail->fromname = '';
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) {
|
||||
$formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER;
|
||||
$formmail->fromname = '';
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
$formmail->trackid=$trackid;
|
||||
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
|
||||
{
|
||||
|
||||
@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e
|
||||
// we keep position for the first line
|
||||
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
|
||||
}
|
||||
$totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
|
||||
if (is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
|
||||
}
|
||||
if (!empty($val['isameasure']))
|
||||
{
|
||||
|
||||
@ -1524,8 +1524,11 @@ if ($action == 'create')
|
||||
}
|
||||
if ($subj == 0) // Line not shown yet, we show it
|
||||
{
|
||||
print '<!-- line not shown yet, we show it -->';
|
||||
print '<tr class="oddeven"><td colspan="3" ></td><td class="center">';
|
||||
$warehouse_selected_id = GETPOST('entrepot_id', 'int');
|
||||
|
||||
print '<!-- line not shown yet, we show it -->';
|
||||
print '<tr class="oddeven"><td colspan="3"></td><td class="center">';
|
||||
|
||||
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
{
|
||||
$disabled = '';
|
||||
@ -1533,6 +1536,9 @@ if ($action == 'create')
|
||||
{
|
||||
$disabled = 'disabled="disabled"';
|
||||
}
|
||||
if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty.
|
||||
$disabled = 'disabled="disabled"';
|
||||
}
|
||||
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled ? ' '.$disabled : '').'> ';
|
||||
}
|
||||
else
|
||||
@ -1544,7 +1550,6 @@ if ($action == 'create')
|
||||
print '<td class="left">';
|
||||
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
{
|
||||
$warehouse_selected_id = GETPOST('entrepot_id', 'int');
|
||||
if ($warehouse_selected_id > 0)
|
||||
{
|
||||
$warehouseObject = new Entrepot($db);
|
||||
|
||||
@ -323,10 +323,10 @@ class Expedition extends CommonObject
|
||||
$sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null");
|
||||
$sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:"null");
|
||||
$sql.= ", '".$this->db->escape($this->tracking_number)."'";
|
||||
$sql.= ", ".$this->weight;
|
||||
$sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth
|
||||
$sql.= ", ".$this->sizeW; // TODO Should use this->trueWidth
|
||||
$sql.= ", ".$this->sizeH; // TODO Should use this->trueHeight
|
||||
$sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL');
|
||||
$sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth
|
||||
$sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth
|
||||
$sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight
|
||||
$sql.= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL');
|
||||
$sql.= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL');
|
||||
$sql.= ", ".(!empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
|
||||
|
||||
@ -330,9 +330,11 @@ class CommandeFournisseur extends CommonOrder
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
|
||||
$sql .= " WHERE c.entity = ".$conf->entity;
|
||||
|
||||
if (empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
|
||||
else $sql .= " WHERE c.rowid=".$id;
|
||||
|
||||
if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'";
|
||||
else $sql .= " AND c.rowid=".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@ -892,6 +894,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1';
|
||||
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
if (!$error)
|
||||
@ -1270,11 +1273,15 @@ class CommandeFournisseur extends CommonOrder
|
||||
$error = 0;
|
||||
$now = dol_now();
|
||||
|
||||
// $date_commande is deprecated
|
||||
$date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set
|
||||
if(empty($date)) $date = $now;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->source)) $this->source = 0;
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
|
||||
@ -359,7 +359,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$remise = $this->remise;
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
|
||||
@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product
|
||||
//$out .= '<td class="liste_titre right">'.$langs->trans("QtyMin").'</td>';
|
||||
$out .= '<td class="liste_titre">'.$langs->trans("User").'</td></tr>';
|
||||
foreach ($productFournLogList as $productFournLog) {
|
||||
$out .= '<tr><td class="right">'.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').'</td>';
|
||||
$out .= '<tr><td class="right">'.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').'</td>';
|
||||
$out .= '<td class="right">'.price($productFournLog['price']).'</td>';
|
||||
//$out.= '<td class="right">'.$productFournLog['quantity'].'</td>';
|
||||
$out .= '<td>'.$productFournLog['lastname'].'</td></tr>';
|
||||
|
||||
@ -460,11 +460,26 @@ if (empty($reshook))
|
||||
if ($idprod > 0)
|
||||
{
|
||||
$label = $productsupplier->label;
|
||||
|
||||
// Define output language
|
||||
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if (empty($newlang) && GETPOST('lang_id', 'aZ09'))
|
||||
$newlang = GETPOST('lang_id', 'aZ09');
|
||||
if (empty($newlang))
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
if (!empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$desc = (!empty($productsupplier->multilangs [$outputlangs->defaultlang] ["description"])) ? $productsupplier->multilangs [$outputlangs->defaultlang] ["description"] : $productsupplier->description;
|
||||
} else {
|
||||
$desc = $productsupplier->description;
|
||||
}
|
||||
// if we use supplier description of the products
|
||||
if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
||||
$desc = $productsupplier->desc_supplier;
|
||||
} else $desc = $productsupplier->description;
|
||||
}
|
||||
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
|
||||
@ -27,10 +27,10 @@
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
||||
$langs->loadLangs(array('bills', 'banks', 'companies', 'suppliers'));
|
||||
|
||||
@ -210,7 +210,7 @@ if ($result > 0)
|
||||
*/
|
||||
|
||||
// Amount
|
||||
print '<tr><td colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->montant, '', $langs, 0, 0, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td colspan="2">'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, '', $langs, 0, 0, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
{
|
||||
|
||||
@ -409,12 +409,11 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
||||
|
||||
className: "phpdebugbar " + csscls('minimized'),
|
||||
|
||||
options: {
|
||||
bodyMarginBottom: true,
|
||||
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom'))
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
this.options = {
|
||||
bodyMarginBottom: true,
|
||||
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
|
||||
};
|
||||
this.controls = {};
|
||||
this.dataMap = {};
|
||||
this.datasets = {};
|
||||
|
||||
@ -98,7 +98,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
|
||||
ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0;
|
||||
|
||||
ALTER TABLE llx_bom_bomline DROP COLUMN rank;
|
||||
ALTER TABLE llx_bom_bomline DROP COLUMN `rank`;
|
||||
|
||||
create table llx_categorie_warehouse
|
||||
(
|
||||
|
||||
@ -353,8 +353,8 @@ PriceUTTC=P.U TTC
|
||||
Amount=Montant
|
||||
AmountInvoice=Montant facture
|
||||
AmountInvoiced=Montant facturé
|
||||
AmountInvoicedHT=Montant facturé (TTC)
|
||||
AmountInvoicedTTC=Montant facturé (HT)
|
||||
AmountInvoicedHT=Montant facturé (HT)
|
||||
AmountInvoicedTTC=Montant facturé (TTC)
|
||||
AmountPayment=Montant paiement
|
||||
AmountHTShort=Montant HT
|
||||
AmountTTCShort=Montant TTC
|
||||
|
||||
@ -530,7 +530,7 @@ class MultiCurrency extends CommonObject
|
||||
$sql1.= " AND m.entity IN (".getEntity('multicurrency').")";
|
||||
$sql2= '';
|
||||
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"';
|
||||
$sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1';
|
||||
$sql3 = ' ORDER BY mc.date_sync DESC LIMIT 1';
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $db->query($sql1.$sql2.$sql3);
|
||||
|
||||
@ -66,12 +66,13 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
if ($cancel) $action ='';
|
||||
|
||||
// Action association d'un sousproduit
|
||||
// Add subproduct to product
|
||||
if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
$error=0;
|
||||
|
||||
for ($i=0; $i < GETPOST("max_prod", 'int'); $i++)
|
||||
$maxprod = GETPOST("max_prod", 'int');
|
||||
for ($i=0; $i < $maxprod; $i++)
|
||||
{
|
||||
$qty = price2num(GETPOST("prod_qty_".$i, 'alpha'), 'MS');
|
||||
if ($qty > 0)
|
||||
|
||||
@ -225,7 +225,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", $option, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datef", "", $option, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "f.total", "", $option, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -208,7 +208,7 @@ if ($id > 0 || !empty($ref))
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -104,6 +104,7 @@ class Entrepot extends CommonObject
|
||||
*/
|
||||
public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15),
|
||||
'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30),
|
||||
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35),
|
||||
@ -441,6 +442,7 @@ class Entrepot extends CommonObject
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id";
|
||||
$sql .= " , entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
|
||||
if ($id)
|
||||
{
|
||||
@ -460,6 +462,7 @@ class Entrepot extends CommonObject
|
||||
$obj=$this->db->fetch_object($result);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
$this->fk_parent = $obj->fk_parent;
|
||||
$this->ref = $obj->label;
|
||||
$this->label = $obj->label;
|
||||
|
||||
@ -209,13 +209,13 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk
|
||||
$sql .= " WHERE t.entity IN (".getEntity('stock').")";
|
||||
foreach ($search as $key => $val)
|
||||
{
|
||||
if ($key == 'status' && $search[$key] == -1) continue;
|
||||
if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue;
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
|
||||
if ($search[$key] == '-1') $search[$key] = '';
|
||||
$mode_search = 2;
|
||||
}
|
||||
if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : $key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
// Add where from extra fields
|
||||
|
||||
@ -78,6 +78,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
$object->label = $_POST["libelle"];
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
||||
$object->update($object->id, $user);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -63,7 +63,7 @@ $search_agenda_label = GETPOST('search_agenda_label');
|
||||
$id = GETPOST("id", 'int');
|
||||
$socid = 0;
|
||||
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||
$result = restrictedArea($user, 'projet', $id, '');
|
||||
$result = restrictedArea($user, 'projet', $id, 'projet&project');
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ $search_task_label = GETPOST('search_task_label');
|
||||
$search_task_description = GETPOST('search_task_description');
|
||||
$search_project_user = GETPOST('search_project_user');
|
||||
$search_task_user = GETPOST('search_task_user');
|
||||
$search_societe = GETPOST('search_societe');
|
||||
|
||||
$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
|
||||
if ($mine) { $search_task_user = $user->id; $mine = 0; }
|
||||
|
||||
@ -861,6 +861,11 @@ if (empty($reshook))
|
||||
$id = $socid;
|
||||
$object->fetch($socid);
|
||||
|
||||
// Selection of new fields
|
||||
if (!empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_MAIN_CARD) && (empty($conf->global->SOCIETE_DISABLE_CONTACTS) || !empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))) {
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
|
||||
}
|
||||
|
||||
// Actions to send emails
|
||||
$triggersendname = 'COMPANY_SENTBYMAIL';
|
||||
$paramname = 'socid';
|
||||
|
||||
@ -891,7 +891,7 @@ class SupplierProposal extends CommonObject
|
||||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
$this->multicurrency_code = $conf->currency;
|
||||
|
||||
@ -156,7 +156,10 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
|
||||
continue;
|
||||
|
||||
print 'Check sql file '.$file."\n";
|
||||
$filecontent=file_get_contents($dir.'/'.$file);
|
||||
$filecontent = file_get_contents($dir.'/'.$file);
|
||||
|
||||
// Allow ` for 'rank' column name
|
||||
$filecontent = str_replace('`rank`', '_rank_', $filecontent);
|
||||
|
||||
$result=strpos($filecontent, '`');
|
||||
print __METHOD__." Result for checking we don't have back quote = ".$result."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user