Patch level : 2.2 121

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Riportata la versione 2.1 320


git-svn-id: svn://10.65.10.50/trunk@13169 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2005-06-01 11:20:06 +00:00
parent fce3f51353
commit 4b9323466b
35 changed files with 762 additions and 335 deletions

View File

@ -41,8 +41,8 @@
#define FN_DEDART13 "DEDART13" /* CHK_GD3_DEDART13 */
#define FN_RICSUP20 "RICSUP20" /* CHK_GD3_RICSUP20 */
#define FN_RAPPR "RAPPR" /* FLD_GD3_RAPPR */
#define FN_CARRAPP "CARRAPP" /* FLD_GD3_CARRAPP */
#define FN_DECCARRAPP "DECCARRAPP" /* FLD_GD3_DECCARRAPP */
#define FN_CARRAPP "CARRAPP" /* FLD_GD3_CARRAPP */
#define FN_DECCARINT "DECCARINT" /* FLD_GD3_DECCARINT */
#define RDB_GD1_FREQVIVA 102
#define FLD_GD3_FIRMAT 107
@ -57,7 +57,7 @@
#define FLD_GD3_RAPPR_ANAGR_RAGSOC 116
#define FLD_GD3_CARRAPP 117
#define FLD_GD3_CARRAPP_TABCARICHE_DESCR 118
#define FLD_GD3_DECCARRAPP 119
#define FLD_GD3_DECCARINT 119
#define FLD_GD2_CODSTAT1_TABSTT_S0 121
#define FLD_GD2_CODSTAT2_TABSTT_S0 122
#define FLD_GD2_CODSTAT3_TABSTT_S0 123
@ -74,7 +74,7 @@
#define FLD_GD2_RAPPR_ANAGR_RAGSOC 133
#define FLD_GD2_CARRAPP 134
#define FLD_GD2_CARRAPP_TABCARICHE_DESCR 135
#define FLD_GD2_DECCARRAPP 136
#define FLD_GD2_DECCARINT 136
#define RDB_GD2_FREQVIVA_M 137
#define RDB_GD2_FREQVIVA_T 138
#define FLD_GD1_CODATTPREV 139

View File

@ -639,10 +639,10 @@ BEGIN
HELP "Indicare l'iscrizione al CAF dell' intermediario"
END
DATE FLD_GD3_DECCARRAPP
DATE FLD_GD3_DECCARINT
BEGIN
PROMPT 52 6 "Decorrenza "
FIELD LF_NDITTE->DECCARRAPP
FIELD LF_NDITTE->DECCARINT
HELP "Data di decorrenza della rappresentanza legale"
WARNING "Data non coerente"
VALIDATE DATE_CMP_FUNC >= FLD_GD2_DINIZIOATT

View File

@ -20,63 +20,64 @@
#define F_PROG_DARE 147
#define F_PROG_AVERE 148
#define F_STAMPA_RIEPIL_SUL_REGISTRO 149
#define F_STAMPA_LIQUIDAZIONE 150
#define F_ULTIMO_NUM_PROT 151
#define F_MESE_STAMPA_ULTIMA_LIQ 152
#define F_ULTIMA_DATA_DI_REGISTR 153
#define F_STAMPA_RIEPIL_SUL_REGISTRO 149
#define F_STAMPA_LIQUIDAZIONE 150
#define F_ULTIMO_NUM_PROT 151
#define F_MESE_STAMPA_ULTIMA_LIQ 152
#define F_ULTIMA_DATA_DI_REGISTR 153
#define F_VENTIL 154
#define F_STAMPA_CREDITO_ANNO_PREC 155
#define F_STAMPA_INDIRIZZI_COMPLETI 156
#define F_STAMPA_INTESTAZIONE 157
#define F_VENTIL 154
#define F_STAMPA_CREDITO_ANNO_PREC 155
#define F_STAMPA_INDIRIZZI_COMPLETI 156
#define F_STAMPA_INTESTAZIONE 157
#define F_FREQUENZA_STAMPA 158
#define F_FREQUENZA_STAMPA 158
#define F_STAMPA_COSTI_RICAVI 159
#define F_TIPO_DESC_COSTI_RICAVI 160
#define F_STAMPA_COSTI_RICAVI 159
#define F_TIPO_DESC_COSTI_RICAVI 160
#define F_TOT_INCASSI 161
#define F_TOT_PAGAMENTI 162
#define F_TOT_INCASSI 161
#define F_TOT_PAGAMENTI 162
#define F_ULTIMA_DATA_DI_STAMPA 170
#define F_CODULC 163
#define F_CODLBU 164
#define F_RAGSOC 165
#define F_REGSOSPEXT 166
#define F_STAMPA_PLAFONDS 167
#define F_STAMPA_NUMERI 168
#define F_CODULC 163
#define F_CODLBU 164
#define F_RAGSOC 165
#define F_REGSOSPEXT 166
#define F_STAMPA_PLAFONDS 167
#define F_STAMPA_NUMERI 168
#define F_ULTIMA_DATA_DI_STAMPA 170
#define F_PROGINV 171
#define F_TOTINV 172
#define F_PRINTER 201
#define F_CONFIG 202
#define F_PRINTER 201
#define F_CONFIG 202
#define F_FREQSTA 203
#define F_STARAGG 204
#define F_STARAGGMAG 205
#define F_STACLAFIS 206
#define F_STAFISART 207
#define F_STAFISCAU 208
#define F_PAGULTCORR 215
#define F_ULTCORR 216
#define F_PAGULTPREC 217
#define F_ULTPREC 218
#define F_FREQSTA 203
#define F_STARAGG 204
#define F_STARAGGMAG 205
#define F_STACLAFIS 206
#define F_STAFISART 207
#define F_STAFISCAU 208
#define F_PAGULTCORR 215
#define F_ULTCORR 216
#define F_PAGULTPREC 217
#define F_ULTPREC 218
#define GRP_VENDITE 2
#define GRP_ACQUISTI 3
#define GRP_RIEPIVA 4
#define GRP_INCASSI 5
#define GRP_GIORNALE 6
#define GRP_LSOCIALI 7
#define GRP_CESPITI 8
#define GRP_INVENTARI 9
#define GRP_GIORNMAG 10
#define GRP_VENDITE 2
#define GRP_ACQUISTI 3
#define GRP_RIEPIVA 4
#define GRP_INCASSI 5
#define GRP_GIORNALE 6
#define GRP_LSOCIALI 7
#define GRP_CESPITI 8
#define GRP_INVENTARI 9
#define GRP_GIORNMAG 10
#define GRP_SOLOGIORNMAG 11
#define GRP_NOGIORNMAG 12
#define GRP_SOLOGIORNALE 13
#define GRP_NOGIORNALE 14
#define GRP_SOLOGIORNMAG 11
#define GRP_NOGIORNMAG 12
#define GRP_SOLOGIORNALE 13
#define GRP_NOGIORNALE 14
#define GRP_INTENTI 15
#define GRP_NOINTENTI 16
#define GRP_INTENTI 15
#define GRP_NOINTENTI 16

View File

