openstamanager/modules/preventivi/crea_documento.php

34 lines
781 B
PHP
Raw Normal View History

2019-02-14 17:49:58 +01:00
<?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';
}
2019-02-14 17:49:58 +01:00
$options = [
'op' => $op,
'type' => 'preventivo',
'module' => $final_module,
2019-02-14 17:49:58 +01:00
'button' => tr('Aggiungi'),
'dir' => 'entrata',
'create_document' => true,
'documento' => $documento,
2019-02-14 17:49:58 +01:00
];
echo App::load('importa.php', [], $options, true);