add transfer unstorno
This commit is contained in:
@@ -4,7 +4,7 @@ return [
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'infoEmail' => 'info@rocho-net.hu',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.63',
|
||||
'version' => 'v0.0.64',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
|
||||
@@ -960,6 +960,36 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
|
||||
ShoppingCart::deleteAll(['id_transfer' => $this->id_transfer]);
|
||||
UserSoldItem::deleteAll(['id_transfer' => $this->id_transfer]);
|
||||
}
|
||||
|
||||
public function unstorono(){
|
||||
|
||||
if ($this->type != Transfer::TYPE_TICKET) {
|
||||
throw new NotAcceptableHttpException("Csak bérletet lehet visszaállítani");
|
||||
}
|
||||
|
||||
$this->status = Transfer::STATUS_NOT_PAID;
|
||||
$this->paid_at = null;
|
||||
$this->paid_by = null;
|
||||
$this->save ( false );
|
||||
|
||||
$ticket = $this->ticket;
|
||||
$ticket->status = Ticket::STATUS_ACTIVE;
|
||||
|
||||
$ticket->save ( false );
|
||||
|
||||
TicketInstallmentRequest::updateAll ( [
|
||||
'status' => TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL
|
||||
], [
|
||||
'id_ticket' => $ticket->id_ticket
|
||||
] );
|
||||
|
||||
|
||||
$item = new ShoppingCart();
|
||||
$item->id_customer = $this->id_customer;
|
||||
$item->id_transfer = $this->id_transfer;
|
||||
$item->save(false);
|
||||
}
|
||||
|
||||
public function payout($id_account = null) {
|
||||
|
||||
if ($this->status != Transfer::STATUS_NOT_PAID) {
|
||||
|
||||
Reference in New Issue
Block a user