mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 03:12:35 +01:00
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -2573,7 +2573,6 @@ if ($action == 'create' && $usercancreate)
|
||||
if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=shipped">'.$langs->trans('ClassifyShipped').'</a></div>';
|
||||
}
|
||||
|
||||
// Create bill and Classify billed
|
||||
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
|
||||
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
|
||||
|
||||
@@ -745,6 +745,10 @@ class Commande extends CommonOrder
|
||||
if ($usercanclose)
|
||||
{
|
||||
$this->db->begin();
|
||||
if ($this->statut == self::STATUS_CLOSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
@@ -2882,6 +2886,10 @@ class Commande extends CommonOrder
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
if ($this->billed)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1';
|
||||
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;
|
||||
|
||||
@@ -164,21 +164,19 @@ class RejetPrelevement
|
||||
$pai->paiementid = 3; // type of payment: withdrawal
|
||||
$pai->num_payment = $fac->ref;
|
||||
|
||||
if ($pai->create($this->user) < 0) // we call with no_commit
|
||||
{
|
||||
if ($pai->create($this->user) < 0) {
|
||||
// we call with no_commit
|
||||
$error++;
|
||||
dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]);
|
||||
} else {
|
||||
$result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', '');
|
||||
if ($result < 0)
|
||||
{
|
||||
if ($result < 0) {
|
||||
dol_syslog("RejetPrelevement::Create AddPaymentToBan Error");
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Payment validation
|
||||
if ($pai->validate($user) < 0)
|
||||
{
|
||||
if ($pai->validate($user) < 0) {
|
||||
$error++;
|
||||
dol_syslog("RejetPrelevement::Create Error payment validation");
|
||||
}
|
||||
@@ -264,8 +262,7 @@ class RejetPrelevement
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $this->user->email, '', $trackid);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
dol_syslog("RejetPrelevement::_send_email email envoye");
|
||||
} else {
|
||||
dol_syslog("RejetPrelevement::_send_email Erreur envoi email");
|
||||
@@ -308,8 +305,9 @@ class RejetPrelevement
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
if (!$amounts) $arr[$i] = $row[0];
|
||||
else {
|
||||
if (!$amounts) {
|
||||
$arr[$i] = $row[0];
|
||||
} else {
|
||||
$arr[$i] = array(
|
||||
$row[0],
|
||||
$row[1]
|
||||
@@ -346,9 +344,9 @@ class RejetPrelevement
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $rowid;
|
||||
$this->date_rejet = $this->db->jdate($obj->dr);
|
||||
$this->motif = $this->motifs[$obj->motif];
|
||||
$this->id = $rowid;
|
||||
$this->date_rejet = $this->db->jdate($obj->dr);
|
||||
$this->motif = $this->motifs[$obj->motif];
|
||||
$this->invoicing = $this->facturer[$obj->afacturer];
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
@@ -2192,7 +2192,7 @@ class ExpenseReport extends CommonObject
|
||||
$modele = $conf->global->EXPENSEREPORT_ADDON_PDF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($modele)) {
|
||||
$modelpath = "core/modules/expensereport/doc/";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user