Merge pull request #16232 from frederic34/paymentvat

use camelCaps name
This commit is contained in:
Laurent Destailleur 2021-02-09 13:29:40 +01:00 committed by GitHub
commit 89bda722bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 325 additions and 74 deletions

View File

@ -1749,7 +1749,7 @@ class Adherent extends CommonObject
if (!$error) { if (!$error) {
// Set invoice as paid // Set invoice as paid
$invoice->set_paid($user); $invoice->setPaid($user);
} }
} }

View File

@ -319,7 +319,7 @@ switch ($action)
&& $obj_facturation->getSetPaymentMode() != 'DIFF') && $obj_facturation->getSetPaymentMode() != 'DIFF')
{ {
// We set status to paid // We set status to paid
$result = $invoice->set_paid($user); $result = $invoice->setPaid($user);
//print 'set paid';exit; //print 'set paid';exit;
} }
} }

View File

@ -501,7 +501,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} elseif ($action == 'setremise' && $usercancreate) { } elseif ($action == 'setremise' && $usercancreate) {
$result = $object->set_remise($user, GETPOST('remise')); $result = $object->setDiscount($user, GETPOST('remise'));
if ($result < 0) if ($result < 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@ -607,7 +607,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} elseif ($action == 'setremisepercent' && $usercancreate) { } elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise($user, price2num(GETPOST('remise_percent'), 2)); $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) { } elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU')); $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha')) { } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha')) {

View File

