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

Conflicts:
	htdocs/holiday/document.php
This commit is contained in:
Laurent Destailleur 2017-10-04 13:32:53 +02:00
commit 8e0da9bfeb
13 changed files with 68 additions and 46 deletions

View File

@ -419,7 +419,7 @@ class AccountancyExport
/**
* Export format : Agiris
* Export format : Agiris Isacompta
*
* @param array $objectLines data
*
@ -433,30 +433,23 @@ class AccountancyExport
$date = dol_print_date($line->doc_date, '%d%m%Y');
print $line->id . $this->separator;
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
print $line->piece_num . $this->separator;
print $line->label_operation . $this->separator;
print $date . $this->separator;
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
print $line->label_operation . $this->separator;
if (empty($line->subledger_account)) {
print length_accountg($line->numero_compte) . $this->separator;
} else {
// FIXME Because the subledger_account is already an accounting account, does we really need
// to concat 4011 or 401 to it ?
if (substr($line->numero_compte, 0, 1) == 'C' || substr($line->numero_compte, 0, 1) == '9') {
print '411' . substr(str_replace(" ", "", $line->subledger_account), 0, 5) . $this->separator;
}
if (substr($line->numero_compte, 0, 1) == 'F' || substr($line->numero_compte, 0, 1) == '0') {
print '401' . substr(str_replace(" ", "", $line->subledger_account), 0, 5) . $this->separator;
}
print length_accounta($line->subledger_account) . $this->separator;
}
print length_accounta($line->subledger_account) . $this->separator;
print $line->doc_ref . $this->separator;
print price($line->debit) . $this->separator;
print price($line->credit) . $this->separator;
print price($line->montant).$this->separator;
print $line->sens.$this->separator;
print $line->code_journal . $this->separator;
print $line->code_journal;
print $this->end_line;
}
}

View File

@ -136,6 +136,9 @@ class DolibarrApi
unset($object->table_element_line);
unset($object->picto);
unset($object->skip_update_total);
unset($object->context);
// Remove the $oldcopy property because it is not supported by the JSON
// encoder. The following error is generated when trying to serialize
// it: "Error encoding/decoding JSON: Type is not supported"

View File

@ -278,7 +278,7 @@ class Proposals extends DolibarrApi
$request_data->fk_unit,
$this->element,
$request_data->id,
$request_data->pu_ht_devise,
$request_data->multicurrency_subprice,
$request_data->fk_remise_except
);
@ -316,26 +316,27 @@ class Proposals extends DolibarrApi
$request_data = (object) $request_data;
$updateRes = $this->propal->updateline(
$lineid,
$request_data->desc,
$request_data->subprice,
$request_data->qty,
$request_data->remise_percent,
$request_data->tva_tx,
$request_data->localtax1_tx,
$request_data->localtax2_tx,
'HT',
$request_data->desc,
'HT',
$request_data->info_bits,
$request_data->date_start,
$request_data->date_end,
$request_data->product_type,
$request_data->fk_parent_line,
0,
$request_data->fk_fournprice,
$request_data->pa_ht,
$request_data->label,
$request_data->special_code,
$request_data->fk_parent_line,
0,
$request_data->fk_fournprice,
$request_data->pa_ht,
$request_data->label,
$request_data->product_type,
$request_data->date_start,
$request_data->date_end,
$request_data->array_options,
$request_data->fk_unit
$request_data->fk_unit,
$request_data->multicurrency_subprice
);
if ($updateRes > 0) {
@ -508,4 +509,23 @@ class Proposals extends DolibarrApi
}
return $propal;
}
/**
* Clean sensible object datas
*
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object) {
$object = parent::_cleanObjectDatas($object);
unset($object->name);
unset($object->lastname);
unset($object->firstname);
unset($object->civility_id);
unset($object->address);
return $object;
}
}

View File

@ -639,6 +639,7 @@ class Propal extends CommonObject
$pa_ht=price2num($pa_ht);
if (empty($qty) && empty($special_code)) $special_code=3; // Set option tag
if (! empty($qty) && $special_code == 3) $special_code=0; // Remove option tag
if (empty($type)) $type=0;
if ($this->statut == self::STATUS_DRAFT)
{

View File

@ -3787,7 +3787,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
* @param string $rate Rate value to format ('19.6', '19,6', '19.6%', '19,6%', '19.6 (CODEX)', ...)
* @param boolean $addpercent Add a percent % sign in output
* @param int $info_bits Miscellaneous information on vat (0=Default, 1=French NPR vat)
* @param int $usestarfornpr 1=Use '*' for NPR vat rate intead of MAIN_LABEL_MENTION_NPR
* @param int $usestarfornpr -1=Never show, 0 or 1=Use '*' for NPR vat rates
* @return string String with formated amounts ('19,6' or '19,6%' or '8.5% (NPR)' or '8.5% *' or '19,6 (CODEX)')
*/
function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
@ -3817,7 +3817,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
// TODO Split on / and output with a price2num to have clean numbers without ton of 000.
$ret=$rate.($addpercent?'%':'');
}
if ($info_bits & 1) $ret.=' *';
if (($info_bits & 1) && $usestarfornpr >= 0) $ret.=' *';
$ret.=$morelabel;
return $ret;
}

