mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-08 23:58:42 +01:00
Aggiunta descrizione revisione
This commit is contained in:
parent
d65d879eae
commit
49e660f10a
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||||
* Copyright (C) DevCode s.r.l.
|
* Copyright (C) DevCode s.n.c.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -61,20 +61,18 @@ switch (post('op')) {
|
|||||||
$preventivo->idporto = post('idporto');
|
$preventivo->idporto = post('idporto');
|
||||||
$preventivo->tempi_consegna = post('tempi_consegna');
|
$preventivo->tempi_consegna = post('tempi_consegna');
|
||||||
$preventivo->numero = post('numero');
|
$preventivo->numero = post('numero');
|
||||||
$preventivo->condizioni_fornitura = post('condizioni_fornitura');
|
|
||||||
|
|
||||||
// Informazioni sulle date del documento
|
// Informazioni sulle date del documento
|
||||||
$preventivo->data_bozza = post('data_bozza') ?: null;
|
$preventivo->data_bozza = post('data_bozza');
|
||||||
$preventivo->data_rifiuto = post('data_rifiuto') ?: null;
|
$preventivo->data_rifiuto = post('data_rifiuto');
|
||||||
|
|
||||||
// Dati relativi alla validità del documento
|
// Dati relativi alla validità del documento
|
||||||
$preventivo->validita = post('validita');
|
$preventivo->validita = post('validita');
|
||||||
$preventivo->tipo_validita = post('tipo_validita');
|
$preventivo->tipo_validita = post('tipo_validita');
|
||||||
$preventivo->data_accettazione = post('data_accettazione') ?: null;
|
$preventivo->data_accettazione = post('data_accettazione');
|
||||||
$preventivo->data_conclusione = post('data_conclusione') ?: null;
|
$preventivo->data_conclusione = post('data_conclusione');
|
||||||
|
|
||||||
$preventivo->esclusioni = post('esclusioni');
|
$preventivo->esclusioni = post('esclusioni');
|
||||||
$preventivo->garanzia = post('garanzia');
|
|
||||||
$preventivo->descrizione = post('descrizione');
|
$preventivo->descrizione = post('descrizione');
|
||||||
$preventivo->id_documento_fe = post('id_documento_fe');
|
$preventivo->id_documento_fe = post('id_documento_fe');
|
||||||
$preventivo->num_item = post('num_item');
|
$preventivo->num_item = post('num_item');
|
||||||
@ -326,6 +324,7 @@ switch (post('op')) {
|
|||||||
|
|
||||||
$new->default_revision = 1;
|
$new->default_revision = 1;
|
||||||
$new->numero_revision = $new->ultima_revisione + 1;
|
$new->numero_revision = $new->ultima_revisione + 1;
|
||||||
|
$new->descrizione_revision = post('descrizione');
|
||||||
$new->save();
|
$new->save();
|
||||||
|
|
||||||
$id_record = $new->id;
|
$id_record = $new->id;
|
||||||
@ -347,7 +346,7 @@ switch (post('op')) {
|
|||||||
$order = explode(',', post('order', true));
|
$order = explode(',', post('order', true));
|
||||||
|
|
||||||
foreach ($order as $i => $id_riga) {
|
foreach ($order as $i => $id_riga) {
|
||||||
$dbo->query('UPDATE `co_righe_preventivi` SET `order` = '.prepare($i + 1).' WHERE id='.prepare($id_riga));
|
$dbo->query('UPDATE `co_righe_preventivi` SET `order` = '.prepare($i).' WHERE id='.prepare($id_riga));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||||
* Copyright (C) DevCode s.r.l.
|
* Copyright (C) DevCode s.n.c.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
echo '
|
echo'
|
||||||
<button type="button" class="btn btn-primary" onclick="if( confirm(\'Duplicare questo preventivo?\') ){ $(\'#copia-preventivo\').submit(); }">
|
<button type="button" class="btn btn-primary" onclick="if( confirm(\'Duplicare questo preventivo?\') ){ $(\'#copia-preventivo\').submit(); }">
|
||||||
<i class="fa fa-copy"></i> '.tr('Duplica preventivo').'
|
<i class="fa fa-copy"></i> '.tr('Duplica preventivo').'
|
||||||
</button>';
|
</button>';
|
||||||
@ -31,8 +31,8 @@ echo '
|
|||||||
<div class="tip" data-toggle="tooltip" title="'.tr('Per creare una nuova revisione lo stato del preventivo deve essere tra: _STATE_LIST_', [
|
<div class="tip" data-toggle="tooltip" title="'.tr('Per creare una nuova revisione lo stato del preventivo deve essere tra: _STATE_LIST_', [
|
||||||
'_STATE_LIST_' => $stati_abilitati,
|
'_STATE_LIST_' => $stati_abilitati,
|
||||||
]).'">
|
]).'">
|
||||||
<button type="button" class="btn btn-warning '.($record['is_revisionabile'] ? '' : 'disabled').'" onclick="if(confirm(\''.tr('Creare un nuova revisione?').'\')){$(\'#crea-revisione\').submit();}">
|
<button type="button" class="btn btn-warning '.($record['is_revisionabile'] ? '' : 'disabled').'" onclick="openModal(\''.tr('Crea revisione').'\', \''.$module->fileurl('crea_revisione.php').'?id_module='.$id_module.'&id_record='.$id_record.'\')">
|
||||||
<i class="fa fa-plus-square"></i> '.tr('Crea nuova revisione...').'
|
<i class="fa fa-edit"></i> '.tr('Crea nuova revisione...').'
|
||||||
</button>
|
</button>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
@ -84,11 +84,3 @@ echo '
|
|||||||
<input type="hidden" name="backto" value="record-edit">
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
<input type="hidden" name="op" value="copy">
|
<input type="hidden" name="op" value="copy">
|
||||||
</form>';
|
</form>';
|
||||||
|
|
||||||
// Crea revisione
|
|
||||||
echo '
|
|
||||||
<form action="" method="post" id="crea-revisione">
|
|
||||||
<input type="hidden" name="backto" value="record-edit">
|
|
||||||
<input type="hidden" name="op" value="add_revision">
|
|
||||||
<input type="hidden" name="id_record" value="'.$id_record.'">
|
|
||||||
</form>';
|
|
||||||
|
44
modules/preventivi/crea_revisione.php
Normal file
44
modules/preventivi/crea_revisione.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||||
|
* Copyright (C) DevCode s.n.c.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\Preventivi\Preventivo;
|
||||||
|
|
||||||
|
$revisione = Preventivo::find($id_record)->ultima_revisione;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form action="" method="post">
|
||||||
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
|
<input type="hidden" name="op" value="add_revision">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "Revisione n. <?php echo $revisione+1; ?>" ]}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 text-right">
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
<i class="fa fa-plus"></i><?php echo tr(' Aggiungi'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
@ -22,7 +22,7 @@ $r = $dbo->fetchOne('SELECT *,
|
|||||||
IF( (an_referenti.email IS NOT NULL AND an_referenti.email!=""), an_referenti.email, an_anagrafiche.email) AS email
|
IF( (an_referenti.email IS NOT NULL AND an_referenti.email!=""), an_referenti.email, an_anagrafiche.email) AS email
|
||||||
FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica LEFT OUTER JOIN an_referenti ON an_referenti.id=co_preventivi.idreferente WHERE co_preventivi.id='.prepare($id_record));
|
FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica LEFT OUTER JOIN an_referenti ON an_referenti.id=co_preventivi.idreferente WHERE co_preventivi.id='.prepare($id_record));
|
||||||
|
|
||||||
$revisione = $dbo->fetchNum('SELECT * FROM co_preventivi WHERE master_revision = (SELECT master_revision FROM co_preventivi WHERE id = '.prepare($id_record).') AND id < '.prepare($id_record)) + 1;
|
$revisione = $dbo->fetchNum('SELECT * FROM co_preventivi WHERE master_revision = (SELECT master_revision FROM co_preventivi WHERE id = '.prepare($id_record).') AND id < '.prepare($id_record));
|
||||||
|
|
||||||
// Variabili da sostituire
|
// Variabili da sostituire
|
||||||
return [
|
return [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||||
* Copyright (C) DevCode s.r.l.
|
* Copyright (C) DevCode s.n.c.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -61,8 +61,9 @@ foreach ($revisioni as $i => $revisione) {
|
|||||||
<input type='radio' class='revision_changer' name='idrevisione' value='".$revisione['id']."' ".$cheched.'>
|
<input type='radio' class='revision_changer' name='idrevisione' value='".$revisione['id']."' ".$cheched.'>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
'.tr('Revisione _NUM_ creata il _DATE_ alle _TIME_', [
|
'.tr('(REV. _NUM_) _DESC_ creata il _DATE_ alle _TIME_', [
|
||||||
'_NUM_' => ($revisione['numero_revision']),
|
'_NUM_' => ($revisione['numero_revision']),
|
||||||
|
'_DESC_' => ($revisione['descrizione_revision']),
|
||||||
'_DATE_' => dateFormat($revisione['created_at']),
|
'_DATE_' => dateFormat($revisione['created_at']),
|
||||||
'_TIME_' => timeFormat($revisione['created_at']),
|
'_TIME_' => timeFormat($revisione['created_at']),
|
||||||
])."
|
])."
|
||||||
|
@ -167,4 +167,8 @@ ALTER TABLE `co_pagamenti` DROP `riba`;
|
|||||||
INSERT INTO `zz_group_module` (`idgruppo`, `idmodule`, `name`, `clause`, `position`, `enabled`, `default`) VALUES(4, 31, 'Mostra i contratti ai clienti coivolti', 'co_contratti.idanagrafica=|id_anagrafica|', 'WHR', 1, 1);
|
INSERT INTO `zz_group_module` (`idgruppo`, `idmodule`, `name`, `clause`, `position`, `enabled`, `default`) VALUES(4, 31, 'Mostra i contratti ai clienti coivolti', 'co_contratti.idanagrafica=|id_anagrafica|', 'WHR', 1, 1);
|
||||||
|
|
||||||
-- Fix widget crediti clienti
|
-- Fix widget crediti clienti
|
||||||
UPDATE `zz_widgets` SET `query` = 'SELECT \n CONCAT_WS(\' \', REPLACE(REPLACE(REPLACE(FORMAT((\n SELECT SUM(da_pagare-pagato)), 2), \',\', \'#\'), \'.\', \',\'),\'#\', \'.\'), \'€\') AS dato FROM (co_scadenziario INNER JOIN co_documenti ON co_scadenziario.iddocumento=co_documenti.id) INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_tipidocumento.dir=\'entrata\' AND co_documenti.idstatodocumento!=1 |segment| AND 1=1' WHERE `zz_widgets`.`name` = 'Crediti da clienti';
|
UPDATE `zz_widgets` SET `query` = 'SELECT \n CONCAT_WS(\' \', REPLACE(REPLACE(REPLACE(FORMAT((\n SELECT SUM(da_pagare-pagato)), 2), \',\', \'#\'), \'.\', \',\'),\'#\', \'.\'), \'€\') AS dato FROM (co_scadenziario INNER JOIN co_documenti ON co_scadenziario.iddocumento=co_documenti.id) INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_tipidocumento.dir=\'entrata\' AND co_documenti.idstatodocumento!=1 |segment| AND 1=1' WHERE `zz_widgets`.`name` = 'Crediti da clienti';
|
||||||
|
|
||||||
|
-- Aggiunto campo descrizione revisione in preventivi
|
||||||
|
ALTER TABLE `co_preventivi` ADD `descrizione_revision` VARCHAR(255) NOT NULL AFTER `default_revision`;
|
||||||
|
UPDATE `zz_prints` SET `filename` = 'Preventivo num. {numero} del {data} rev {revisione}' WHERE `zz_prints`.`name` = 'Preventivo';
|
Loading…
x
Reference in New Issue
Block a user