瀏覽代碼

Refonte paiement

feature/rotating_product
Guillaume Bourgeois 7 月之前
父節點
當前提交
225c6dc1d2
共有 14 個檔案被更改,包括 276 行新增139 行删除
  1. +42
    -10
      backend/views/point-sale/_form.php
  2. +13
    -7
      backend/views/point-sale/index.php
  3. +0
    -7
      backend/views/producer/update.php
  4. +119
    -100
      backend/web/css/screen.css
  5. +3
    -1
      backend/web/js/backend.js
  6. +6
    -0
      backend/web/sass/_adminlte.scss
  7. +3
    -1
      backend/web/sass/point_sale/_form.scss
  8. +7
    -0
      backend/web/sass/point_sale/_index.scss
  9. +1
    -1
      common/web/js/common.js
  10. +39
    -0
      console/commands/InitPointSaleCreditFunctioningFromSettingsController.php
  11. +30
    -0
      console/migrations/m240424_071154_add_columns_point_sale_payment_method.php
  12. +5
    -3
      domain/PointSale/PointSale/PointSale.php
  13. +2
    -2
      domain/PointSale/PointSale/PointSaleSearch.php
  14. +6
    -7
      domain/Producer/Producer/Producer.php

+ 42
- 10
backend/views/point-sale/_form.php 查看文件

@@ -38,6 +38,8 @@

use domain\Distribution\Distribution\DistributionModule;
use domain\Distribution\Distribution\ExportManager;
use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use lo\widgets\Toggle;
@@ -49,6 +51,7 @@ use yii\widgets\ActiveForm;
$producerModule = ProducerModule::getInstance();
$userModule = UserModule::getInstance();
$distributionModule = DistributionModule::getInstance();
$featureChecker = FeatureModule::getInstance()->getChecker();

?>

@@ -78,19 +81,32 @@ $distributionModule = DistributionModule::getInstance();
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-piggy-bank"></span>
Cagnotte
<span class="glyphicon glyphicon-credit-card"></span>
Modes de paiement
</h3>
</div>
<div class="panel-body">
<div id="credit">
<?php

echo $form->field($model, 'payment_method_onsite')->widget(Toggle::class,
[
'options' => [
'data-id' => $model->id,
'data-on' => 'Oui',
'data-off' => 'Non',
],
]
);

$addHintCredit = '';
if (!$producerModule->getConfig('credit')):
$addHintCredit = '<br /><strong>Attention, le système de cagnotte est désactivé au niveau des ' . Html::a('paramètres globaux', ['producer/update']) . '.</strong>';
$addHintCredit = 'Attention, le système de cagnotte est désactivé au niveau des ' . Html::a('paramètres globaux', ['producer/update']);
endif;

echo $form->field($model, 'credit')->widget(Toggle::class,
echo '<div class="row">';
echo '<div class="col-md-4">';
echo $form->field($model, 'payment_method_credit')->widget(Toggle::class,
[
'options' => [
'data-id' => $model->id,
@@ -98,16 +114,32 @@ $distributionModule = DistributionModule::getInstance();
'data-off' => 'Non',
],
]
)->hint('Activez cette option si vous souhaitez que vos clients puissent régler leurs commandes via leur cagnotte pour ce point de vente.'
. $addHintCredit); ?>

<?= $form->field($model, 'credit_functioning')
)->hint($addHintCredit);
echo '</div>';
echo '<div class="col-md-8">';
echo $form->field($model, 'credit_functioning')
->label('Fonctionnement de la cagnotte <span class="glyphicon glyphicon-info-sign" data-toggle="tooltip" data-placement="bottom" title="'.Producer::HINT_CREDIT_FUNCTIONING.'" data-html="true"></span>')
->dropDownList([
'' => 'Paramètres globaux (' . Producer::$creditFunctioningArray[$producerModule->getConfig('credit_functioning')] . ')',
Producer::CREDIT_FUNCTIONING_OPTIONAL => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_OPTIONAL],
Producer::CREDIT_FUNCTIONING_MANDATORY => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_MANDATORY],
Producer::CREDIT_FUNCTIONING_USER => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_USER],
], [])->hint(Producer::HINT_CREDIT_FUNCTIONING); ?>
]);
echo '</div>';
echo '</div>';

if($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT)) {
echo $form->field($model, 'payment_method_online')->widget(Toggle::class,
[
'options' => [
'data-id' => $model->id,
'data-on' => 'Oui',
'data-off' => 'Non',
],
]
);
}