@ -72,7 +72,6 @@ BEGIN
OUTPUT F_CODICE CODTAB[5,7]
OUTPUT F_ANNO CODTAB[1,4]
OUTPUT F_DESCR S0
// COPY ALL F_ANNO
FLAGS "GUZ"
KEY 1
GROUP 1
@ -183,7 +182,7 @@ BEGIN
GROUP GRP_VENDITE GRP_ACQUISTI GRP_RIEPIVA GRP_INCASSI GRP_GIORNALE GRP_LSOCIALI GRP_GIORNMAG GRP_NOINTENTI
FIELD I7
USE LF_UNLOC
JOIN LF_COMUNI TO LF_UNLOC KEY 1 INTO COM=COMULC
JOIN LF_COMUNI TO LF_UNLOC KEY 1 INTO COM=COMULC
INPUT CODDITTA F_CODDITTA SELECT
INPUT CODULC F_CODULC
DISPLAY "Codice" CODDITTA
@ -200,38 +199,38 @@ END
NUMBER F_PAGSTAMP 5
BEGIN
PROMPT 1 10 "Pagine stampate "
PROMPT 1 10 "Pagine stampate "
HELP "Numero di pagine gia' stampate"
FIELD I1
GROUP 1
END
DATE F_ULTIMA_DATA_DI_STAMPA
BEGIN
PROMPT 26 10 "Ultima data di stampa "
HELP "Data dell'ultima stampa effettuata"
FIELD D3
GROUP 1
END
NUMBER F_PAGNUM 5
BEGIN
PROMPT 60 10 "Pagine numerate "
PROMPT 30 10 "Pagine numerate "
HELP "numero di pagine di cui e' stata stampata la numerazione"
FIELD I2
GROUP 1
END
DATE F_ULTIMA_DATA_DI_STAMPA
BEGIN
PROMPT 1 11 "Ultima data di stampa "
HELP "Data dell'ultima stampa effettuata"
FIELD D3
GROUP 1
END
BOOLEAN F_STAMPA_NUMERI
BEGIN
PROMPT 1 11 "Stampa numeri di pagina durante la stampa del registro"
PROMPT 1 13 "Stampa numeri di pagina durante la stampa del registro"
FIELD S11
GROUP 1
GROUP 1
END
DATE F_DATAVID
BEGIN
PROMPT 1 13 "Data vidimazione "
PROMPT 1 14 "Data vidimazione "
HELP "Data di vidimazione del registro"
FIELD D0
GROUP 1
@ -239,15 +238,29 @@ END
DATE F_DATASCAD
BEGIN
PROMPT 35 13 "Data scadenza "
PROMPT 35 14 "Data scadenza "
HELP "Data fino a cui rimane in vigore il registro"
FIELD D1
GROUP 1
END
NUMBER F_PROGINV 4
BEGIN
PROMPT 1 15 "Progressivo invio "
FIELD I3
GROUP GRP_INTENTI
END
NUMBER F_TOTINV 4
BEGIN
PROMPT 30 15 "Totale invii "
FIELD I4
GROUP GRP_INTENTI
END
STRING F_CODLBU 3
BEGIN
PROMPT 1 15 "Cod. libro unico "
PROMPT 1 16 "Cod. libro unico "
FIELD S6
HELP "Codice del libro unico a cui fa riferimento"
FLAGS "UZ"
@ -267,13 +280,13 @@ END
BOOLEAN F_CONFIG
BEGIN
PROMPT 1 17 "Stampante configurata"
PROMPT 1 18 "Stampante configurata"
GROUP GRP_NOINTENTI
END
BUTTON F_PRINTER 30 2
BEGIN
PROMPT 40 17 "Configurazione ~stampante"
PROMPT 40 18 "Configurazione ~stampante"
GROUP GRP_NOINTENTI
END
@ -358,7 +371,7 @@ BEGIN
PROMPT 1 5 "Tipo descrizione costi/ricavi "
HELP "Livello a cui stampare la descrizione costi/ricavi"
FIELD I3
GROUP GRP_INCASSI GRP_NOGIORNMAG
GROUP GRP_INCASSI GRP_NOGIORNMAG GRP_NOINTENTI
ITEM "1|Gruppo"
ITEM "2|Conto"
END
@ -463,7 +476,7 @@ BEGIN
FLAGS "M"
ITEM "00|Nessuno"
ITEM "13|Annuale"
GROUP GRP_VENDITE GRP_ACQUISTI GRP_RIEPIVA
GROUP GRP_VENDITE GRP_ACQUISTI GRP_RIEPIVA GRP_NOINTENTI
END
BOOLEAN F_VENTIL
@ -514,7 +527,7 @@ BEGIN
FIELD I3
NUM_EXPR #F_FREQ<=31
WARNING "La frequenza di stampa può arrivare fino a 31 giorni"
GROUP GRP_GIORNMAG GRP_SOLOGIORNMAG
GROUP GRP_GIORNMAG GRP_SOLOGIORNMAG GRP_NOINTENTI
END
BOOLEAN F_STARAGG

View File

@ -31,7 +31,7 @@ ESILOR|8|1|0|
NAPP|2|3|0|
RAPPR|3|5|0|
CARRAPP|2|1|0|
DECCARRAPP|5|8|0|
DECCARINT|5|8|0|
REGSTATSP|8|1|0|
FIRMAT|3|5|0|
AZCONIUG|8|1|0|

View File

@ -256,7 +256,7 @@ bool TCespite::valido()
if (alienazione.ok() && alienazione < ini_es)
{
set_msg05(TR("cespite completamente eliminato."));
return FALSE;
return false;
}
// Categoria non ammortizzabile
@ -264,7 +264,7 @@ bool TCespite::valido()
if (cat.get_bool("B0"))
{
set_msg05(TR("categoria non ammortizzabile."));
return FALSE;
return false;
}
// Cespite non ancora completato
@ -272,7 +272,7 @@ bool TCespite::valido()
if (!completamento.ok() || completamento > fin_es)
{
set_msg05(TR("cespite non completato."));
return FALSE;
return false;
}
// Cespite materiale non in funzione
@ -284,7 +284,7 @@ bool TCespite::valido()
if (!funzione.ok() || funzione > fin_es)
{
set_msg05(TR("cespite non ancora entrato in funzione."));
return FALSE;
return false;
}
}
@ -298,7 +298,7 @@ bool TCespite::valido()
if (!ricavi.ok() || ricavi > fin_es)
{
set_msg05(TR("non sono ancora stati conseguiti ricavi."));
return FALSE;
return false;
}
}
}
@ -309,11 +309,11 @@ bool TCespite::valido()
if (completamento >= ini_es && completamento <= fin_es)
{
set_msg05(TR("decorrenza ammortamenti dall'esercizio successivo."));
return FALSE;
return false;
}
}
return TRUE;
return true;
}
// Calcola il valore ammortizzabile di un cespite in base a quanto scritto in SALPRO
@ -1172,11 +1172,11 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
// Calcolare quote perse
const TDate dtmov = tmv.get_date(MOVCE_DTMOV);
const real quote_perse = calc_quote_perse(valamm, per_eff, resamm, qnor, TRUE, dtmov);
const real quote_perse = calc_quote_perse(valamm, per_eff, resamm, qnor, true, dtmov);
ammmv.put(AMMMV_QPERSE, quote_perse);
if (_tipo_sit == 1 && get_int(CESPI_USOPROM) > 1)
agg_quota(valamm, ammmv, "QNOR", TRUE);
agg_quota(valamm, ammmv, "QNOR", true);
else
{
ammmv.zero(AMMMV_FPRIVATO);
@ -1194,7 +1194,7 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
ammmv.put(AMMMV_QACC, qacc);
ammmv.put(AMMMV_PEACC, per_eff);
if (_tipo_sit == 1 && get_int(CESPI_USOPROM) > 1)
agg_quota(valamm, ammmv, "QACC", FALSE);
agg_quota(valamm, ammmv, "QACC", false);
else
ammmv.zero(AMMMV_FPRIVATO);
}
@ -1215,7 +1215,7 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
ammmv.put(AMMMV_QANT, qant);
ammmv.put(AMMMV_PEANT, per_eff);
if (_tipo_sit == 1 && get_int(CESPI_USOPROM) > 1)
agg_quota(valamm, ammmv, "QANT", FALSE);
agg_quota(valamm, ammmv, "QANT", false);
else
ammmv.zero(AMMMV_FPRIVATO);
}
@ -1364,13 +1364,13 @@ void TCespite::elabora_mov_neg(TRelation& rel, TRectype& tmv, TRectype& tmvam)
const TRectype& tmc = cache().get("%TMC", tpmov);
TRectype& ammmv = rel.curr(LF_AMMMV);
bool apv = FALSE; // Ho calcolato l'ammortamente del venduto sul movimento?
bool apv = false; // Ho calcolato l'ammortamente del venduto sul movimento?
if (ditta_cespiti().ammortamento_parti_vendute())
{
if (tmc.get_bool("B4")) // Possibile ammortamento su movimento
{
amm_mov_ven(rel, tmv, tmvam);
apv = TRUE; // Si, ho calcolato
apv = true; // Si, ho calcolato
}
}
if (!apv) // Se non ho calcolato allora azzero
@ -1657,12 +1657,12 @@ void TCespite::calc_amm_residui(bool is_valid)
_ammpro.put(AMMCE_QNOR, qnor);
_ammpro.put(AMMCE_PNOR, per_eff);
const real quote_perse = calc_quote_perse(valamm, pmat, resamm, qnor, FALSE, TDate());
const real quote_perse = calc_quote_perse(valamm, pmat, resamm, qnor, false, TDate());
_ammpro.put(AMMCE_QPERSE, quote_perse);
const int uso_promiscuo = get_int(CESPI_USOPROM);
if (_tipo_sit == 1 && uso_promiscuo > 1)
agg_quota(valamm, _ammpro, "QNOR", TRUE);
agg_quota(valamm, _ammpro, "QNOR", true);
else
zero_fields(_ammpro, AMMCE_FPRIVATO, AMMCE_QPPRIVATE, NULL);
resamm -= qnor + _ammpro.get_real(AMMCE_FPRIVATO);
@ -1674,7 +1674,7 @@ void TCespite::calc_amm_residui(bool is_valid)
_ammpro.put(AMMCE_QACC, qacc);
ammpro_put_perc(AMMCE_PACC, per_eff);
if (_tipo_sit == 1 && uso_promiscuo > 1)
agg_quota(valamm, _ammpro, "QACC", FALSE);
agg_quota(valamm, _ammpro, "QACC", false);
else
_ammpro.zero(AMMCE_FPRIVATO);
resamm -= qacc;
@ -1696,7 +1696,7 @@ void TCespite::calc_amm_residui(bool is_valid)
_ammpro.put(AMMCE_QANT, qant);
ammpro_put_perc(AMMCE_PANT, per_eff);
if (_tipo_sit == 1 && uso_promiscuo > 1)
agg_quota(valamm, _ammpro, "QANT", FALSE);
agg_quota(valamm, _ammpro, "QANT", false);
else
_ammpro.zero(AMMCE_FPRIVATO);
}
@ -1828,7 +1828,7 @@ bool TCespite::calc_amm(int tipo_sit, const TDate& data_limite, bool recalc_spe_
log(FR("* Inizio calcolo situazione %d cespite %s"), tipo_sit, (const char*)idcespite);
#ifdef DBG
if (tipo_sit == 1 && atol(idcespite) == 2208L)
if (tipo_sit == 1 && atol(idcespite) == 229L)
{
tipo_sit = 1; // Put your breakpoint here
}

View File

@ -556,6 +556,12 @@ void TRegistro_cespiti::header_registro()
//se stampa bollato -> nascondi data stampa
_form->find_field('F', last_page, FR_DATASTAMPA).show(_mask->get_int(F_TIPOREGISTRO) != 2);
//azzera i campi dei totali generali
TPrint_section& totgen = _form->get_piede_registro();
for(word t = 0; t < totgen.fields(); t++)
totgen.field(t).set("");
_form->set_piede();
}

