Browse Source

Gestion des bons de livraison : formulaire de création #158

dev
Guillaume Bourgeois 5 years ago
parent
commit
b58982f2e9
3 changed files with 13 additions and 4 deletions
  1. +9
    -3
      backend/views/delivery-note/index.php
  2. +1
    -1
      common/models/DeliveryNoteSearch.php
  3. +3
    -0
      common/models/Document.php

+ 9
- 3
backend/views/delivery-note/index.php View File



$this->setTitle('Bons de livraison'); $this->setTitle('Bons de livraison');
$this->addBreadcrumb($this->getTitle()); $this->addBreadcrumb($this->getTitle());
//$this->addButton(['label' => 'Nouveau bon de livraison <span class="glyphicon glyphicon-plus"></span>', 'url' => 'delivery-note/create', 'class' => 'btn btn-primary']);
$this->addButton(['label' => 'Nouveau bon de livraison <span class="glyphicon glyphicon-plus"></span>', 'url' => 'delivery-note/create', 'class' => 'btn btn-primary']);


?> ?>


'header' => 'Point de vente', 'header' => 'Point de vente',
'format' => 'raw', 'format' => 'raw',
'value' => function($model) { 'value' => function($model) {
return Html::encode($model->getPointSale()->name).'<br />'
.'le '.date('d/m/Y', strtotime($model->getDistribution()->date));
$pointSale = $model->getPointSale() ;
$distribution = $model->getDistribution() ;
if($pointSale && $distribution) {
return Html::encode($pointSale->name).'<br />'
.'le '.date('d/m/Y', strtotime($distribution->date));
}
return '' ;
} }
], ],
[ [

+ 1
- 1
common/models/DeliveryNoteSearch.php View File

$query = DeliveryNote::find() $query = DeliveryNote::find()
->with($optionsSearch['with']) ->with($optionsSearch['with'])
->joinWith($optionsSearch['join_with'], true) ->joinWith($optionsSearch['join_with'], true)
->where(['distribution.id_producer' => GlobalParam::getCurrentProducerId()])
->where(['delivery_note.id_producer' => GlobalParam::getCurrentProducerId()])
->orderBy('delivery_note.reference DESC') ->orderBy('delivery_note.reference DESC')
; ;

+ 3
- 0
common/models/Document.php View File

{ {
$class = $this->getClass() ; $class = $this->getClass() ;
$classLower = strtolower($class) ; $classLower = strtolower($class) ;
if($classLower == 'deliverynote') {
$classLower = 'delivery_note' ;
}
$prefix = Producer::getConfig('document_'.$classLower.'_prefix') ; $prefix = Producer::getConfig('document_'.$classLower.'_prefix') ;
$oneDocumentExist = $class::searchOne([],['orderby'=> 'reference DESC']) ; $oneDocumentExist = $class::searchOne([],['orderby'=> 'reference DESC']) ;

Loading…
Cancel
Save