Patch level : 12.0 982

Files correlati     : li0.exe f154.dir f154.trr li0200a.msk li0300a.msk li0400a.msk limenu.men
Commento            :

Ristrutturato modulo li
This commit is contained in:
Alessandro Bonazzi 2020-07-26 19:57:29 +02:00
parent 97b82a31b0
commit 59005050c9
13 changed files with 808 additions and 1142 deletions

View File

@ -1,3 +1,3 @@
154
0
$letint|0|0|114|0|Lettere d'intento|||
$letint|0|0|132|0|Lettere d'intento|||

View File

@ -1,5 +1,5 @@
154
17
18
ANNO|2|4|0|Anno
NUMPROT|3|6|0|Numero protocollo
DATAREG|5|8|0|Data di registrazione
@ -9,7 +9,8 @@ CODCLI|3|6|0|Codice cliente
UFFIVA|9|3|0|Codice ufficio IVA
NOTE|11|10|0|Note
TIPOOP|2|1|0|Tipo operazione (1=singola,2=fino a,3=nel periodo dal/al)
IMPORTO|4|18|3|Importo
IMPORTO|4|18|2|Importo lettera d'intento
UTILIZZATO|4|18|2|Importo utilizzato
DAL|5|8|0|Data inizio periodo
AL|5|8|0|Data fine periodo
STAMPATO|8|1|0|Stampato

View File

@ -11,6 +11,7 @@
#define LETINT_NOTE "NOTE"
#define LETINT_TIPOOP "TIPOOP"
#define LETINT_IMPORTO "IMPORTO"
#define LETINT_UTILIZZATO "UTILIZZATO"
#define LETINT_DAL "DAL"
#define LETINT_AL "AL"
#define LETINT_STAMPATO "STAMPATO"

View File

