Fix travis

This commit is contained in:
John Botella 2019-06-24 14:36:06 +02:00
parent 9c414a7a57
commit ec7446762c
7 changed files with 40 additions and 40 deletions

View File

@ -4102,7 +4102,7 @@ elseif ($id > 0 || ! empty($ref))
// Check if this situation invoice is 100% for real // Check if this situation invoice is 100% for real
if(!empty($object->situation_final) && !empty($object->lines)){ if(!empty($object->situation_final) && !empty($object->lines)){
$displayWarranty = true; $displayWarranty = true;
foreach( $object->lines as $i => $line ){ foreach($object->lines as $i => $line){
if($line->product_type < 2 && $line->situation_percent < 100){ if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false; $displayWarranty = false;
break; break;
@ -4203,7 +4203,7 @@ elseif ($id > 0 || ! empty($ref))
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">'; print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input name="retained_warranty_date_limit" type="date" step="1" min="'.dol_print_date($object->date,'%Y-%m-%d' ).'" value="'.dol_print_date($defaultDate,'%Y-%m-%d' ).'" >'; print '<input name="retained_warranty_date_limit" type="date" step="1" min="'.dol_print_date($object->date, '%Y-%m-%d').'" value="'.dol_print_date($defaultDate, '%Y-%m-%d').'" >';
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>'; print '</form>';
} }
@ -4213,7 +4213,6 @@ elseif ($id > 0 || ! empty($ref))
} }
print '</td></tr>'; print '</td></tr>';
} }
} }

View File

