add reception key changes, add money movent storno, status display

This commit is contained in:
2016-01-22 19:10:30 +01:00
parent a2a6b1f240
commit 027a96790a
24 changed files with 220 additions and 25 deletions

View File

@@ -60,6 +60,8 @@ class CardSearch extends Card
$query->select(['card.id_card as card_id_card', 'card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone']);
$query->from('card');
$query->innerJoin('customer','card.id_card = customer.id_customer_card');
$query->leftJoin("card_key_assignment", 'card.id_card = card_key_assignment.id_card');
$query->leftJoin("key", 'key.id_key = card_key_assignment.id_key');
$query->orderBy(['customer.name' => SORT_ASC]);
@@ -77,9 +79,18 @@ class CardSearch extends Card
return $dataProvider;
}
$query->andFilterWhere([
// 'lower(customer.name)' => $this->customerName
]);
// $query->andFilterWhere([
// 'lower(card.number)' => $this->customerName
// ]);
if ( !empty($this->number)){
$query->andWhere(['or',
['and',[ 'in','card.number' , [$this->number]],"trim(coalesce(card.number, '')) <>'' " ],
['and', ['in','card.rfid_key' ,[ $this->number] ],"trim(coalesce(card.rfid_key, '')) <>'' "],
['and',[ 'in','key.number' , [$this->number]],"trim(coalesce(key.number, '')) <>'' " ],
['and', ['in','key.rfid_key' ,[ $this->number] ],"trim(coalesce(key.rfid_key, '')) <>'' "]
]);
}
$query->andFilterWhere(['like', 'customer.name', $this->customerName]);

View File

@@ -152,7 +152,7 @@ class MoneyMovement extends \yii\db\ActiveRecord
public static function toStatusName($id_status){
$result = "Ismeretlen";
$statuses = Ticket::statuses();
$statuses = MoneyMovement::statuses();
if ( array_key_exists($id_status, $statuses)){
$result = $statuses[$id_status];
}

View File

@@ -5,6 +5,7 @@ namespace common\models;
use Yii;
use yii\helpers\ArrayHelper;
use yii\behaviors\TimestampBehavior;
use common\components\Helper;
/**
* This is the model class for table "ticket_installment_request".
@@ -25,6 +26,9 @@ use yii\behaviors\TimestampBehavior;
* @property string $request_target_time_at
* @property string $created_at
* @property string $updated_at
* @property string $detsta_answer
* @property string $comment
* @property string $updated_at
* @property common\components\giro\GiroDETSTATetel $detstaTetel GiroDetstaTetel record a DetSta fájlból
*/
class TicketInstallmentRequest extends \yii\db\ActiveRecord
@@ -144,6 +148,7 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
$this->status = $status;
$tranfer = $this->addTransfer();
$this->id_transfer = $tranfer->id_transfer;
$this->request_processed_at = Helper::getDateTimeString();
$this->save(false);
$this->applyNewTicketState($partRequired);
return true;
@@ -152,6 +157,9 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
}
}else{
$this->status = $status;
$this->detsta_answer = $visszajelzes;
$this->comment = $comment;
$this->request_processed_at = Helper::getDateTimeString();
$this->save(false);
$this->applyNewTicketState($partRequired);
return true;

View File

@@ -580,6 +580,8 @@ class Transfer extends \common\models\BaseFitnessActiveRecord
$query->andFilterWhere(['in' ,'transfer.type', $types]);
$query->andWhere(['not in','transfer.status', Transfer::STATUS_STORNO]);
if ( $mode == 'created_at'){
self::inInterval($query, 'transfer.created_at', $start, $end);

View File

@@ -207,7 +207,7 @@ class TransferTicketSearch extends Transfer
protected function readTickets(){
$query = (new \yii\db\Query());
$query->select([ 'customer.name as customer_name', 'user.username as user_name', 'account.name as account_name','ticket_type.name as ticket_type_name' , 'transfer.count AS ticket_count', 'transfer.money AS ticket_money','transfer.item_price AS ticket_item_price', 'transfer.created_at as ticket_created_at','transfer.paid_at as ticket_paid_at']);
$query->select([ 'ticket.id_ticket as ticket_id_ticket', 'customer.name as customer_name', 'user.username as user_name', 'account.name as account_name','ticket_type.name as ticket_type_name' ,'ticket.status as ticket_status', 'transfer.count AS ticket_count', 'transfer.money AS ticket_money','transfer.item_price AS ticket_item_price', 'transfer.created_at as ticket_created_at','transfer.paid_at as ticket_paid_at']);
$query->from('transfer');
$query->andWhere(['transfer.type' => Transfer::TYPE_TICKET]);
$query->innerJoin("ticket", "ticket.id_ticket = transfer.id_object");