View File

@ -120,19 +120,19 @@ const char * num2str(const TString & s)
case 1:
break;
case 2:
str << " bis";
str << "bis";
break;
case 3:
str << " ter";
str << "ter";
break;
case 4:
str << " quater";
str << "quater";
break;
case 5:
str << " quinquies";
str << "quinquies";
break;
case 6:
str << " sexies";
str << "sexies";
break;
default:
break;
@ -796,8 +796,7 @@ void CG1100_application::set_completa()
if (sezione != '0' && sezione != '9')
set_row (i, "@58g@1s", FLD(LF_PCON, PCN_SEZIVD) );
set_row (i, "@60g@1s", FLD(LF_PCON, PCN_LETTIVD) );
set_row (i, "@62g#-8t", &_clivd );
// set_row (i, "@71g@pn", FLD(LF_PCON, PCN_NUMIVD, "@@") );
set_row (i, "@62g#-8t", &_clivd );
set_row (i, "@71g#t", &_num_dec);
}
else
@ -806,8 +805,8 @@ void CG1100_application::set_completa()
if (conto != 0 && sottoc == 0l)
{
set_row (i, "@76g@pn", FLD(LF_PCON, PCN_INDBIL, "#") );
set_row (i, "@82g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (i, "@82g@pn", FLD(LF_PCON, PCN_INDBIL, "#") );
set_row (i, "@84g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (i, "@89g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (i, "@98g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (i, "@121g@f", FLD(LF_PCON, PCN_STSOTTAB) );
@ -1116,8 +1115,8 @@ void CG1100_application::intesta (stampe tipo)
set_header (soh++, FR("@20gStampa completa per IV direttiva"));
s.fill('-');
set_header (soh++, (const char *) s);
set_header (soh++, FR("Conto @59gSez. Classe@75gTipo@86gNo Dettaglio@104gT@107gSpesa@118gDet.alleg.bil."));
set_header (soh++, FR("Sottoconto @16gDescrizione@61gIV dir.@75gConto@81gC/F@86gBilancio@97gComp.@104gA@107gRicavo@114gSez@118gSot.con * Mov."));
set_header (soh++, FR("Conto @59gSez. Classe@82gT@84gC@86gNo Dettaglio@104gT@107gSpesa@118gDet.alleg.bil."));
set_header (soh++, FR("Sottoconto @16gDescrizione@61gIV dir.@82gC@84gF@86gBilancio@97gComp.@104gA@107gRicavo@114gSez@118gSot.con * Mov."));
break;
case con_IV_direttiva:

View File

@ -7,10 +7,13 @@ int main(int argc,char** argv)
const int s = (argc > 1) ? argv[1][1] - '0' : 0;
switch (s)
{
{
case 1 :
cgp4100(argc,argv) ; break; // Importa stipendi in prima nota (OMASA)
default: cgp4100(argc,argv) ; break; // Importazione clienti (GSA/CODFIDI)
}
exit(0);
return 0;
@ -18,4 +21,3 @@ int main(int argc,char** argv)

View File

@ -39,7 +39,6 @@ enum AVM_opcode
avm_store, avm_sp, avm_sub, avm_swap,
avm_then, avm_trunc,
avm_until, avm_usrword,
avm_variable,
avm_warm, avm_while,
avm_zzz
};
@ -67,7 +66,6 @@ const char* AVM_TOKENS[avm_zzz+1] =
"!", "SP", "-", "SWAP",
"THEN", "TRUNC",
"UNTIL", "$USR$",
"VARIABLE",
"WARM", "WHILE"
};
@ -571,6 +569,20 @@ bool TAVM::compile(istream& instr, TBytecode& bytecode)
return false;
}
} else
if (str == "VARIABLE")
{
if (get_token(instr, str))
{
_vars.add(str, NULL_VARIANT);
op = new TAVM_op(avm_nop);
}
else
{
_last_error = "Missing VARIABLE name";
log_error(_last_error);
return false;
}
} else
if (str == ";")
{
return true;
@ -586,6 +598,10 @@ bool TAVM::compile(istream& instr, TBytecode& bytecode)
TString256 str;
instr.getline(str.get_buffer(), str.size());
op = new TAVM_op(avm_nop);
} else
if (_vars.objptr(str) != NULL)
{
op = new TAVM_op(avm_push, str);
}
else
{
@ -1006,7 +1022,6 @@ void TAVM::execute(const TAVM_op& op)
_vm->execute_usr_word(usrword, _stack);
}
break;
case avm_variable: _vars.add(_stack.pop().as_string(), NULL_VARIANT); break;
case avm_warm: do_restart(false); _bc = NULL; break;
case avm_while:
if (_stack.pop().is_zero())

View File

@ -7,7 +7,6 @@
#define ANF_STATONASC "STATO"
#define ANF_COMNASC "COMNASC"
#define ANF_COMRES "COMRES"
//#define ANF_TIPOA "TIPOA"
#endif

View File

@ -2,7 +2,6 @@
#define __ANAGIU_H
#define ANG_CODANAGR "CODANAGR"
#define ANG_COMRES "COMRES"
#define ANG_NATGIU "NATGIU"
#define ANG_STATOSOC "STATOSOC"

View File

@ -179,8 +179,8 @@ bool TAssoc_array::add(
// la funzione aggiunge una copia dell'oggetto e quindi deve essere
// definita <mf TObject::dup>
{
bool isnew = FALSE;
THash_object* o = _lookup(key,isnew,TRUE);
bool isnew = false;
THash_object* o = _lookup(key, isnew, true);
if (!isnew)
{
if (force)
@ -189,10 +189,10 @@ bool TAssoc_array::add(
delete o->_obj;
o->_obj = obj;
}
return TRUE;
return true;
}
o->_obj = obj;
return FALSE;
return false;
}
bool TAssoc_array::add(const char* key, const TObject& obj, bool force)

View File

@ -2718,6 +2718,54 @@ bool TFile_select::check(CheckTime ct)
return ok;
}
///////////////////////////////////////////////////////////
// TDir_select
///////////////////////////////////////////////////////////
TDir_select::TDir_select(TEdit_field* ef) : TBrowse_button(ef)
{ }
void TDir_select::parse_input(TScanner& scanner)
{
scanner.pop();
}
void TDir_select::parse_output(TScanner& scanner)
{
scanner.pop();
}
KEY TDir_select::run()
{
DIRECTORY savedir;
xvt_fsys_get_dir(&savedir);
DIRECTORY dir;
xvt_fsys_convert_str_to_dir(field().get(), &dir);
bool good = xvt_dm_post_dir_sel(&dir) == FL_OK;
xvt_fsys_set_dir(&savedir);
if (good)
{
TFilename path;
xvt_fsys_convert_dir_to_str(&dir, path.get_buffer(), path.size());
field().set(path);
}
return good ? K_ENTER : K_ESC;
}
bool TDir_select::check(CheckTime ct)
{
const TFilename name = field().get();
if (ct != STARTING_CHECK && name.empty() &&
field().check_type() == CHECK_REQUIRED)
return false;
bool ok = true;
if (field().roman()) // Must exist
ok = name.exist();
return ok;
}
///////////////////////////////////////////////////////////
// TProfile_select
///////////////////////////////////////////////////////////
@ -3150,6 +3198,17 @@ bool TEdit_field::parse_item(TScanner& scanner)
return TRUE;
}
if (scanner.key() == "DS") // DSELECT
{
#ifdef DBG
if (_browse)
NFCHECK("DSELECT duplicato nel campo %d", _ctl_data._dlg);
#endif
_browse = new TDir_select(this);
_check_enabled = TRUE;
return TRUE;
}
if (scanner.key() == "PS") // PSELECT
{
#ifdef DBG

View File

@ -992,6 +992,26 @@ public:
virtual ~TFile_select() { }
};
class TDir_select : public TBrowse_button
{
public:
// @cmember Controlla la sintassi della input del campo e ne setta i membri
virtual void parse_input(TScanner& scanner);
// @cmember Controlla la sintassi della output del campo e ne setta i membri
virtual void parse_output(TScanner& scanner);
virtual KEY run();
// @cmember Controlla la validita' del campo
virtual bool check(CheckTime = RUNNING_CHECK);
virtual bool is_filesel() const { return TRUE; }
TDir_select(TEdit_field* ef);
virtual ~TDir_select() { }
};
class TReport_select : public TBrowse_button
{
TString _library;

View File

@ -8,44 +8,53 @@
#define NDT_PERRIF "PERRIF"
#define NDT_PTEL "PTEL"
#define NDT_TEL "TEL"
#define NDT_PFAX "PFAX"
#define NDT_FAX "FAX"
#define NDT_NULC "NULC"
#define NDT_ARTIG "ARTIG"
#define NDT_NISCRAA "NISCRAA"
#define NDT_PFAX "PFAX"
#define NDT_FAX "FAX"
#define NDT_NULC "NULC"
#define NDT_ARTIG "ARTIG"
#define NDT_NISCRAA "NISCRAA"
#define NDT_DATAISCRAA "DATAISCRAA"
#define NDT_COMAA "COMAA"
#define NDT_CAPAA "CAPAA"
#define NDT_FLIVA11Q "FLIVA11Q"
#define NDT_COMAA "COMAA"
#define NDT_CAPAA "CAPAA"
#define NDT_FLIVA11Q "FLIVA11Q"
#define NDT_CODATTPREV "CODATTPREV"
#define NDT_FREQVIVA "FREQVIVA"
#define NDT_DATLAV "DATLAV"
#define NDT_ABIBAN "ABIBAN"
#define NDT_CABBAN "CABBAN"
#define NDT_CONTORD "CONTORD"
#define NDT_FREQVIVA "FREQVIVA"
#define NDT_DATLAV "DATLAV"
#define NDT_ABIBAN "ABIBAN"
#define NDT_CABBAN "CABBAN"
#define NDT_CONTORD "CONTORD"
#define NDT_DINIZIOATT "DINIZIOATT"
#define NDT_NENASARCO "NENASARCO"
#define NDT_IMPRFAM "IMPRFAM"
#define NDT_CONDFAM "CONDFAM"
#define NDT_DEDART13 "DEDART13"
#define NDT_ESILOR "ESILOR"
#define NDT_NAPP "NAPP"
#define NDT_STATOSOC "STATOSOC"
#define NDT_SITSOC "SITSOC"
#define NDT_RAPPR "RAPPR"
#define NDT_CARRAPP "CARRAPP"
#define NDT_DECCARRAPP "DECCARRAPP"
#define NDT_REGSTATSP "REGSTATSP"
#define NDT_FIRMAT "FIRMAT"
#define NDT_AZCONIUG "AZCONIUG"
#define NDT_CODSTAT1 "CODSTAT1"
#define NDT_CODSTAT2 "CODSTAT2"
#define NDT_CODSTAT3 "CODSTAT3"
#define NDT_RICSUP20 "RICSUP20%"
#define NDT_REGMAG "REGMAG"
#define NDT_DENEST1 "DENEST1"
#define NDT_DENEST2 "DENEST2"
#define NDT_DENEST3 "DENEST3"
#define NDT_VALUTA "VALUTA"
#define NDT_NENASARCO "NENASARCO"
#define NDT_IMPRFAM "IMPRFAM"
#define NDT_CONDFAM "CONDFAM"
#define NDT_DEDART13 "DEDART13"
#define NDT_ESILOR "ESILOR"
#define NDT_NAPP "NAPP"
#define NDT_STATOSOC "STATOSOC"
#define NDT_SITSOC "SITSOC"
#define NDT_RAPPR "RAPPR"
#define NDT_CARRAPP "CARRAPP"
#define NDT_DECCARINT "DECCARINT"
#define NDT_REGSTATSP "REGSTATSP"
#define NDT_FIRMAT "FIRMAT"
#define NDT_AZCONIUG "AZCONIUG"
#define NDT_CODSTAT1 "CODSTAT1"
#define NDT_CODSTAT2 "CODSTAT2"
#define NDT_CODSTAT3 "CODSTAT3"
#define NDT_RICSUP20 "RICSUP20%"
#define NDT_REGMAG "REGMAG"
#define NDT_DENEST1 "DENEST1"
#define NDT_DENEST2 "DENEST2"
#define NDT_DENEST3 "DENEST3"
#define NDT_VALUTA "VALUTA"
#define NDT_PRESELEN "PRESELEN"
#define NDT_CESSIVA "CESSIVA"
#define NDT_FREQCES "FREQCES"
#define NDT_FREQACQ "FREQACQ"
#define NDT_TIPOSOGDEL "TIPOSOGDEL"
#define NDT_CODSOGDEL "CODSOGDEL"
#define NDT_NONOBBSTAT "NONOBBSTAT"
#define NDT_INTCAF "INTCAF"
#define NDT_DICHP "DICHP"
#endif

View File

@ -1267,12 +1267,35 @@ const TString& TCursor_parser::pop()
if (_instr.eof())
return _token;
char c;
_instr.get(c);
while (!isspace(c) && c != EOF)
char instring = '\0';
while (true)
{
_token << c;
char c;
_instr.get(c);
if (c == EOF)
break;
if (instring > ' ') // Sono dentro ad una stringa
{
if (c == '\n')
break;
if (c == instring)
instring = '\0';
_token << c;
}
else
{
if (c == '"' || c == '\'')
{
instring = c;
_token << c;
}
else
{
if (isspace(c))
break;
_token << c;
}
}
}
}
return _token;
@ -1611,7 +1634,7 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
push();
if (!rec_start.empty() || !rec_stop.empty())
_cursor->setregion(rec_start, rec_stop, 0x2);
_cursor->setregion(rec_start, rec_stop);
if (!filter.empty())
_cursor->setfilter(filter);
if (_relation->items() == 0) // Non ci sono anche tabelle collegate