@ -4387,8 +4387,8 @@ class Facture extends CommonInvoice
/** /**
* @return number or -1 if not available * @return number or -1 if not available
*/ */
function getRetainedWarrantyAmount() { public function getRetainedWarrantyAmount()
{
if(empty($this->retained_warranty) ){ if(empty($this->retained_warranty) ){
return -1; return -1;
} }
@ -4401,11 +4401,11 @@ class Facture extends CommonInvoice
$displayWarranty = true; $displayWarranty = true;
// Check if this situation invoice is 100% for real // Check if this situation invoice is 100% for real
if(!empty($this->lines)){ if(!empty($this->lines)){
foreach( $this->lines as $i => $line ){ foreach($this->lines as $i => $line ){
if($line->product_type < 2 && $line->situation_percent < 100){ if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false; $displayWarranty = false;
break; break;
} }
} }
} }
@ -4425,7 +4425,6 @@ class Facture extends CommonInvoice
else{ else{
return -1; return -1;
} }
} }
else else
{ {
@ -4442,7 +4441,7 @@ class Facture extends CommonInvoice
* @param float $value value of retained warranty * @param float $value value of retained warranty
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function setRetainedWarranty($value) public function setRetainedWarranty($value)
{ {
dol_syslog(get_class($this).'::setRetainedWarranty('.$value.')'); dol_syslog(get_class($this).'::setRetainedWarranty('.$value.')');
if ($this->statut >= 0) if ($this->statut >= 0)
@ -4476,17 +4475,18 @@ class Facture extends CommonInvoice
/** /**
* Change the retained_warranty_date_limit * Change the retained_warranty_date_limit
* *
* @param timestamp $value value of retained warranty * @param int $timestamp date limit of retained warranty in timestamp format
* @param string $dateYmd date limit of retained warranty in Y m d format
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function setRetainedWarrantyDateLimit($timestamp,$dateYmd=false) public function setRetainedWarrantyDateLimit($timestamp, $dateYmd = false)
{ {
if(!$timestamp && $dateYmd){ if(!$timestamp && $dateYmd){
$timestamp = $this->db->jdate($dateYmd); $timestamp = $this->db->jdate($dateYmd);
} }
dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit('.$value.')'); dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit('.$timestamp.')');
if ($this->statut >= 0) if ($this->statut >= 0)
{ {
$fieldname = 'retained_warranty_date_limit'; $fieldname = 'retained_warranty_date_limit';

View File

@ -916,7 +916,7 @@ if ($resql)
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['f.retained_warranty']['checked'])) print_liste_field_titre($arrayfields['f.retained_warranty']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.retained_warranty']['checked'])) print_liste_field_titre($arrayfields['f.retained_warranty']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
// Extra fields // Extra fields

View File

@ -2059,7 +2059,7 @@ abstract class CommonObject
* @param int $id Id of new payment terms * @param int $id Id of new payment terms
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function setRetainedWarrantyPaymentTerms($id) public function setRetainedWarrantyPaymentTerms($id)
{ {
dol_syslog(get_class($this).'::setRetainedWarrantyPaymentTerms('.$id.')'); dol_syslog(get_class($this).'::setRetainedWarrantyPaymentTerms('.$id.')');
if ($this->statut >= 0 || $this->element == 'societe') if ($this->statut >= 0 || $this->element == 'societe')

View File

@ -2216,8 +2216,7 @@ function pdf_getSizeForImage($realpath)
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string Return total of line excl tax * @return string Return total of line excl tax
*/ */
function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0)
function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails=0)
{ {
global $conf, $hookmanager; global $conf, $hookmanager;
$sign=1; $sign=1;
@ -2243,7 +2242,7 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails=0
$action=''; $action='';
if( $hookmanager->executeHooks('getlinetotalremise',$parameters,$object,$action)>0) if( $hookmanager->executeHooks('getlinetotalremise', $parameters, $object, $action)>0)
{ {
return $hookmanager->resPrint; // Note that $action and $object may have been modified by some hooks return $hookmanager->resPrint; // Note that $action and $object may have been modified by some hooks
} }

View File

@ -1349,10 +1349,12 @@ class pdf_crabe extends ModelePDFFactures
// Retained warranty // Retained warranty
if( !empty($object->situation_final) && ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) ) ) ) if( !empty($object->situation_final) && ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) ) ) )
{ {
$displayWarranty = false;
// Check if this situation invoice is 100% for real // Check if this situation invoice is 100% for real
if(!empty($object->lines)){ if(!empty($object->lines)){
$displayWarranty = true; $displayWarranty = true;
foreach( $object->lines as $i => $line ){ foreach($object->lines as $i => $line ){
if($line->product_type < 2 && $line->situation_percent < 100){ if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false; $displayWarranty = false;
break; break;
@ -1361,8 +1363,8 @@ class pdf_crabe extends ModelePDFFactures
} }
if($displayWarranty){ if($displayWarranty){
$pdf->SetTextColor(40,40,40); $pdf->SetTextColor(40, 40, 40);
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; $retainedWarranty = $object->total_ttc * $object->retained_warranty / 100;
$billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty ; $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty ;
@ -1373,7 +1375,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty) , $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1);
// retained warranty // retained warranty
$index++; $index++;
@ -1384,7 +1386,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty) , $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1);
} }
} }

View File

