Refactored supplier invoice line view to fit commonobjectline view
This commit is contained in:
parent
47a151f157
commit
174f1cb5f7
@ -2686,7 +2686,9 @@ abstract class CommonObject
|
|||||||
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0,$permtoedit=0)
|
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0,$permtoedit=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user,$object,$hookmanager;
|
global $conf,$langs,$user,$object,$hookmanager;
|
||||||
global $form,$bc,$bcdd;
|
global $form,$bc,$bcdd, $object_rights;
|
||||||
|
|
||||||
|
$object_rights = $this->getRights();
|
||||||
|
|
||||||
$element=$this->element;
|
$element=$this->element;
|
||||||
|
|
||||||
@ -3727,4 +3729,16 @@ abstract class CommonObject
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the rights used for this class
|
||||||
|
* @return stdClass
|
||||||
|
*/
|
||||||
|
public function getRights()
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
return $user->rights->{$this->element};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,7 @@ if (empty($usemargins)) $usemargins=0;
|
|||||||
|
|
||||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
|
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
|
||||||
|
|
||||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ht)?price($line->pu_ht):price($line->subprice)); ?></td>
|
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->pu_ht); ?></td>
|
||||||
|
|
||||||
<?php if ($inputalsopricewithtax) { ?>
|
<?php if ($inputalsopricewithtax) { ?>
|
||||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td>
|
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td>
|
||||||
@ -173,7 +173,7 @@ if (empty($usemargins)) $usemargins=0;
|
|||||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td>
|
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ($this->statut == 0 && ($user->rights->$element->creer || $permtoedit)) { ?>
|
<?php if ($this->statut == 0 && ($object_rights->creer)) { ?>
|
||||||
<td align="center"><?php $coldisplay++; ?>
|
<td align="center"><?php $coldisplay++; ?>
|
||||||
<?php if (($line->info_bits & 2) == 2) { ?>
|
<?php if (($line->info_bits & 2) == 2) { ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user