View File

@ -472,7 +472,7 @@ TReport_field* TReport_section::find_field(int id)
return NULL;
}
// Determina se e' possibile manntenere la sezione nella stessa pagina della successiva
// Determina se e' possibile mantenere la sezione nella stessa pagina della successiva
bool TReport_section::keep_with_next() const
{ return _keep_with_next && type() == 'H' && level() > 1; }
@ -2850,14 +2850,16 @@ bool TReport::execute_usr_word(unsigned int opcode, TVariant_stack& stack)
break;
case 9: // SET_BACK_COLOR
{
const TVariant& fld = stack.pop();
const COLOR rgb = stack.pop().as_color();
do_message(stack.pop(), do_set_back_color, (void*)rgb);
do_message(fld, do_set_back_color, (void*)rgb);
}
break;
case 10: // SET_FORE_COLOR
{
const TVariant& fld = stack.pop();
const COLOR rgb = stack.pop().as_color();
do_message(stack.pop(), do_set_fore_color, (void*)rgb);
do_message(fld, do_set_fore_color, (void*)rgb);
}
break;
case 11: // SET_POS

View File

@ -504,7 +504,7 @@ public:
int print_cpi() const;
int print_lpi() const;
bool set_recordset(const TString& sql);
virtual bool set_recordset(const TString& sql);
bool set_recordset(TRecordset* sql);
TRecordset* recordset() const { return _recordset; }
bool evaluate_atom(const char* atom, TVariant& var);

View File