?>
</div>
</div>
</div>

+ 13
- 7
backend/views/point-sale/index.php 查看文件

@@ -135,18 +135,24 @@ $this->addButton(
}
],
[
'attribute' => 'credit',
'label' => 'Cagnotte',
'label' => 'Modes de paiement',
'format' => 'raw',
'headerOptions' => ['class' => 'column-hide-on-mobile'],
'filterOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile'],
'contentOptions' => ['class' => 'column-hide-on-mobile column-payment-method'],
'value' => function ($model) {
if ($model->credit && isset(Producer::$creditFunctioningArray[$model->credit_functioning])) {
return '<span class="glyphicon glyphicon-euro"></span> ' . Producer::$creditFunctioningArray[$model->credit_functioning];
$html = '<ul>';
if($model->payment_method_onsite) {
$html .= "<li>Sur place</li>";
}

return '';
if ($model->payment_method_credit && isset(Producer::$creditFunctioningArray[$model->credit_functioning])) {
$html .= "<li>Cagnotte (". strtolower(Producer::$creditFunctioningArray[$model->credit_functioning]).")</li>";
}
if ($model->payment_method_online) {
$html .= "<li>Paiement en ligne</li>";
}
$html .= '</ul>';
return $html;
}
],
[

+ 0
- 7
backend/views/producer/update.php 查看文件

@@ -352,13 +352,6 @@ $this->addBreadcrumb($this->getTitle());
. 'Ils créditent leur compte en vous donnant la somme de leur choix et c\'est ensuite à vous de ' . Html::a('mettre à jour', ['user/index']) . ' leur cagnotte en ligne.<br />'
. 'Ceci fait, les clients paient leur commande directement via leur cagnotte.'); ?>

<?= $form->field($model, 'credit_functioning')
->dropDownList([
Producer::CREDIT_FUNCTIONING_OPTIONAL => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_OPTIONAL],
Producer::CREDIT_FUNCTIONING_MANDATORY => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_MANDATORY],
Producer::CREDIT_FUNCTIONING_USER => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_USER],
], [])->hint(Producer::HINT_CREDIT_FUNCTIONING); ?>

<?= $form->field($model, 'use_credit_checked_default')
->dropDownList(Dropdown::noYesChoices())
->hint('Utilisation optionnelle de la cagnotte.'); ?>

+ 119
- 100
backend/web/css/screen.css 查看文件

@@ -1541,41 +1541,45 @@ a.btn.btn-primary .glyphicon-triangle-bottom, button.btn.btn-primary .glyphicon-
text-align: center;
}

