Browse Source

[Administration] Distributions > Commandes : possibilité d'envoyer les bons de livraison directement depuis la ligne de la commande

feature/rotating_product
Guillaume Bourgeois 7 months ago
parent
commit
7a271a0e64
5 changed files with 88 additions and 42 deletions
  1. +15
    -0
      backend/controllers/DistributionController.php
  2. +13
    -5
      backend/views/distribution/index.php
  3. +42
    -37
      backend/web/css/screen.css
  4. +13
    -0
      backend/web/js/vuejs/distribution-index.js
  5. +5
    -0
      backend/web/sass/_adminlte.scss

+ 15
- 0
backend/controllers/DistributionController.php View File

'isCreditFunctioningMandatory' => $orderModule->isOrderCreditFunctioningMandatory($order), 'isCreditFunctioningMandatory' => $orderModule->isOrderCreditFunctioningMandatory($order),
'isCreditFunctioningUser' => $orderModule->isOrderCreditFunctioningUser($order), 'isCreditFunctioningUser' => $orderModule->isOrderCreditFunctioningUser($order),
'debitCredit' => false, 'debitCredit' => false,
'deliveryNote' => $order->deliveryNote ? $order->deliveryNote->getAttributes() : null
]); ]);
} }
} }
return Ajax::responseSuccess('Bon de livraison généré'); return Ajax::responseSuccess('Bon de livraison généré');
} }


public function actionAjaxSendDeliveryNote(int $idOrder)
{
$orderModule = $this->getOrderModule();
$documentModule = $this->getDocumentModule();
$order = $orderModule->getRepository()->findOneOrderById($idOrder);

if($order->deliveryNote) {
$documentModule->getManager()->sendDocument($order->deliveryNote);
return Ajax::responseSuccess('Bon de livraison envoyé');
}

return Ajax::responseSuccess('Une erreur est survenue lors de l\'envoi du bon de livraison.');
}

