Commit 8dd2a2a4 by Damien Moulard

ccas: mark refund transaction as ccas if base transaction is ccas

parent 5ec6fb59
...@@ -294,6 +294,11 @@ class UserController extends AbstractController ...@@ -294,6 +294,11 @@ class UserController extends AbstractController
$flux->setMontant($montant); $flux->setMontant($montant);
$flux->setMoyen(MoyenEnum::MOYEN_EMLC); $flux->setMoyen(MoyenEnum::MOYEN_EMLC);
// The flux to cancel a ccas flux is also marked as ccas
if ($this->getParameter('ccas_mode')) {
$flux->setIsCcas($transactionAdherentPrestataire->getIsCcas());
}
$now = (new \Datetime('now'))->format('d/m/Y H:i:s'); $now = (new \Datetime('now'))->format('d/m/Y H:i:s');
$flux->setReference( $flux->setReference(
'Remboursement en Monnaie Solidaire du ' . $now . ' annule ' . $transactionAdherentPrestataire->getReference() 'Remboursement en Monnaie Solidaire du ' . $now . ' annule ' . $transactionAdherentPrestataire->getReference()
......
...@@ -31,6 +31,13 @@ class Transaction extends Flux ...@@ -31,6 +31,13 @@ class Transaction extends Flux
const TYPE_TRANSACTION_PRESTATAIRE_ADHERENT = 'prestataire_adherent'; const TYPE_TRANSACTION_PRESTATAIRE_ADHERENT = 'prestataire_adherent';
const TYPE_TRANSACTION_PRESTATAIRE_PRESTATAIRE = 'prestataire_prestataire'; const TYPE_TRANSACTION_PRESTATAIRE_PRESTATAIRE = 'prestataire_prestataire';
/**
* A transaction is marked as CCAS if both parties are CCAS complient.
*
* @ORM\Column(type="boolean", options={"default": false})
*/
protected $isCcas = false;
public static function getAvailableTypes(): array public static function getAvailableTypes(): array
{ {
return [ return [
...@@ -84,4 +91,16 @@ class Transaction extends Flux ...@@ -84,4 +91,16 @@ class Transaction extends Flux
{ {
return []; return [];
} }
public function getIsCcas(): ?bool
{
return $this->isCcas;
}
public function setIsCcas(bool $isCcas): self
{
$this->isCcas = $isCcas;
return $this;
}
} }
...@@ -38,11 +38,6 @@ class TransactionAdherentPrestataire extends Transaction ...@@ -38,11 +38,6 @@ class TransactionAdherentPrestataire extends Transaction
protected $cancellerFlux; protected $cancellerFlux;
/** /**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isCcas = false;
/**
* @return string * @return string
*/ */
public function getType(): string public function getType(): string
...@@ -60,16 +55,4 @@ class TransactionAdherentPrestataire extends Transaction ...@@ -60,16 +55,4 @@ class TransactionAdherentPrestataire extends Transaction
public function setCancellerFlux($var) {$this->cancellerFlux = $var;} public function setCancellerFlux($var) {$this->cancellerFlux = $var;}
public function getCancellerFlux() {return $this->cancellerFlux;} public function getCancellerFlux() {return $this->cancellerFlux;}
public function getIsCcas(): ?bool
{
return $this->isCcas;
}
public function setIsCcas(bool $isCcas): self
{
$this->isCcas = $isCcas;
return $this;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment