Skip to content

Commit

Permalink
Fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-john committed Jun 24, 2019
1 parent 9c414a7 commit ec74467
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
9 changes: 4 additions & 5 deletions htdocs/compta/facture/card.php
Expand Up @@ -4102,7 +4102,7 @@
// Check if this situation invoice is 100% for real
if(!empty($object->situation_final) && !empty($object->lines)){
$displayWarranty = true;
foreach( $object->lines as $i => $line ){
foreach($object->lines as $i => $line){
if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false;
break;
Expand Down Expand Up @@ -4136,7 +4136,7 @@
{
print price($object->retained_warranty).'%';
}
print '</td></tr>';
print '</td></tr>';

// Retained warranty payment term
print '<tr class="retained-warranty-lines" ><td>';
Expand Down Expand Up @@ -4174,7 +4174,7 @@
print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" ');
}
}
print '</td></tr>';
print '</td></tr>';



Expand Down Expand Up @@ -4203,7 +4203,7 @@
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'">';
print '<input type="hidden" name="action" value="setretainedwarrantydatelimit">';
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 '</form>';
}
Expand All @@ -4213,7 +4213,6 @@
}
print '</td></tr>';
}

}


Expand Down
18 changes: 9 additions & 9 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -4387,8 +4387,8 @@ public function hasDelay()
/**
* @return number or -1 if not available
*/
function getRetainedWarrantyAmount() {
public function getRetainedWarrantyAmount()
{
if(empty($this->retained_warranty) ){
return -1;
}
Expand All @@ -4401,11 +4401,11 @@ function getRetainedWarrantyAmount() {
$displayWarranty = true;
// Check if this situation invoice is 100% for real
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){
$displayWarranty = false;
break;
}
}
}
}

Expand All @@ -4425,7 +4425,6 @@ function getRetainedWarrantyAmount() {
else{
return -1;
}

}
else
{
Expand All @@ -4442,7 +4441,7 @@ function getRetainedWarrantyAmount() {
* @param float $value value of retained warranty
* @return int >0 if OK, <0 if KO
*/
function setRetainedWarranty($value)
public function setRetainedWarranty($value)
{
dol_syslog(get_class($this).'::setRetainedWarranty('.$value.')');
if ($this->statut >= 0)
Expand Down Expand Up @@ -4476,17 +4475,18 @@ function setRetainedWarranty($value)
/**
* 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
*/
function setRetainedWarrantyDateLimit($timestamp,$dateYmd=false)
public function setRetainedWarrantyDateLimit($timestamp, $dateYmd = false)
{
if(!$timestamp && $dateYmd){
$timestamp = $this->db->jdate($dateYmd);
}


dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit('.$value.')');
dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit('.$timestamp.')');
if ($this->statut >= 0)
{
$fieldname = 'retained_warranty_date_limit';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/list.php
Expand Up @@ -916,7 +916,7 @@
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_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['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder);
// Extra fields
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -2059,7 +2059,7 @@ public function setPaymentTerms($id)
* @param int $id Id of new payment terms
* @return int >0 if OK, <0 if KO
*/
function setRetainedWarrantyPaymentTerms($id)
public function setRetainedWarrantyPaymentTerms($id)
{
dol_syslog(get_class($this).'::setRetainedWarrantyPaymentTerms('.$id.')');
if ($this->statut >= 0 || $this->element == 'societe')
Expand Down
7 changes: 3 additions & 4 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -2216,8 +2216,7 @@ function pdf_getSizeForImage($realpath)
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @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;
$sign=1;
Expand All @@ -2243,7 +2242,7 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails=0

$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
}
Expand All @@ -2252,4 +2251,4 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails=0
if (empty($hidedetails) || $hidedetails > 1) return $sign * ( ($object->lines[$i]->subprice * $object->lines[$i]->qty) - $object->lines[$i]->total_ht );
}
return '';
}
}
12 changes: 7 additions & 5 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -1349,10 +1349,12 @@ private function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
// 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
if(!empty($object->lines)){
$displayWarranty = true;
foreach( $object->lines as $i => $line ){
foreach($object->lines as $i => $line ){
if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false;
break;
Expand All @@ -1361,8 +1363,8 @@ private function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
}

if($displayWarranty){
$pdf->SetTextColor(40,40,40);
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(40, 40, 40);
$pdf->SetFillColor(255, 255, 255);

$retainedWarranty = $object->total_ttc * $object->retained_warranty / 100;
$billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty ;
Expand All @@ -1373,7 +1375,7 @@ private function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
$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->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty) , $useborder, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1);

// retained warranty
$index++;
Expand All @@ -1384,7 +1386,7 @@ private function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)

$pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
$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);
}
}

Expand Down
30 changes: 15 additions & 15 deletions htdocs/core/modules/facture/doc/pdf_sponge.modules.php
Expand Up @@ -1278,19 +1278,19 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
foreach ($TPreviousIncoice as &$fac){

if($posy > $this->page_hauteur - 4 ) {
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf, $object, $outputlangs, 1);
$pdf->addPage();
$pdf->setY($this->marge_haute);
$posy = $pdf->GetY();
}

// cumul TVA précédent
$index++;
$pdf->SetFillColor(255,255,255);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy);
$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 = '';
if($i>1){
Expand All @@ -1306,15 +1306,14 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
$posy += $tab2_hl;

$pdf->setY($posy);

}

// Display curent total
$pdf->SetFillColor(255,255,255);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy);
$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 = '';
if($i>1){
$facSign = $object->total_ht>=0?'+':''; // gestion d'un cas particulier client
Expand All @@ -1332,7 +1331,7 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs

// Display all total
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetFillColor(255,255,255);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $posy);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("SituationTotalProgress", $avancementGlobal), 0, 'L', 1);

Expand Down Expand Up @@ -1367,7 +1366,7 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
}
if($total_line_remise > 0) {
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->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
Expand All @@ -1377,7 +1376,7 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
}
// Show total NET 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->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount"), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + 0);
Expand All @@ -1388,7 +1387,7 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
}

// Total HT
$pdf->SetFillColor(255,255,255);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);

Expand Down Expand Up @@ -1417,7 +1416,7 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
//{
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)
{
Expand Down Expand Up @@ -1637,14 +1636,15 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
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
if(!empty($object->situation_final)){
$displayWarranty = true;
}
elseif(!empty($object->lines) && $object->status == Facture::STATUS_DRAFT ){
// $object->situation_final need validation to be done so this test is need for draft
$displayWarranty = true;
foreach( $object->lines as $i => $line ){
foreach($object->lines as $i => $line ){
if($line->product_type < 2 && $line->situation_percent < 100){
$displayWarranty = false;
break;
Expand All @@ -1665,7 +1665,7 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs
$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->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty) , $useborder, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1);

// retained warranty
$index++;
Expand All @@ -1676,13 +1676,13 @@ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs

$pdf->MultiCell($col2x-$col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
$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);
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
Expand Down

0 comments on commit ec74467

Please sign in to comment.