/* line 4, ../sass/_adminlte.scss */
/* line 5, ../sass/_adminlte.scss */
body.skin-black .ui-tooltip {
white-space: pre-wrap;
}
/* line 10, ../sass/_adminlte.scss */
body.skin-black .main-header .logo {
background-color: white;
font-family: 'highvoltageregular';
font-size: 23px;
position: relative;
}
/* line 10, ../sass/_adminlte.scss */
/* line 16, ../sass/_adminlte.scss */
body.skin-black .main-header .logo:hover, body.skin-black .main-header .logo:focus {
background-color: white;
text-decoration: none;
}
/* line 15, ../sass/_adminlte.scss */
/* line 21, ../sass/_adminlte.scss */
body.skin-black .main-header .logo img {
position: relative;
max-width: 300px;
max-height: 300px;
height: auto;
}
/* line 23, ../sass/_adminlte.scss */
/* line 29, ../sass/_adminlte.scss */
body.skin-black .main-header .logo .logo-lg img {
width: 90px;
top: -2px;
}
/* line 29, ../sass/_adminlte.scss */
/* line 35, ../sass/_adminlte.scss */
body.skin-black .main-header .logo .logo-mini img {
width: 50px;
}
/* line 34, ../sass/_adminlte.scss */
/* line 40, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar {
display: block;
background-color: white;
padding: 0px;
}
/* line 39, ../sass/_adminlte.scss */
/* line 45, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .producer-panel {
position: relative;
float: left;
@@ -1583,11 +1587,11 @@ body.skin-black .main-header .navbar .producer-panel {
padding-left: 50px;
margin-left: 7px;
}
/* line 46, ../sass/_adminlte.scss */
/* line 52, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .producer-panel.without-logo {
padding-left: 10px;
}
/* line 50, ../sass/_adminlte.scss */
/* line 56, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .producer-panel .logo {
position: absolute;
top: 5px;
@@ -1602,7 +1606,7 @@ body.skin-black .main-header .navbar .producer-panel .logo {
text-align: center;
overflow: hidden;
}
/* line 62, ../sass/_adminlte.scss */
/* line 68, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .producer-panel .logo .img-logo {
position: absolute;
top: 50%;
@@ -1611,202 +1615,207 @@ body.skin-black .main-header .navbar .producer-panel .logo .img-logo {
max-width: 35px;
max-height: 35px;
}
/* line 72, ../sass/_adminlte.scss */
/* line 78, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .producer-panel .title {
position: relative;
top: 2px;
text-transform: uppercase;
}
/* line 79, ../sass/_adminlte.scss */
/* line 85, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .sidebar-toggle {
color: #333;
}
/* line 83, ../sass/_adminlte.scss */
/* line 89, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .link-support {
float: left;
padding: 15px 15px;
border-right: solid 1px #e0e0e0;
color: #333;
}
/* line 89, ../sass/_adminlte.scss */
/* line 95, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .link-support:hover {
text-decoration: none;
color: #F39C12;
}
/* line 95, ../sass/_adminlte.scss */
/* line 101, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .navbar-custom-menu .nav {
display: block;
}
/* line 99, ../sass/_adminlte.scss */
/* line 105, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .navbar-custom-menu .navbar-nav > li > a,
body.skin-black .main-header .navbar .navbar-right > li > a {
border-left: solid 1px #e0e0e0;
color: #333;
}
/* line 105, ../sass/_adminlte.scss */
/* line 111, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav > li > a:hover, body.skin-black .main-header .navbar .nav > li > a:active, body.skin-black .main-header .navbar .nav > li > a:focus,
body.skin-black .main-header .navbar .nav .open > a, body.skin-black .main-header .navbar .nav .open > a:hover, body.skin-black .main-header .navbar .nav .open > a:focus,
body.skin-black .main-header .navbar .nav > .active > a {
color: #F39C12;
}
/* line 111, ../sass/_adminlte.scss */
/* line 117, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .dropdown-menu {
-moz-box-shadow: 0px 0px 4px gray;
-webkit-box-shadow: 0px 0px 4px gray;
box-shadow: 0px 0px 4px gray;
}
/* line 116, ../sass/_adminlte.scss */
/* line 122, ../sass/_adminlte.scss */
body.skin-black .main-header .logo, body.skin-black .main-header .navbar .sidebar-toggle {
border-right: solid 1px #e0e0e0;
}
/* line 120, ../sass/_adminlte.scss */
/* line 126, ../sass/_adminlte.scss */
body.skin-black .main-header .link-control-sidebar {
display: none;
}
/* line 125, ../sass/_adminlte.scss */
/* line 131, ../sass/_adminlte.scss */
body.skin-black .main-header .notifications-menu ul.menu {
max-height: 300px;
}
/* line 128, ../sass/_adminlte.scss */
/* line 134, ../sass/_adminlte.scss */
body.skin-black .main-header .notifications-menu ul.menu li a {
padding-top: 4px;
padding-bottom: 4px;
}
/* line 132, ../sass/_adminlte.scss */
/* line 138, ../sass/_adminlte.scss */
body.skin-black .main-header .notifications-menu ul.menu li a h5 {
margin-bottom: 2px;
}
/* line 135, ../sass/_adminlte.scss */
/* line 141, ../sass/_adminlte.scss */
body.skin-black .main-header .notifications-menu ul.menu li a h5 small {
float: right;
}
/* line 140, ../sass/_adminlte.scss */
/* line 146, ../sass/_adminlte.scss */
body.skin-black .main-header .notifications-menu ul.menu li a p {
margin-left: 10px;
}
/* line 151, ../sass/_adminlte.scss */
/* line 157, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu .dropdown-menu {
width: 400px;
}
/* line 155, ../sass/_adminlte.scss */
/* line 161, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu .search-producer {
margin: 10px;
width: 94%;
}
/* line 160, ../sass/_adminlte.scss */
/* line 166, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu .li-alert-no-results {
display: none;
}
/* line 163, ../sass/_adminlte.scss */
/* line 169, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu .li-alert-no-results .alert {
margin-bottom: 0px;
margin-left: 10px;
margin-right: 10px;
padding: 15px 15px 10px 15px;
}
/* line 171, ../sass/_adminlte.scss */
/* line 177, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu .label {
position: relative;
top: -2px;
left: 0px;
}
/* line 177, ../sass/_adminlte.scss */
/* line 183, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu #link-display-producers-offline {
color: #F39C12;
}
/* line 181, ../sass/_adminlte.scss */
/* line 187, ../sass/_adminlte.scss */
body.skin-black .main-header .navbar .nav li.producer-menu .offline {
display: none;
}
/* line 188, ../sass/_adminlte.scss */
/* line 194, ../sass/_adminlte.scss */
body.skin-black .sidebar .sidebar-menu > li.header {
color: #899397;
}
/* line 192, ../sass/_adminlte.scss */
/* line 198, ../sass/_adminlte.scss */
body.skin-black .sidebar .label {
padding-top: 5px;
position: relative;
top: -3px;
}
/* line 199, ../sass/_adminlte.scss */
/* line 205, ../sass/_adminlte.scss */
body.skin-black .sidebar-menu > li.active > a {
border-color: #F39C12;
}
/* line 204, ../sass/_adminlte.scss */
/* line 210, ../sass/_adminlte.scss */
body.skin-black section.sidebar .user-panel {
text-align: center;
}
/* line 207, ../sass/_adminlte.scss */
/* line 213, ../sass/_adminlte.scss */
body.skin-black section.sidebar .user-panel .image {
margin-bottom: 3px;
}
/* line 211, ../sass/_adminlte.scss */
/* line 217, ../sass/_adminlte.scss */
body.skin-black section.sidebar .user-panel .title {
font-weight: bold;
color: white;
}
/* line 218, ../sass/_adminlte.scss */
/* line 224, ../sass/_adminlte.scss */
body.skin-black .content-wrapper {
background-color: #f5f5f5;
}
/* line 221, ../sass/_adminlte.scss */
/* line 227, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header {
background-color: #F5F5F5;
padding-bottom: 15px;
border-bottom: solid 1px #e0e0e0;
border-top: solid 1px #e0e0e0;
}
/* line 227, ../sass/_adminlte.scss */
/* line 233, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header .btn {
padding: 3px 6px;
font-size: 10px;
font-family: Arial;
text-transform: uppercase;
}
/* line 234, ../sass/_adminlte.scss */
/* line 240, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header h1 {
font-family: 'myriadpro-light';
font-size: 20px;
}
/* line 240, ../sass/_adminlte.scss */
/* line 246, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .col-no-padding-left {
padding-left: 0px;
}
/* line 244, ../sass/_adminlte.scss */
/* line 250, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .col-no-padding-right {
padding-right: 0px;
}
/* line 248, ../sass/_adminlte.scss */
/* line 254, ../sass/_adminlte.scss */
body.skin-black .content-wrapper a {
color: #e08e0b;
}
/* line 252, ../sass/_adminlte.scss */
/* line 257, ../sass/_adminlte.scss */
body.skin-black .content-wrapper a.disable {
pointer-events: none;
cursor: default;
}
/* line 263, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .label {
padding-top: 4px;
padding-bottom: 1px;
}
/* line 257, ../sass/_adminlte.scss */
/* line 268, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn {
color: white;
}
/* line 261, ../sass/_adminlte.scss */
/* line 272, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-default {
color: #333;
background-color: white;
}
/* line 266, ../sass/_adminlte.scss */
/* line 277, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-primary {
background-color: #F39C12;
color: white;
border-color: #F39C12;
}
/* line 273, ../sass/_adminlte.scss */
/* line 284, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .nav.nav-tabs .badge {
margin-left: 4px;
background-color: #e0e0e0;
color: #444;
}
/* line 280, ../sass/_adminlte.scss */
/* line 291, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .tab-content {
border-left: solid 1px #ddd;
border-bottom: solid 1px #ddd;
@@ -1814,20 +1823,20 @@ body.skin-black .content-wrapper .tab-content {
padding: 30px 15px 15px 15px;
background-color: white;
}
/* line 288, ../sass/_adminlte.scss */
/* line 299, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert {
position: relative;
}
/* line 291, ../sass/_adminlte.scss */
/* line 302, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a {
color: white;
}
/* line 294, ../sass/_adminlte.scss */
/* line 305, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a.btn {
color: #333;
text-decoration: none;
}
/* line 299, ../sass/_adminlte.scss */
/* line 310, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert .close {
font-size: 30px;
position: absolute;
@@ -1837,83 +1846,83 @@ body.skin-black .content-wrapper .alert .close {
color: white;
opacity: 0.6;
}
/* line 308, ../sass/_adminlte.scss */
/* line 319, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert .close:hover {
opacity: 1;
}
/* line 313, ../sass/_adminlte.scss */
/* line 324, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert.alert-dark {
background-color: #ece4d8;
color: black;
}
/* line 320, ../sass/_adminlte.scss */
/* line 331, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .small-box h3 {
font-size: 28px;
font-family: 'Source Sans Pro',sans-serif;
}
/* line 325, ../sass/_adminlte.scss */
/* line 336, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .small-box .icon {
top: -2px;
}
/* line 329, ../sass/_adminlte.scss */
/* line 340, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .small-box .small-box-footer {
color: white;
padding-top: 6px;
padding-bottom: 2px;
}
/* line 338, ../sass/_adminlte.scss */
/* line 349, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout h4 .fa {
margin-right: 7px;
}
/* line 341, ../sass/_adminlte.scss */
/* line 352, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout a {
color: white;
}
/* line 344, ../sass/_adminlte.scss */
/* line 355, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout .btn {
color: #333;
text-decoration: none;
}
/* line 351, ../sass/_adminlte.scss */
/* line 362, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th {
font-size: 13px;
}
/* line 354, ../sass/_adminlte.scss */
/* line 365, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions {
width: 172px;
text-align: right;
}
/* line 358, ../sass/_adminlte.scss */
/* line 369, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small {
font-size: 12px;
}
/* line 362, ../sass/_adminlte.scss */
/* line 373, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table.table-bordered > thead > tr > th, body.skin-black .content-wrapper .table.table-bordered > tbody > tr > th, body.skin-black .content-wrapper .table.table-bordered > tfoot > tr > th, body.skin-black .content-wrapper .table.table-bordered > thead > tr > td, body.skin-black .content-wrapper .table.table-bordered > tbody > tr > td, body.skin-black .content-wrapper .table.table-bordered > tfoot > tr > td {
border: 1px solid #ddd;
}
/* line 371, ../sass/_adminlte.scss */
/* line 382, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table.table-bordered > thead > tr > th, body.skin-black .content-wrapper .table.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
/* line 377, ../sass/_adminlte.scss */
/* line 388, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > .active > a, body.skin-black .content-wrapper .pagination > .active > span, body.skin-black .content-wrapper .pagination > .active > a:hover, body.skin-black .content-wrapper .pagination > .active > span:hover, body.skin-black .content-wrapper .pagination > .active > a:focus, body.skin-black .content-wrapper .pagination > .active > span:focus {
background-color: #F39C12;
border: solid 1px #F39C12;
color: white;
}
/* line 383, ../sass/_adminlte.scss */
/* line 394, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span {
color: #F39C12;
}
/* line 385, ../sass/_adminlte.scss */
/* line 396, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover {
color: #c87f0a;
}
/* line 390, ../sass/_adminlte.scss */
/* line 401, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .submenu {
margin-bottom: 25px;
}
/* line 394, ../sass/_adminlte.scss */
/* line 405, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-actions {
position: fixed;
bottom: 0;
@@ -1927,71 +1936,71 @@ body.skin-black .content-wrapper .form-actions {
z-index: 10;
border-top: solid 1px #e0e0e0;
}
/* line 407, ../sass/_adminlte.scss */
/* line 418, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-actions a, body.skin-black .content-wrapper .form-actions button {
margin-left: 10px;
}
/* line 412, ../sass/_adminlte.scss */
/* line 423, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-buttons {
margin-top: 25px;
text-align: right;
}
/* line 419, ../sass/_adminlte.scss */
/* line 430, ../sass/_adminlte.scss */
body.skin-black .main-footer a {
color: #F39C12;
}
/* line 424, ../sass/_adminlte.scss */
/* line 435, ../sass/_adminlte.scss */
body.skin-black .gridview-pagesize {
float: right;
margin-bottom: 8px;
}
/* line 429, ../sass/_adminlte.scss */
/* line 440, ../sass/_adminlte.scss */
body.skin-black #yii-debug-toolbar {
bottom: 64px;
}

