diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index e9ad42858aa..ac92dcab195 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -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; } } diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 8ed6657e7e6..f8f8d37ce17 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -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" diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 42dbdbf9d2c..46ac4cf0327 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -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; + } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b81da82adce..230a855bafc 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -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) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dbd1832aeb4..c43ecf9d038 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 8a445625022..90d28b7d559 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -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) ) ) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index e5a22c62867..f5ab606f404 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -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 diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 3617a130c68..cdff9317446 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -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 diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 913f1e3bc29..0c9a39a3fea 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -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'); } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 87ff0adfafa..52c23f551d2 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002-2007 Rodolphe Quiedeville * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin - * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Ferran Marcet * Copyright (C) 2014-2015 Charlie Benke @@ -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++; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 2811ccce891..b959eebeb2d 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -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 ''; - print ''; + print ''; print ''.$prod->getNomUrl(1, '').''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e7a3480b992..1941c1a397f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -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] { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e29b3a7c9d3..c5577469182 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -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 {