From c8e3ef6754442afcd0f610cb41892d96cc17ccb9 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Mon, 6 Feb 2017 08:20:18 +0100 Subject: [PATCH 1/2] Add property reception show stock. --- common/components/Helper.php | 93 ++++++++++++++++----- common/components/giro/GiroBeszed.php | 3 - common/config/params.php | 2 + frontend/controllers/ContractController.php | 2 +- frontend/models/ContractForm.php | 4 +- frontend/models/ProductSaleForm.php | 4 +- frontend/views/product/_view.php | 9 ++ 7 files changed, 91 insertions(+), 26 deletions(-) diff --git a/common/components/Helper.php b/common/components/Helper.php index 4d6f2b9..1f70149 100644 --- a/common/components/Helper.php +++ b/common/components/Helper.php @@ -2,6 +2,7 @@ namespace common\components; +use common\models\Transfer; use \Yii; class Helper { @@ -11,10 +12,13 @@ class Helper { // $days_between = $this->calcStartDaysSinceToday(); return $days_between > $days_visiblity; } - - /** - * @param string $start the date string, format "datetime => "Y-m-d H:i", "date => "Y-m-d" - * */ + + /** + * Calculate time until today. + * @param string $start the date string, format "datetime => "Y-m-d H:i", "date => "Y-m-d" + * @param string $format the format of date + * @return float the days between start and today. + */ public static function calcStartDatimeDaysSinceToday($start, $format = "datetime" ){ $now = time(); @@ -31,15 +35,20 @@ class Helper { return $days_between; } - - - /** - * Leellenőriz egy dátumot. Ha az aktuális felhasználó nem admin, - * akkor a params[reception_visibility_days] napnál korábbi , vagy null - * dátumot e params-ban megadott dátumra állítjuk - * - * - * */ + + + /** + * Leellenőriz egy dátumot. Ha az aktuális felhasználó nem admin, + * akkor a params[reception_visibility_days] napnál korábbi , vagy null + * dátumot e params-ban megadott dátumra állítjuk + * + * + * @param \yii\db\Query $query + * @param string $date + * @param string[] array $fields + * @param string string $format + * @return null + */ public static function restrictIfNotAdminTheStartDate($query,$date, $fields = ['transfer.paid_at','transfer.created_at'], $format = 'datetime'){ $result = null; @@ -110,7 +119,14 @@ class Helper { $result = round ( $m / 5, 0 ) * 5; return $result; } - public static function notInInterval($query, $field, $start, $end) { + + /** + * @param \yii\db\Query $query + * @param $field + * @param $start + * @param $end + */ + public static function notInInterval($query, $field, $start, $end) { $query->andFilterWhere ( [ 'or', [ @@ -125,7 +141,14 @@ class Helper { ] ] ); } - public static function notPaid($query, $field, $start, $end) { + + /** + * @param \yii\db\Query $query the query + * @param string $field the field name + * @param string $start the start date + * @param string $end the end date + */ + public static function notPaid($query, $field, $start, $end) { $query->andFilterWhere ( [ 'or', [ @@ -143,6 +166,13 @@ class Helper { ] ] ); } + + /** + * @param \yii\db\Query $query the query + * @param string $field the field name + * @param string $start the start date + * @param string $end the end date + */ public static function inInterval($query, $field, $start, $end) { $query->andFilterWhere ( [ '>=', @@ -155,6 +185,13 @@ class Helper { $end ] ); } + + /** + * @param string $field the field name + * @param string $start the start date + * @param string $end the end date + * @return array the query 'in interval' rule + */ public static function queryInIntervalRule($field, $start, $end) { return [ 'and', @@ -208,13 +245,28 @@ class Helper { public static function sqlInIntervalRule($field, $paramStart, $paramEnd) { return ' ' . $field . ' >= ' . $paramStart . ' and ' . $field . ' < ' . $paramEnd; } - public static function sqlExpireRule($field_start, $field_end, $paramStart, $paramEnd) { + + /** + * @noinspection PhpUnusedParameterInspection + * + * @param $field_start + * @param $field_endsqlExpireRulesqlExpireRule + * @param $paramStart + * @param $paramEnd + * @return string + */ + public static function sqlExpireRule($field_start, $field_end, $paramStart, $paramEnd) { return ' ' . $field_start . ' < ' . $paramEnd . ' and ' . $field_end . ' < ' . $paramEnd; } public static function sqlValidRule($field_start, $field_end, $paramStart, $paramEnd) { return ' ' . $field_start . ' < ' . $paramEnd . ' and ' . $field_end . ' >=' . $paramStart; } - public static function queryAccountConstraint($query, $field) { + + /** + * @param \yii\db\Query $query the query + * @param string $field the field name + */ + public static function queryAccountConstraint($query, $field) { if (! RoleDefinition::isAdmin ()) { $query->innerJoin ( "user_account_assignment", $field . ' = user_account_assignment.id_account' ); $query->andWhere ( [ @@ -315,8 +367,11 @@ class Helper { public static function getReceptionVisibilityDays() { return \Yii::$app->params ['reception_visibility_days'] ; } - - + + public static function isReceptionShowStock() { + return \Yii::$app->params ['reception_show_stock'] ; + } + public static function isTicketCreatePriceEditable() { return \Yii::$app->params ['ticket_create_price_editable'] == true ; } diff --git a/common/components/giro/GiroBeszed.php b/common/components/giro/GiroBeszed.php index 3708cdc..8a17da2 100644 --- a/common/components/giro/GiroBeszed.php +++ b/common/components/giro/GiroBeszed.php @@ -82,11 +82,8 @@ class GiroBeszed extends GiroBase { $tetel->tetelSorszam = $request->number; $tetel->terhelesiDatum = $terhelesiDatum; $tetel->osszeg = $request->money; -// $tetel->kotelezettBankszamla->bankszerv = "58600252"; $tetel->kotelezettBankszamla->szamlaszam = $customer->bank_account; $tetel->ugyfelazonositoAKezdemenyezonel = $customer->id_customer; -// $tetel->ugyfelNeve = "Schneider Roland"; -// $tetel->ugyfelCime = "Mosonmagyarovar, Gardonyi 31"; $tetel->szamlaTulajdonosNeve = $customer->name; $tetel->kozlemeny = "Fitness berlet. Megbizas azon: " . $request->id_ticket_installment_request; diff --git a/common/config/params.php b/common/config/params.php index 4dd5988..53147e8 100644 --- a/common/config/params.php +++ b/common/config/params.php @@ -33,6 +33,8 @@ return [ 'reception_account_state_index_only_today' => false, 'reception_transfer_list_only_today' => false, + 'reception_show_stock' => true, + 'backend_skin' => 'skin-red', //skin-green /**User cart module on/off*/ 'user_cart_on' => true, diff --git a/frontend/controllers/ContractController.php b/frontend/controllers/ContractController.php index b520b57..8970686 100644 --- a/frontend/controllers/ContractController.php +++ b/frontend/controllers/ContractController.php @@ -285,6 +285,7 @@ class ContractController extends Controller { 'id' => $contract->id_contract ] ); } + public function actionMake($id) { $customer = Customer::findOne ( $id ); @@ -301,7 +302,6 @@ class ContractController extends Controller { $model->started_at = date(date('Y.m.d')); - $model->fillOut (); if ($model->load ( Yii::$app->request->post () ) && $model->validate ()) { diff --git a/frontend/models/ContractForm.php b/frontend/models/ContractForm.php index f42f33c..92c45af 100644 --- a/frontend/models/ContractForm.php +++ b/frontend/models/ContractForm.php @@ -133,7 +133,7 @@ class ContractForm extends Model { ], [ [ - 'ticket_type' + 'ticket_type' ], 'validateTicketType' ] , @@ -154,7 +154,7 @@ class ContractForm extends Model { public function validateTicketType($attribute, $params) { $this->ticketType = TicketType::findOne ( $this->ticket_type ); - if (! isset ( $this->ticketType )) { + if (! isset ( $this->ticketType ) ) { $this->addError ( $attribute, "Bérlet típus nem található" ); }else{ $contracts = Contract::find() diff --git a/frontend/models/ProductSaleForm.php b/frontend/models/ProductSaleForm.php index 7553a9a..02dfddc 100644 --- a/frontend/models/ProductSaleForm.php +++ b/frontend/models/ProductSaleForm.php @@ -203,7 +203,9 @@ class ProductSaleForm extends Model $paid_at = date('Y-m-d H:i:s' ) ; } - $this->transfer = Transfer::createProductTransfer($this->sale,$this->account, $this->discount, $this->currency, $this->count, $this->product,$status,$customer); + $this->transfer = Transfer::createProductTransfer($this->sale, $this->account, $this->discount, + $this->currency, $this->count, + $this->product,$status,$customer); $this->transfer->payment_method = $this->payment_method; if ( isset($this->comment)){ $this->transfer->comment = $this->comment; diff --git a/frontend/views/product/_view.php b/frontend/views/product/_view.php index ab6247c..cc64e7c 100644 --- a/frontend/views/product/_view.php +++ b/frontend/views/product/_view.php @@ -25,6 +25,7 @@ + @@ -37,6 +38,14 @@ 1 + + + + + + 1 + + From fb67171e711880f6214a5f5710dfe3d80e8c2b4b Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Tue, 7 Feb 2017 22:25:26 +0100 Subject: [PATCH 2/2] change version to v.0.0.97 --- changelog.txt | 2 ++ common/config/params.php | 2 +- .../sslforfree.com - fintessadmin.hu.ssl.zip | Bin 0 -> 5502 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 common/data/sslforfree.com - fintessadmin.hu.ssl.zip diff --git a/changelog.txt b/changelog.txt index 59cf5e5..4edc3ee 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,5 @@ +-0.0.97 + - frontend - add property to hide/show stock on reception > product form -0.0.96 - add asset compress -0.0.95 diff --git a/common/config/params.php b/common/config/params.php index 53147e8..3817db6 100644 --- a/common/config/params.php +++ b/common/config/params.php @@ -5,7 +5,7 @@ return [ 'supportEmail' => 'rocho02@gmail.com', 'infoEmail' => 'info@rocho-net.hu', 'user.passwordResetTokenExpire' => 3600, - 'version' => 'v0.0.96', + 'version' => 'v0.0.97', 'company' => 'movar',//gyor 'company_name' => "Freimann Kft.", 'product_visiblity' => 'account',// on reception which products to display. account or global diff --git a/common/data/sslforfree.com - fintessadmin.hu.ssl.zip b/common/data/sslforfree.com - fintessadmin.hu.ssl.zip new file mode 100644 index 0000000000000000000000000000000000000000..a960cf6955abdf5826cfb9674863a4cc28318fdc GIT binary patch literal 5502 zcma)=Nz<#`R>zNCn<^}Ia>v%aRnAfxLX(ie9c*CJgeG*M8)(sm9s(qx(ehL1XV9r5 zzn=Sf&fA>#ylP2`O4vsG$AL8X-|4I6X-~aiSFCXV$qqZa) zpXI$wqG$H^$@u)ckAsDxtpARKmLm%?2ORj>ifOVe2ph+N{VoTy%z|9D!TBmuyiSQZ zJ8y+()m*B$ofT;S7dd+nZ8;`+6SCZV1DFQ;h1`rtxPl?t8Y$=tLq2-s_2##ihf4Vl233}s#3 zEfa7Vm2}Dt*imC1TM!!6qTQcSuM^QG9_XM|_-EJ!{np->V84|*=CmT&FMG2*vsvSF zY!EcAXB$Sz83Depd|_yeN*MD*dUiFDJ+JL9&^J}18#~8u#~K?YSL;Mtei(gbM{8ef z0~vEpJ@F?^%u{YOCX;6NPBpA|Ct#F#E49{J!Lkm*%PVl~+M0B%F>Jy_^`fYy-1wO? z62al|97Vg>=s{oF;yB0$1VTtaL6^8J?T z(Uw=;TL)2y@VMLXx*1?f%=!>TFMr~|3;~F)90tnUoab_(0ZIgiTguOn-OnaOQ7QC1 zNIxE@WZ$4rfg79WBb!5kH4`3~fvn5{i?QZSLW5`iBl0ZV0j9KPfjomBCz})$a`V>a z=Zxz~h`hh&Pih$@u6Y}nCze07S(-m5S1g;)LJw{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