Browse Source

[Administration] Documents : pouvoir ajouter des informations supplémentaires en dessous de l'adresse #1155

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
a0b6fb5c3e
5 changed files with 43 additions and 6 deletions
  1. +8
    -1
      backend/views/document/download.php
  2. +7
    -4
      backend/views/producer/update.php
  3. +0
    -1
      common/logic/Document/Document/Service/DocumentUtils.php
  4. +2
    -0
      common/logic/Producer/Producer/Model/Producer.php
  5. +26
    -0
      console/migrations/m230829_081058_add_column_producer_option_document_infos_top.php

+ 8
- 1
backend/views/document/download.php View File

<img style="max-height: 80px;" src="<?= $producerManager->getUrlLogo($producer) ?>"/> <img style="max-height: 80px;" src="<?= $producerManager->getUrlLogo($producer) ?>"/>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="address"><?= $producerManager->getFullAddress($producer, true); ?></div>
<div class="address">
<?= $producerManager->getFullAddress($producer, true); ?>
</div>
<?php if (strlen($producer->document_infos_top)): ?>
<div class="infos-top">
<?= nl2br(Html::encode($producer->document_infos_top)) ?>
</div>
<?php endif; ?>
</div> </div>
<div class="user"> <div class="user">
<?php if ($document->address && strlen($document->address) > 0): ?> <?php if ($document->address && strlen($document->address) > 0): ?>

+ 7
- 4
backend/views/producer/update.php View File

2 => '2', 2 => '2',
3 => '3' 3 => '3'
]); ?> ]); ?>
<?= $form->field($model, 'document_infos_top')
->textarea(['rows' => 8])
->hint("Affichées juste en dessous de l'adresse"); ?>
<?= $form->field($model, 'document_infos_bottom') <?= $form->field($model, 'document_infos_bottom')
->textarea(['rows' => 15]) ?>
->textarea(['rows' => 8]) ?>
<?= $form->field($model, 'document_infos_quotation') <?= $form->field($model, 'document_infos_quotation')
->textarea(['rows' => 15]) ?>
->textarea(['rows' => 8]) ?>
<?= $form->field($model, 'document_infos_invoice') <?= $form->field($model, 'document_infos_invoice')
->textarea(['rows' => 15]) ?>
->textarea(['rows' => 8]) ?>
<?= $form->field($model, 'document_infos_delivery_note') <?= $form->field($model, 'document_infos_delivery_note')
->textarea(['rows' => 15]) ?>
->textarea(['rows' => 8]) ?>
</div> </div>
</div> </div>



+ 0
- 1
common/logic/Document/Document/Service/DocumentUtils.php View File

$aliasDirectoryBase = $this->documentSolver->getAliasDirectoryBase($document); $aliasDirectoryBase = $this->documentSolver->getAliasDirectoryBase($document);
$directoryPdf = \Yii::getAlias($aliasDirectoryBase); $directoryPdf = \Yii::getAlias($aliasDirectoryBase);
if (!file_exists($directoryPdf)) { if (!file_exists($directoryPdf)) {
//die('dir : '.$directoryPdf);
mkdir($directoryPdf, 0755); mkdir($directoryPdf, 0755);
} }
} }

+ 2
- 0
common/logic/Producer/Producer/Model/Producer.php View File

'tiller_provider_token', 'tiller_provider_token',
'tiller_restaurant_token', 'tiller_restaurant_token',
'status', 'status',
'document_infos_top',
'document_infos_bottom', 'document_infos_bottom',
'document_infos_quotation', 'document_infos_quotation',
'document_infos_invoice', 'document_infos_invoice',
'document_invoice_first_reference' => 'Première référence des factures', 'document_invoice_first_reference' => 'Première référence des factures',
'document_delivery_note_prefix' => 'Préfixe des bons de livraison', 'document_delivery_note_prefix' => 'Préfixe des bons de livraison',
'document_delivery_note_first_reference' => 'Première référence des bons de livraison', 'document_delivery_note_first_reference' => 'Première référence des bons de livraison',
'document_infos_top' => 'Informations affichées en haut des documents',
'document_infos_bottom' => 'Informations affichées en bas des documents', 'document_infos_bottom' => 'Informations affichées en bas des documents',
'document_infos_quotation' => 'Informations affichées en bas des devis', 'document_infos_quotation' => 'Informations affichées en bas des devis',
'document_infos_invoice' => 'Informations affichées en bas des factures', 'document_infos_invoice' => 'Informations affichées en bas des factures',

+ 26
- 0
console/migrations/m230829_081058_add_column_producer_option_document_infos_top.php View File

<?php

use yii\db\Migration;
use yii\db\Schema;

/**
* Class m230829_081058_add_column_producer_option_document_infos_top
*/
class m230829_081058_add_column_producer_option_document_infos_top extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('producer', 'document_infos_top', Schema::TYPE_TEXT) ;
}

/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('producer', 'document_infos_top');
}
}

Loading…
Cancel
Save