Merge branch '9.0' of https://github.com/dolibarr/dolibarr into develop

This commit is contained in:
Laurent Destailleur 2019-05-18 02:27:23 +02:00
commit 26d4875f8f
5 changed files with 7 additions and 6 deletions

View File

@ -73,10 +73,10 @@ class Invoices extends DolibarrApi
}
// Get payment details
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
$this->invoice->totalpaid = $this->invoice->getSommePaiement();
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
$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->remaintopay = price2num($this->invoice->total_ttc - $this->invoice->totalpaid - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);

View File

@ -96,7 +96,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
}
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;

View File

@ -145,8 +145,8 @@ function user_prepare_head($object)
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))
|| (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id)
|| (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id )
|| (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->read_all))
)
{
// Bank

View File

@ -301,7 +301,7 @@ class pdf_beluga extends ModelePDFProjects
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire,
'lang'=>'order'),
'lang'=>'orders'),
'invoice'=>array(
'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",

View File

@ -408,6 +408,7 @@ class Dolresource extends CommonObject
public function delete($rowid, $notrigger = 0)
{
global $user,$langs,$conf;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;