public function actionAjaxGenerateDeliveryNoteEachUser(string $idOrders) public function actionAjaxGenerateDeliveryNoteEachUser(string $idOrders)
{ {
if (strlen($idOrders)) { if (strlen($idOrders)) {

+ 13
- 5
backend/views/distribution/index.php View File

</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li v-if="!order.id_delivery_note"> <li v-if="!order.id_delivery_note">
<a href="javascript:void(0);" class="" :data-id-order="order.id" @click="generateDeliveryNote">
<a href="javascript:void(0);" :data-id-order="order.id" @click="generateDeliveryNote">
<span class="glyphicon glyphicon-plus"></span> Générer un bon de livraison <span class="glyphicon glyphicon-plus"></span> Générer un bon de livraison
</a> </a>
</li> </li>
<li v-if="order.id_quotation"> <li v-if="order.id_quotation">
<a :href="UrlManager.getBaseUrl()+'quotation/update?id='+order.id_quotation"> <a :href="UrlManager.getBaseUrl()+'quotation/update?id='+order.id_quotation">
<span class="glyphicon glyphicon-file"></span> Devis
<span class="glyphicon glyphicon-file"></span> Modifier le devis
</a> </a>
</li> </li>
<li v-if="order.id_delivery_note">
<li v-if="order.id_delivery_note && order.deliveryNote">
<a :href="UrlManager.getBaseUrl()+'delivery-note/update?id='+order.id_delivery_note"> <a :href="UrlManager.getBaseUrl()+'delivery-note/update?id='+order.id_delivery_note">
<span class="glyphicon glyphicon-file"></span> Bon de livraison
<span class="glyphicon glyphicon-file"></span> Modifier le bon de livraison
</a> </a>
<template v-if="order.deliveryNote.status == 'valid'">
<a v-if="!order.deliveryNote.is_sent" href="javascript:void(0);" :data-id-order="order.id" @click="sendDeliveryNote">
<span class="glyphicon glyphicon-send"></span> Envoyer le bon de livraison
</a>
<a v-else class="text-success disable" href="#">
<span class="glyphicon glyphicon-ok"></span> Bon de livraison envoyé
</a>
</template>
</li> </li>
<li v-if="order.id_invoice"> <li v-if="order.id_invoice">
<a :href="UrlManager.getBaseUrl()+'invoice/update?id='+order.id_invoice"> <a :href="UrlManager.getBaseUrl()+'invoice/update?id='+order.id_invoice">
<span class="glyphicon glyphicon-file"></span> Facture
<span class="glyphicon glyphicon-file"></span> Modifier la facture
</a> </a>
</li> </li>
</ul> </ul>

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

body.skin-black .content-wrapper a { body.skin-black .content-wrapper a {
color: #e08e0b; color: #e08e0b;
} }
/* line 238, ../sass/_adminlte.scss */
/* line 237, ../sass/_adminlte.scss */
body.skin-black .content-wrapper a.disable {
pointer-events: none;
cursor: default;
}
/* line 243, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .label { body.skin-black .content-wrapper .label {
padding-top: 4px; padding-top: 4px;
padding-bottom: 1px; padding-bottom: 1px;
} }
/* line 243, ../sass/_adminlte.scss */
/* line 248, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn { body.skin-black .content-wrapper .btn {
color: white; color: white;
} }
/* line 247, ../sass/_adminlte.scss */
/* line 252, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-default { body.skin-black .content-wrapper .btn-default {
color: #333; color: #333;
background-color: white; background-color: white;
} }
/* line 252, ../sass/_adminlte.scss */
/* line 257, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-primary { body.skin-black .content-wrapper .btn-primary {
background-color: #F39C12; background-color: #F39C12;
color: white; color: white;
border-color: #F39C12; border-color: #F39C12;
} }
/* line 259, ../sass/_adminlte.scss */
/* line 264, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .nav.nav-tabs .badge { body.skin-black .content-wrapper .nav.nav-tabs .badge {
margin-left: 4px; margin-left: 4px;
background-color: #e0e0e0; background-color: #e0e0e0;
color: #444; color: #444;
} }
/* line 266, ../sass/_adminlte.scss */
/* line 271, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .tab-content { body.skin-black .content-wrapper .tab-content {
border-left: solid 1px #ddd; border-left: solid 1px #ddd;
border-bottom: solid 1px #ddd; border-bottom: solid 1px #ddd;
padding: 30px 15px 15px 15px; padding: 30px 15px 15px 15px;
background-color: white; background-color: white;
} }
/* line 274, ../sass/_adminlte.scss */
/* line 279, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert { body.skin-black .content-wrapper .alert {
position: relative; position: relative;
} }
/* line 277, ../sass/_adminlte.scss */
/* line 282, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a { body.skin-black .content-wrapper .alert a {
color: white; color: white;
} }
/* line 280, ../sass/_adminlte.scss */
/* line 285, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a.btn { body.skin-black .content-wrapper .alert a.btn {
color: #333; color: #333;
text-decoration: none; text-decoration: none;
} }
/* line 285, ../sass/_adminlte.scss */
/* line 290, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert .close { body.skin-black .content-wrapper .alert .close {
font-size: 30px; font-size: 30px;
position: absolute; position: absolute;
color: white; color: white;
opacity: 0.6; opacity: 0.6;
} }
/* line 294, ../sass/_adminlte.scss */
/* line 299, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert .close:hover { body.skin-black .content-wrapper .alert .close:hover {
opacity: 1; opacity: 1;
} }
/* line 301, ../sass/_adminlte.scss */
/* line 306, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .small-box h3 { body.skin-black .content-wrapper .small-box h3 {
font-size: 28px; font-size: 28px;
font-family: 'Source Sans Pro',sans-serif; font-family: 'Source Sans Pro',sans-serif;
} }
/* line 306, ../sass/_adminlte.scss */
/* line 311, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .small-box .icon { body.skin-black .content-wrapper .small-box .icon {
top: -2px; top: -2px;
} }
/* line 310, ../sass/_adminlte.scss */
/* line 315, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .small-box .small-box-footer { body.skin-black .content-wrapper .small-box .small-box-footer {
color: white; color: white;
padding-top: 6px; padding-top: 6px;
padding-bottom: 2px; padding-bottom: 2px;
} }
/* line 319, ../sass/_adminlte.scss */
/* line 324, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout h4 .fa { body.skin-black .content-wrapper .callout h4 .fa {
margin-right: 7px; margin-right: 7px;
} }
/* line 322, ../sass/_adminlte.scss */
/* line 327, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout a { body.skin-black .content-wrapper .callout a {
color: white; color: white;
} }
/* line 325, ../sass/_adminlte.scss */
/* line 330, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout .btn { body.skin-black .content-wrapper .callout .btn {
color: #333; color: #333;
text-decoration: none; text-decoration: none;
} }
/* line 332, ../sass/_adminlte.scss */
/* line 337, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th { body.skin-black .content-wrapper .table th {
font-size: 13px; font-size: 13px;
} }
/* line 335, ../sass/_adminlte.scss */
/* line 340, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions { body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions {
width: 172px; width: 172px;
text-align: right; text-align: right;
} }
/* line 339, ../sass/_adminlte.scss */
/* line 344, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small { body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small {
font-size: 12px; font-size: 12px;
} }
/* line 344, ../sass/_adminlte.scss */
/* line 349, ../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 { 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; background-color: #F39C12;
border: solid 1px #F39C12; border: solid 1px #F39C12;
color: white; color: white;
} }
/* line 350, ../sass/_adminlte.scss */
/* line 355, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span { body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span {
color: #F39C12; color: #F39C12;
} }
/* line 352, ../sass/_adminlte.scss */
/* line 357, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover { body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover {
color: #c87f0a; color: #c87f0a;
} }
/* line 357, ../sass/_adminlte.scss */
/* line 362, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .submenu { body.skin-black .content-wrapper .submenu {
margin-bottom: 25px; margin-bottom: 25px;
} }
/* line 361, ../sass/_adminlte.scss */
/* line 366, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-actions { body.skin-black .content-wrapper .form-actions {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
z-index: 10; z-index: 10;
border-top: solid 1px #e0e0e0; border-top: solid 1px #e0e0e0;
} }
/* line 374, ../sass/_adminlte.scss */
/* line 379, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-actions a, body.skin-black .content-wrapper .form-actions button { body.skin-black .content-wrapper .form-actions a, body.skin-black .content-wrapper .form-actions button {
margin-left: 10px; margin-left: 10px;
} }
/* line 379, ../sass/_adminlte.scss */
/* line 384, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-buttons { body.skin-black .content-wrapper .form-buttons {
margin-top: 25px; margin-top: 25px;
text-align: right; text-align: right;
} }
/* line 386, ../sass/_adminlte.scss */
/* line 391, ../sass/_adminlte.scss */
body.skin-black .main-footer a { body.skin-black .main-footer a {
color: #F39C12; color: #F39C12;
} }
/* line 391, ../sass/_adminlte.scss */
/* line 396, ../sass/_adminlte.scss */
body.skin-black .gridview-pagesize { body.skin-black .gridview-pagesize {
float: right; float: right;
margin-bottom: 8px; margin-bottom: 8px;
} }
/* line 396, ../sass/_adminlte.scss */
/* line 401, ../sass/_adminlte.scss */
body.skin-black #yii-debug-toolbar { body.skin-black #yii-debug-toolbar {
bottom: 64px; bottom: 64px;
} }


/* line 401, ../sass/_adminlte.scss */
/* line 406, ../sass/_adminlte.scss */
body.login-page { body.login-page {
background: none; background: none;
background-color: white; background-color: white;
} }
/* line 405, ../sass/_adminlte.scss */
/* line 410, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo { body.login-page .login-box .login-logo {
text-align: center; text-align: center;
font-family: 'highvoltageregular'; font-family: 'highvoltageregular';
} }
/* line 409, ../sass/_adminlte.scss */
/* line 414, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo img { body.login-page .login-box .login-logo img {
width: 50px; width: 50px;
} }
/* line 414, ../sass/_adminlte.scss */
/* line 419, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary { body.login-page .login-box .login-box-body .btn-primary {
background-color: #F39C12; background-color: #F39C12;
border-color: #F39C12; border-color: #F39C12;
padding: 5px 10px; padding: 5px 10px;
} }
/* line 419, ../sass/_adminlte.scss */
/* line 424, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary:active { body.login-page .login-box .login-box-body .btn-primary:active {
background-color: #f4a62a; background-color: #f4a62a;
border-color: #F39C12; border-color: #F39C12;
} }
/* line 425, ../sass/_adminlte.scss */
/* line 430, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a { body.login-page .login-box .login-box-body a {
color: #F39C12; color: #F39C12;
} }
/* line 427, ../sass/_adminlte.scss */
/* line 432, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a:hover { body.login-page .login-box .login-box-body a:hover {
color: #f4a62a; color: #f4a62a;
} }

+ 13
- 0
backend/web/js/vuejs/distribution-index.js View File

app.init(app.idActivePointSale); app.init(app.idActivePointSale);
}); });
}, },
sendDeliveryNote: function (event) {
var app = this;
var idOrder = event.currentTarget.getAttribute('data-id-order');
axios.get(UrlManager.getBaseUrlAbsolute() + "distribution/ajax-send-delivery-note", {
params: {
idOrder: idOrder
}
})
.then(function (response) {
appAlerts.alertResponse(response);
app.init(app.idActivePointSale);
});
},
deliveryNoteExist: function (idPointSale) { deliveryNoteExist: function (idPointSale) {
return typeof this.deliveryNotes[this.idActivePointSale] != 'undefined'; return typeof this.deliveryNotes[this.idActivePointSale] != 'undefined';
}, },

+ 5
- 0
backend/web/sass/_adminlte.scss View File



a { a {
color: darken($color1, 5) ; color: darken($color1, 5) ;

&.disable {
pointer-events: none;
cursor: default;
}
} }


.label { .label {

Loading…
Cancel
Save