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

Conflicts:
	ChangeLog
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
	htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/product/doc/pdf_standard.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
	htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
	htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
	htdocs/filefunc.inc.php
This commit is contained in:
Laurent Destailleur
2019-05-09 12:27:14 +02:00
15 changed files with 157 additions and 349 deletions

View File

@@ -3,7 +3,6 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
For Users:
NEW: Module "Ticket" is available as a stable module.
@@ -38,6 +37,38 @@ Following changes may create regressions for some external modules, but were nec
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
FIX: #11013
FIX: #11041
FIX: actioncomm: sort events by date after external calendars and hook (into 7.0)
FIX: better test
FIX: Combo list was limited to 20 in stock correction
FIX: Confusion between expired and late
FIX: Cursor pointer in payment screen for autofill
FIX: CVE-2019-11199
FIX: CVE-2019-11200
FIX: CVE-2019-11201
FIX: Default value on form to send email
FIX: error messages not displayed
FIX: Massive debug in lettering function
FIX: missing compatibility with multicompany
FIX: missing global $user
FIX: missing situation invoice in list
FIX: MultiEntity in lettering functionality
FIX: Product accountancey sell intra code must be visible if main feature level 1
FIX: ref for table without ref manager are set to NULL.
FIX: Sending email to mass actions send same email on same customer
FIX: Several fixes on import of services/products
FIX: shipping default warehouse if only one warehouse
FIX: sortfield on lettering function
FIX: Status of opportunity should never be -1
FIX: test to display create invoice button on supplier_order card
FIX: The autocopy feature was ko for suppliers
FIX: Total per day in timespent per week
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
FIX: Update/delete currency on same languages
FIX: Wrong variable name make contact of supplier order not used on PDF.
***** ChangeLog for 9.0.2 compared to 9.0.1 *****
FIX: #10822
FIX: Accountancy - Format EBP import

View File

@@ -55,17 +55,6 @@ $langs->loadLangs(array("main","bills","cashdesk"));
onfocus="javascript: this.select();" />
</td>
<td class="select_design maxwidthonsmartphone">
<?php /*
$selected='';
$htmlname='idprod';
$status=-1;
$rice_level=$company->price_level;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
if (! $hidelabel) print $langs->trans("RefOrLabel").' : ';
print '<input type="text" size="4" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'" />';
*/
?>
<select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');">
<?php
print '<option value="0">'.$top_liste_produits.'</option>'."\n";

View File

@@ -1898,8 +1898,10 @@ class Form
// phpcs:enable
global $langs,$conf;
// check parameters
$price_level = (! empty($price_level) ? $price_level : 0);
if (is_null($ajaxoptions)) $ajaxoptions=array();
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
{
$placeholder='';

View File

@@ -180,6 +180,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
$this->posxdiscount=162;
$this->postotalht=174;
@@ -314,14 +315,16 @@ class pdf_einstein extends ModelePDFCommandes
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@@ -476,15 +479,7 @@ class pdf_einstein extends ModelePDFCommandes
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@@ -1190,22 +1185,14 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
if($conf->global->PRODUCT_USE_UNITS) {
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
'C');
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
}
}

View File

@@ -356,15 +356,6 @@ class pdf_eratosthene extends ModelePDFCommandes
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
}
// New page
$pdf->AddPage();

View File