@ -2359,6 +2359,8 @@ class Commande extends CommonOrder
/** /**
* Applique une remise relative * Applique une remise relative
* *
* @deprecated
* @see setDiscount()
* @param User $user User qui positionne la remise * @param User $user User qui positionne la remise
* @param float $remise Discount (percent) * @param float $remise Discount (percent)
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
@ -2367,6 +2369,20 @@ class Commande extends CommonOrder
public function set_remise($user, $remise, $notrigger = 0) public function set_remise($user, $remise, $notrigger = 0)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_remise is deprecated, use setDiscount instead", LOG_NOTICE);
return $this->setDiscount($user, $remise, $notrigger);
}
/**
* Applique une remise relative
*
* @param User $user User qui positionne la remise
* @param float $remise Discount (percent)
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK
*/
public function setDiscount($user, $remise, $notrigger = 0)
{
$remise = trim($remise) ?trim($remise) : 0; $remise = trim($remise) ?trim($remise) : 0;
if ($user->rights->commande->creer) if ($user->rights->commande->creer)

View File

@ -193,7 +193,7 @@ if (empty($reshook))
$result = $object->fetch($id); $result = $object->fetch($id);
if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
$result = $object->set_unpaid($user); $result = $object->setUnpaid($user);
if ($result > 0) { if ($result > 0) {
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
exit(); exit();
@ -483,7 +483,7 @@ if (empty($reshook))
$result = $object->setBankAccount(GETPOST('fk_account', 'int')); $result = $object->setBankAccount(GETPOST('fk_account', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) { } elseif ($action == 'setremisepercent' && $usercancreate) {
$object->fetch($id); $object->fetch($id);
$result = $object->set_remise($user, price2num(GETPOST('remise_percent'), 2)); $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
} elseif ($action == "setabsolutediscount" && $usercancreate) { } elseif ($action == "setabsolutediscount" && $usercancreate) {
// POST[remise_id] or POST[remise_id_for_payment] // POST[remise_id] or POST[remise_id_for_payment]
@ -747,7 +747,7 @@ if (empty($reshook))
elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercanissuepayment) elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercanissuepayment)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->setPaid($user);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} // Classif "paid partialy" } // Classif "paid partialy"
elseif ($action == 'confirm_paid_partially' && $confirm == 'yes' && $usercanissuepayment) elseif ($action == 'confirm_paid_partially' && $confirm == 'yes' && $usercanissuepayment)
@ -756,7 +756,7 @@ if (empty($reshook))
$close_code = GETPOST("close_code", 'restricthtml'); $close_code = GETPOST("close_code", 'restricthtml');
$close_note = GETPOST("close_note", 'restricthtml'); $close_note = GETPOST("close_note", 'restricthtml');
if ($close_code) { if ($close_code) {
$result = $object->set_paid($user, $close_code, $close_note); $result = $object->setPaid($user, $close_code, $close_note);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@ -767,7 +767,7 @@ if (empty($reshook))
$close_code = GETPOST("close_code", 'restricthtml'); $close_code = GETPOST("close_code", 'restricthtml');
$close_note = GETPOST("close_note", 'restricthtml'); $close_note = GETPOST("close_note", 'restricthtml');
if ($close_code) { if ($close_code) {
$result = $object->set_canceled($user, $close_code, $close_note); $result = $object->setCanceled($user, $close_code, $close_note);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
@ -921,7 +921,7 @@ if (empty($reshook))
{ {
if ($object->type != Facture::TYPE_DEPOSIT) { if ($object->type != Facture::TYPE_DEPOSIT) {
// Classe facture // Classe facture
$result = $object->set_paid($user); $result = $object->setPaid($user);
if ($result >= 0) if ($result >= 0)
{ {
$db->commit(); $db->commit();

View File

@ -910,7 +910,7 @@ class Invoices extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
$result = $this->invoice->set_paid(DolibarrApiAccess::$user, $close_code, $close_note); $result = $this->invoice->setPaid(DolibarrApiAccess::$user, $close_code, $close_note);
if ($result == 0) { if ($result == 0) {
throw new RestException(304, 'Error nothing done. May be object is already validated'); throw new RestException(304, 'Error nothing done. May be object is already validated');
} }
@ -960,7 +960,7 @@ class Invoices extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
$result = $this->invoice->set_unpaid(DolibarrApiAccess::$user); $result = $this->invoice->setUnpaid(DolibarrApiAccess::$user);
if ($result == 0) { if ($result == 0) {
throw new RestException(304, 'Nothing done'); throw new RestException(304, 'Nothing done');
} }
@ -1167,7 +1167,7 @@ class Invoices extends DolibarrApi
{ {
if ($this->invoice->type != Facture::TYPE_DEPOSIT) { if ($this->invoice->type != Facture::TYPE_DEPOSIT) {
// Classe facture // Classe facture
$result = $this->invoice->set_paid(DolibarrApiAccess::$user); $result = $this->invoice->setPaid(DolibarrApiAccess::$user);
if ($result >= 0) if ($result >= 0)
{ {
$this->db->commit(); $this->db->commit();

View File

@ -2293,6 +2293,8 @@ class Facture extends CommonInvoice
* Tag the invoice as paid completely (if close_code is filled) => this->fk_statut=2, this->paye=1 * Tag the invoice as paid completely (if close_code is filled) => this->fk_statut=2, this->paye=1
* or partialy (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 * or partialy (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
* *
* @deprecated
* @see setPaid()
* @param User $user Object user that modify * @param User $user Object user that modify
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple)
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple)
@ -2301,6 +2303,21 @@ class Facture extends CommonInvoice
public function set_paid($user, $close_code = '', $close_note = '') public function set_paid($user, $close_code = '', $close_note = '')
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
return $this->setPaid($user, $close_code, $close_note);
}
/**
* Tag the invoice as paid completely (if close_code is filled) => this->fk_statut=2, this->paye=1
* or partialy (if close_code filled) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
*
* @param User $user Object user that modify
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple)
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple)
* @return int <0 if KO, >0 if OK
*/
public function setPaid($user, $close_code = '', $close_note = '')
{
$error = 0; $error = 0;
if ($this->paye != 1) if ($this->paye != 1)
@ -2352,12 +2369,28 @@ class Facture extends CommonInvoice
* Fonction utilisee quand un paiement prelevement est refuse, * Fonction utilisee quand un paiement prelevement est refuse,
* ou quand une facture annulee et reouverte. * ou quand une facture annulee et reouverte.
* *
* @deprecated
* @see setUnpaid()
* @param User $user Object user that change status * @param User $user Object user that change status
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_unpaid($user) public function set_unpaid($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE);
return $this->setUnpaid($user);
}
/**
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
* Fonction utilisee quand un paiement prelevement est refuse,
* ou quand une facture annulee et reouverte.
*
* @param User $user Object user that change status
* @return int <0 if KO, >0 if OK
*/
public function setUnpaid($user)
{
$error = 0; $error = 0;
$this->db->begin(); $this->db->begin();
@ -2399,6 +2432,8 @@ class Facture extends CommonInvoice
* Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because
* of no payment even if merchandises were sent). * of no payment even if merchandises were sent).
* *
* @deprecated
* @see setCanceled()
* @param User $user Object user making change * @param User $user Object user making change
* @param string $close_code Code of closing invoice (CLOSECODE_REPLACED, CLOSECODE_...) * @param string $close_code Code of closing invoice (CLOSECODE_REPLACED, CLOSECODE_...)
* @param string $close_note Comment * @param string $close_note Comment
@ -2407,8 +2442,23 @@ class Facture extends CommonInvoice
public function set_canceled($user, $close_code = '', $close_note = '') public function set_canceled($user, $close_code = '', $close_note = '')
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_canceled is deprecated, use setCanceled instead", LOG_NOTICE);
return $this->setCanceled($user, $close_code, $close_note);
}
dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); /**
* Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL
* Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because
* of no payment even if merchandises were sent).
*
* @param User $user Object user making change
* @param string $close_code Code of closing invoice (CLOSECODE_REPLACED, CLOSECODE_...)
* @param string $close_note Comment
* @return int <0 if KO, >0 if OK
*/
public function setCanceled($user, $close_code = '', $close_note = '')
{
dol_syslog(get_class($this)."::setCanceled rowid=".$this->id, LOG_DEBUG);
$this->db->begin(); $this->db->begin();
@ -2542,7 +2592,7 @@ class Facture extends CommonInvoice
return -12; return -12;
} }
$result = $facreplaced->set_canceled($user, self::CLOSECODE_REPLACED, ''); $result = $facreplaced->setCanceled($user, self::CLOSECODE_REPLACED, '');
if ($result < 0) if ($result < 0)
{ {
$this->error = $facreplaced->error; $this->error = $facreplaced->error;
@ -3567,6 +3617,8 @@ class Facture extends CommonInvoice
/** /**
* Set percent discount * Set percent discount
* *
* @deprecated
* @see setDiscount()
* @param User $user User that set discount * @param User $user User that set discount
* @param double $remise Discount * @param double $remise Discount
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
@ -3575,6 +3627,20 @@ class Facture extends CommonInvoice
public function set_remise($user, $remise, $notrigger = 0) public function set_remise($user, $remise, $notrigger = 0)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_remise is deprecated, use setDiscount instead", LOG_NOTICE);
return $this->setDiscount($user, $remise, $notrigger);
}
/**
* Set percent discount
*
* @param User $user User that set discount
* @param double $remise Discount
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
*/
public function setDiscount($user, $remise, $notrigger = 0)
{
// Clean parameters // Clean parameters
if (empty($remise)) $remise = 0; if (empty($remise)) $remise = 0;

View File

@ -788,7 +788,7 @@ class RemiseCheque extends CommonObject
{ {
$invoice = new Facture($this->db); $invoice = new Facture($this->db);
$invoice->fetch($obj->fk_facture); $invoice->fetch($obj->fk_facture);
$invoice->set_unpaid($user); $invoice->setUnpaid($user);
$rejectedPayment->amounts[$obj->fk_facture] = price2num($obj->amount) * -1; $rejectedPayment->amounts[$obj->fk_facture] = price2num($obj->amount) * -1;
} }

View File

@ -398,7 +398,7 @@ class Paiement extends CommonObject
// Set invoice to paid // Set invoice to paid
if (!$error) if (!$error)
{ {
$result = $invoice->set_paid($user, '', ''); $result = $invoice->setPaid($user, '', '');
if ($result < 0) if ($result < 0)
{ {
$this->error = $invoice->error; $this->error = $invoice->error;

View File

@ -375,7 +375,7 @@ class BonPrelevement extends CommonObject
dol_syslog(get_class($this)."::set_credite set_paid fac ".$facs[$i]); dol_syslog(get_class($this)."::set_credite set_paid fac ".$facs[$i]);
$fac = new Facture($this->db); $fac = new Facture($this->db);
$fac->fetch($facs[$i]); $fac->fetch($facs[$i]);
$result = $fac->set_paid($user); $result = $fac->setPaid($user);
} }
} }
@ -482,7 +482,7 @@ class BonPrelevement extends CommonObject
// @TODO Move this after creation of payment // @TODO Move this after creation of payment
if (price2num($alreadypayed + $facs[$i][1], 'MT') == $fac->total_ttc) { if (price2num($alreadypayed + $facs[$i][1], 'MT') == $fac->total_ttc) {
$result = $fac->set_paid($user); $result = $fac->setPaid($user);
if ($result < 0) { if ($result < 0) {
$this->error = $fac->error; $this->error = $fac->error;
$this->errors = $fac->errors; $this->errors = $fac->errors;

View File

@ -184,7 +184,7 @@ class RejetPrelevement
//Tag invoice as unpaid //Tag invoice as unpaid
dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref); dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref);
$fac->set_unpaid($user); $fac->setUnpaid($user);
//TODO: Must be managed by notifications module //TODO: Must be managed by notifications module
// Send email to sender of the standing order request // Send email to sender of the standing order request

View File

@ -74,14 +74,14 @@ $object = new ChargeSociales($db);
if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes') if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->setPaid($user);
} }
if ($action == 'reopen' && $user->rights->tax->charges->creer) { if ($action == 'reopen' && $user->rights->tax->charges->creer) {
$result = $object->fetch($id); $result = $object->fetch($id);
if ($object->paye) if ($object->paye)
{ {
$result = $object->set_unpaid($user); $result = $object->setUnpaid($user);
if ($result > 0) if ($result > 0)
{ {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);

View File

@ -432,12 +432,26 @@ class ChargeSociales extends CommonObject
/** /**
* Tag social contribution as paid completely * Tag social contribution as paid completely
* *
* @deprecated
* @see setPaid()
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_paid($user) public function set_paid($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
return $this->setPaid($user);
}
/**
* Tag social contribution as paid completely
*
* @param User $user Object user making change
* @return int <0 if KO, >0 if OK
*/
public function setPaid($user)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
$sql .= " paye = 1"; $sql .= " paye = 1";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
@ -450,12 +464,26 @@ class ChargeSociales extends CommonObject
/** /**
* Remove tag paid on social contribution * Remove tag paid on social contribution
* *
* @deprecated
* @see setUnpaid()
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_unpaid($user) public function set_unpaid($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE);
return $this->setUnpaid($user);
}
/**
* Remove tag paid on social contribution
*
* @param User $user Object user making change
* @return int <0 if KO, >0 if OK
*/
public function setUnpaid($user)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
$sql .= " paye = 0"; $sql .= " paye = 0";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;

View File

@ -197,7 +197,7 @@ class PaymentSocialContribution extends CommonObject
$remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT'); $remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
if ($remaintopay == 0) if ($remaintopay == 0)
{ {
$result = $contrib->set_paid($user); $result = $contrib->setPaid($user);
} else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); } else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
} }
} }

View File

@ -111,14 +111,14 @@ if ($action == 'setbankaccount' && $user->rights->tax->charges->creer) {
if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes') if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->setPaid($user);
} }
if ($action == 'reopen' && $user->rights->tax->charges->creer) { if ($action == 'reopen' && $user->rights->tax->charges->creer) {
$result = $object->fetch($id); $result = $object->fetch($id);
if ($object->paye) if ($object->paye)
{ {
$result = $object->set_unpaid($user); $result = $object->setUnpaid($user);
if ($result > 0) if ($result > 0)
{ {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);

View File

@ -194,7 +194,7 @@ class PaymentVAT extends CommonObject
$remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT'); $remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
if ($remaintopay == 0) if ($remaintopay == 0)
{ {
$result = $contrib->set_paid($user); $result = $contrib->setPaid($user);
} }
else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
} }

View File

@ -246,14 +246,14 @@ class Tva extends CommonObject
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_paid($user) public function setPaid($user)
{ {
// phpcs:enable // phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."tva SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."tva SET";
$sql .= " paye = 1"; $sql .= " paye = 1";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
$return = $this->db->query($sql); $resql = $this->db->query($sql);
if ($return) return 1; if ($resql) return 1;
else return -1; else return -1;
} }
@ -263,14 +263,14 @@ class Tva extends CommonObject
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_unpaid($user) public function setUnpaid($user)
{ {
// phpcs:enable // phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."tva SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."tva SET";
$sql .= " paye = 0"; $sql .= " paye = 0";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
$return = $this->db->query($sql); $resql = $this->db->query($sql);
if ($return) return 1; if ($resql) return 1;
else return -1; else return -1;
} }

View File

@ -307,7 +307,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG);
if ($totalonlinkedelements == $object->total_ht) { if ($totalonlinkedelements == $object->total_ht) {
foreach ($object->linkedObjects['reception'] as $element) { foreach ($object->linkedObjects['reception'] as $element) {
$ret = $element->set_billed(); $ret = $element->setBilled();
} }
} }
} }

View File

@ -255,7 +255,7 @@ if ($action == 'set_cancel') {
} }
if ($action == 'set_paid') { if ($action == 'set_paid') {
$object->fetch($id); $object->fetch($id);
if ($object->set_paid($id, $modepayment) >= 0) { if ($object->setPaid($id, $modepayment) >= 0) {
$action = ''; $action = '';
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');

View File

@ -761,6 +761,8 @@ class Don extends CommonObject
/** /**
* Classify the donation as paid, the donation was received * Classify the donation as paid, the donation was received
* *
* @deprecated
* @see setPaid()
* @param int $id id of donation * @param int $id id of donation
* @param int $modepayment mode of payment * @param int $modepayment mode of payment
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@ -768,6 +770,19 @@ class Don extends CommonObject
public function set_paid($id, $modepayment = 0) public function set_paid($id, $modepayment = 0)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
return $this->setPaid($id, $modepayment);
}
/**
* Classify the donation as paid, the donation was received
*
* @param int $id id of donation
* @param int $modepayment mode of payment
* @return int <0 if KO, >0 if OK
*/
public function setPaid($id, $modepayment = 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2"; $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
if ($modepayment) if ($modepayment)
{ {

View File

@ -523,7 +523,7 @@ if (empty($reshook))
} elseif ($action == 'classifybilled') } elseif ($action == 'classifybilled')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_billed(); $result = $object->setBilled();
if ($result >= 0) { if ($result >= 0) {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit(); exit();

View File

@ -2307,11 +2307,24 @@ class Expedition extends CommonObject
/** /**
* Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on) * Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on)
* *
* @deprecated
* @see setBilled()
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
public function set_billed() public function set_billed()
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_billed is deprecated, use setBilled instead", LOG_NOTICE);
return $this->setBilled();
}
/**
* Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on)
*
* @return int <0 if ko, >0 if ok
*/
public function setBilled()
{
global $user; global $user;
$error = 0; $error = 0;

View File

@ -953,7 +953,7 @@ if (empty($reshook))
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
$result = $object->set_unpaid($user); $result = $object->setUnpaid($user);
if ($result > 0) if ($result > 0)
{ {
@ -981,7 +981,7 @@ if (empty($reshook))
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($id, $user); $result = $object->setPaid($id, $user);
if ($result > 0) if ($result > 0)
{ {

View File

@ -637,6 +637,8 @@ class ExpenseReport extends CommonObject
/** /**
* Classify the expense report as paid * Classify the expense report as paid
* *
* @deprecated
* @see setPaid()
* @param int $id Id of expense report * @param int $id Id of expense report
* @param user $fuser User making change * @param user $fuser User making change
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
@ -645,6 +647,20 @@ class ExpenseReport extends CommonObject
public function set_paid($id, $fuser, $notrigger = 0) public function set_paid($id, $fuser, $notrigger = 0)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
return $this->setPaid($id, $fuser, $notrigger);
}
/**
* Classify the expense report as paid
*
* @param int $id Id of expense report
* @param user $fuser User making change
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
public function setPaid($id, $fuser, $notrigger = 0)
{
$error = 0; $error = 0;
$this->db->begin(); $this->db->begin();
@ -1492,6 +1508,8 @@ class ExpenseReport extends CommonObject
/** /**
* set_unpaid * set_unpaid
* *
* @deprecated
* @see setUnpaid()
* @param User $fuser User * @param User $fuser User
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@ -1499,6 +1517,19 @@ class ExpenseReport extends CommonObject
public function set_unpaid($fuser, $notrigger = 0) public function set_unpaid($fuser, $notrigger = 0)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE);
return $this->setUnpaid($fuser, $notrigger);
}
/**
* set_unpaid
*
* @param User $fuser User
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
public function setUnpaid($fuser, $notrigger = 0)
{
$error = 0; $error = 0;
if ($this->paid) if ($this->paid)

View File

@ -144,7 +144,7 @@ if ($action == 'add_payment')
if (!$error) { if (!$error) {
$payment->fetch($paymentid); $payment->fetch($paymentid);
if ($expensereport->total_ttc - $payment->amount == 0) { if ($expensereport->total_ttc - $payment->amount == 0) {
$result = $expensereport->set_paid($expensereport->id, $user); $result = $expensereport->setPaid($expensereport->id, $user);
if (!$result > 0) { if (!$result > 0) {
setEventMessages($payment->error, $payment->errors, 'errors'); setEventMessages($payment->error, $payment->errors, 'errors');
$error++; $error++;

View File

@ -1250,6 +1250,8 @@ class FactureFournisseur extends CommonInvoice
/** /**
* Tag invoice as a paid invoice * Tag invoice as a paid invoice
* *
* @deprecated
* @see setPaid()
* @param User $user Object user * @param User $user Object user
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet. * @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
* @param string $close_note Comment informs if the class has been paid while payment is incomplete. Not implementd yet. * @param string $close_note Comment informs if the class has been paid while payment is incomplete. Not implementd yet.
@ -1258,6 +1260,20 @@ class FactureFournisseur extends CommonInvoice
public function set_paid($user, $close_code = '', $close_note = '') public function set_paid($user, $close_code = '', $close_note = '')
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
return $this->setPaid($user, $close_code, $close_note);
}
/**
* Tag invoice as a paid invoice
*
* @param User $user Object user
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
* @param string $close_note Comment informs if the class has been paid while payment is incomplete. Not implementd yet.
* @return int <0 si ko, >0 si ok
*/
public function setPaid($user, $close_code = '', $close_note = '')
{
global $conf, $langs; global $conf, $langs;
$error = 0; $error = 0;
@ -1291,8 +1307,24 @@ class FactureFournisseur extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Tag the invoice as not fully paid + trigger call BILL_UNPAYED
* Function used when a direct debit payment is refused,
* or when the invoice was canceled and reopened.
*
* @deprecated
* @see setUnpaid()
* @param User $user Object user that change status
* @return int <0 si ok, >0 si ok
*/
public function set_unpaid($user)
{
// phpcs:enable
dol_syslog(get_class($this)."::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE);
return $this->setUnpaid($user);
}
/** /**
* Tag the invoice as not fully paid + trigger call BILL_UNPAYED * Tag the invoice as not fully paid + trigger call BILL_UNPAYED
* Function used when a direct debit payment is refused, * Function used when a direct debit payment is refused,
@ -1301,9 +1333,8 @@ class FactureFournisseur extends CommonInvoice
* @param User $user Object user that change status * @param User $user Object user that change status
* @return int <0 si ok, >0 si ok * @return int <0 si ok, >0 si ok
*/ */
public function set_unpaid($user) public function setUnpaid($user)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
$error = 0; $error = 0;

View File

@ -241,7 +241,7 @@ class PaiementFourn extends Paiement
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
if ($remaintopay == 0) if ($remaintopay == 0)
{ {
$result = $invoice->set_paid($user, '', ''); $result = $invoice->setPaid($user, '', '');
} else dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing."); } else dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing.");
} }

View File

@ -277,7 +277,7 @@ if (empty($reshook))
$discount->unlink_invoice(); $discount->unlink_invoice();
} elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercancreate) { } elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercancreate) {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->setPaid($user);
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
@ -605,7 +605,7 @@ if (empty($reshook))
{ {
if ($object->type != FactureFournisseur::TYPE_DEPOSIT) { if ($object->type != FactureFournisseur::TYPE_DEPOSIT) {
// Classe facture // Classe facture
$result = $object->set_paid($user); $result = $object->setPaid($user);
if ($result >= 0) if ($result >= 0)
{ {
$db->commit(); $db->commit();
@ -1545,7 +1545,7 @@ if (empty($reshook))
if ($object->statut == FactureFournisseur::STATUS_CLOSED if ($object->statut == FactureFournisseur::STATUS_CLOSED
|| ($object->statut == FactureFournisseur::STATUS_ABANDONED && $object->close_code != 'replaced')) || ($object->statut == FactureFournisseur::STATUS_ABANDONED && $object->close_code != 'replaced'))
{ {
$result = $object->set_unpaid($user); $result = $object->setUnpaid($user);
if ($result > 0) if ($result > 0)
{ {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);

View File

@ -67,7 +67,7 @@ if (empty($reshook))
if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->loan->write) if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->loan->write)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->setPaid($user);
if ($result > 0) if ($result > 0)
{ {
setEventMessages($langs->trans('LoanPaid'), null, 'mesgs'); setEventMessages($langs->trans('LoanPaid'), null, 'mesgs');

View File

@ -379,12 +379,26 @@ class Loan extends CommonObject
/** /**
* Tag loan as paid completely * Tag loan as paid completely
* *
* @deprecated
* @see setPaid()
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_paid($user) public function set_paid($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
return $this->setPaid($user);
}
/**
* Tag loan as paid completely
*
* @param User $user Object user making change
* @return int <0 if KO, >0 if OK
*/
public function setPaid($user)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
$sql .= " paid = ".$this::STATUS_PAID; $sql .= " paid = ".$this::STATUS_PAID;
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
@ -399,14 +413,28 @@ class Loan extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Tag loan as payement started * Tag loan as payment started
* *
* @deprecated
* @see setStarted()
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_started($user) public function set_started($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_started is deprecated, use setStarted instead", LOG_NOTICE);
return $this->setStarted($user);
}
/**
* Tag loan as payment started
*
* @param User $user Object user making change
* @return int <0 if KO, >0 if OK
*/
public function setStarted($user)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
$sql .= " paid = ".$this::STATUS_STARTED; $sql .= " paid = ".$this::STATUS_STARTED;
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
@ -422,13 +450,26 @@ class Loan extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Tag loan as payement as unpaid * Tag loan as payement as unpaid
* * @deprecated
* @see setUnpaid()
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function set_unpaid($user) public function set_unpaid($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_unpaid is deprecated, use setUnpaid instead", LOG_NOTICE);
return $this->setUnpaid($user);
}
/**
* Tag loan as payement as unpaid
*
* @param User $user Object user making change
* @return int <0 if KO, >0 if OK
*/
public function setUnpaid($user)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."loan SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."loan SET";
$sql .= " paid = ".$this::STATUS_UNPAID; $sql .= " paid = ".$this::STATUS_UNPAID;
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;

View File

@ -377,8 +377,7 @@ class PaymentLoan extends CommonObject
if ($sum_payment == 0) if ($sum_payment == 0)
{ {
dol_syslog(get_class($this)."::delete : set loan to unpaid", LOG_DEBUG); dol_syslog(get_class($this)."::delete : set loan to unpaid", LOG_DEBUG);
if ($loan->set_unpaid($user) < 1) if ($loan->setUnpaid($user) < 1) {
{
$error++; $error++;
dol_print_error($this->db); dol_print_error($this->db);
} }
@ -532,7 +531,7 @@ class PaymentLoan extends CommonObject
if ($loan->paid == $loan::STATUS_UNPAID) if ($loan->paid == $loan::STATUS_UNPAID)
{ {
dol_syslog(get_class($this)."::addPaymentToBank : set loan payment to started", LOG_DEBUG); dol_syslog(get_class($this)."::addPaymentToBank : set loan payment to started", LOG_DEBUG);
if ($loan->set_started($user) < 1) if ($loan->setStarted($user) < 1)
{ {
$error++; $error++;
dol_print_error($this->db); dol_print_error($this->db);

View File

@ -506,7 +506,7 @@ if (empty($reshook))
} elseif ($action == 'classifybilled') } elseif ($action == 'classifybilled')
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_billed(); $result = $object->setBilled();
if ($result >= 0) { if ($result >= 0) {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit(); exit();

View File

@ -1551,11 +1551,24 @@ class Reception extends CommonObject
/** /**
* Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on) * Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on)
* *
* @deprecated
* @see setBilled()
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
public function set_billed() public function set_billed()
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::set_billed is deprecated, use setBilled instead", LOG_NOTICE);
return $this->setBilled();
}
/**
* Classify the reception as invoiced (used when WORKFLOW_BILL_ON_RECEPTION is on)
*
* @return int <0 if ko, >0 if ok
*/
public function setBilled()
{
global $user; global $user;
$error = 0; $error = 0;

View File

@ -270,7 +270,7 @@ if ($action == 'valid' && $user->rights->facture->creer)
if ($remaintopay == 0) { if ($remaintopay == 0) {
dol_syslog("Invoice is paid, so we set it to status Paid"); dol_syslog("Invoice is paid, so we set it to status Paid");
$result = $invoice->set_paid($user); $result = $invoice->setPaid($user);
if ($result > 0) $invoice->paye = 1; if ($result > 0) $invoice->paye = 1;
// set payment method // set payment method
$invoice->setPaymentMethods($paiementid); $invoice->setPaymentMethods($paiementid);

View File

@ -778,15 +778,15 @@ function updateInvoice($authentication, $invoice)
} }
} }
if ($invoice['status'] == Facture::STATUS_CLOSED) { if ($invoice['status'] == Facture::STATUS_CLOSED) {
$result = $object->set_paid($fuser, $invoice['close_code'], $invoice['close_note']); $result = $object->setPaid($fuser, $invoice['close_code'], $invoice['close_note']);
}
if ($invoice['status'] == Facture::STATUS_ABANDONED) {
$result = $object->setCanceled($fuser, $invoice['close_code'], $invoice['close_note']);
} }
if ($invoice['status'] == Facture::STATUS_ABANDONED)
$result = $object->set_canceled($fuser, $invoice['close_code'], $invoice['close_note']);
} }
} }
if ((!$error) && ($objectfound)) if ((!$error) && ($objectfound)) {
{
$db->commit(); $db->commit();
$objectresp = array( $objectresp = array(
'result'=>array('result_code'=>'OK', 'result_label'=>''), 'result'=>array('result_code'=>'OK', 'result_label'=>''),
@ -794,9 +794,7 @@ function updateInvoice($authentication, $invoice)
'ref'=>$object->ref, 'ref'=>$object->ref,
'ref_ext'=>$object->ref_ext 'ref_ext'=>$object->ref_ext
); );
} } elseif ($objectfound) {
elseif ($objectfound)
{
$db->rollback(); $db->rollback();
$error++; $error++;
$errorcode = 'KO'; $errorcode = 'KO';

View File

@ -174,7 +174,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase
/** /**
* testChargeSocialesValid * testChargeSocialesValid
* *
* @param Object $localobject Social contribution * @param ChargeSociales $localobject Social contribution
* @return void * @return void
* *
* @depends testChargeSocialesFetch * @depends testChargeSocialesFetch
@ -188,7 +188,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase
$langs=$this->savlangs; $langs=$this->savlangs;
$db=$this->savdb; $db=$this->savdb;
$result=$localobject->set_paid($user); $result=$localobject->setPaid($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n"; print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
@ -198,7 +198,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase
/** /**
* testChargeSocialesOther * testChargeSocialesOther
* *
* @param Object $localobject Social contribution * @param ChargeSociales $localobject Social contribution
* @return void * @return void
* *
* @depends testChargeSocialesValid * @depends testChargeSocialesValid

View File

@ -189,7 +189,7 @@ class LoanTest extends PHPUnit\Framework\TestCase
$langs=$this->savlangs; $langs=$this->savlangs;
$db=$this->savdb; $db=$this->savdb;
$result=$localobject->set_paid($user); $result=$localobject->setPaid($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n"; print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);