diff --git a/ce/ce0400a.uml b/ce/ce0400a.uml index 36ec31341..cd20941ad 100755 --- a/ce/ce0400a.uml +++ b/ce/ce0400a.uml @@ -204,15 +204,25 @@ BEGIN GROUP 9 END -GROUPBOX DLG_NULL 78 7 +GROUPBOX DLG_NULL 78 8 BEGIN - PROMPT 1 7 "@B Cod. Causali" + PROMPT 1 7 "" FLAGS "R" END +TEXT -1 +BEGIN + PROMPT 33 8 "@BCod." +END + +TEXT -1 +BEGIN + PROMPT 40 8 "@BCausale" +END + STRING F_ELIMCESP 3 BEGIN - PROMPT 2 8 "Eliminazione cespite " + PROMPT 2 9 "Eliminazione cespite " FIELD COAUEL USE LF_CAUSALI SELECT ((SOSPESO!="X")&&(TIPODOC=="")&&(COLLCESP=="")) INPUT CODCAUS F_ELIMCESP @@ -227,7 +237,7 @@ END STRING F_D_ELIMCESP 50 35 BEGIN - PROMPT 40 8 "" + PROMPT 40 9 "" USE LF_CAUSALI KEY 2 INPUT DESCR F_D_ELIMCESP DISPLAY "Descrizione@50" DESCR @@ -240,7 +250,7 @@ END STRING F_RIL_DIFF 3 BEGIN - PROMPT 2 9 "Rilevazione differenze " + PROMPT 2 10 "Rilevazione differenze " FIELD COAUDI COPY USE F_ELIMCESP INPUT CODCAUS F_RIL_DIFF @@ -254,7 +264,7 @@ END STRING F_D_RIL_DIFF 50 35 BEGIN - PROMPT 40 9 "" + PROMPT 40 10 "" COPY USE F_D_ELIMCESP INPUT DESCR F_D_RIL_DIFF COPY DISPLAY F_D_ELIMCESP @@ -266,7 +276,7 @@ END STRING F_RIL_QUOT 3 BEGIN - PROMPT 2 10 "Rilevazione quote ammortamento " + PROMPT 2 11 "Rilevazione quote ammortamento " FIELD COAUQU COPY USE F_ELIMCESP INPUT CODCAUS F_RIL_QUOT @@ -280,7 +290,7 @@ END STRING F_D_RIL_QUOT 50 35 BEGIN - PROMPT 40 10 "" + PROMPT 40 11 "" COPY USE F_D_ELIMCESP INPUT DESCR F_D_RIL_QUOT COPY DISPLAY F_D_ELIMCESP @@ -292,7 +302,7 @@ END STRING F_RIL_PLUS 3 BEGIN - PROMPT 2 11 "Rilevazione plusvalenze " + PROMPT 2 12 "Rilevazione plusvalenze " FIELD COAUPL COPY USE F_ELIMCESP INPUT CODCAUS F_RIL_PLUS @@ -306,7 +316,7 @@ END STRING F_D_RIL_PLUS 50 35 BEGIN - PROMPT 40 11 "" + PROMPT 40 12 "" COPY USE F_D_ELIMCESP INPUT DESCR F_D_RIL_PLUS COPY DISPLAY F_D_ELIMCESP @@ -318,7 +328,7 @@ END STRING F_RIL_MIN 3 BEGIN - PROMPT 2 12 "Rilevazione minusvalenze " + PROMPT 2 13 "Rilevazione minusvalenze " FIELD COAUM COPY USE F_ELIMCESP INPUT CODCAUS F_RIL_MIN @@ -332,7 +342,7 @@ END STRING F_D_RIL_MIN 50 35 BEGIN - PROMPT 40 12 "" + PROMPT 40 13 "" COPY USE F_D_ELIMCESP INPUT DESCR F_D_RIL_MIN COPY DISPLAY F_D_ELIMCESP @@ -342,15 +352,35 @@ BEGIN GROUP 9 END -GROUPBOX DLG_NULL 78 8 +GROUPBOX DLG_NULL 78 9 BEGIN - PROMPT 1 14 "@B Gr. Co. Sottoc. Descrizione" + PROMPT 1 14 "" FLAGS "R" END +TEXT -1 +BEGIN + PROMPT 25 15 "@BGr." +END + +TEXT -1 +BEGIN + PROMPT 31 15 "@BCo." +END + +TEXT -1 +BEGIN + PROMPT 37 15 "@BSottoc." +END + +TEXT -1 +BEGIN + PROMPT 46 15 "@BDescrizione" +END + NUMBER F_SOPR_PAS_GR 3 BEGIN - PROMPT 2 15 "Sopravvenienze passive " + PROMPT 2 16 "Sopravvenienze passive " FIELD GRCOTELI FLAGS "R" USE LF_PCON KEY 1 SELECT CONTO="" @@ -365,7 +395,7 @@ END NUMBER F_SOPR_PAS_CO 3 BEGIN - PROMPT 31 15 "" + PROMPT 31 16 "" FIELD COCOTELI FLAGS "R" USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO="")) @@ -385,7 +415,7 @@ END NUMBER F_SOPR_PAS_SO 6 BEGIN - PROMPT 37 15 "" + PROMPT 37 16 "" FIELD SOCOTELI FLAGS "R" USE LF_PCON KEY 1 SELECT SOTTOCONTO!="" @@ -407,7 +437,7 @@ END STRING F_SOPR_PAS_D 50 29 BEGIN - PROMPT 46 15 "" + PROMPT 46 16 "" USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" INPUT DESCR F_SOPR_PAS_D DISPLAY "Descrizione@50" DESCR @@ -424,7 +454,7 @@ END NUMBER F_DIFF_QUO_GR 3 BEGIN - PROMPT 2 16 "Differenze su quote " + PROMPT 2 17 "Differenze su quote " FIELD GRCOTDIQ FLAGS "R" COPY USE F_SOPR_PAS_GR @@ -438,7 +468,7 @@ END NUMBER F_DIFF_QUO_CO 3 BEGIN - PROMPT 31 16 "" + PROMPT 31 17 "" FIELD COCOTDIQ FLAGS "R" COPY USE F_SOPR_PAS_CO @@ -456,7 +486,7 @@ END NUMBER F_DIFF_QUO_SO 6 BEGIN - PROMPT 37 16 "" + PROMPT 37 17 "" FIELD SOCOTDIQ FLAGS "R" COPY USE F_SOPR_PAS_SO @@ -474,7 +504,7 @@ END STRING F_DIFF_QUO_D 50 29 BEGIN - PROMPT 46 16 "" + PROMPT 46 17 "" USE LF_PCON KEY 2 INPUT DESCR F_DIFF_QUO_D COPY DISPLAY F_SOPR_PAS_D @@ -487,7 +517,7 @@ END NUMBER F_DIFF_FON_GR 3 BEGIN - PROMPT 2 17 "Differenze su fondi " + PROMPT 2 18 "Differenze su fondi " FIELD GRCOTDIF FLAGS "R" COPY USE F_SOPR_PAS_GR @@ -501,7 +531,7 @@ END NUMBER F_DIFF_FON_CO 3 BEGIN - PROMPT 31 17 "" + PROMPT 31 18 "" FIELD COCOTDIF FLAGS "R" COPY USE F_SOPR_PAS_CO @@ -519,7 +549,7 @@ END NUMBER F_DIFF_FON_SO 6 BEGIN - PROMPT 37 17 "" + PROMPT 37 18 "" FIELD SOCOTDIF FLAGS "R" COPY USE F_SOPR_PAS_SO @@ -537,7 +567,7 @@ END STRING F_DIFF_FON_D 50 29 BEGIN - PROMPT 46 17 "" + PROMPT 46 18 "" USE LF_PCON KEY 2 INPUT DESCR F_DIFF_FON_D COPY DISPLAY F_SOPR_PAS_D @@ -550,7 +580,7 @@ END NUMBER F_PLUSVAL_GR 3 BEGIN - PROMPT 2 18 "Plusvalenze " + PROMPT 2 19 "Plusvalenze " FIELD GRCOTPLU FLAGS "R" COPY USE F_SOPR_PAS_GR @@ -564,7 +594,7 @@ END NUMBER F_PLUSVAL_CO 3 BEGIN - PROMPT 31 18 "" + PROMPT 31 19 "" FIELD COCOTPLU FLAGS "R" USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==4)) @@ -582,7 +612,7 @@ END NUMBER F_PLUSVAL_SO 6 BEGIN - PROMPT 37 18 "" + PROMPT 37 19 "" FIELD SOCOTPLU FLAGS "R" COPY USE F_SOPR_PAS_SO @@ -601,7 +631,7 @@ END STRING F_PLUSVAL_D 50 29 BEGIN - PROMPT 46 18 "" + PROMPT 46 19 "" USE LF_PCON KEY 2 INPUT DESCR F_PLUSVAL_D COPY DISPLAY F_SOPR_PAS_D @@ -614,7 +644,7 @@ END NUMBER F_MINUSVAL_GR 3 BEGIN - PROMPT 2 19 "Minusvalenze " + PROMPT 2 20 "Minusvalenze " FIELD GRCOTMIN FLAGS "R" COPY USE F_SOPR_PAS_GR @@ -628,7 +658,7 @@ END NUMBER F_MINUSVAL_CO 3 BEGIN - PROMPT 31 19 "" + PROMPT 31 20 "" FIELD COCOTMIN FLAGS "R" USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==3)) @@ -646,7 +676,7 @@ END NUMBER F_MINUSVAL_SO 6 BEGIN - PROMPT 37 19 "" + PROMPT 37 20 "" FIELD SOCOTMIN FLAGS "R" COPY USE F_SOPR_PAS_SO @@ -665,7 +695,7 @@ END STRING F_MINUSVAL_D 50 29 BEGIN - PROMPT 46 19 "" + PROMPT 46 20 "" USE LF_PCON KEY 2 INPUT DESCR F_MINUSVAL_D COPY DISPLAY F_SOPR_PAS_D @@ -678,7 +708,7 @@ END NUMBER F_VEND_CESP_GR 3 BEGIN - PROMPT 2 20 "Vendite cespiti " + PROMPT 2 21 "Vendite cespiti " FIELD GRCOTVEN FLAGS "R" COPY USE F_SOPR_PAS_GR @@ -692,7 +722,7 @@ END NUMBER F_VEND_CESP_CO 3 BEGIN - PROMPT 31 20 "" + PROMPT 31 21 "" FIELD COCOTVEN FLAGS "R" COPY USE F_SOPR_PAS_CO @@ -710,7 +740,7 @@ END NUMBER F_VEND_CESP_SO 6 BEGIN - PROMPT 37 20 "" + PROMPT 37 21 "" FIELD SOCOTVEN FLAGS "R" COPY USE F_SOPR_PAS_SO @@ -728,7 +758,7 @@ END STRING F_VEND_CESP_D 50 29 BEGIN - PROMPT 46 20 "" + PROMPT 46 21 "" USE LF_PCON KEY 2 INPUT DESCR F_VEND_CESP_D COPY DISPLAY F_SOPR_PAS_D diff --git a/ce/ce4400.cpp b/ce/ce4400.cpp index 6c19cce9e..94a59457b 100755 --- a/ce/ce4400.cpp +++ b/ce/ce4400.cpp @@ -1,7 +1,8 @@ #include #include #include -#include +#include +#include #include "../cg/cg2101.h" @@ -37,26 +38,180 @@ bool TTrasf_mov_ce_cg_mask::on_field_event(TOperable_field& o, TField_event e, l //=============================================================================================== //Struct che serve per avere ammortamenti per categoria (Codcat|Qamm_tot|Qperse_tot) -struct TSaldo_cat :public TObject +struct TSaldo_per_codice :public TSortable { - TString4 _codcat; - real _qamm, _qperse; + TString4 _spc; + int _grp, _cat; + TString80 _idcespite; + real _qnor, _qant, _qacc, _qperse; void add(const TRectype& rec_ammce); - TSaldo_cat(const TString& codcat) : _codcat(codcat) {} + virtual int compare(const TSortable& s) const; + const TRectype& categoria() const; + int compila_rmov(const int tipo, const int riga_nor, TArray& righe_mov, TLog_report& log, const int movdett) const; + int genera_righe(TArray& righe_mov, TLog_report& log, const int movdett) const; + + TSaldo_per_codice(const int grp, const TString4 spc, const int cat, const char* idcespite = "") + : _grp(grp),_spc(spc), _cat(cat), _idcespite(idcespite) {} }; -void TSaldo_cat::add(const TRectype& rec_ammce) +void TSaldo_per_codice::add(const TRectype& rec_ammce) { //valore totale degli ammortamenti del cespite di tipo qnor,qant,qacc che trova in AMMCE - const real qamm = rec_ammce.get_real(AMMCE_QNOR) + rec_ammce.get_real(AMMCE_QANT) + rec_ammce.get_real(AMMCE_QACC); + const real qnor = rec_ammce.get_real(AMMCE_QNOR); + const real qant = rec_ammce.get_real(AMMCE_QANT); + const real qacc = rec_ammce.get_real(AMMCE_QACC); //valore totale delle qperse del cespite che trova in AMMCE const real qperse = rec_ammce.get_real(AMMCE_QPERSE); - _qamm += qamm; + _qnor += qnor; + _qant += qant; + _qacc += qacc; _qperse += qperse; } +//confrontatore di saldi_per_codice +int TSaldo_per_codice::compare(const TSortable& s) const +{ + int cmp = 0; + const TSaldo_per_codice& sc = (const TSaldo_per_codice&)s; + cmp = _grp - sc._grp; + if (cmp == 0) + { + cmp = _spc.compare(sc._spc); + if (cmp == 0) + { + cmp = _cat - sc._cat; + if (cmp == 0) + cmp = _idcespite.compare(sc._idcespite); + } + } + + return cmp; +} + +bool str2bill(const TString& stringona, const int pos, TBill& zio) +{ + const int gr = atoi(stringona.mid(pos, 3)); + const int co = atoi(stringona.mid(pos+3, 3)); + if (co <= 0) + return false; + const long so = atoi(stringona.mid(pos+6, 6)); + zio.set(gr, co, so); + return true; +} + +int TSaldo_per_codice::compila_rmov(const int tipo, const int riga_nor, TArray& righe_mov, TLog_report& log, + const int movdett) const +{ + int pos = 0; + const char* field = "S1"; + real quota; + switch (tipo) + { + case 1: quota = _qnor; pos = 24; break; + case 2: quota = _qant; pos = 36; break; + case 3: quota = _qacc; pos = 48; break; + case 4: quota = _qperse; pos = 0; field = "S2"; break; + default: break; + } + if (quota <= ZERO) + return -1; + + const TRectype& rec_cac = categoria(); + const TString& stringona = rec_cac.get(field); + TBill zio; + if (!str2bill(stringona, pos, zio)) + { + if (tipo < 4) + { + pos = 24; + if (tipo == 1 || !str2bill(stringona, pos, zio)) + { + TString msg; + msg << TR("Manca il conto per le quote ammortamento normali della categoria ") << rec_cac.get("CODTAB"); + log.log(2, msg); + return -1; + } + } + else + { + TString msg; + msg << TR("Manca il conto per le quote perse della categoria ") << rec_cac.get("CODTAB"); + log.log(2, msg); + return -1; + } + } + + if (pos == 24 && riga_nor >= 0) + { + TRectype& rmovnor = (TRectype&)righe_mov[riga_nor]; + rmovnor.add(RMV_IMPORTO, quota); + return riga_nor; + } + + TRectype* rmov = new TRectype(LF_RMOV); + rmov->put(RMV_SEZIONE, "D"); + rmov->put(RMV_IMPORTO, quota); + //conto e descrizione dipendono dal livello di dettaglio stabilito nella configurazione del collegamento CG/CE + switch (movdett) + { + case 0: + rmov->put(RMV_DESCR, rec_cac.get("S0")); + break; + case 1: + { + const TRectype& rec_cespi = cache().get(LF_CESPI, _idcespite); + rmov->put(RMV_DESCR, rec_cespi.get(CESPI_DESC)); + } + break; + case 2: + { + const TRectype& rec_cespi = cache().get(LF_CESPI, _idcespite); + rmov->put(RMV_DESCR, rec_cespi.get(CESPI_DESC)); + bool ok = real::is_natural(_idcespite); + if (ok) + { + const long sottoc = atol(_idcespite); + ok = sottoc > 0 && sottoc < 1000000; + if (ok) + zio.set(zio.gruppo(), zio.conto(), sottoc); + } + if (!ok) + { + TString msg; + msg.format(FR("Il codice cespite %s non e' un sottoconto valido"), (const char*)_idcespite); + log.log(2, msg); + } + } + break; + default: + break; + } + zio.put(*rmov); + + return righe_mov.add(rmov); +} + +//metodo di alto livello per la compilazione delle righe contabili;chiama il metodo di basso livello.. +//..compila_rmov con i parametri caso x caso +int TSaldo_per_codice::genera_righe(TArray& righe_mov, TLog_report& log, const int movdett) const +{ + const int righe_prima = righe_mov.items(); + const int riga_nor = compila_rmov(1, -1, righe_mov, log, movdett); + const int riga_ant = compila_rmov(2, riga_nor, righe_mov, log, movdett); + const int riga_acc = compila_rmov(3, riga_nor, righe_mov, log, movdett); + const int riga_persa = compila_rmov(4, -1, righe_mov, log, movdett); + + const int righe_dopo = righe_mov.items(); + return righe_dopo - righe_prima; //messo qui tanto per poter compilare +} + +const TRectype& TSaldo_per_codice::categoria() const +{ + return ditta_cespiti().categoria(_grp, _spc, _cat); +} + //=============================================================================================== //Applicazione @@ -124,41 +279,92 @@ void TTrasf_mov_ce_cg::elabora() TISAM_recordset cespiti("USE CESPI"); const TRecnotype nrec = cespiti.items(); - if (nrec > 0) //test del cazzo necessario per avere una progind - { - //Assoc_array Categoria-QammTot-QperseTot - TAssoc_array quote_per_cat; + //report con log errori + TLog_report cont_cesp_log(TR("Contabilizzazione cespiti")); - TProgind pi(nrec, TR("Ricalcolo ammortamenti in corso..."), true, true); - for (int i = 0; cespiti.move_to(i); i++) - { - if (!pi.addstatus(1)) - break; - //id e categoria del cespite corrente - const TString& idcespite = cespiti.get(CESPI_IDCESPITE).as_string(); - TCespite cespite(idcespite); - const TString4 codcat = cespiti.get(CESPI_CODCAT).as_string(); + //Legge un po' di parametri dal ditta.ini che servono al tipo di calcolo + TConfig config_ditta_ce(CONFIG_DITTA, "ce"); + //Situazione fiscale (99,99%) o civilistica (1 suora su 1.000.000)? + const int tpamm = config_ditta_ce.get_int("TPAMM"); + //Tipo di calcolo da eseguire in base al dettaglio + const int movdett = config_ditta_ce.get_int("MOVDETT"); - //calcola gli ammortamenti di tutti i cespiti; SOLO situazione FISCALE (tiposit = 1) - //la calc_amm pensa da sola a calcolare gli ammortamenti solo per i cespiti validi - //l'ultimo parametro e' true x' il calcolo viene fatto in memoria! - cespite.calc_amm(1, datacalc, false, true); + //Assoc_array Categoria-QammTot-QperseTot + TAssoc_array quote_per_codice; - //controlla le quote del cespite in questione su AMMCE - const TRectype& rec_ammce = cespite.amm_pro(); + TProgind pi(nrec, TR("Ricalcolo ammortamenti in corso..."), true, true); + for (int i = 0; cespiti.move_to(i); i++) + { + if (!pi.addstatus(1)) + break; + //id e categoria del cespite corrente + const TString& idcespite = cespiti.get(CESPI_IDCESPITE).as_string(); + const int gruppo = cespiti.get(CESPI_CODCGRA).as_int(); + const TString4 specie = cespiti.get(CESPI_CODSPA).as_string(); + const int codcat = cespiti.get(CESPI_CODCAT).as_int(); + + //calcola gli ammortamenti di tutti i cespiti; situazione presa dal config_ditta poco prima + //la calc_amm pensa da sola a calcolare gli ammortamenti solo per i cespiti validi + //l'ultimo parametro e' true x' il calcolo viene fatto in memoria! + TCespite cespite(idcespite); + + if (cespite.calc_amm(tpamm, datacalc, false, true)) + { + //controlla le quote del cespite in questione su AMMCE + const TRectype& rec_ammce = cespite.amm_pro(); - TSaldo_cat* sc = (TSaldo_cat*)quote_per_cat.objptr(codcat); - //se non trova il codice categoria lo aggiunge... + //in base al tipo di dettaglio sceglie il codice dell'assoc_array + //movdett=0 -> codice=codice categoria (assoc_array con record per categorie) + //movdett=1;2 -> codice=idcespite (assoc_array con record per cespite) + TToken_string gsc; + gsc.add(gruppo); gsc.add(specie); gsc.add(codcat); + if (movdett != 0) + gsc.add(idcespite); + + TSaldo_per_codice* sc = (TSaldo_per_codice*)quote_per_codice.objptr(gsc); + //se non trova il codice (categoria o cespite) lo aggiunge... if (sc == NULL) { - sc = new TSaldo_cat(codcat); - quote_per_cat.add(codcat, sc); + sc = new TSaldo_per_codice(gruppo, specie, codcat, idcespite); + quote_per_codice.add(gsc, sc); } //..e poi somma i valori comunque sc->add(rec_ammce); + } + } //for(int i... + + TArray saldi_ordinati; + //riempie l'array saldi_ordinati con gli elementi dell'assoc quote_per_codice + FOR_EACH_ASSOC_OBJECT(quote_per_codice, h, k, obj) + saldi_ordinati.add(h->remove_obj()); + //accoppa l'assoc + quote_per_codice.destroy(); + //e ordina l'array (questo assurdo giro serve perche' l'assoc non e' ordinabile) + saldi_ordinati.sort(); + + //array con le righe movimento CG + TArray righe_mov; + //riempie l'array delle righe movimento CG + FOR_EACH_ARRAY_ITEM(saldi_ordinati, riga, sldobj) + { + const TSaldo_per_codice& sld = *(const TSaldo_per_codice*)sldobj; + sld.genera_righe(righe_mov, cont_cesp_log, movdett); + } + + + + /*TMovimentoPN mov; + mov.last(); + //primo numero libero da usare come numreg + long numreg = mov.curr().get_long(MOV_NUMREG) + 1;*/ + + + + + TReport_book book; + book.add(cont_cesp_log); + book.preview(); - } //for(int i=0... - } //calcolati,se richiesti,gli ammortamenti, passa in rassegna AMMCE e AMMMV alla ricerca dei cespiti.. @@ -201,6 +407,6 @@ void TTrasf_mov_ce_cg::main_loop() int ce4400(int argc, char* argv[]) { TTrasf_mov_ce_cg a; - a.run(argc,argv,TR("Trasferimento movimenti cespiti in contabilita'")); + a.run(argc,argv,TR("Trasferimento cespiti in contabilita'")); return 0; } diff --git a/ce/ce4400a.h b/ce/ce4400a.h index 4b2a27972..3e074ab1a 100755 --- a/ce/ce4400a.h +++ b/ce/ce4400a.h @@ -4,8 +4,11 @@ #define F_ESERCIZIO 203 #define F_INIZIO_ES 204 #define F_FINE_ES 205 -#define F_PROVDEF 206 -#define F_DATACALC 207 -#define F_DATAREG 208 -#define F_DATACOMP 209 -#define F_KILLOLD 210 +#define F_GRUPPO 206 +#define F_SPECIE 207 +#define F_DESC_GRSP 208 +#define F_PROVDEF 209 +#define F_DATACALC 210 +#define F_DATAREG 211 +#define F_DATACOMP 212 +#define F_KILLOLD 213 diff --git a/ce/ce4400a.uml b/ce/ce4400a.uml index adf7727d8..7b63a0b4c 100755 --- a/ce/ce4400a.uml +++ b/ce/ce4400a.uml @@ -25,7 +25,7 @@ ENDPAGE PAGE "Contabilizzazione cespiti" -1 -1 0 -3 -GROUPBOX DLG_NULL 78 4 +GROUPBOX DLG_NULL 78 5 BEGIN PROMPT 1 0 "" END @@ -75,6 +75,38 @@ BEGIN FLAGS "D" END +NUMBER F_GRUPPO 2 +BEGIN + PROMPT 1 3 "Gruppo " + FLAGS "Z" + FIELD CODTAB[5,6] +END + +STRING F_SPECIE 4 +BEGIN + PROMPT 12 3 "Specie " + FLAGS "_" + USE CCB + JOIN %CAT ALIAS 400 INTO CODTAB=CODTAB[5,10] + INPUT CODTAB[1,4] F_ESERCIZIO SELECT + INPUT CODTAB[5,6] F_GRUPPO + INPUT CODTAB[7,10] F_SPECIE + DISPLAY "Gruppo" CODTAB[5,6] + DISPLAY "Specie" CODTAB[7,10] + DISPLAY "Descrizione@50" 400@->S0 + OUTPUT F_GRUPPO CODTAB[5,6] + OUTPUT F_SPECIE CODTAB[7,10] + OUTPUT F_DESC_GRSP 400@->S0 + CHECKTYPE REQUIRED + FIELD CODTAB[7,10] +END + +STRING F_DESC_GRSP 60 50 +BEGIN + PROMPT 26 3 "" + FLAGS "D" +END + GROUPBOX DLG_NULL 78 5 BEGIN PROMPT 1 5 "@bParametri cespiti" diff --git a/ce/cetbcac.h b/ce/cetbcac.h index 450c2b0c9..435f9bf71 100755 --- a/ce/cetbcac.h +++ b/ce/cetbcac.h @@ -53,3 +53,7 @@ #define F_QACC_CO 218 #define F_QACC_SOT 219 #define F_QACC_DES 220 +#define F_QPERSE_GR 221 +#define F_QPERSE_CO 222 +#define F_QPERSE_SOT 223 +#define F_QPERSE_DES 224 diff --git a/ce/cetbcac.uml b/ce/cetbcac.uml index dbeb7f298..25ce9a8c5 100755 --- a/ce/cetbcac.uml +++ b/ce/cetbcac.uml @@ -241,15 +241,35 @@ ENDPAGE PAGE "Collegamento contabilita'" -1 -1 60 6 -GROUPBOX DLG_NULL 74 7 +GROUPBOX DLG_NULL 74 9 BEGIN - PROMPT 1 1 "@bConti per attivita' Gruppo Conto Sottoconto Descrizione" + PROMPT 1 1 "@bConti per attivita'" FLAGS "R" END +TEXT -1 +BEGIN + PROMPT 15 2 "@BGruppo" +END + +TEXT -1 +BEGIN + PROMPT 22 2 "@BConto" +END + +TEXT -1 +BEGIN + PROMPT 29 2 "@BSottoconto" +END + +TEXT -1 +BEGIN + PROMPT 39 2 "@BDescrizione" +END + NUMBER F_IMM_GR 3 BEGIN - PROMPT 2 2 "Immobilizzo " + PROMPT 2 3 "Immobilizzo " FIELD S1[1,3] FLAGS "Z" USE LF_PCON SELECT CONTO="" @@ -263,7 +283,7 @@ END NUMBER F_IMM_CO 3 BEGIN - PROMPT 22 2 "" + PROMPT 22 3 "" FIELD S1[4,6] FLAGS "Z" USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&((INDBIL==1)||(INDBIL==2))) @@ -281,7 +301,7 @@ END NUMBER F_IMM_SOT 6 BEGIN - PROMPT 29 2 "" + PROMPT 29 3 "" FIELD S1[7,12] FLAGS "Z" USE LF_PCON SELECT SOTTOCONTO!="" @@ -300,7 +320,7 @@ END STRING F_IMM_DES 50 32 BEGIN - PROMPT 39 2 "" + PROMPT 39 3 "" USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" INPUT DESCR F_IMM_DES DISPLAY "Descrizione@50" DESCR @@ -314,7 +334,7 @@ END NUMBER F_FON_GR 3 BEGIN - PROMPT 2 3 "Fondo " + PROMPT 2 4 "Fondo " FIELD S1[13,15] FLAGS "Z" USE LF_PCON SELECT CONTO="" @@ -328,7 +348,7 @@ END NUMBER F_FON_CO 3 BEGIN - PROMPT 22 3 "" + PROMPT 22 4 "" FIELD S1[16,18] FLAGS "Z" USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&((INDBIL==1)||(INDBIL==2))) @@ -346,7 +366,7 @@ END NUMBER F_FON_SOT 6 BEGIN - PROMPT 29 3 "" + PROMPT 29 4 "" FIELD S1[19,24] FLAGS "Z" USE LF_PCON SELECT SOTTOCONTO!="" @@ -365,7 +385,7 @@ END STRING F_FON_DES 50 32 BEGIN - PROMPT 39 3 "" + PROMPT 39 4 "" USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" INPUT DESCR F_FON_DES DISPLAY "Descrizione@50" DESCR @@ -379,7 +399,7 @@ END NUMBER F_QNOR_GR 3 BEGIN - PROMPT 2 4 "Amm. Normali " + PROMPT 2 5 "Amm. Normali " FIELD S1[25,27] FLAGS "Z" USE LF_PCON SELECT CONTO="" @@ -393,10 +413,10 @@ END NUMBER F_QNOR_CO 3 BEGIN - PROMPT 22 4 "" + PROMPT 22 5 "" FIELD S1[28,30] FLAGS "Z" - USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&((INDBIL==1)||(INDBIL==2))) + USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==3)) COPY INPUT F_QNOR_GR INPUT CONTO F_QNOR_CO DISPLAY "Gruppo" GRUPPO @@ -411,7 +431,7 @@ END NUMBER F_QNOR_SOT 6 BEGIN - PROMPT 29 4 "" + PROMPT 29 5 "" FIELD S1[31,36] FLAGS "Z" USE LF_PCON SELECT SOTTOCONTO!="" @@ -430,7 +450,7 @@ END STRING F_QNOR_DES 50 32 BEGIN - PROMPT 39 4 "" + PROMPT 39 5 "" USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" INPUT DESCR F_QNOR_DES DISPLAY "Descrizione@50" DESCR @@ -444,7 +464,7 @@ END NUMBER F_QANT_GR 3 BEGIN - PROMPT 2 5 "Amm. Anticip." + PROMPT 2 6 "Amm. Anticip." FIELD S1[37,39] FLAGS "Z" USE LF_PCON SELECT CONTO="" @@ -453,15 +473,15 @@ BEGIN DISPLAY "Descrizione@50" DESCR OUTPUT F_QANT_GR GRUPPO ADD RUN CG0 -0 - CHECKTYPE REQUIRED + CHECKTYPE NORMAL END NUMBER F_QANT_CO 3 BEGIN - PROMPT 22 5 "" + PROMPT 22 6 "" FIELD S1[40,42] FLAGS "Z" - USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&((INDBIL==1)||(INDBIL==2))) + USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==3)) COPY INPUT F_QANT_GR INPUT CONTO F_QANT_CO DISPLAY "Gruppo" GRUPPO @@ -471,12 +491,12 @@ BEGIN COPY OUTPUT F_QANT_GR OUTPUT F_QANT_CO CONTO ADD RUN CG0 -0 - CHECKTYPE REQUIRED + CHECKTYPE NORMAL END NUMBER F_QANT_SOT 6 BEGIN - PROMPT 29 5 "" + PROMPT 29 6 "" FIELD S1[43,48] FLAGS "Z" USE LF_PCON SELECT SOTTOCONTO!="" @@ -490,12 +510,12 @@ BEGIN OUTPUT F_QANT_SOT SOTTOCONTO OUTPUT F_QANT_DES DESCR ADD RUN CG0 -0 - CHECKTYPE REQUIRED + CHECKTYPE NORMAL END STRING F_QANT_DES 50 32 BEGIN - PROMPT 39 5 "" + PROMPT 39 6 "" USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" INPUT DESCR F_QANT_DES DISPLAY "Descrizione@50" DESCR @@ -509,7 +529,7 @@ END NUMBER F_QACC_GR 3 BEGIN - PROMPT 2 6 "Amm. Accel. " + PROMPT 2 7 "Amm. Accel. " FIELD S1[49,51] FLAGS "Z" USE LF_PCON SELECT CONTO="" @@ -518,15 +538,15 @@ BEGIN DISPLAY "Descrizione@50" DESCR OUTPUT F_QACC_GR GRUPPO ADD RUN CG0 -0 - CHECKTYPE REQUIRED + CHECKTYPE NORMAL END NUMBER F_QACC_CO 3 BEGIN - PROMPT 22 6 "" + PROMPT 22 7 "" FIELD S1[52,54] FLAGS "Z" - USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&((INDBIL==1)||(INDBIL==2))) + USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==3)) COPY INPUT F_QACC_GR INPUT CONTO F_QACC_CO DISPLAY "Gruppo" GRUPPO @@ -536,12 +556,12 @@ BEGIN COPY OUTPUT F_QACC_GR OUTPUT F_QACC_CO CONTO ADD RUN CG0 -0 - CHECKTYPE REQUIRED + CHECKTYPE NORMAL END NUMBER F_QACC_SOT 6 BEGIN - PROMPT 29 6 "" + PROMPT 29 7 "" FIELD S1[55,60] FLAGS "Z" USE LF_PCON SELECT SOTTOCONTO!="" @@ -555,12 +575,12 @@ BEGIN OUTPUT F_QACC_SOT SOTTOCONTO OUTPUT F_QACC_DES DESCR ADD RUN CG0 -0 - CHECKTYPE REQUIRED + CHECKTYPE NORMAL END STRING F_QACC_DES 50 32 BEGIN - PROMPT 39 6 "" + PROMPT 39 7 "" USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" INPUT DESCR F_QACC_DES DISPLAY "Descrizione@50" DESCR @@ -572,6 +592,71 @@ BEGIN CHECKTYPE NORMAL END +NUMBER F_QPERSE_GR 3 +BEGIN + PROMPT 2 8 "Quote perse " + FIELD S2[1,3] + FLAGS "Z" + USE LF_PCON SELECT CONTO="" + INPUT GRUPPO F_QPERSE_GR + DISPLAY "Gruppo" GRUPPO + DISPLAY "Descrizione@50" DESCR + OUTPUT F_QPERSE_GR GRUPPO + ADD RUN CG0 -0 + CHECKTYPE REQUIRED +END + +NUMBER F_QPERSE_CO 3 +BEGIN + PROMPT 22 8 "" + FIELD S2[4,6] + FLAGS "Z" + USE LF_PCON SELECT ((CONTO!="")&&(SOTTOCONTO="")&&(INDBIL==3)) + COPY INPUT F_QPERSE_GR + INPUT CONTO F_QPERSE_CO + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Ind.Bil." INDBIL + DISPLAY "Descrizione@50" DESCR + COPY OUTPUT F_QPERSE_GR + OUTPUT F_QPERSE_CO CONTO + ADD RUN CG0 -0 + CHECKTYPE REQUIRED +END + +NUMBER F_QPERSE_SOT 6 +BEGIN + PROMPT 29 8 "" + FIELD S2[7,12] + FLAGS "Z" + USE LF_PCON SELECT SOTTOCONTO!="" + COPY INPUT F_QPERSE_CO + INPUT SOTTOCONTO F_QPERSE_SOT + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + DISPLAY "Descrizione@50" DESCR + COPY OUTPUT F_QPERSE_CO + OUTPUT F_QPERSE_SOT SOTTOCONTO + OUTPUT F_QPERSE_DES DESCR + ADD RUN CG0 -0 + CHECKTYPE REQUIRED +END + +STRING F_QPERSE_DES 50 32 +BEGIN + PROMPT 39 8 "" + USE LF_PCON KEY 2 SELECT SOTTOCONTO!="" + INPUT DESCR F_QPERSE_DES + DISPLAY "Descrizione@50" DESCR + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + COPY OUTPUT F_QPERSE_SOT + ADD RUN CG0 -0 + CHECKTYPE NORMAL +END + ENDPAGE ENDMASK