1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-12 16:38:19 +01:00
openstamanager/modules/preventivi/crea_documento.php
2020-07-02 15:27:18 +02:00

34 lines
781 B
PHP

<?php
include_once __DIR__.'/../../core.php';
use Modules\Preventivi\Preventivo;
$documento = Preventivo::find($id_record);
if (get('documento') == 'fattura') {
$final_module = 'Fatture di vendita';
$op = 'add_documento';
} elseif (get('documento') == 'ordine') {
$final_module = 'Ordini cliente';
$op = 'add_preventivo';
} elseif (get('documento') == 'ddt') {
$final_module = 'Ddt di vendita';
$op = 'add_documento';
} else {
$final_module = 'Contratti';
$op = 'add_preventivo';
}
$options = [
'op' => $op,
'type' => 'preventivo',
'module' => $final_module,
'button' => tr('Aggiungi'),
'dir' => 'entrata',
'create_document' => true,
'documento' => $documento,
];
echo App::load('importa.php', [], $options, true);