@ -3,7 +3,9 @@
int main(int argc,char** argv)
{
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
const char * s = argv[1]; s++;
int r = (argc > 1) ? atoi(s) : -1;
switch (r)
{
case 1: li0200(argc,argv) ; break; // Visualizzazione riepilogo plafond

View File

@ -1,8 +1,12 @@
#include <automask.h>
#include <relapp.h>
#include <utility.h>
#include <toolfld.h> // TButton_tool
#include <urldefid.h> // ID Bottoni
#include <doc.h>
#include "../ve/velib.h"
#include "lilib01.h"
#include "li0.h"
@ -13,12 +17,12 @@
/* Utility ***********************/
HIDDEN bool key_handler(TMask& m, KEY k)
{
// Per ora facciamo che il SHIFT+F12 attiva sempre il campo 3
if (k == K_SHIFT+K_F12)
m.enable(DLG_OK);
return true;
HIDDEN bool key_handler(TMask& m, KEY k)
{
// Per ora facciamo che il SHIFT+F12 attiva sempre il campo 3
if (k == K_SHIFT+K_F12)
m.enable(DLG_OK);
return true;
}
/*****************************************************************/
@ -70,26 +74,28 @@ void TVisLI_mask::load_sheet()
*/
int key = get(F_DACODCF).full() ? 2 : (get(F_DATAINI).full() ? 3 : (get(F_CODNUM).full() ? 5 : 1));
query << "KEY " << key << "\n";
TString queryFrom, queryTo;
switch (key)
{
case 2:
{
// 2: TIPOCF+CODCF+PROVV+ANNO+DATADOC+CODNUM+NDOC
queryFrom.cut(0) << "FROM TIPOCF='C' CODCF=#DACODCF PROVV='D'";
queryTo.cut(0) << "TO TIPOCF='C' CODCF=#ACODCF PROVV='D'";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
if(get(F_DATAINI).full())
{
queryFrom << " DATADOC=#DADATA";
if(get(F_CODNUM).full())
queryFrom << " CODNUM=#DACODNUM";
}
if(get(F_DATAFIN).full())
{
queryFrom.cut(0) << "FROM TIPOCF='C' CODCF=#DACODCF PROVV='D'";
queryTo.cut(0) << "TO TIPOCF='C' CODCF=#ACODCF PROVV='D'";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
if(get(F_DATAINI).full())
{
queryFrom << " DATADOC=#DADATA";
if(get(F_CODNUM).full())
queryFrom << " CODNUM=#DACODNUM";
}
if(get(F_DATAFIN).full())
{
queryTo << " DATADOC=#ADATA";
if(get(F_CODNUM).full())
queryTo << " CODNUM=#ACODNUM";
@ -100,11 +106,11 @@ void TVisLI_mask::load_sheet()
case 3:
{
// 3: DATADOC+PROVV+ANNO+CODNUM+NDOC
queryFrom.cut(0) << "DATADOC=#DADATA PROVV='D'";
queryFrom.cut(0) << "DATADOC=#DADATA PROVV='D'";
queryTo.cut(0) << "DATADOC=#ADATA PROVV='D'";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
if(get(F_CODNUM).full())
{
@ -117,12 +123,12 @@ void TVisLI_mask::load_sheet()
case 5:
{
// 5: PROVV+CODNUM+ANNO+NDOC
queryFrom.cut(0) << "PROVV='D' CODNUM=#DACODNUM";
queryFrom.cut(0) << "PROVV='D' CODNUM=#DACODNUM";
queryTo.cut(0) << "PROVV='D' CODNUM=#ACODNUM";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
}
}
break;
@ -130,12 +136,12 @@ void TVisLI_mask::load_sheet()
default:
{
// 1: PROVV+ANNO+CODNUM+NDOC
queryFrom.cut(0) << "PROVV='D'";
queryFrom.cut(0) << "PROVV='D'";
queryTo.cut(0) << "PROVV='D'";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
if(get(F_ANNO).full())
{
queryFrom << " ANNO=#DAANNO";
queryTo << " ANNO=#AANNO";
}
}
break;
@ -145,16 +151,8 @@ void TVisLI_mask::load_sheet()
TString querySel;
bool tipo = get(F_TIPODOC).full();
bool stato = get(F_STATO).full();
querySel << ((tipo || stato) ? "\nSELECT " : "") << (tipo ? "TIPODOC==#TIPODOC&&" : "") << (stato ? "STR(STATO==#STATO)" : "");
/*
if(tipo || stato)
querySel = "\nSELECT ";
if(tipo)
querySel << "TIPODOC==#TIPODOC&&";
if(stato)
querySel << "STATO==#STATO";
else
*/
if(tipo && !stato)
querySel.cut(querySel.len()-2);
@ -197,8 +195,8 @@ void TVisLI_mask::load_sheet()
TString16 key; key << get(F_ANNO) << "|" << get(F_NUMPROT);
TRectype letint = cache().get(LF_LETINT, key);
// 2: TIPOCF+CODCF+PROVV+ANNO+DATADOC+CODNUM+NDOC
query << "KEY 2\n"
"FROM TIPOCF='C' CODCF=" << letint.get("CODCLI") << " PROVV='D' ANNO=" << letint.get("ANNO") << " DATADOC=" << letint.get("DAL") << "\n"
query << "KEY 2\n"
"FROM TIPOCF='C' CODCF=" << letint.get("CODCLI") << " PROVV='D' ANNO=" << letint.get("ANNO") << " DATADOC=" << letint.get("DAL") << "\n"
"TO TIPOCF='C' CODCF=" << letint.get("CODCLI") << " PROVV='D' ANNO=" << letint.get("ANNO") << " DATADOC="<< letint.get("ANNO") << "1231";
TISAM_recordset rec(query);
for(bool ok = rec.move_first(); ok; ok = rec.move_next())
@ -233,24 +231,17 @@ void TVisLI_mask::addRow(TSheet_field& sheet, TISAM_recordset& rec)
// Creo una nuova riga
TToken_string& row = sheet.row(-1);
// Data documento
row.add(rec.get("DATADOC").as_date(), sheet.cid2index(A_DATADOC));
// Anno documento
row.add(rec.get("ANNO").as_int(), sheet.cid2index(A_ANNO));
// Numero documento
row.add(rec.get("NDOC").as_string(), sheet.cid2index(A_NUMDOC));
// Numero documento
row.add(rec.get("CODNUM").as_string(), sheet.cid2index(A_CODNUM));
// Tipo documento
row.add(rec.get("TIPODOC").as_string(), sheet.cid2index(A_TIPODOC));
// Stato documento
row.add(rec.get("STATO").as_string(), sheet.cid2index(A_STATODOC));
// Tipo cliente
row.add("C", sheet.cid2index(A_TIPOCF));
// Codice cliente
row.add(rec.get("CODCF").as_int(), sheet.cid2index(A_CODCF));
// Ragione Sociale
static TString key; key.cut(0) << "C|" << rec.get("CODCF").as_string();
row.add(cache().get(LF_CLIFO, key, "RAGSOC"), sheet.cid2index(A_RAGSOC));
row.add(rec.get("DATADOC").as_date(), sheet.cid2index(A_DATADOC)); // Anno documento
row.add(rec.get("ANNO").as_int(), sheet.cid2index(A_ANNO)); // Numero documento
row.add(rec.get("NDOC").as_string(), sheet.cid2index(A_NUMDOC)); // Numero documento
row.add(rec.get("CODNUM").as_string(), sheet.cid2index(A_CODNUM)); // Tipo documento
row.add(rec.get("TIPODOC").as_string(), sheet.cid2index(A_TIPODOC)); // Stato documento
row.add(rec.get("STATO").as_string(), sheet.cid2index(A_STATODOC)); // Tipo cliente
row.add("C", sheet.cid2index(A_TIPOCF)); // Codice cliente
row.add(rec.get("CODCF").as_int(), sheet.cid2index(A_CODCF)); // Ragione Sociale
TToken_string key("C"); key.add(rec.get("CODCF").as_string());
row.add(cache().get(LF_CLIFO, key, CLI_RAGSOC), sheet.cid2index(A_RAGSOC));
// Totale documento
row.add(rec.get("G1:TOTDOC").as_real(), sheet.cid2index(A_TOTDOC));
@ -338,14 +329,50 @@ bool TVisLI_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
case DLG_OK:
{
// Creo una maschera che richiede la data
TMask app("Creazione storico LI", 1, 50, 10);
app.add_button_tool(DLG_OK, "~Conferma", TOOL_OK);
app.add_button_tool(DLG_CANCEL, "Annulla", TOOL_CANCEL);
app.add_date(101, 0, "Data iniziale ", 1,1);
app.field(101).check_type(CHECK_REQUIRED);
TMask sto("Creazione storico LI", 1, 50, 14);
sto.add_button_tool(DLG_OK, "~Conferma", TOOL_OK);
sto.add_button_tool(DLG_CANCEL, "Annulla", TOOL_CANCEL);
TList_field & tipo = sto.add_list(F_TIPO, 0, "", 0, 0, 7, "H", "C", "Cliente");
TReal_field & anno = sto.add_number(F_ANNO_STO, 0, "Esercizio ", 1, 1, 4, "B");
TBrowse * b = new TBrowse(&anno, new TRelation("ESC"));
b->add_input_field(F_ANNO_STO, "CODTAB");
b->add_display_field("Codice esercizio", "CODTAB");
b->add_display_field("Data inizio esercizio", "D0");
b->add_display_field("Data fine esercizio", "D1");
b->add_output_field(F_ANNO_STO, "CODTAB");
anno.set_query_button(b);
anno.enable_check();
anno.check_type(CHECK_SEARCH);
TReal_field & from_cli = sto.add_number(F_FROM_CLI, 0, "Da cliente ", 1, 3, 6, "B");
TBrowse * bfc = new TBrowse(&from_cli, new TRelation(LF_CLIFO));
bfc->add_input_field(F_TIPO, CLI_TIPOCF, -1, true);
bfc->add_input_field(F_FROM_CLI, CLI_CODCF);
bfc->add_display_field("Codice cliente/fornitore", CLI_CODCF);
bfc->add_display_field("Ragione sociale@50", CLI_RAGSOC);
bfc->add_output_field(F_FROM_CLI, CLI_CODCF);
from_cli.set_query_button(bfc);
from_cli.enable_check();
from_cli.check_type(CHECK_SEARCH);
TReal_field & to_cli = sto.add_number(F_TO_CLI, 0, "A cliente ", 2, 5, 6, "B");
TBrowse * btc = new TBrowse(&to_cli, new TRelation(LF_CLIFO));
btc->add_input_field(F_TIPO, CLI_TIPOCF, -1, true);
btc->add_input_field(F_TO_CLI, CLI_CODCF);
btc->copy_display(bfc);
btc->add_output_field(F_TO_CLI, CLI_CODCF);
to_cli.set_query_button(btc);
to_cli.enable_check();
from_cli.check_type(CHECK_SEARCH);
// Lancio la maschera
if(app.run() == K_ENTER)
genera_li_storico(app.get_date(101));
if (sto.run() == K_ENTER)
genera_li_storico(sto.get_int(F_ANNO_STO), sto.get_long(F_FROM_CLI), sto.get_long(F_TO_CLI));
return false;
break;
}
case DLG_USER:
@ -359,11 +386,8 @@ bool TVisLI_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
if (e == fe_button && enab)
{
o.disable(); // Tecnica anti doppio click!
TRectype doc(LF_DOC);
doc.put("PROVV", 'D');
doc.put("ANNO", anno);
doc.put("CODNUM", codnum);
doc.put("NDOC", numdoc);
TDocumento doc('D', anno, codnum, numdoc);
doc.edit();
o.enable();
}
@ -392,11 +416,7 @@ void TVisLI_app::main_loop()
open_files(LF_LETINT, LF_DOC, LF_RIGHEDOC);
TVisLI_mask m;
while (m.run() == K_ENTER)
{
// DO DA TING
}
while (m.run() == K_ENTER);
}
int li0100(int argc, char* argv[])

View File

@ -19,6 +19,12 @@
#define END_MASK 499
// maschera ricostruzione storico
#define F_ANNO_STO 101
#define F_FROM_CLI 102
#define F_TO_CLI 103
#define F_TIPO 104
#define F_RIGHE 301
#define START_SHEET 101

View File

@ -6,6 +6,7 @@
#include "..\ve\velib.h"
#include <real.h>
#include "lilib01.h"
#include "letint.h"
#include "li0.h"
#include "li0200a.h"
@ -122,19 +123,48 @@ void TResDI_app::elab(TResDI_mask& m)
{
TRectype row_clifo(c_clifo.curr());
TLi_manager currentCli(row_clifo.get_char("TIPOCF"), row_clifo.get_long("CODCF"), aData); // Inizializzo l'oggetto per la gestione del plafond
if(currentCli.has_valid_plafond())
TLi_manager cli(row_clifo.get_long("CODCF"), aData.year()); // Inizializzo l'oggetto per la gestione del plafond
if (cli.has_valid_plafond())
{
real plafond = currentCli.get_plafond();
real resPlafond = plafond - currentCli.elab_util(tipi, stati, aData) - currentCli.elab_util(tipif, statif);
TArray arr = cli.get_plafond_array();
const int rows = arr.items();
for (int r = 0; r < rows; r++)
{
const TRectype & reclint = (const TRectype &) arr[r];
const int numprot = reclint.get_int(LETINT_NUMPROT);
real plafond = reclint.get_real(LETINT_IMPORTO);
real utilizzato = reclint.get_real(LETINT_UTILIZZATO);
real residuo = plafond - utilizzato;
const int tipo = reclint.get_int(LETINT_TIPOOP);
const TDate dal = reclint.get_date(LETINT_DAL);
const TDate al = reclint.get_date(LETINT_AL);
TString msg;
TString msg;
msg << "\nDichiarazione di intento cliente N." << row_clifo.get_long("CODCF") << "\nRagione sociale: " << row_clifo.get("RAGSOC") << "\nPlafond totale: " << static_cast<TCurrency>(plafond).string() << "\n";
log.log(0, msg);
msg = TString("Plafond disponibile: ") << static_cast<TCurrency>((resPlafond > ZERO ? resPlafond : ZERO )).string() << "";
log.log(0, msg);
msg = TString("Tipo dichiarazione: ") << (currentCli.is_soluzione() ? "Singola\n" : "A concorrenza\n");
log.log(0, msg);
msg << TR("Dichiarazione di intento cliente ") << row_clifo.get_long(CLI_CODCF) << " - "<< row_clifo.get(CLI_RAGSOC) << '\n';
log.log(0, msg);
msg.cut(0) << TR("Protocollo: ") << numprot << " - " << TR("Plafond disponibile: ") << residuo << "" << '\n';
log.log(0, msg);
msg.cut(0) << TR("Tipo dichiarazione: ");
switch (tipo)
{
case SOLUZIONE_UNICA:
msg << TR("Singola") << '\n';
break;
case FINO_A_PLAFOND:
msg << TR("A concorrenza ") << TR("Dal ") << dal << '\n';
break;
case A_TEMPO:
msg << TR("Dal ") << dal << TR("Al ") << al << '\n';
break;
default:
break;
}
log.log(0, msg);
log.log(0, "");
}
}
}
log.print_or_preview();

View File

@ -35,6 +35,7 @@ bool TLetint_mask::on_key(KEY k)
keyforced = true;
enable(DLG_SAVEREC);
enable(F_NUMPROT);
enable(F_UTILIZZATO);
}
if (k == K_SHIFT+K_F11)
keyforced = false;
@ -180,6 +181,7 @@ protected:
virtual TMask* get_mask(int mode) { return _mask; }
virtual bool changing_mask(int mode) { return false; }
virtual bool protected_record(TRectype &rec);
virtual void init_query_mode(TMask& m);
virtual void init_modify_mode(TMask& m);
virtual bool get_next_key(TToken_string& key);
@ -231,18 +233,23 @@ bool TLetint::protected_record(TRectype& rec) //evita la cancellazione del reco
return prot;
}
void TLetint::init_query_mode(TMask& m) //evita la registrazione di un record modificato se STAMPATO
{
m.disable(F_UTILIZZATO);
}
void TLetint::init_modify_mode(TMask& m) //evita la registrazione di un record modificato se STAMPATO
{
const TRectype& rec = get_relation()->curr();
const bool stampato = rec.get_bool(LETINT_STAMPATO);
const TRectype& rec = get_relation()->curr();
const bool stampato = rec.get_bool(LETINT_STAMPATO);
if (stampato)
{
m.disable(DLG_SAVEREC);
m.disable(DLG_DELREC);
TString msg = TR("Dichiarazione già stampata sul registro dell'esercizio ");
xvtil_statbar_set(msg);
}
m.disable(DLG_SAVEREC);
m.disable(DLG_DELREC);
TString msg = TR("Dichiarazione già stampata sul registro dell'esercizio ");
xvtil_statbar_set(msg);
}
m.disable(F_UTILIZZATO);
}

View File

@ -30,3 +30,5 @@
#define F_PROTINTS 124
#define F_NOTE 125
#define B_CHIUSA 126
#define F_UTILIZZATO 127
#define F_DISPONIBILE 128

View File

@ -244,9 +244,24 @@ BEGIN
CHECKTYPE REQUIRED
END
CURRENCY F_UTILIZZATO 18
BEGIN
PROMPT 1 18 "Utilizzato "
FIELD UTILIZZATO
FLAGS "D"
END
CURRENCY F_DISPONIBILE 18
BEGIN
PROMPT 1 19 "Disponibile "
NUM_EXPR #F_IMPORTO-#F_UTILIZZATO
DRIVENBY F_IMPORTO F_UTILIZZATO
FLAGS "DG"
END
DATE F_DAL
BEGIN
PROMPT 42 17 "Data inizio periodo"
PROMPT 42 18 "Data inizio periodo"
FIELD DAL
CHECKTYPE REQUIRED
VALIDATE DATE_CMP_FUNC >= F_VSDATA
@ -256,7 +271,7 @@ END
DATE F_AL
BEGIN
PROMPT 42 18 "Data fine periodo "
PROMPT 42 19 "Data fine periodo "
FIELD AL
CHECKTYPE REQUIRED
FLAGS "D"

File diff suppressed because it is too large Load Diff

View File

@ -9,102 +9,106 @@
#include <relation.h>
#endif
#ifndef __VELIB04_H
#include "../ve/velib04.h"
#ifndef __RECARRAY_H
#include <recarray.h>
#endif
class TDocumento;
class TLista_documenti;
#ifndef __REPUTILS_H
#include <reputils.h>
#endif
#include <map>
#include <unordered_map>
#define SOLUZIONE_UNICA 1
#define FINO_A_PLAFOND 2
#define A_TEMPO 3
enum plafStruct { _planno, _plnumprot, _plimporto, _plchiusura, _plNC };
enum plafStruct { _planno, _plnumprot, _plimporto};
class TLi_manager : TObject
// Ritorna il codice iva del plafond
const TString & iva_plafond();
// Controllo se il codice iva è uguale a quello impostato per il calcolo del plafond
bool check_iva_plafond(const TString& cod);
// controlla la visualizzazione immediata dei messaggi
void lint_batch(const bool on = true);
// azzera i messaggi
void lint_reset_msg();
// restituisce i messaggi
const TToken_string & lint_get_msg();
// Ricostruisce il plafond dall'anno
void genera_li_storico(const int anno, const long from_cli = 0L, const long to_cli = 0L, const char tipocf = 'C');
class TLi_manager : public TObject
{
TToken_string _tipi;
TToken_string _stati;
bool _valid_plafond;
bool _soluzione;
bool _elab_pr;
const char _tipocf;
const long _codcli;
char _tipocf;
long _codcli;
int _anno;
bool _dirty;
TDate _ini_dic_int;
TDate _fin_dic_int;
real _plafond;
real _utilizzato;
TString_array _days;
TArray _plafonds;
protected:
void clear_letint();
void read(const TRectype & filter);
int flush();
const TString _codiva_def;
const TString _codiva_alt;
// Elenco di plafond con eventuale
// Chiave ANNO|NUMERO(6)
std::map<TString, real> _plafondi;
std::map<int, TString> _modifiche; // Progressivo, TToken_string(chiave,stato);
void elab_tipi_stati(); // Preparo due token string con tipi[0] -> stati[0], ...
public:
// Getters
char tipo() const { return _tipocf; }
long codice() const { return _codcli; }
int anno() const { return _anno; }
bool doc_ok(const TDocumento & doc) const;
// Ritorno il plafond
const real get_plafond() { return _plafond; }
// Ritorno l'utilizzo
const real get_utilizzo() { return _utilizzato; }
// Ritorno il plafond
const real get_residuo() { return _plafond - _utilizzato; }
// Ritorno se il plafond è valido
bool has_valid_plafond() const { return _valid_plafond; }
// Ritorna se è una dichiarazione di tipo soluzione
bool is_soluzione() const { return _soluzione; }
// Funzione che unisce consPlaf e incrPlaf
const TToken_string& get_use(TDocumento& d, const bool write = false);
// "Consuma" il plafond
const TToken_string& cons_plaf(real& plaf_used, const bool write = false);
// Da una nota credito passata incremento il plafond
const TToken_string& incr_plaf(TDocumento& d, real imp_nc = ZERO, const bool write = false);
// Storna un documento che riceve
const TToken_string& storna_doc(const TDocumento& d, real imp_dc = ZERO, const bool write = false);
// Storna i documenti dopo a quello che riceve
//void stornaDocs(const TDocumento& d, const bool write = false);
// Ricalcola i documenti dopo quello che riceve
//bool recalcAfter(const TDocumento& d, TLog_report& lerr);
// ritorna lettera d'intento modificata
const bool dirty() const { return _dirty; }
// imposta lettera d'intento modificata
void set_dirty(bool on = true) { _dirty = on; }
// imposta l'anno
void set_anno(const int anno);
// Ritorna la lettera d'intento
TRectype & get_lint(const int numprot);
// Ritorna la lettera d'intento
const TArray & get_plafond_array() const { return _plafonds; }
// Utilizza il plafond
bool utilizza_plafond(const TDocumento & d, TToken_string & plafs, const real importo);
// Functions
// Vado a estrapolare il plafond
void elab_plafond();
// Testo se con i documenti passati supero il plafond
bool test_plafond(TLista_documenti& dout, TLog_report& lerr);
// Controllo se il codice iva è uguale a quello impostato per il calcolo del plafond
bool check_iva(const TString& cod) const { return cod == _codiva_def || cod == _codiva_alt; }
// Controllo se il plafond che la NC passata rilascia non è già stato utilizzato
bool check_utilizzo(TDocumento& d, real imp_nc = ZERO);
// Aggiunge a una lettera d'intento
void sub2lint(TRectype & reclint, const real & utilizzo) { add2lint(reclint, utilizzo, false); }
// Aggiungono a una lettera d'intento
void add2lint(TRectype & reclint, const real & utilizzo, const bool add = true);
// Calcolo il rimanente del plafond
const real get_pla_res();
// Calcolo il rimanente del plafond su tipi e stati documento passati
const real get_pla_res(TToken_string tipi, TToken_string stati);
// Funzione che effettivamente effettua il calcolodalla data della dichiarazione alla data passata
const real elab_pla_res(TToken_string t = "", TToken_string s = "", TDate ad = 0L);
// Ritorna la quantità di plafond utilizzato dalla data della dichiarazione alla data passata
const real elab_util(TToken_string tipi, TToken_string stati, TDate ad = 0L);
// Modifica una lettera e salva la modifica in "modifiche"
void change_stato(const TString& key, const bool stato);
// Controlla se ci sono delle modifiche da salvare nei plafonds
bool has_modifiche() const { return !_modifiche.empty(); }
// Annullo le modifiche
void revert_modifiche();
// Vuoto le modifiche
void clear_modifiche() { _modifiche.clear(); }
// Funzione che aggiorna il residuo plafond dichiarazione dalla data alla data
void TLi_manager::rebuild_plafond(bool update_docs = true, const int anno = 0);
// Funzione che effettivamente effettua il calcolodalla data della dichiarazione alla data passata
const real elab_util(TDate ad = 0L);
bool plafond_write(TDocumento& d);
bool plafond_rewrite(TDocumento& d);
bool rewrite(TDocumento& d) { return write_rewrite(d, true); }
bool write(TDocumento& d) { return write_rewrite(d, false); }
bool write_rewrite(TDocumento& d, bool rewrite = false);
bool remove(TDocumento& d);
// Costructors/Destructors
TLi_manager(const char t, const long c, TDate ini_dic, TDate fin_dic);
TLi_manager(const char t, const long c, TDate fin_dic); // Sets iniDicInt as 01/01/finDic.year()
virtual ~TLi_manager() {}
void read(const char t = ' ', const long c = 0L, TDate iniDic = TDate(NULLDATE), TDate finDic = TDate(NULLDATE));
// Costructors/Destructors
TLi_manager(const long c, const int anno = 0) : TLi_manager('C', c, anno) {}
TLi_manager(const char t = 'C' , const long c = 0L, const int anno = 0);
virtual ~TLi_manager();
};
static void create_tipi_stati(TToken_string& tipi, TToken_string& stati);
bool genera_li_storico(const TDate& data_ini);
bool popola_plafond(TLista_documenti& din, const TDate& data_elab);
void scrivi_plafond(TLista_documenti& din, const TDate& data_elab);
#endif

View File

@ -6,6 +6,6 @@ Flags = "F"
Item_01 = "Dichiarazioni d'intento", "li0 -3", ""
Item_02 = "Stampa dichiarazioni", "li0 -4", ""
Item_03 = "Riepilogo dichiarazioni", "li0 -1", ""
Item_04 = "Riepilogo Documenti/Lettere", "li0", ""
Item_04 = "Riepilogo Documenti/Lettere", "li0 -0", ""
Item_03 = "Impostazioni", "li0 -2", ""