View File

@ -1491,14 +1491,14 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
{
$tmpresult='';
$tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1);
$tmpresult.=vatrate($object->lines[$i]->tva_tx, 0, $object->lines[$i]->info_bits, -1);
if (empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX))
{
if ($object->lines[$i]->total_localtax1 != 0)
{
if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/';
else $tmpresult='';
$tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1);
$tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx), 0);
}
}
if (empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX))
@ -1507,9 +1507,10 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
{
if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/';
else $tmpresult='';
$tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx),1);
$tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx), 0);
}
}
$tmpresult.= '%';
$result.=$tmpresult;
}
@ -1820,6 +1821,8 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
*/
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
{
if (empty($hookmanager)) global $hookmanager;
$reshook=0;
$result='';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )

View File

@ -140,7 +140,7 @@ class pdf_einstein extends ModelePDFCommandes
}
else
{
$this->posxtva=112;
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
}
@ -431,8 +431,8 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
$pdf->SetXY($this->posxtva-5, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva+4, 3, $vat_rate, 0, 'R');
}
// Unit price before discount

View File

@ -125,7 +125,7 @@ class pdf_crabe extends ModelePDFFactures
}
else
{
$this->posxtva=112;
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
}
@ -496,8 +496,8 @@ class pdf_crabe extends ModelePDFFactures
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
$pdf->SetXY($this->posxtva-5, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva+4, 3, $vat_rate, 0, 'R');
}
// Unit price before discount

View File

@ -114,7 +114,7 @@ class pdf_azur extends ModelePDFPropales
}
else
{
$this->posxtva=112;
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
}
@ -505,8 +505,8 @@ class pdf_azur extends ModelePDFPropales
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R');
$pdf->SetXY($this->posxtva-5, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva+4, 3, $vat_rate, 0, 'R');
}
// Unit price before discount
@ -1312,6 +1312,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
if (empty($hidetop))
{
// Not do -3 and +3 instead of -1 -1 to have more space for text 'Sales tax'
$pdf->SetXY($this->posxtva-3, $tab_top+1);
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
}

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2015 Charlie Benke <charlies@patas-monkey.com>
@ -743,7 +743,8 @@ if (empty($reshook))
$parameters=array('id'=>$object->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{ $result=$object->updateExtraField($_POST["attribute"]);
{
$result=$object->insertExtraFields();
if ($result < 0)
{
$error++;

View File

@ -115,7 +115,7 @@ if ($action == 'order' && isset($_POST['valid']))
$suppliers = array();
for ($i = 0; $i < $linecount; $i++)
{
if (GETPOST($i, 'alpha') === 'on' && GETPOST('fourn' . $i, 'int') > 0)
if (GETPOST('choose' . $i, 'alpha') === 'on' && GETPOST('fourn' . $i, 'int') > 0)
{
//one line
$box = $i;
@ -616,7 +616,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
// Select field
//print '<td><input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td>';
print '<td><input type="checkbox" class="check" name="'.$i.'"></td>';
print '<td><input type="checkbox" class="check" name="choose'.$i.'"></td>';
print '<td class="nowrap">'.$prod->getNomUrl(1, '').'</td>';

View File

@ -269,7 +269,7 @@ input.select2-input {
.liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month],
.liste_titre input[name=month_lim] {
.liste_titre input[name=month_lim], .liste_titre input[name=month_create] {
margin-right: 4px;
}
input[type=submit] {

View File

@ -284,7 +284,7 @@ textarea.cke_source:focus
.liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month],
.liste_titre input[name=month_lim] {
.liste_titre input[name=month_lim], .liste_titre input[name=month_create] {
margin-right: 4px;
}
input, input.flat, textarea, textarea.flat, form.flat select, select, select.flat, .dataTables_length label select {