@ -1278,7 +1278,7 @@ class pdf_sponge extends ModelePDFFactures
foreach ($TPreviousIncoice as &$fac){ foreach ($TPreviousIncoice as &$fac){
if($posy > $this->page_hauteur - 4 ) { if($posy > $this->page_hauteur - 4 ) {
$this->_pagefoot($pdf,$object,$outputlangs,1); $this->_pagefoot($pdf, $object, $outputlangs, 1);
$pdf->addPage(); $pdf->addPage();
$pdf->setY($this->marge_haute); $pdf->setY($this->marge_haute);
$posy = $pdf->GetY(); $posy = $pdf->GetY();
@ -1286,11 +1286,11 @@ class pdf_sponge extends ModelePDFFactures
// cumul TVA précédent // cumul TVA précédent
$index++; $index++;
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy); $pdf->SetXY($col1x, $posy);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $fac->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $fac->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$pdf->SetXY($col2x,$posy); $pdf->SetXY($col2x, $posy);
$facSign = ''; $facSign = '';
if($i>1){ if($i>1){
@ -1306,15 +1306,14 @@ class pdf_sponge extends ModelePDFFactures
$posy += $tab2_hl; $posy += $tab2_hl;
$pdf->setY($posy); $pdf->setY($posy);
} }
// Display curent total // Display curent total
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy); $pdf->SetXY($col1x, $posy);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$pdf->SetXY($col2x,$posy); $pdf->SetXY($col2x, $posy);
$facSign = ''; $facSign = '';
if($i>1){ if($i>1){
$facSign = $object->total_ht>=0?'+':''; // gestion d'un cas particulier client $facSign = $object->total_ht>=0?'+':''; // gestion d'un cas particulier client
@ -1332,7 +1331,7 @@ class pdf_sponge extends ModelePDFFactures
// Display all total // Display all total
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy); $pdf->SetXY($col1x, $posy);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("SituationTotalProgress", $avancementGlobal), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("SituationTotalProgress", $avancementGlobal), 0, 'L', 1);
@ -1367,7 +1366,7 @@ class pdf_sponge extends ModelePDFFactures
} }
if($total_line_remise > 0) { if($total_line_remise > 0) {
if (! empty($conf->global->MAIN_SHOW_AMOUNT_DISCOUNT)) { if (! empty($conf->global->MAIN_SHOW_AMOUNT_DISCOUNT)) {
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl); $pdf->SetXY($col1x, $tab2_top + $tab2_hl);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl); $pdf->SetXY($col2x, $tab2_top + $tab2_hl);
@ -1377,7 +1376,7 @@ class pdf_sponge extends ModelePDFFactures
} }
// Show total NET before discount // Show total NET before discount
if (! empty($conf->global->MAIN_SHOW_AMOUNT_BEFORE_DISCOUNT)) { if (! empty($conf->global->MAIN_SHOW_AMOUNT_BEFORE_DISCOUNT)) {
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0); $pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + 0); $pdf->SetXY($col2x, $tab2_top + 0);
@ -1388,7 +1387,7 @@ class pdf_sponge extends ModelePDFFactures
} }
// Total HT // Total HT
$pdf->SetFillColor(255,255,255); $pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
@ -1417,7 +1416,7 @@ class pdf_sponge extends ModelePDFFactures
//{ //{
foreach($this->localtax1 as $localtax_type => $localtax_rate) foreach($this->localtax1 as $localtax_type => $localtax_rate)
{ {
if (in_array((string) $localtax_type, array('1','3','5'))) continue; if (in_array((string) $localtax_type, array('1', '3', '5'))) continue;
foreach($localtax_rate as $tvakey => $tvaval) foreach($localtax_rate as $tvakey => $tvaval)
{ {
@ -1637,6 +1636,7 @@ class pdf_sponge extends ModelePDFFactures
if( !empty($object->situation_final) && ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) ) ) ) if( !empty($object->situation_final) && ( $object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) ) ) )
{ {
$displayWarranty = false; $displayWarranty = false;
// Check if this situation invoice is 100% for real // Check if this situation invoice is 100% for real
if(!empty($object->situation_final)){ if(!empty($object->situation_final)){
$displayWarranty = true; $displayWarranty = true;
@ -1644,7 +1644,7 @@ class pdf_sponge extends ModelePDFFactures
elseif(!empty($object->lines) && $object->status == Facture::STATUS_DRAFT ){ elseif(!empty($object->lines) && $object->status == Facture::STATUS_DRAFT ){
// $object->situation_final need validation to be done so this test is need for draft // $object->situation_final need validation to be done so this test is need for draft
$displayWarranty = true; $displayWarranty = true;
foreach( $object->lines as $i => $line ){ foreach($object->lines as $i => $line ){
if($line->product_type < 2 && $line->situation_percent < 100){ if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false; $displayWarranty = false;
break; break;
@ -1665,7 +1665,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty) , $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1);
// retained warranty // retained warranty
$index++; $index++;
@ -1676,13 +1676,13 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty) , $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1);
} }
} }
} }
} }
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0, 0, 0);
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); $depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);