@ -1551,7 +1551,10 @@ bool TReport_book::close_page()
void TReport_book::reprint_group_headers(const TReport_section& rs)
{
const int max_group = _report->find_max_level('H');
int max_group = _report->find_max_level('H');
if (rs.type() == 'H' && rs.level() <= max_group)
max_group = rs.level()-1;
for (int level = 2; level <= max_group; level++)
{
TReport_section& rs = _report->section('H', level);
@ -1615,16 +1618,36 @@ long TReport_book::print_section(TReport_section& rs)
if (height > 0) // Has some visible fields
{
bool page_break = _page_break_allowed && rs.page_break();
long reprint_from = 0;
if (!page_break)
long reprint_from = 0; // Posizione di stampa per sezione interrotte a meta'
bool page_break = _page_break_allowed && rs.page_break(); // Salto pagina "forzato"
if (!page_break && rs.level() > 0) // Controlla se il salto pagina e' "necessario"
{
long h = height;
if (rs.keep_with_next())
h += rs.report().section('B', 1).compute_size().y;
const long space_left = _logical_foot_pos - _delta.y;
page_break = h > space_left;
if (rs.keep_with_next()) // Devo mantenermi con la prossima sezione
{
char next_type = 'B'; // Spesso la prossima sezione e' body 1
int next_level = 1;
if (rs.type() == 'H') // Tento di essere piu' preciso con gli headers
{
const int maxlev = rs.report().find_max_level('H');
if (rs.level() < maxlev)
{
next_type = 'H';
next_level = rs.level()+1;
h += 100; // Bonus per il body successivo all'header successivo
}
}
const TReport_section& next_section = rs.report().section(next_type, next_level);
if (next_section.page_break())
h += _ph;
else
h += next_section.compute_size().y;
}
const long space_left = _logical_foot_pos - _delta.y; // Calcola spazio rimasto
page_break = h > space_left; // Controlla se e' sufficiente
// Controllo se la sezione puo' essere stampata su due pagine
if (page_break && space_left >= 100 && rs.can_be_broken() )
{
@ -1632,12 +1655,12 @@ long TReport_book::print_section(TReport_section& rs)
rs.print_clipped(*this, 0, reprint_from);
}
}
if (page_break && rs.level() > 0) // Avoid recursion
if (page_break)
{
close_page();
open_page();
if (rs.type() == 'B')
reprint_group_headers(rs);
reprint_group_headers(rs);
}
if (_page_is_open)
{

View File

@ -102,7 +102,15 @@ long TVariant::as_int() const
case _datefld:
case _longfld: n = (long)_ptr; break;
case _realfld: n = as_real().integer(); break;
case _alfafld: n = atoi(as_string()); break;
case _alfafld:
{
const TString& str = as_string();
if (str[0] == '#')
sscanf(str, "#%X", &n);
else
n = atoi(str);
}
break;
default : break;
}
return n;
@ -120,7 +128,7 @@ bool TVariant::as_bool() const
COLOR TVariant::as_color() const
{
const unsigned long rgb = as_int();
unsigned long rgb = as_int();
unsigned char r = XVT_COLOR_GET_RED(rgb);
unsigned char g = XVT_COLOR_GET_GREEN(rgb);
unsigned char b = XVT_COLOR_GET_BLUE(rgb);

View File

@ -63,7 +63,7 @@ public:
TVariant() : _type(_nullfld), _ptr(NULL) { }
TVariant(const char* str) : _type(_alfafld), _ptr(new TString(str)) { }
TVariant(const real& num) : _type(_realfld), _ptr(new real(num)) { };
TVariant(const TDate& d) : _type(_datefld), _ptr(new TDate(d)) { };
TVariant(const TDate& d) : _type(_datefld), _ptr((void*)d.date2ansi()) { };
TVariant(long num) : _type(_longfld), _ptr((void*)num) { };
TVariant(bool ok) : _type(_longfld), _ptr((void*)ok) { };
TVariant(const TVariant& var) : _type(_nullfld), _ptr(NULL) { copy(var); }

View File

@ -16,6 +16,7 @@ class TLetint_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
virtual bool on_key(KEY k);
public:
TDate ultima_stampa(int anno);
@ -24,6 +25,13 @@ public:
};
bool TLetint_mask::on_key(KEY k)
{
if (k == K_SHIFT+K_F12 && edit_mode())
enable(DLG_SAVEREC);
return TAutomask::on_key(k);
}
bool TLetint_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
@ -129,6 +137,8 @@ protected:
bool user_destroy();
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_modify_mode(TMask& m);
virtual bool get_next_key(TToken_string& key);
@ -169,6 +179,31 @@ bool TLetint::get_next_key(TToken_string& key)
}
bool TLetint::protected_record(TRectype& rec) //evita la cancellazione del record se STAMPATO
{
bool prot = TRelation_application::protected_record(rec);
if (!prot)
{
prot = rec.get_bool(LETINT_STAMPATO);
}
return prot;
}
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);
if (stampato)
{
m.disable(DLG_SAVEREC);
m.disable(DLG_DELREC);
TString msg = TR("Dichiarazione già stampata sul registro dell'esercizio ");
xvt_statbar_set(msg);
}
}
bool TLetint::user_create()
{
_rel = new TRelation(LF_LETINT);

View File

@ -270,10 +270,26 @@ void TPrint_letint::main_loop()
{
TReport_book book;
word last_page = 0;
const bool definitiva = m.get_bool(F_DEFINITIVA);
const int anno = m.get_int(F_ANNO);
const bool definitiva = m.get_bool(F_DEFINITIVA);
if (definitiva)
{
last_page = m.get_int(F_PAGINI);
const int mese = m.get_int(F_MESE);
_da_data = TDate(1, mese, anno);
_a_data = _da_data;
_a_data.set_end_month();
}
else
{
_da_data = m.get_date(F_DAL);
if (!_da_data.ok())
_da_data = TDate(1, 1, anno);
_a_data = m.get_date(F_AL);
if (!_a_data.ok())
_a_data = TDate(31, 12, anno);
}
TLetint_report rep(last_page);
@ -282,6 +298,11 @@ void TPrint_letint::main_loop()
path = "li0500a";
rep.load(path);
rep.mask2report(m);
rep.recordset()->set_var("#DADATA", TVariant(_da_data));
rep.recordset()->set_var("#ADATA", TVariant(_a_data));
book.add(rep);
book.print_or_preview();

View File

@ -90,13 +90,14 @@ GET_FIRM_DATA</prescript>
<field x="112.5" type="Numero" align="right" width="3" pattern="1">
<source>154.UFFIVA</source>
</field>
<field x="117" type="Stringa" dynamic_height="1" width="15" height="18.5" pattern="1">
<field x="118" type="Stringa" dynamic_height="1" width="15" height="18.5" pattern="1">
<source>154.NOTE</source>
</field>
</section>
<section type="Foot" />
<section type="Foot" level="1" />
<sql>USE 154
SELECT (NUM(ANSI(DATAREG))&#3E;=ANSI(#DADATA))&#26;&#26;(NUM(ANSI(DATAREG))&#3C;=ANSI(#ADATA))
JOIN CLIFO INTO TIPOCF=='C' CODCF==CODCLI
FROM ANNO=#ANNO
TO ANNO=#ANNO</sql>

View File

@ -27,7 +27,7 @@ LIST F_MESE 2 16
BEGIN
PROMPT 15 3 "Mese "
FLAGS "AM"
GROUP 2
GROUP 2
END
DATE F_DAL

View File

@ -4,8 +4,10 @@
#include <execp.h>
#include <progind.h>
#include <recarray.h>
#include <recset.h>
#include <relapp.h>
#include <reprint.h>
#include <tabutil.h>
#include <utility.h>
#include <anagr.h>
@ -82,6 +84,24 @@ bool TSend_letint_mask::on_field_event(TOperable_field& o, TField_event e, long
}
TString4 str_mese; str_mese.format("%02d", mese);
o.mask().set(F_MESE, str_mese);
//riempie i campi dei progressivi e totali inviati
TISAM_recordset reg_dich("USE REG SELECT (I0==10)&&(CODTAB[1,4]=#ANNO)");
reg_dich.set_var("#ANNO", TVariant(long(anno)));
if (reg_dich.move_first())
{
set(F_PROGINV, reg_dich.get("I3").as_int());
set(F_TOTINV, reg_dich.get("I4").as_int());
set(F_REGISTRO, reg_dich.get("CODTAB[5,7]").as_string());
enable(DLG_OK);
}
else
{
reset(F_PROGINV);
reset(F_TOTINV);
disable(DLG_OK);
error_box(TR("Non esiste il registro delle dichiarazioni d'intento per l'anno selezionato."));
}
}
break;
@ -126,6 +146,19 @@ bool TSend_letint_mask::on_field_event(TOperable_field& o, TField_event e, long
rec_letint.zero(LETINT_INVIATO); //svuota il campo
rel_letint.rewrite(); //aggiorna fisicamente il file
}
//decrementa di 1 il numero totale degli invii sulla tabella registri (NON è
//corretto ma è meglio che niente x ora)
/* TTable tabreg("REG");
TString8 key;
key << anno_rip << get(F_REGISTRO);
tabreg.put("CODTAB", key);
if (tabreg.read() == NOERR)
{
tabreg.put("I4", get_int(F_TOTINV)-1);
tabreg.rewrite();
}*/
}
else
return true;
@ -773,7 +806,7 @@ public:
void read_dati_dic();
const TString& get_anagr_field(const TString field_name) { return _rec_anagrafica->get(field_name); }
void fill_a_rec(TRecord_DI& rec);
void fill_a_rec(const TMask& mask, TRecord_DI& rec);
void fill_b_rec(const TMask& mask, const int items, TRecord_DI& rec);
void fill_c_rec(const int modulo, TRecord_DI& rec);
void fill_z_rec(const int items, TRecord_DI& rec);
@ -807,9 +840,25 @@ void TSend_letint::read_dati_dic()
_rec_anagrafica = new TRectype(rec_anagr);
}
void TSend_letint::fill_a_rec(TRecord_DI& rec)
void TSend_letint::fill_a_rec(const TMask& mask, TRecord_DI& rec)
{
TString80 key;
key << main_app().get_firm();
const TRectype& rec_nditte = cache().get(LF_NDITTE, key); //legge la ditta..
const char dichp = rec_nditte.get_char(NDT_DICHP); //se ha un intermediario..
if (dichp == 'I')
rec.set(4, 10);
else
rec.set(4, 01);
rec.set(5, get_anagr_field(ANA_COFI)); //codice fiscale del dichiarante
rec.set(7, mask.get_int(F_PROGINV)); //progressivo invio nella fornitura
rec.set(8, mask.get_int(F_TOTINV)+1); //totale inviii incrementato dell'attuale
}
@ -822,8 +871,8 @@ void TSend_letint::fill_b_rec(const TMask& mask, const int items, TRecord_DI& re
if (persona_fisica) //se persona fisica..
{
rec.set(25, get_anagr_field(ANA_RAGSOC).left(30)); //cognome dichiarante
rec.set(26, get_anagr_field(ANA_RAGSOC).mid(30)); //nome
rec.set(25, get_anagr_field(ANA_RAGSOC).left(24)); //cognome dichiarante
rec.set(26, get_anagr_field(ANA_RAGSOC).mid(30,20)); //nome
}
else //..altrimenti..
rec.set(27, get_anagr_field(ANA_RAGSOC)); //ragsoc dichiarante
@ -844,7 +893,7 @@ void TSend_letint::fill_b_rec(const TMask& mask, const int items, TRecord_DI& re
const TRectype& rec_nasc = cache().get(LF_COMUNI, chiave_comuni);
rec.set(38, rec_nasc.get(COM_DENCOM));
rec.set(39, rec_nasc.get(COM_PROVCOM));
rec.set(40, rec_fis.get(ANF_DATANASC));
rec.set(40, rec_fis.get_date(ANF_DATANASC).string(def, '\0'));
rec.set(41, rec_fis.get(ANF_SESSO));
// dati residenza anagrafica
chiave_comuni.cut(0);
@ -885,10 +934,81 @@ void TSend_letint::fill_b_rec(const TMask& mask, const int items, TRecord_DI& re
const TRectype& rec_giu = cache().get(LF_ANAGGIU, get_anagr_field(ANA_CODANAGR)); //record della persona giuridica
rec.set(83, rec_giu.get_int(ANG_NATGIU));
}
//**//parte con dati del rappresentante
//parte con dati del rappresentante
TString80 key;
key << main_app().get_firm();
const TRectype& rec_nditte = cache().get(LF_NDITTE, key); //legge la ditta..
const char dichp = rec_nditte.get_char(NDT_DICHP); //se ha un intermediario..
if (dichp == 'I')
{
const long firmat = rec_nditte.get_long(NDT_FIRMAT); //..ne prende il codice..
//..e ricava la sua partita iva o codice fiscale
//..e tutti i suoi dati in anagrafica
TToken_string chiave_anagr;
chiave_anagr.add("F");
chiave_anagr.add(firmat);
const TRectype& rec_anagr = cache().get(LF_ANAG, chiave_anagr); //record di anagr
if (!rec_anagr.empty()) //se l'intermediario esiste come persona fisica...
{
rec.set(98, rec_anagr.get(ANA_COFI));
//impegno alla presentazione telematica
rec.set(198, rec_anagr.get(ANA_COFI)); //questo va nella sezione di impegno alla presentazione telematica
TString8 intcaf = rec_nditte.get(NDT_INTCAF).left(5);
rec.set(199, intcaf); //..e questo pure(e' qui x comodita')
rec.set(201, 1);
const int carica_rapp = rec_nditte.get_int(NDT_CARRAPP);
if (carica_rapp != 0) //solo se il rappresentante ha una carica...
{
const long rappr = rec_nditte.get_long(NDT_RAPPR); //..prende codice rappresentante
chiave_anagr.add(rappr, 1);
const TRectype& rec_anag_rappr = cache().get(LF_ANAG, chiave_anagr); //..e ricava tutti i suoi dati
rec.set(99, rec_anag_rappr.get(ANA_COFI));
rec.set(101, carica_rapp);
const TString& ragsoc_rappr = rec_anag_rappr.get(ANA_RAGSOC);
rec.set(104, ragsoc_rappr.left(24));
rec.set(105, ragsoc_rappr.mid(30));
const TRectype& rec_anag_rappr_fis = cache().get(LF_ANAGFIS, rappr); //..anche quelli personali
rec.set(106, rec_anag_rappr_fis.get(ANF_SESSO));
rec.set(107, rec_anag_rappr_fis.get_date(ANF_DATANASC).string(def, '\0'));
chiave_comuni.cut(0);
chiave_comuni.add(" ");
chiave_comuni.add(rec_anag_rappr_fis.get(ANF_COMNASC)); //comune,provincia di nascita
const TRectype& com_nasc_rappr = cache().get(LF_COMUNI, chiave_comuni);
rec.set(108, com_nasc_rappr.get(COM_DENCOM));
rec.set(109, com_nasc_rappr.get(COM_PROVCOM));
chiave_comuni.add(rec_anag_rappr.get(ANA_COMRES), 1); //comune,provincia di residenza
const TRectype& com_res_rappr = cache().get(LF_COMUNI, chiave_comuni);
rec.set(110, com_res_rappr.get(COM_DENCOM));
rec.set(111, com_res_rappr.get(COM_PROVCOM));
rec.set(112, com_res_rappr.get(COM_CAPCOM));
if (!com_res_rappr.get(COM_PROVCOM).empty())
{
TString address_rapp = rec_anag_rappr.get(ANA_INDRES); //indirizzo,civico di residenza
address_rapp << ", " << rec_anag_rappr.get(ANA_CIVRES);
rec.set(113, address_rapp);
}
rec.set(114, rec_anag_rappr.get(ANA_TELRF));
} //endif carica_rappr!=0
} //endif !rec_anagr.empty()
} //endif dichp==I
if (dichp == 'C')
rec.set(200, 1);
//comunicazione dichiarazioni d'intento
rec.set(197, items);
//**//impegno alla presentazione telematica
rec.set(202, rec_nditte.get_date(NDT_DECCARINT).string(def, '\0'));
}
void TSend_letint::fill_c_rec(const int modulo, TRecord_DI& rec)
@ -896,6 +1016,7 @@ void TSend_letint::fill_c_rec(const int modulo, TRecord_DI& rec)
rec.set(2, get_anagr_field(ANA_COFI)); //codice fiscale del dichiarante
rec.set(3, modulo); //modulo del corrente record C
rec.azzera_campi_non_posizionali();
}
void TSend_letint::fill_z_rec(const int written_c_records, TRecord_DI& rec)
@ -936,6 +1057,7 @@ void TSend_letint::fill_non_positional(const int modulo, const int rigo, const T
break;
case 5:
val = rec_cli.get(CLI_RAGSOC).left(30);
val.trim();
break;
case 6:
val = rec_cli.get(CLI_RAGSOC).mid(30);
@ -1020,14 +1142,11 @@ void TSend_letint::main_loop()
TFilename path;
TSend_letint_mask m;
#ifdef DBG
m.set(F_PATH, "C:\\temp\\pippo.txt");
#endif
while (m.run() == K_ENTER)
{
TFilename output_filename = m.get(F_PATH);
output_filename.add(m.get(F_FILE));
TTrasferimento_DI t(output_filename, 'w');
TRectype darec(LF_LETINT), arec(LF_LETINT);
@ -1041,7 +1160,10 @@ void TSend_letint::main_loop()
_a_data = _da_data,
_a_data.set_end_month();
TCursor cur_letint(&rel_letint, "", 1, &darec, &arec);
TString filtro;
filtro = "(STAMPATO==\"X\")&&(INVIATO!=\"X\")"; //si possono inviare solo dichiarazioni stampate in definitivo
TCursor cur_letint(&rel_letint, filtro, 1, &darec, &arec);
cur_letint.set_filterfunction(filtra_per_date);
const long items = cur_letint.items();
@ -1054,55 +1176,77 @@ void TSend_letint::main_loop()
TProgind pi(items, "Generazione file di trasferimento", false);
TRectype& rec_letint = rel_letint.curr();
bool go_on = true; //bool per controllare il corretto avanzamento della creazione record
//istanziamento record di tipo A e B (testate) e loro scrittura
TRecord_DI a_rec('A');
fill_a_rec(a_rec);
t.write(a_rec);
TRecord_DI b_rec('B');
fill_b_rec(m, items, b_rec);
t.write(b_rec);
fill_a_rec(m, a_rec);
if (!t.write(a_rec))
go_on = false;
TRecord_DI b_rec('B');
fill_b_rec(m, items, b_rec);
if (!t.write(b_rec))
go_on = false;
//record di tipo C (righe)
int written_c_records = 0;
int modulo = 1;
int rigo = 1;
//parte posizionale del primo record di tipo C
TRecord_DI c_rec('C');
fill_c_rec(modulo, c_rec);
for (cur_letint = 0; cur_letint.pos() < items; ++cur_letint)
{
pi.addstatus(1);
//parte non posizionale;va compilata sul record C
fill_non_positional(modulo, rigo, rec_letint, c_rec, t, written_c_records);
rigo++; //avanza di un rigo
int written_c_records = 0;
int modulo = 1;
int rigo = 1;
//parte posizionale del primo record di tipo C
TRecord_DI c_rec('C');
fill_c_rec(modulo, c_rec);
if (rigo > 4) //ogni 4 righi di tipo C..
{
t.write(c_rec); //..si scrive sul file..
written_c_records++;
rigo = 1;
modulo++;
fill_c_rec(modulo, c_rec); //..ci vuole una nuova parte posizionale..
}
for (cur_letint = 0; cur_letint.pos() < items; ++cur_letint)
{
pi.addstatus(1);
//parte non posizionale;va compilata sul record C
fill_non_positional(modulo, rigo, rec_letint, c_rec, t, written_c_records);
rigo++; //avanza di un rigo
//registra i record inviati
rec_letint.put(LETINT_INVIATO, 'X'); //riempie il campo
rel_letint.rewrite(); //aggiorna fisicamente il file
}
//caso base in cui il numero di righi non è multiplo di 4
if (c_rec.ha_campi_non_posizionali_compilati())
{
t.write(c_rec); //..si scrive sul file..
written_c_records++;
}
if (rigo > 4) //ogni 4 righi di tipo C..
{
t.write(c_rec); //..si scrive sul file..
written_c_records++;
rigo = 1;
modulo++;
fill_c_rec(modulo, c_rec); //..ci vuole una nuova parte posizionale..
}
//registra i record inviati
rec_letint.put(LETINT_INVIATO, 'X'); //riempie il campo
rel_letint.rewrite(); //aggiorna fisicamente il file
}
//caso base in cui il numero di righi non è multiplo di 4
if (c_rec.ha_campi_non_posizionali_compilati())
{
t.write(c_rec); //..si scrive sul file..
written_c_records++;
}
TRecord_DI z_rec('Z');
fill_z_rec(written_c_records, z_rec);
if (!t.write(z_rec))
go_on = false;
//incrementa di 1 il numero totale degli invii sulla tabella registri
if (go_on)
{
TTable tabreg("REG");
TString8 key;
key << anno << m.get(F_REGISTRO);
tabreg.put("CODTAB", key);
if (tabreg.read() == NOERR)
{
tabreg.put("I4", m.get_int(F_TOTINV)+1);
tabreg.rewrite();
}
}
//record di tipo Z (code)
TRecord_DI z_rec('Z');
fill_z_rec(written_c_records, z_rec);
t.write(z_rec);
}
}
if (_rec_anagrafica != NULL)