/* line 434, ../sass/_adminlte.scss */
/* line 445, ../sass/_adminlte.scss */
body.login-page {
background: none;
background-color: white;
}
/* line 438, ../sass/_adminlte.scss */
/* line 449, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo {
text-align: center;
font-family: 'worksans_bold';
}
/* line 442, ../sass/_adminlte.scss */
/* line 453, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo img {
width: 150px;
}
/* line 448, ../sass/_adminlte.scss */
/* line 459, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body,
body.login-page .login-box .login-box-body input#loginform-email,
body.login-page .login-box .login-box-body input#loginform-password,
body.login-page .login-box .login-box-body .btn-primary {
font-size: 14px;
}
/* line 455, ../sass/_adminlte.scss */
/* line 466, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary {
background-color: #F39C12;
border-color: #F39C12;
padding: 5px 10px;
margin-bottom: 15px;
}
/* line 461, ../sass/_adminlte.scss */
/* line 472, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary:active {
background-color: #f4a62a;
border-color: #F39C12;
}
/* line 467, ../sass/_adminlte.scss */
/* line 478, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a {
color: #F39C12;
}
/* line 469, ../sass/_adminlte.scss */
/* line 480, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a:hover {
color: #f4a62a;
}
/* line 474, ../sass/_adminlte.scss */
/* line 485, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .checkbox label input {
position: relative;
top: 0px;
@@ -2762,33 +2771,43 @@ termes.
.point-sale-index table .td-default {
text-align: center;
}
/* line 8, ../sass/point_sale/_index.scss */
.point-sale-index table .column-payment-method ul {
padding: 0px;
padding-left: 15px;
margin: 0px;
}

