diff --git a/changelog.txt b/changelog.txt index 9dee88a..fdaae47 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +-0.0.49 + - contract - add started_at + - receptions/account-state/mixed -0.0.48 - add payment method display to backend/transfer/index - add footer money display to backend/transfer/index diff --git a/common/components/DailyListing.php b/common/components/DailyListing.php index b596f59..6b422a5 100644 --- a/common/components/DailyListing.php +++ b/common/components/DailyListing.php @@ -135,6 +135,17 @@ class DailyListing return $days_between > $days_visiblity; } + + /** + * cutler győr-ben a nap záráshoz ezt nyomtatjuk ki + * Ez a metódus csak akkor használható, ha csak ez a statisztika kell + * */ + public function readMixed(){ + $this->readProductsByCategory(); + $this->readTicketStas(); + $this->readMoneyMovements(); + } + public function readTotalEasy(){ $this->readTicketMoney(); $this->readProductsMoney(); diff --git a/common/components/Helper.php b/common/components/Helper.php index e96bc1e..ac79953 100644 --- a/common/components/Helper.php +++ b/common/components/Helper.php @@ -254,6 +254,13 @@ class Helper { public static function fixAsciiChars($in) { $out = str_replace ( "ö", "0", $in ); $out = str_replace ( "Ö", "0", $out ); + /* + $out = str_replace ( "Y", "%", $out ); + $out = str_replace ( "y", "%", $out ); + $out = str_replace ( "Z", "y", $out ); + $out = str_replace ( "z", "y", $out ); + $out = str_replace ( "%", "y", $out ); + */ return $out; } public static function isUserCartVisibilityUser() { @@ -361,7 +368,7 @@ class Helper { return $result; } - public static function generateRandomString($length = 6,$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) { + public static function generateRandomString($length = 6,$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWX' ) { $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { diff --git a/common/components/accountstate/AccountStateWidget.php b/common/components/accountstate/AccountStateWidget.php index d0fd53a..c368403 100644 --- a/common/components/accountstate/AccountStateWidget.php +++ b/common/components/accountstate/AccountStateWidget.php @@ -40,7 +40,8 @@ class AccountStateWidget extends Widget{ 'user.username', [ 'attribute' => 'created_at', - 'label' => 'Nyitás ideje' + 'label' => 'Nyitás ideje', + 'format' => 'datetime' ], ]; }else{ @@ -61,11 +62,13 @@ class AccountStateWidget extends Widget{ 'user.username', [ 'attribute' => 'start_date', - 'label' => 'Előző nyitás ideje' + 'label' => 'Előző nyitás ideje' , + 'format' => 'datetime' ], [ 'attribute' => 'created_at', - 'label' => 'Zárás ideje' + 'label' => 'Zárás ideje', + 'format' => 'datetime' ], ]; } @@ -74,6 +77,7 @@ class AccountStateWidget extends Widget{ echo DetailView::widget([ + 'options' => ['class' => 'table table-striped table-bordered detail-view table-account-view'] , 'model' => $this->model, 'attributes' =>$attributes, ]) ; diff --git a/common/components/total/TotalDifferenceWidget.php b/common/components/total/TotalDifferenceWidget.php index d023cc5..7e1174d 100644 --- a/common/components/total/TotalDifferenceWidget.php +++ b/common/components/total/TotalDifferenceWidget.php @@ -27,6 +27,7 @@ class TotalDifferenceWidget extends Widget{ $ft = " Ft"; $s .= DetailView::widget([ + 'options' => ['class' => 'table table-striped table-bordered detail-view table-account-diff'], 'model' => $this->model, 'template' =>"{label}{value} ", 'attributes' => [ diff --git a/common/components/total/TotalProductsByCategoryWidget.php b/common/components/total/TotalProductsByCategoryWidget.php new file mode 100644 index 0000000..bafb19f --- /dev/null +++ b/common/components/total/TotalProductsByCategoryWidget.php @@ -0,0 +1,9 @@ + 'rocho02@gmail.com', 'infoEmail' => 'info@rocho-net.hu', 'user.passwordResetTokenExpire' => 3600, - 'version' => 'v0.0.48', + 'version' => 'v0.0.49', 'company' => 'movar',//gyor 'company_name' => "Freimann Kft.", 'product_visiblity' => 'account',// on reception which products to display. account or global diff --git a/common/views/total/total_detailed_money_movement.php b/common/views/total/total_detailed_money_movement.php index 8b22905..3698083 100644 --- a/common/views/total/total_detailed_money_movement.php +++ b/common/views/total/total_detailed_money_movement.php @@ -1,5 +1,4 @@ -

Pénzmozgások

- +
@@ -7,20 +6,20 @@ - + moneyMovements as $p ){?> - - - - - + + + + + + - diff --git a/common/views/total/total_medium_ticket.php b/common/views/total/total_medium_ticket.php index ddc00ca..37e1117 100644 --- a/common/views/total/total_medium_ticket.php +++ b/common/views/total/total_medium_ticket.php @@ -1,4 +1,4 @@ -
DátumFelhasználó Név TípusÖsszeg MegjegyzésÖsszeg
formatter->asInteger( $p['signed_money'])?> Ft
+
diff --git a/common/views/total/total_product_by_category.php b/common/views/total/total_product_by_category.php new file mode 100644 index 0000000..0a7e190 --- /dev/null +++ b/common/views/total/total_product_by_category.php @@ -0,0 +1,37 @@ +productMoneies; + + ?> + +
Bérlet típus
+ + + + + + + + + + + + + + + + + + +
KategóriaMennyiségÖsszeg
Dbformatter->asInteger( $p['product_money'])?> FT
+ +
+
+ Összesen: + formatter->asInteger( $model->productsByCategory ['total']); + ?> Ft +
+
\ No newline at end of file diff --git a/frontend/components/AccountStateBanknoteCountWidget.php b/frontend/components/AccountStateBanknoteCountWidget.php index b4c05fd..31ad4ea 100644 --- a/frontend/components/AccountStateBanknoteCountWidget.php +++ b/frontend/components/AccountStateBanknoteCountWidget.php @@ -59,6 +59,11 @@ class AccountStateBanknoteCountWidget extends Widget{ $s .= Html::a( Html::tag("span","",['class' =>'glyphicon glyphicon-download-alt']) ." Pdf", Url::to([ 'view', 'id' =>$this->model->id_account_state, 'output' =>'pdf']) ,['class' => 'btn btn-primary btn-pdf','style' =>'margin-bottom: 12px; margin-right: 6px;']); + $s .= Html::a(' Napi összefoglaló', Url::toRoute(['mixed','id' =>$this->model->id_account_state]), [ + 'title' => 'Napi összefoglaló', + 'class' => 'btn btn-success', + 'style' =>'margin-bottom: 12px; margin-right: 6px;' + ]); $s .= Html::a(' Részletek', Url::toRoute(['view','id' =>$this->model->id_account_state]), [ 'title' => 'Részletek', 'class' => 'btn btn-success', diff --git a/frontend/controllers/AccountStateController.php b/frontend/controllers/AccountStateController.php index f19fa98..403fdd7 100644 --- a/frontend/controllers/AccountStateController.php +++ b/frontend/controllers/AccountStateController.php @@ -27,7 +27,8 @@ class AccountStateController extends Controller { 'index', 'open', 'close', - 'view' + 'view' , + 'mixed' ], 'rules' => [ // allow authenticated users @@ -301,4 +302,63 @@ class AccountStateController extends Controller { ] ); } } + + + public function actionMixed($id){ + $accountState = $this->findModel ( $id ); + $output = Yii::$app->getRequest ()->getQueryParam ( 'output' ); + $details = null; + + if ($accountState->isTypeClose ()) { + + $prev; + if ($accountState->type == AccountState::TYPE_CLOSE) { + if (isset ( $accountState->prev_state )) { + $prev = AccountState::findOne ( $accountState->prev_state ); + } + if (isset ( $prev )) { + $accountState->start_date = $prev->created_at; + } + } + $details = new DailyListing (); + $details->loadAccountState ( $accountState ); + + $details->readTotalEasy (); + $details->readTotalDetailed (); + $details->readTotalMedium (); + + } + + + if ($output == 'pdf') { + $user = User::findOne(\Yii::$app->user->id); + $mpdf=new \mPDF('utf-8', 'A4'); + $mpdf->useSubstitutions=false; + $mpdf->simpleTables = true; + $mpdf->SetHeader( \Yii::$app->params[ "company_name" ] . " - Létrehozva: " .$user->username . ", ".\Yii::$app->formatter->asDatetime(time()) ); + $mpdf->setFooter('{PAGENO} / {nb}'); + + $stylesheet = file_get_contents( \Yii::getAlias('@vendor'.'/bower/bootstrap/dist/css/bootstrap.css')); // external css + $mpdf->WriteHTML($stylesheet,1); + + $stylesheet = file_get_contents( \Yii::getAlias('@frontend'.'/web/css/account_close.css')); // external css + $mpdf->WriteHTML($stylesheet,1); + + + $mpdf->WriteHTML($this->renderPartial("@frontend/views/account-state/mixed_pdf", [ + 'model' => $accountState, + 'details' => $details + ])); + $type = $accountState->isTypeOpen() ? "kassza_nyitas" : "kassza_zaras"; + $dt= "_letrehozva_".date("Ymd_His"). "_" . $user->username; + $fn= $type .$dt.".pdf"; + $mpdf->Output($fn, 'D'); + exit(); + + } + return $this->render ( 'mixed', [ + 'model' => $accountState, + 'details' => $details + ] ); + } } diff --git a/frontend/views/account-state/_mixed.php b/frontend/views/account-state/_mixed.php new file mode 100644 index 0000000..72c3186 --- /dev/null +++ b/frontend/views/account-state/_mixed.php @@ -0,0 +1,21 @@ + + +

Bérletek típus szerint

+ $details]);?> +

Termékek kategória szerint

+ $details]);?> +

Pénzmozgások

+ $details]);?> + +

Összesen

+ + + + + + +
Végösszeg bruttóformatter->asInteger( $model->money)?> FT
\ No newline at end of file diff --git a/frontend/views/account-state/mixed.php b/frontend/views/account-state/mixed.php new file mode 100644 index 0000000..1dba06c --- /dev/null +++ b/frontend/views/account-state/mixed.php @@ -0,0 +1,61 @@ + + + +
+ +

Napi összefoglaló

+ + hasDifferenceToPrevState() ){ + if ( $model->hasMinus()){ + ?> + + + + + $model]) ?> + + 'glyphicon glyphicon-download-alt'])." Pdf", Url::current(['output' =>'pdf']) ,['class' => 'btn btn-primary btn-pdf']); + ?> + + hasDifferenceToPrevState() ){ + ?> +

Különbözet

+ $model] ); + + } + +?> +
+ + + +render('_mixed', [ + 'model' => $model, + 'details' => $details + ] ); ?> + \ No newline at end of file diff --git a/frontend/views/account-state/mixed_pdf.php b/frontend/views/account-state/mixed_pdf.php new file mode 100644 index 0000000..8eaf501 --- /dev/null +++ b/frontend/views/account-state/mixed_pdf.php @@ -0,0 +1,45 @@ + + + +
+ + + + + + + + +
+