View File

@ -5,3 +5,7 @@
#define F_MESE 102
#define F_RIPRISTINA 103
#define F_PATH 104
#define F_FILE 105
#define F_PROGINV 106
#define F_TOTINV 107
#define F_REGISTRO 108

View File

@ -1,13 +1,13 @@
[A]
3=16,5,AN,IVD05
4=21,2,NU,01
4=21,2,NU
5=23,16,AN
7=522,4,NU,1
8=526,4,NU,1
7=522,4,NU
8=526,4,NU
[B]
2=2,16,AN
3=18,8,NU,1
3=18,8,NU, 1
7=74,16,AN,04162720967
8=90,1,CB,1
25=108,24,AN
@ -60,7 +60,7 @@
200=1451,1,CB
201=1452,1,CB
202=1453,8,DT
203=1461,1,CB
203=1461,1,CB,1
[C]
1=1,1,AN
@ -70,5 +70,5 @@
[Z]
1=1,1,AN
3=16,9,NU,1
3=16,9,NU, 1
4=25,9,NU

View File

@ -1,6 +1,6 @@
#include "li0600a.h"
PAGE "Invio dichiarazioni d'intento" -1 -1 52 8
PAGE "Invio dichiarazioni d'intento" -1 -1 56 14
NUMBER F_ANNO 4
BEGIN
@ -16,14 +16,39 @@ BEGIN
FLAGS "MD"
END
TEXT DLG_NULL
STRING F_REGISTRO 3
BEGIN
PROMPT 1 4 "Percorso file di output:"
PROMPT 1 3 "Registro "
FLAGS "D"
END
STRING F_PATH 255 50
NUMBER F_PROGINV 4
BEGIN
PROMPT 1 5 ""
PROMPT 1 4 "Progressivo invio "
END
NUMBER F_TOTINV 4
BEGIN
PROMPT 1 5 "Totale invii "
END
TEXT DLG_NULL
BEGIN
PROMPT 1 7 "Percorso file di output"
END
STRING F_PATH 255 40
BEGIN
PROMPT 1 8 "Cartella "
DSELECT
FLAGS "M"
CHECKTYPE REQUIRED
WARNING "Selezionare una cartella valida!"
END
STRING F_FILE 12
BEGIN
PROMPT 1 9 "File "
CHECKTYPE REQUIRED
END

