Browse Source

[Backend] Distributions : afficher "payé/non réglé" en version mobile #968

refactoring
Guillaume Bourgeois 1 year ago
parent
commit
0b6fb1aba6
5 changed files with 77 additions and 39 deletions
  1. +16
    -8
      backend/views/distribution/index.php
  2. +42
    -30
      backend/web/css/screen.css
  3. +6
    -1
      backend/web/js/vuejs/distribution-index.js
  4. +9
    -0
      backend/web/sass/_responsive.scss
  5. +4
    -0
      backend/web/sass/distribution/_index.scss

+ 16
- 8
backend/views/distribution/index.php View File

</td> </td>
<td class="column-amount"> <td class="column-amount">
{{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }} {{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}
</td>
<td class="column-state-payment">
<div class="input-group">
<span class="label label-success input-group-addon" v-if="order.amount_paid == order.amount">payé</span>
<span class="label label-default input-group-addon" v-else-if="order.amount_paid == 0">non réglé</span>
<span class="label label-default input-group-addon" v-else-if="order.amount_paid > order.amount">surplus</span>
<span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span>


<span class="glyphicon glyphicon-time" title="Paiement automatique" v-if="order.auto_payment && producer && producer.credit && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
<div class="state-payment-mobile">
<order-state-payment :order="order" :producer="producer"></order-state-payment>
</div> </div>
</td> </td>
<td class="column-state-payment">
<order-state-payment :order="order" :producer="producer"></order-state-payment>
</td>
<td class="column-payment" v-if="producer && producer.credit"> <td class="column-payment" v-if="producer && producer.credit">
<div class="btn-group" v-if="order.user && !order.date_delete"> <div class="btn-group" v-if="order.user && !order.date_delete">
<button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount"> <button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount">
</modal> </modal>
</script> </script>


<script type="text/x-template" id="order-state-payment">
<div class="input-group">
<span class="label label-success input-group-addon" v-if="order.amount_paid == order.amount">payé</span>
<span class="label label-default input-group-addon" v-else-if="order.amount_paid == 0">non réglé</span>
<span class="label label-default input-group-addon" v-else-if="order.amount_paid > order.amount">surplus</span>
<span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span>

<span class="glyphicon glyphicon-time" title="Paiement automatique" v-if="order.auto_payment && producer && producer.credit && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
</div>
</script>

<!-- template for the modal component --> <!-- template for the modal component -->
<script type="text/x-template" id="modal-template"> <script type="text/x-template" id="modal-template">
<transition name="modal"> <transition name="modal">

+ 42
- 30
backend/web/css/screen.css View File

.distribution-index #orders table td.column-state-payment { .distribution-index #orders table td.column-state-payment {
width: 120px; width: 120px;
} }
/* line 300, ../sass/distribution/_index.scss */
/* line 299, ../sass/distribution/_index.scss */
.distribution-index #orders table .state-payment-mobile {
display: none;
}
/* line 304, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-payment div.btn-group { .distribution-index #orders table td.column-payment div.btn-group {
width: 125px; width: 125px;
} }
/* line 306, ../sass/distribution/_index.scss */
/* line 310, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view ul { .distribution-index #orders table tr.view ul {
list-style-type: none; list-style-type: none;
margin-left: 0px; margin-left: 0px;
padding-left: 15px; padding-left: 15px;
} }
/* line 316, ../sass/distribution/_index.scss */
/* line 320, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view .comment { .distribution-index #orders table tr.view .comment {
margin-top: 20px; margin-top: 20px;
} }
/* line 320, ../sass/distribution/_index.scss */
/* line 324, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view .delivery { .distribution-index #orders table tr.view .delivery {
margin-top: 20px; margin-top: 20px;
} }
/* line 329, ../sass/distribution/_index.scss */
/* line 333, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container { .distribution-index .modal-form-order .modal-container {
width: 100%; width: 100%;
padding: 0px; padding: 0px;
} }
/* line 333, ../sass/distribution/_index.scss */
/* line 337, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-body { .distribution-index .modal-form-order .modal-container .modal-body {
padding-right: 15px; padding-right: 15px;
} }
/* line 336, ../sass/distribution/_index.scss */
/* line 340, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-body table { .distribution-index .modal-form-order .modal-container .modal-body table {
margin-bottom: 150px; margin-bottom: 150px;
} }
/* line 341, ../sass/distribution/_index.scss */
/* line 345, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-footer { .distribution-index .modal-form-order .modal-container .modal-footer {
border-top-color: #f4f4f4; border-top-color: #f4f4f4;
position: fixed; position: fixed;
text-align: center; text-align: center;
border-top: solid 1px #e0e0e0; border-top: solid 1px #e0e0e0;
} }
/* line 353, ../sass/distribution/_index.scss */
/* line 357, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form button { .distribution-index .modal-form-order .modal-container .modal-footer .actions-form button {
float: none; float: none;
} }
/* line 357, ../sass/distribution/_index.scss */
/* line 361, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form div.right { .distribution-index .modal-form-order .modal-container .modal-footer .actions-form div.right {
float: right; float: right;
} }
/* line 364, ../sass/distribution/_index.scss */
/* line 368, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .btn-credit { .distribution-index .modal-form-order .btn-credit {
float: right; float: right;
} }
/* line 370, ../sass/distribution/_index.scss */
/* line 374, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered td { .distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9; background-color: #e9e9e9;
} }
/* line 374, ../sass/distribution/_index.scss */
/* line 378, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered input.input-quantity { .distribution-index .modal-form-order table.table-products .product-ordered input.input-quantity {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
/* line 380, ../sass/distribution/_index.scss */
/* line 384, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price { .distribution-index .modal-form-order table.table-products td.price {
width: 150px; width: 150px;
} }
/* line 383, ../sass/distribution/_index.scss */
/* line 387, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price input { .distribution-index .modal-form-order table.table-products td.price input {
text-align: center; text-align: center;
} }
/* line 387, ../sass/distribution/_index.scss */
/* line 391, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price .input-group-addon { .distribution-index .modal-form-order table.table-products td.price .input-group-addon {
background-color: #eee; background-color: #eee;
} }
/* line 392, ../sass/distribution/_index.scss */
/* line 396, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity { .distribution-index .modal-form-order table.table-products td.quantity {
width: 165px; width: 165px;
} }
/* line 395, ../sass/distribution/_index.scss */
/* line 399, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input { .distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center; text-align: center;
color: black; color: black;
} }
/* line 400, ../sass/distribution/_index.scss */
/* line 404, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .form-control { .distribution-index .modal-form-order table.table-products td.quantity .form-control {
border-right: 0px none; border-right: 0px none;
padding-right: 4px; padding-right: 4px;
} }
/* line 405, ../sass/distribution/_index.scss */
/* line 409, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { .distribution-index .modal-form-order table.table-products td.quantity .input-group-addon {
padding: 5px; padding: 5px;
padding-left: 0px; padding-left: 0px;
border-left: 0px none; border-left: 0px none;
border-right: 0px none; border-right: 0px none;
} }
/* line 414, ../sass/distribution/_index.scss */
/* line 418, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining { .distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right; text-align: right;
} }
/* line 417, ../sass/distribution/_index.scss */
/* line 421, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite { .distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite {
color: #00A65A; color: #00A65A;
} }
/* line 421, ../sass/distribution/_index.scss */
/* line 425, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { .distribution-index .modal-form-order table.table-products td.quantity-remaining.negative {
color: #DD4B39; color: #DD4B39;
} }
/* line 425, ../sass/distribution/_index.scss */
/* line 429, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty { .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty {
font-size: 18px; font-size: 18px;
} }
/* line 432, ../sass/distribution/_index.scss */
/* line 436, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button { .distribution-index .modal-form-order .actions-form button {
margin-left: 15px; margin-left: 15px;
} }
/* line 440, ../sass/distribution/_index.scss */
/* line 444, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon { .distribution-index .modal-payment .info-box .info-box-icon {
width: 50px; width: 50px;
} }
/* line 443, ../sass/distribution/_index.scss */
/* line 447, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i { .distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px; font-size: 30px;
} }
/* line 448, ../sass/distribution/_index.scss */
/* line 452, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content { .distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px; margin-left: 50px;
} }
display: block; display: block;
} }
/* line 120, ../sass/_responsive.scss */ /* line 120, ../sass/_responsive.scss */
.distribution-index #orders table .state-payment-mobile {
display: block;
}
/* line 123, ../sass/_responsive.scss */
.distribution-index #orders table .state-payment-mobile .glyphicon-time {
display: none;
}
/* line 129, ../sass/_responsive.scss */
.distribution-index #orders table ul.dropdown-menu a { .distribution-index #orders table ul.dropdown-menu a {
padding: 15px; padding: 15px;
} }
/* line 125, ../sass/_responsive.scss */
/* line 134, ../sass/_responsive.scss */
.distribution-index #orders table button.dropdown-toggle, .distribution-index #orders table button.dropdown-toggle,
.distribution-index #orders table button.btn-moins, .distribution-index #orders table button.btn-moins,
.distribution-index #orders table button.btn-plus { .distribution-index #orders table button.btn-plus {
padding: 15px; padding: 15px;
} }
/* line 132, ../sass/_responsive.scss */
/* line 141, ../sass/_responsive.scss */
.distribution-index #orders table .column-origin, .distribution-index #orders table .column-origin,
.distribution-index #orders table .column-point-sale, .distribution-index #orders table .column-point-sale,
.distribution-index #orders table .column-state-payment, .distribution-index #orders table .column-state-payment,

+ 6
- 1
backend/web/js/vuejs/distribution-index.js View File

}, },
}); });


Vue.component('order-state-payment', {
props: ['order', 'producer'],
template: '#order-state-payment'
});

Vue.component('modal', { Vue.component('modal', {
template: '#modal-template' template: '#modal-template'
})
});


Vue.component('order-form',{ Vue.component('order-form',{
props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'producer', 'loadingUpdateProductOrder'], props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'producer', 'loadingUpdateProductOrder'],

+ 9
- 0
backend/web/sass/_responsive.scss View File

} }


table { table {

.state-payment-mobile {
display: block;

.glyphicon-time {
display: none;
}
}

ul.dropdown-menu { ul.dropdown-menu {
a { a {
padding: 15px; padding: 15px;

+ 4
- 0
backend/web/sass/distribution/_index.scss View File

width: 120px; width: 120px;
} }


.state-payment-mobile {
display: none;
}

td.column-payment { td.column-payment {
div.btn-group { div.btn-group {
width: 125px; width: 125px;

Loading…
Cancel
Save