Tab vs space
This commit is contained in:
parent
9c6b6f244c
commit
74a34acf77
@ -60,30 +60,30 @@ class Invoices extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function get($id)
|
function get($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->invoice->fetch($id);
|
$result = $this->invoice->fetch($id);
|
||||||
if( ! $result ) {
|
if (! $result) {
|
||||||
throw new RestException(404, 'Invoice not found');
|
throw new RestException(404, 'Invoice not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get payment details
|
// Get payment details
|
||||||
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
|
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
|
||||||
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
|
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
|
||||||
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
|
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
|
||||||
$this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
|
$this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
if (! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->invoice->fetchObjectLinked();
|
$this->invoice->fetchObjectLinked();
|
||||||
return $this->_cleanObjectDatas($this->invoice);
|
return $this->_cleanObjectDatas($this->invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List invoices
|
* List invoices
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user