瀏覽代碼

[backend] Distributions : gestion des abonnements manquants

dev
Guillaume 3 年之前
父節點
當前提交
49a1d48d8c
共有 5 個文件被更改,包括 29 次插入1 次删除
  1. +11
    -0
      backend/controllers/DistributionController.php
  2. +7
    -0
      backend/views/distribution/index.php
  3. +2
    -1
      backend/web/js/vuejs/distribution-index.js
  4. +9
    -0
      common/models/Subscription.php
  5. +0
    -0
      producer/web/assets/.gitignore

+ 11
- 0
backend/controllers/DistributionController.php 查看文件

@@ -359,6 +359,17 @@ class DistributionController extends BackendController
$tiller = new Tiller();
$json['tiller_is_synchro'] = (int)$tiller->isSynchro($date);
}

// abonnements manquants
$arraySubscriptions = Subscription::searchByDate($date);
$json['missing_subscriptions'] = [] ;
foreach ($arraySubscriptions as $subscription) {
if (!$subscription->hasOrderAlreadyExist($ordersArrayObject)) {
$json['missing_subscriptions'][] = [
'username' => $subscription->getUsername()
] ;
}
}
}

return $json;

+ 7
- 0
backend/views/distribution/index.php 查看文件

@@ -274,6 +274,13 @@ $this->setPageTitle('Distributions') ;
<div class="clr"></div>
</div>

<div class="alert alert-danger" v-if="missingSubscriptions.length > 0">
{{ missingSubscriptions.length }} abonnement<template v-if="missingSubscriptions.length > 1">s</template> manquant<template v-if="missingSubscriptions.length > 1">s</template> :
<ul>
<li v-for="subscription in missingSubscriptions">{{ subscription.username }}</li>
</ul>
</div>

<table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)">
<thead>
<tr>

+ 2
- 1
backend/web/js/vuejs/distribution-index.js 查看文件

@@ -75,6 +75,7 @@ var app = new Vue({
tillerIsSynchro: false,
checkboxSelectAllOrders: false,
messageGenerateDeliveryNoteDisplayed: false,
missingSubscriptions: false,
calendar: {
mode: 'single',
attrs: [],
@@ -155,7 +156,7 @@ var app = new Vue({
app.initCountActiveProducts() ;
app.meansPayment = response.data.means_payment ;
app.oneDistributionWeekActive = response.data.one_distribution_week_active ;
app.missingSubscriptions = response.data.missing_subscriptions ;
app.countOrders = 0 ;
if(response.data.orders) {
app.orders = JSON.parse(JSON.stringify(response.data.orders)) ;

+ 9
- 0
common/models/Subscription.php 查看文件

@@ -476,5 +476,14 @@ class Subscription extends ActiveRecordCommon
}
}

public function getUsername()
{
if($this->user) {
return $this->user->getUsername() ;
}

return $this->username ;
}


}

+ 0
- 0
producer/web/assets/.gitignore 查看文件


Loading…
取消
儲存