/* line 6, ../sass/point_sale/_form.scss */
.point-sale-create #credit .field-pointsale-credit label,
.point-sale-update #credit .field-pointsale-credit label {
/* line 8, ../sass/point_sale/_form.scss */
.point-sale-create #credit .field-pointsale-payment_method_onsite label,
.point-sale-create #credit .field-pointsale-payment_method_credit label,
.point-sale-create #credit .field-pointsale-payment_method_online label,
.point-sale-update #credit .field-pointsale-payment_method_onsite label,
.point-sale-update #credit .field-pointsale-payment_method_credit label,
.point-sale-update #credit .field-pointsale-payment_method_online label {
display: block;
}
/* line 13, ../sass/point_sale/_form.scss */
/* line 15, ../sass/point_sale/_form.scss */
.point-sale-create #days-distribution .form-group,
.point-sale-update #days-distribution .form-group {
margin-bottom: 0px;
}
/* line 15, ../sass/point_sale/_form.scss */
/* line 17, ../sass/point_sale/_form.scss */
.point-sale-create #days-distribution .form-group label,
.point-sale-update #days-distribution .form-group label {
font-weight: normal;
}
/* line 18, ../sass/point_sale/_form.scss */
/* line 20, ../sass/point_sale/_form.scss */
.point-sale-create #days-distribution .form-group.has-success label,
.point-sale-update #days-distribution .form-group.has-success label {
color: #333;
}
/* line 21, ../sass/point_sale/_form.scss */
/* line 23, ../sass/point_sale/_form.scss */
.point-sale-create #days-distribution .form-group .help-block,
.point-sale-update #days-distribution .form-group .help-block {
display: none;
}
/* line 26, ../sass/point_sale/_form.scss */
/* line 28, ../sass/point_sale/_form.scss */
.point-sale-create #days-distribution .field-pointsale-infos_monday,
.point-sale-create #days-distribution .field-pointsale-infos_tuesday,
.point-sale-create #days-distribution .field-pointsale-infos_wednesday,
@@ -2805,7 +2824,7 @@ termes.
.point-sale-update #days-distribution .field-pointsale-infos_sunday {
margin-bottom: 10px;
}
/* line 34, ../sass/point_sale/_form.scss */
/* line 36, ../sass/point_sale/_form.scss */
.point-sale-create #days-distribution .field-pointsale-infos_monday label,
.point-sale-create #days-distribution .field-pointsale-infos_tuesday label,
.point-sale-create #days-distribution .field-pointsale-infos_wednesday label,
@@ -2822,23 +2841,23 @@ termes.
.point-sale-update #days-distribution .field-pointsale-infos_sunday label {
display: none;
}
/* line 41, ../sass/point_sale/_form.scss */
/* line 43, ../sass/point_sale/_form.scss */
.point-sale-create #delivery-note-generation .form-group,
.point-sale-update #delivery-note-generation .form-group {
margin-bottom: 0px;
}
/* line 44, ../sass/point_sale/_form.scss */
/* line 46, ../sass/point_sale/_form.scss */
.point-sale-create #delivery-note-generation .form-group label,
.point-sale-update #delivery-note-generation .form-group label {
margin-bottom: 0px;
font-weight: normal;
}
/* line 52, ../sass/point_sale/_form.scss */
/* line 54, ../sass/point_sale/_form.scss */
.point-sale-create #home-delivery .field-pointsale-is_home_delivery label,
.point-sale-update #home-delivery .field-pointsale-is_home_delivery label {
display: block;
}
/* line 58, ../sass/point_sale/_form.scss */
/* line 60, ../sass/point_sale/_form.scss */
.point-sale-create #bread-box .field-pointsale-is_bread_box label,
.point-sale-update #bread-box .field-pointsale-is_bread_box label {
display: block;