@@ -949,7 +949,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxqty-1, $tab_top+1);
$pdf->MultiCell($this->postotalttc-$this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'R');
$pdf->MultiCell($this->postotalttc-$this->posxqty - 1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
// Total with all taxes

View File

@@ -191,9 +191,11 @@ class pdf_crabe extends ModelePDFFactures
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
$this->posxprogress=151; // Only displayed for situation invoices
$this->posxdiscount=162;
$this->posxprogress=174;
$this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
@@ -363,14 +365,16 @@ class pdf_crabe extends ModelePDFFactures
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS)) // retreive space not used by discount
if (empty($this->atleastonediscount)) // retreive space not used by discount
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->posxprogress - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
$progress_width = 0;
@@ -378,15 +382,14 @@ class pdf_crabe extends ModelePDFFactures
if ($object->situation_cycle_ref)
{
$this->situationinvoice = true;
$progress_width = 18;
$progress_width = 10;
$this->posxpicture -= $progress_width;
$this->posxtva -= $progress_width;
$this->posxup -= $progress_width;
$this->posxqty -= $progress_width;
if (empty($conf->global->PRODUCT_USE_UNITS)) {
$this->posxunit -= $progress_width;
}
/*$this->posxdiscount -= $progress_width;
$this->posxprogress -= $progress_width;*/
$this->posxunit -= $progress_width;
$this->posxdiscount -= $progress_width;
$this->posxprogress -= $progress_width;
}
// New page
@@ -567,38 +570,7 @@ class pdf_crabe extends ModelePDFFactures
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if ($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
elseif($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
// Situation progress
if ($this->situationinvoice)
{
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxprogress, $curY);
if (! empty($conf->global->PRODUCT_USE_UNITS))
{
$pdf->MultiCell($this->posxunit-$this->posxprogress-1, 3, $progress, 0, 'R');
}
elseif ($this->atleastonediscount)
{
$pdf->MultiCell($this->posxdiscount-$this->posxprogress-1, 3, $progress, 0, 'R');
}
else
{
$pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R');
}
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if (! empty($conf->global->PRODUCT_USE_UNITS))
@@ -613,7 +585,15 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->SetXY($this->posxdiscount-2, $curY);
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
}
// Situation progress
if ($this->situationinvoice)
{
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell($this->postotalht-$this->posxprogress-1, 3, $progress, 0, 'R');
}
// Total HT line
@@ -1525,66 +1505,37 @@ class pdf_crabe extends ModelePDFFactures
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
elseif($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
if ($this->situationinvoice) {
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxprogress, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxprogress, 2, $outputlangs->transnoentities("%"), '', 'C');
}
elseif ($this->atleastonediscount)
{
$pdf->MultiCell($this->posxdiscount-$this->posxprogress, 2, $outputlangs->transnoentities("%"), '', 'C');
}
else
{
$pdf->MultiCell($this->postotalht-$this->posxprogress, 2, $outputlangs->transnoentities("%"), '', 'C');
}
}
}
if($conf->global->PRODUCT_USE_UNITS) {
if (! empty($conf->global->PRODUCT_USE_UNITS))
{
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
'C');
}
}
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if (empty($hidetop))
{
if ($this->atleastonediscount)
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C');
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
}
}
if ($this->atleastonediscount)
{
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
}
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxdiscount-1, $tab_top+1);
$pdf->MultiCell($this->posxprogress-$this->posxdiscount+1, 2, $outputlangs->transnoentities("ReductionShort"),'','C');
}
}
if ($this->situationinvoice) {
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxprogress, $tab_top+1);
$pdf->MultiCell($this->postotalht-$this->posxprogress, 2, $outputlangs->transnoentities("ProgressShort"), '', 'C');
}
}
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->postotalht-1, $tab_top+1);

View File