View File

@ -3,6 +3,6 @@ Caption = "Dichiarazioni d'intento"
Picture = <cg01>
Module = 16
Flags = "F"
Item_01 = "Archivio di base", "li0 -3", ""
Item_02 = "Stampa Archivio di base", "li0 -4", ""
Item_03 = "Invio telematico", "li0 -5", ""
Item_01 = "Dichiarazioni d'intento", "li0 -3", ""
Item_02 = "Stampa dichiarazioni", "li0 -4", ""
Item_03 = "Invio telematico dichiarazioni", "li0 -5", ""

View File

@ -1978,11 +1978,14 @@ bool TMatResPlanning::load_gross_requirements()
{
// Scandisce le righe articolo e memorizza
// le quantita' richieste
TDocumento doc(cur.curr());
const TDocumento doc(curr_doc);
for (int r = doc.physical_rows(); r > 0; r--)
{
// Seleziona le righe articolo non ancora evase
const TRiga_documento& riga = doc[r];
if (!riga.is_articolo())
continue;
TDate datacons = riga.get(RDOC_DATACONS);
if (!datacons.ok()) datacons = doc_cons;
@ -1990,53 +1993,50 @@ bool TMatResPlanning::load_gross_requirements()
if (datacons > date_to)
continue;
if (riga.is_articolo())
const real qta = riga.qtaresidua();
if (qta > ZERO)
{
const real qta = riga.qtaresidua();
if (qta > ZERO)
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
const TString16 liv = riga.get(RDOC_LIVELLO);
TString8 mag = nomag ? EMPTY_STRING : riga.get(RDOC_CODMAG).left(nodep ? 3 : 5);
TString8 imp = noimp ? EMPTY_STRING : riga.get(RDOC_IMPIANTO);
TString8 lin = nolin ? EMPTY_STRING : riga.get(RDOC_LINEA);
const TCodice_um um = riga.get(RDOC_UMQTA);
// GUY was Here, but it's Koki fault!
const long codcli = is_production_article(art) ? doc.get_long(DOC_CODCF) : 0;
TPrice prz(riga.prezzo(TRUE,TRUE));
TQuantita q(art, um, qta);
q.convert2umbase();
q.currency2umbase(prz);
if (lin.empty())
_artinfo.art2magimpline(art, mag, imp, lin);
TMRP_line* line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli);
if (line == NULL)
{
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
const TString16 liv = riga.get(RDOC_LIVELLO);
TString8 mag = nomag ? EMPTY_STRING : riga.get(RDOC_CODMAG).left(nodep ? 3 : 5);
TString8 imp = noimp ? EMPTY_STRING : riga.get(RDOC_IMPIANTO);
TString8 lin = nolin ? EMPTY_STRING : riga.get(RDOC_LINEA);
const TCodice_um um = riga.get(RDOC_UMQTA);
// GUY was Here, but it's Koki fault!
const long codcli = is_production_article(art) ? doc.get_long(DOC_CODCF) : 0;
TPrice prz(riga.prezzo(TRUE,TRUE));
TQuantita q(art, um, qta);
q.convert2umbase();
q.currency2umbase(prz);
if (lin.empty())
_artinfo.art2magimpline(art, mag, imp, lin);
TMRP_line* line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli);
if (line == NULL)
{
// nuova linea
line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli, true);
line->set_description(riga.get(RDOC_DESCR));
line->set_final_product();
}
TString8 codnum = doc.get(DOC_CODNUM);
long docnum = doc.get_long(DOC_NDOC);
int numriga = riga.get_int(RDOC_NRIGA);
TMRP_docref * docref = new TMRP_docref(doc.get_int(DOC_ANNO), codnum, docnum,
numriga, um, qta, prz.get_num());
TMRP_time t(datacons, 0, imp, lin);
if (m.get_int(F_LDTIME_MODE) != 0)
{
t.add_time(0, -1); // Toglie un'ora: sposta datacons a fine turno
t.add_time(0, +1); // Riaggiunge un'ora nel giorno stesso
}
line->add_gross_req(t, q.val(), docref);
if (master)
line->add_net_req(t, q.val());
// nuova linea
line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli, true);
line->set_description(riga.get(RDOC_DESCR));
line->set_final_product();
}
const TString8 codnum = doc.get(DOC_CODNUM);
const long docnum = doc.get_long(DOC_NDOC);
const int numriga = riga.get_int(RDOC_NRIGA);
TMRP_docref * docref = new TMRP_docref(doc.get_int(DOC_ANNO), codnum, docnum,
numriga, um, qta, prz.get_num());
TMRP_time t(datacons, 0, imp, lin);
if (m.get_int(F_LDTIME_MODE) != 0)
{
t.add_time(0, -1); // Toglie un'ora: sposta datacons a fine turno
t.add_time(0, +1); // Riaggiunge un'ora nel giorno stesso
}
line->add_gross_req(t, q.val(), docref);
if (master)
line->add_net_req(t, q.val());
}
}
}
@ -2207,7 +2207,8 @@ bool TMatResPlanning::load_planned_orders()
// quelli con uno stato nel range corretto
for (cur = 0; cur.pos() < items; ++cur)
{
const bool evaso = !load_evasi && curr.get_bool(DOC_DOCEVASO);
const bool doc_evaso = curr.get_bool(DOC_DOCEVASO);
const bool evaso = !load_evasi && doc_evaso;
if (evaso)
continue;
@ -2222,57 +2223,63 @@ bool TMatResPlanning::load_planned_orders()
// Scandisce le righe articolo e memorizza
// le quantita' richieste
TDocumento doc(cur.curr());
const TDocumento doc(cur.curr());
for (int r = doc.physical_rows(); r > 0; r--)
{
// Seleziona le righe articolo non ancora evase
const TRiga_documento& riga = doc[r];
if (!riga.is_articolo())
continue;
TDate consegna = riga.get(RDOC_DATACONS);
if (!consegna.ok())
consegna = doc_cons;
// Data consegna troppo avanti
if (consegna > date_to)
continue;
if (riga.is_articolo())
if (load_evasi && doc_evaso)
{
const real qta = load_evasi ? riga.quantita() : riga.qtaresidua();
if (qta > ZERO)
const TRectype* dariga = riga.find_original_rdoc();
if (dariga != NULL && dariga->get_bool(RDOC_RIGAEVASA))
continue;
}
const real qta = load_evasi ? riga.quantita() : riga.qtaresidua();
if (qta > ZERO)
{
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
const TString16 liv = riga.get(RDOC_LIVELLO);
const TString8 mag = riga.get(RDOC_CODMAG);
const TString8 imp = riga.get(RDOC_IMPIANTO);
const TString8 lin = riga.get(RDOC_LINEA);
// GUY was Here, but it's Koki fault!
const long codcli = is_production_article(art) ? doc.get_long(DOC_CODCF) : 0;
TMRP_line* line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli);
if (line == NULL)
{
const TCodice_articolo art = riga.get(RDOC_CODARTMAG);
const TString16 liv = riga.get(RDOC_LIVELLO);
const TString8 mag = riga.get(RDOC_CODMAG);
const TString8 imp = riga.get(RDOC_IMPIANTO);
const TString8 lin = riga.get(RDOC_LINEA);
// GUY was Here, but it's Koki fault!
const long codcli = is_production_article(art) ? doc.get_long(DOC_CODCF) : 0;
TMRP_line* line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli);
if (line == NULL)
{
line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli, TRUE);
line->set_description(riga.get(RDOC_DESCR));
}
TPrice prz(riga.prezzo(TRUE,TRUE));
const TCodice_um um = riga.get(RDOC_UMQTA);
TQuantita q(art, um, qta);
q.convert2umbase();
q.currency2umbase(prz);
TString8 codnum = doc.get(DOC_CODNUM);
long docnum = doc.get_long(DOC_NDOC);
int numriga = riga.get_int(RDOC_NRIGA);
TMRP_docref * docref = new TMRP_docref(doc.get_int(DOC_ANNO), codnum, docnum,
numriga, um, q.val(), prz.get_num());
const TMRP_time t(consegna, 0, imp, lin);
if (has_confirmed_status(doc, a.row(sheetrow)) ||
(codnum != m.get(F_NUM_PROD) && codnum != m.get(F_NUM_FORN)))
line->add_sched_rec(t, q.val(), docref);
else
line->add_planned_ord(t, q.val(), docref);
line = _articles.find(art, liv, mag, EMPTY_STRING, imp, lin, codcli, TRUE);
line->set_description(riga.get(RDOC_DESCR));
}
TPrice prz(riga.prezzo(TRUE,TRUE));
const TCodice_um um = riga.get(RDOC_UMQTA);
TQuantita q(art, um, qta);
q.convert2umbase();
q.currency2umbase(prz);
TString8 codnum = doc.get(DOC_CODNUM);
long docnum = doc.get_long(DOC_NDOC);
int numriga = riga.get_int(RDOC_NRIGA);
TMRP_docref * docref = new TMRP_docref(doc.get_int(DOC_ANNO), codnum, docnum,
numriga, um, q.val(), prz.get_num());
const TMRP_time t(consegna, 0, imp, lin);
if (has_confirmed_status(doc, a.row(sheetrow)) ||
(codnum != m.get(F_NUM_PROD) && codnum != m.get(F_NUM_FORN)))
line->add_sched_rec(t, q.val(), docref);
else
line->add_planned_ord(t, q.val(), docref);
}
}
}