+ 3
- 1
backend/web/js/backend.js 查看文件

@@ -407,7 +407,9 @@ function opendistrib_product_prices_event_reduction_increase() {
}

function opendistrib_tooltip() {
$('[data-toggle="tooltip"]').tooltip({container: 'body'});
$('[data-toggle="tooltip"]').tooltip({
container: 'body'
});
}

function opendistrib_nl2br(str, is_xhtml) {

+ 6
- 0
backend/web/sass/_adminlte.scss 查看文件

@@ -1,5 +1,11 @@

body.skin-black {

// Gestion des retours à la ligne (à cause de la difficulté à gérer du HTMl dans les tooltip)
.ui-tooltip {
white-space: pre-wrap;
}

.main-header {
.logo {
background-color: white ;

+ 3
- 1
backend/web/sass/point_sale/_form.scss 查看文件

@@ -2,7 +2,9 @@
.point-sale-create,
.point-sale-update {
#credit {
.field-pointsale-credit {
.field-pointsale-payment_method_onsite,
.field-pointsale-payment_method_credit,
.field-pointsale-payment_method_online {
label {
display: block;
}

+ 7
- 0
backend/web/sass/point_sale/_index.scss 查看文件

@@ -4,5 +4,12 @@
.td-default {
text-align: center ;
}
.column-payment-method {
ul {
padding: 0px;
padding-left: 15px;
margin: 0px;
}
}
}
}

+ 1
- 1
common/web/js/common.js 查看文件

@@ -13,7 +13,7 @@ function opendistrib_dropdown_tooltip() {
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
})
});

}
}

