Quellcode durchsuchen

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

refactoring
Guillaume Bourgeois vor 4 Jahren
Ursprung
Commit
b58982f2e9
3 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen
  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 Datei anzeigen

@@ -38,7 +38,7 @@

$this->setTitle('Bons de livraison');
$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']);

?>

@@ -61,8 +61,14 @@ $this->addBreadcrumb($this->getTitle());
'header' => 'Point de vente',
'format' => 'raw',
'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 Datei anzeigen

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

+ 3
- 0
common/models/Document.php Datei anzeigen

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

Laden…
Abbrechen
Speichern