Zárás összefoglaló

+ $model]) ?> +
+ hasDifferenceToPrevState() ){ + ?> + hasMinus()){ + ?> +

Negatív különbözet

+ +

Pozitív különbözet

+ $model] ); + + } + ?> +
+
+ + + +render('_mixed', [ + 'model' => $model, + 'details' => $details + ] ); ?> + \ No newline at end of file diff --git a/frontend/views/account-state/view.php b/frontend/views/account-state/view.php index aeaab98..93ed468 100644 --- a/frontend/views/account-state/view.php +++ b/frontend/views/account-state/view.php @@ -15,6 +15,7 @@ use yii\base\Widget; use common\models\AccountState; use yii\helpers\Url; use common\components\accountstate\AccountStateWidget; +use common\components\total\TotalProductsByCategoryWidget; /* @var $this yii\web\View */ /* @var $model common\models\AccountState */ @@ -81,6 +82,8 @@ $this->params['breadcrumbs'][] = $this->title; role="tab" data-toggle="tab">Részletes összesítő
  • Címletek
  • +
  • Nyomtatni
  • @@ -107,6 +110,12 @@ $this->params['breadcrumbs'][] = $this->title;

    Címletek

    $model]);?> +
    +

    Részletek

    + $details]);?> + $details]);?> + $details]);?> +
    diff --git a/frontend/views/contract/_contract.php b/frontend/views/contract/_contract.php index f0f08a7..c1cd48b 100644 --- a/frontend/views/contract/_contract.php +++ b/frontend/views/contract/_contract.php @@ -32,7 +32,6 @@ use common\components\Azaz; $img = ""; - ?>

    diff --git a/frontend/web/css/account_close.css b/frontend/web/css/account_close.css new file mode 100644 index 0000000..b243233 --- /dev/null +++ b/frontend/web/css/account_close.css @@ -0,0 +1,69 @@ + h1{ + font-size: 16px; + } + + .table td, + .table th{ + font-size: 10px; + } + + .btn-pdf{ + margin-bottom: 6px; + } + + td.money{ + text-align: right; + } + p{ + font-weight: bold; + font-size: 12px; + } + + .total-medium-ticket td.name, + .total-product-by-category td.name + { + width: 50%; + } + .total-medium-ticket td.count, + .total-product-by-category td.count + { + width: 25%; + } + + .table-total td.money{ + width: 50%; + } + .table-account-view td{ + width: 50%; + } + .table-account-diff td{ + width: 50%; + } + + .table-money-movements-detailed td.created-at{ width: 120px;} + .table-money-movements-detailed td.account{ width: 80px;} + .table-money-movements-detailed td.username{ width: 80px;} + .table-money-movements-detailed td.name{ width: 80px;} + .table-money-movements-detailed td.type{ width: 80px;} + .table-money-movements-detailed td.money{ width: 70px;} + + + table.table-top { + width: 100%; + } + + table.table-top td.top-cell { + width: 48%; + vertical-align: top; + + } + table.table-top td.top-cell .table { + margin-top: 6px; + } + + table.table-top td.first { + padding-right: 3px; + } + table.table-top td.last { + padding-left: 3px; + } \ No newline at end of file