+ 39
- 0
console/commands/InitPointSaleCreditFunctioningFromSettingsController.php 查看文件

@@ -0,0 +1,39 @@
<?php

namespace console\commands;

use domain\Distribution\Distribution\DistributionModule;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use yii\console\Controller;

class InitPointSaleCreditFunctioningFromSettingsController extends Controller
{
// ./yii init-point-sale-credit-functioning-from-settings/index
public function actionIndex()
{
$producerModule = ProducerModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

$producersArray = $producerModule->findProducers();
foreach($producersArray as $producer) {
echo '> '.$producer->name."\n";
\Yii::$app->logic->setProducerContext($producer);
$pointSaleArray = $pointSaleModule->getRepository()->findPointSales();
$creditFunctioningProducer = $producerModule->getConfig('credit_functioning');
foreach($pointSaleArray as $pointSale) {
if($pointSale->payment_method_credit && !$pointSale->credit_functioning) {
$pointSale->credit_functioning = $creditFunctioningProducer;
if($pointSale->credit_functioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) {
$pointSale->payment_method_onsite = 1;
}
$pointSale->save();
echo 'Point de vente "'.$pointSale->name. '" configuré sur "'.$pointSale->credit_functioning.'"'."\n";
}
}
}
}
}

?>

+ 30
- 0
console/migrations/m240424_071154_add_columns_point_sale_payment_method.php 查看文件

@@ -0,0 +1,30 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m240424_071154_add_columns_point_sale_payment_method
*/
class m240424_071154_add_columns_point_sale_payment_method extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('point_sale', 'payment_method_onsite', Schema::TYPE_BOOLEAN);
$this->addColumn('point_sale', 'payment_method_online', Schema::TYPE_BOOLEAN);
$this->renameColumn('point_sale', 'credit', 'payment_method_credit');
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('point_sale', 'payment_method_onsite');
$this->dropColumn('point_sale', 'payment_method_online');
$this->renameColumn('point_sale', 'payment_method_credit', 'credit');
}
}

+ 5
- 3
domain/PointSale/PointSale/PointSale.php 查看文件