@@ -320,7 +320,7 @@ class pdf_standard extends ModelePDFProduct
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
$tab_top = 88;
$pdf->SetFont('', '', $default_font_size - 1);
@@ -423,15 +423,7 @@ class pdf_standard extends ModelePDFProduct
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@@ -669,14 +661,7 @@ class pdf_standard extends ModelePDFProduct
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"),'','C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@@ -115,7 +115,7 @@ class pdf_azur extends ModelePDFPropales
/**
* Issuer
* @var Company object that emits
* @var Societe object that emits
*/
public $emetteur;
@@ -179,6 +179,7 @@ class pdf_azur extends ModelePDFPropales
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
$this->posxdiscount=162;
$this->postotalht=174;
@@ -368,14 +369,16 @@ class pdf_azur extends ModelePDFPropales
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@@ -449,7 +452,7 @@ class pdf_azur extends ModelePDFPropales
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
@@ -574,15 +577,7 @@ class pdf_azur extends ModelePDFPropales
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@@ -1395,14 +1390,7 @@ class pdf_azur extends ModelePDFPropales
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@@ -637,89 +637,11 @@ class pdf_standard extends ModelePDFStock
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// VAT Rate
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');
}
// Unit price before discount
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0);
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
// Unit
if($conf->global->PRODUCT_USE_UNITS)
{
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
$pdf->SetXY($this->posxunit, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxunit-0.8, 4, $unit, 0, 'L');
}
// Discount on line
$pdf->SetXY($this->posxdiscount, $curY);
if ($object->lines[$i]->remise_percent)
{
$pdf->SetXY($this->posxdiscount-2, $curY);
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
}
// Total HT line
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
$localtax2_rate=$object->lines[$i]->localtax2_tx;
$localtax1_type=$object->lines[$i]->localtax1_type;
$localtax2_type=$object->lines[$i]->localtax2_type;
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
// Retrieve type from database for backward compatibility with old records
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
{
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc);
$localtax1_type = $localtaxtmp_array[0];
$localtax2_type = $localtaxtmp_array[2];
}
// retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0)
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2_type && $localtax2ligne != 0)
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))

View File

@@ -153,6 +153,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->posxtva=112;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
$this->posxdiscount=162;
$this->postotalht=174;
@@ -302,14 +303,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@@ -447,15 +450,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@@ -470,7 +465,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if ($object->lines[$i]->remise_percent)
{
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent."%", 0, 'R');
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R');
}
// Total HT line
@@ -892,14 +887,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
if($conf->global->PRODUCT_USE_UNITS) {

View File

@@ -159,7 +159,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->emetteur=$mysoc;
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
// Defini position des colonnes
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
$this->posxdiscount=162;
$this->postotalht=174;
@@ -174,6 +174,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->posxtva=110;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference
@@ -350,14 +351,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@@ -526,15 +529,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@@ -1077,22 +1072,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
if($conf->global->PRODUCT_USE_UNITS) {
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
'C');
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
}
}

View File

@@ -171,6 +171,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxtva=102;
$this->posxup=126;
$this->posxqty=145;
$this->posxunit=162;
}
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva;
@@ -339,14 +340,16 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->atleastonediscount++;
}
}
if (empty($this->atleastonediscount) && empty($conf->global->PRODUCT_USE_UNITS))
if (empty($this->atleastonediscount))
{
$this->posxpicture+=($this->postotalht - $this->posxdiscount);
$this->posxtva+=($this->postotalht - $this->posxdiscount);
$this->posxup+=($this->postotalht - $this->posxdiscount);
$this->posxqty+=($this->postotalht - $this->posxdiscount);
$this->posxdiscount+=($this->postotalht - $this->posxdiscount);
//$this->postotalht;
$delta = ($this->postotalht - $this->posxdiscount);
$this->posxpicture+=$delta;
$this->posxtva+=$delta;
$this->posxup+=$delta;
$this->posxqty+=$delta;
$this->posxunit+=$delta;
$this->posxdiscount+=$delta;
// post of fields after are not modified, stay at same position
}
// New page
@@ -382,7 +385,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
@@ -519,15 +522,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
// Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 3, $qty, 0, 'R');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R'); // Enough for 6 chars
// Unit
if($conf->global->PRODUCT_USE_UNITS)
@@ -1236,22 +1231,14 @@ class pdf_aurore extends ModelePDFSupplierProposal
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
else
{
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
$pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C');
}
if($conf->global->PRODUCT_USE_UNITS) {
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '',
'C');
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
}
}

View File

@@ -835,6 +835,7 @@ RelatedObjects=Related Objects
ClassifyBilled=Classify billed
ClassifyUnbilled=Classify unbilled
Progress=Progress
ProgressShort=Progr.
FrontOffice=Front office
BackOffice=Back office
View=View

View File

@@ -20,8 +20,7 @@
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
if (empty($conf) || ! is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}