View File

@ -2108,8 +2108,6 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
_error = conto_error;
}
TString descr = head.get(MOV_DESCR);// La descrizione della riga di totale documento la prende dalla testata
TConto contro;
if (_movimento->iva_items() > 0)
{
@ -2119,11 +2117,12 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc)
rec_cg.put(RMV_ANNOES,annoes);rec_cg.put(RMV_NUMREG,numreg);
const char sezione = _caus->sezione(1);
rec_cg.put(RMV_NUMRIG,1); rec_cg.put(RMV_SEZIONE, sezione); // qui
rec_cg.put(RMV_NUMRIG,1); rec_cg.put(RMV_SEZIONE, sezione);
rec_cg.put(RMV_DATAREG,datareg); rec_cg.put(RMV_TIPOC,tipocf);
rec_cg.put(RMV_GRUPPO,gruppo);rec_cg.put(RMV_CONTO,conto);
rec_cg.put(RMV_SOTTOCONTO,codcf); rec_cg.put(RMV_DESCR,descr);
rec_cg.put(RMV_SOTTOCONTO,codcf);
contro.put(rec_cg, true);
rec_cg.put(RMV_IMPORTO,totdoc); rec_cg.put(RMV_ROWTYPE,"T");
if (tipocf == " ")
{

View File

@ -1777,6 +1777,18 @@ FL_STATUS xvt_dm_post_file_save(FILE_SPEC *fsp, const char *msg)
return xvt_dm_post_file_ask(fsp, msg, flags);
}
FL_STATUS xvt_dm_post_dir_sel(DIRECTORY *dir)
{
wxDirDialog dlg(_task_win);
dlg.SetPath(dir->path);
if (dlg.ShowModal() == wxID_OK)
{
xvt_fsys_convert_str_to_dir(dlg.GetPath(), dir);
return FL_OK;
}
return FL_CANCEL;
}
BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD *precp, unsigned long reserved)
{
TFontId& font = *(TFontId*)font_id;

View File

@ -65,6 +65,7 @@ XVTDLL void xvt_dm_post_error(const char *fmt);
XVTDLL void xvt_dm_post_fatal_exit(const char *fmt);
XVTDLL FL_STATUS xvt_dm_post_file_open(FILE_SPEC *fsp, const char *msg);
XVTDLL FL_STATUS xvt_dm_post_file_save(FILE_SPEC *fsp, const char *msg);
XVTDLL FL_STATUS xvt_dm_post_dir_sel(DIRECTORY *dir);
XVTDLL BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD *precp, unsigned long reserved);
XVTDLL void xvt_dm_post_message(const char *fmt);
XVTDLL void xvt_dm_post_note(const char *fmt);