@@ -77,8 +77,8 @@ class PointSale extends ActiveRecordCommon
[['address', 'locality', 'infos_monday', 'infos_tuesday',
'infos_wednesday', 'infos_thursday', 'infos_friday',
'infos_saturday', 'infos_sunday', 'credit_functioning', 'bread_box_code'], 'string'],
[['point_production', 'credit', 'delivery_monday', 'delivery_tuesday',
'delivery_wednesday', 'delivery_thursday', 'delivery_friday',
[['point_production', 'payment_method_onsite', 'payment_method_credit', 'payment_method_online',
'delivery_monday', 'delivery_tuesday', 'delivery_wednesday', 'delivery_thursday', 'delivery_friday',
'delivery_saturday', 'delivery_sunday', 'default', 'is_bread_box',
'button_generate_delivery_note_point_sale', 'button_generate_delivery_note_each_user',
'exclude_export_shopping_cart_labels', 'is_home_delivery'], 'boolean'],
@@ -109,7 +109,9 @@ class PointSale extends ActiveRecordCommon
'infos_saturday' => 'Samedi',
'infos_sunday' => 'Dimanche',
'restricted_access' => 'Accès restreint',
'credit' => 'Activer la cagnotte',
'payment_method_onsite' => 'Sur place',
'payment_method_credit' => 'Cagnotte',
'payment_method_online' => 'Paiement en ligne',
'delivery_monday' => 'Lundi',
'delivery_tuesday' => 'Mardi',
'delivery_wednesday' => 'Mercredi',

+ 2
- 2
domain/PointSale/PointSale/PointSaleSearch.php 查看文件

@@ -54,7 +54,7 @@ class PointSaleSearch extends PointSale
[['address', 'locality', 'infos_monday', 'infos_tuesday',
'infos_wednesday', 'infos_thursday', 'infos_friday',
'infos_saturday', 'infos_sunday'], 'string'],
[['point_production', 'credit', 'delivery_monday', 'delivery_tuesday',
[['point_production', 'delivery_monday', 'delivery_tuesday',
'delivery_wednesday', 'delivery_thursday', 'delivery_friday',
'delivery_saturday', 'delivery_sunday'], 'boolean'],
['id_producer', 'integer'],
@@ -78,7 +78,7 @@ class PointSaleSearch extends PointSale
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => ['attributes' => ['name', 'locality','point_production','credit']],
'sort' => ['attributes' => ['name', 'locality','point_production']],
'pagination' => [
'pageSize' => 20,
],

+ 6
- 7
domain/Producer/Producer/Producer.php 查看文件

@@ -56,16 +56,15 @@ class Producer extends ActiveRecordCommon
const CREDIT_FUNCTIONING_OPTIONAL = 'optional';
const CREDIT_FUNCTIONING_USER = 'user';

const HINT_CREDIT_FUNCTIONING = '<ul>'
. '<li>Optionnelle : l\'utilisateur choisit s\'il utilise sa cagnotte ou non. Les commandes peuvent être payées ou impayées.</li>'
. '<li>Obligatoire : toutes les commandes de l\'utilisateur son comptabilisées au niveau de la cagnotte. Toutes les commandes sont payées.</li>'
. '<li>Basée sur l\'utilisateur : cagnotte obligatoire si l\'utilisateur a sa cagnotte activée au niveau de son compte, cagnotte non affichée sinon.</li>'
. '</ul>';
const HINT_CREDIT_FUNCTIONING =
"- Optionnelle : les utilisateurs choisissent s'ils débitent ou non leur cagnotte. L'éventuel restant à payer est à régler sur place.\n
- Obligatoire : tous les utilisateurs payent leurs commandes via la cagnotte. Le paiement sur place ne peut pas être proposé en parallèle.\n
- Obligatoire par utilisateur : les utilisateurs avec l'option 'Cagnotte obligatoire' activée au niveau de leur profil payent leurs commandes via la cagnotte. Les autres utilisateurs voient simplement une note explicative au sujet de ce mode de paiement.";

public static $creditFunctioningArray = [
self::CREDIT_FUNCTIONING_MANDATORY => 'Obligatoire',
self::CREDIT_FUNCTIONING_OPTIONAL => 'Optionnelle',
self::CREDIT_FUNCTIONING_USER => 'Basée sur l\'utilisateur',
self::CREDIT_FUNCTIONING_MANDATORY => 'Obligatoire',
self::CREDIT_FUNCTIONING_USER => 'Obligatoire par utilisateur',
];

const BEHAVIOR_DELETE_ORDER_DELETE = 'delete';

Loading…
取消
儲存