Ulteriori correzioni alla stampa conti

git-svn-id: svn://10.65.10.50/trunk@82 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-29 10:36:54 +00:00
parent 3a20f2096d
commit beaea780a2
2 changed files with 237 additions and 199 deletions

View File

@ -25,8 +25,6 @@ BEGIN
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
OUTPUT FLD_CM1_GRUPPO GRUPPO OUTPUT FLD_CM1_GRUPPO GRUPPO
OUTPUT FLD_CM1_CONTO CONTO
OUTPUT FLD_CM1_SOTTOCONTO SOTTOCONTO
OUTPUT FLD_CM1_DESC DESCR OUTPUT FLD_CM1_DESC DESCR
HELP "Inserire il gruppo" HELP "Inserire il gruppo"
VALIDATE NOT_EMPTY_FUNC VALIDATE NOT_EMPTY_FUNC
@ -44,7 +42,9 @@ BEGIN
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
COPY OUTPUT FLD_CM1_GRUPPO OUTPUT FLD_CM1_GRUPPO GRUPPO
OUTPUT FLD_CM1_CONTO CONTO
OUTPUT FLD_CM1_DESC DESCR
HELP "Inserire il conto" HELP "Inserire il conto"
END END
@ -61,7 +61,10 @@ BEGIN
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Sottoconto" SOTTOCONTO DISPLAY "Sottoconto" SOTTOCONTO
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
COPY OUTPUT FLD_CM1_GRUPPO OUTPUT FLD_CM1_GRUPPO GRUPPO
OUTPUT FLD_CM1_CONTO CONTO
OUTPUT FLD_CM1_SOTTOCONTO SOTTOCONTO
OUTPUT FLD_CM1_DESC DESCR
HELP "Inserire il sottoconto" HELP "Inserire il sottoconto"
END END
@ -76,7 +79,7 @@ BEGIN
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
DISPLAY "Sottoconto " SOTTOCONTO DISPLAY "Sottoconto " SOTTOCONTO
COPY OUTPUT FLD_CM1_GRUPPO COPY OUTPUT FLD_CM1_SOTTOCONTO
HELP "Inserire la descrizione del conto" HELP "Inserire la descrizione del conto"
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END
@ -113,7 +116,7 @@ BEGIN
PROMPT 4 7 "Sez. e classe IV dir.: " PROMPT 4 7 "Sez. e classe IV dir.: "
FIELD LF_PCON->SEZIVD FIELD LF_PCON->SEZIVD
GROUP 1 4 GROUP 1 4
ITEM " |Nessuna" ITEM "0|Nessuna"
ITEM "1|Attivita'" ITEM "1|Attivita'"
ITEM "2|Passivita'" ITEM "2|Passivita'"
ITEM "9|Conto economico" ITEM "9|Conto economico"
@ -124,7 +127,7 @@ LIST FLD_CM1_SEZIVDH 1 19
BEGIN BEGIN
PROMPT 4 7 "Sez. e classe IV dir.: " PROMPT 4 7 "Sez. e classe IV dir.: "
FIELD LF_PCON->SEZIVD FIELD LF_PCON->SEZIVD
ITEM " |Nessuna" ITEM "0|Nessuna"
ITEM "1|C.ordine attivo" ITEM "1|C.ordine attivo"
ITEM "2|C.ordine passivo" ITEM "2|C.ordine passivo"
ITEM "5|C.ordine" ITEM "5|C.ordine"
@ -146,18 +149,18 @@ BEGIN
GROUP 4 GROUP 4
END END
NUMBER FLD_CM1_NUMRIVD 8 8 NUMBER FLD_CM1_NUMRIVD 8 4
BEGIN BEGIN
PROMPT 55 7 "" PROMPT 55 7 ""
FIELD LF_PCON->NUMRIVD FIELD LF_PCON->NUMRIVD
GROUP 1 4 GROUP 1 4
FLAGS "M" FLAGS "MZ"
END END
NUMBER FLD_CM1_NUMRIVDH 8 NUMBER FLD_CM1_NUMRIVDH 8 4
BEGIN BEGIN
PROMPT 55 7 "" PROMPT 55 7 ""
FLAGS "HDM" FLAGS "HDMZ"
GROUP 4 GROUP 4
END END
@ -170,17 +173,17 @@ BEGIN
USE %IVD USE %IVD
INPUT CODTAB[1,1] FLD_CM1_SEZIVD INPUT CODTAB[1,1] FLD_CM1_SEZIVD
INPUT CODTAB[2,2] FLD_CM1_LETTIVD INPUT CODTAB[2,2] FLD_CM1_LETTIVD
INPUT CODTAB[3,10] FLD_CM1_NUMRIVD INPUT CODTAB[3,6] FLD_CM1_NUMRIVD
INPUT CODTAB[11,12] FLD_CM1_NUMIVD INPUT CODTAB[7,8] FLD_CM1_NUMIVD
DISPLAY "Sezione" CODTAB[1,1] DISPLAY "Sezione" CODTAB[1,1]
DISPLAY "Lettera" CODTAB[2,2] DISPLAY "Lettera" CODTAB[2,2]
DISPLAY "Classe " CODTAB[3,10] DISPLAY "Classe " CODTAB[3,6]
DISPLAY "Numero" CODTAB[11,12] DISPLAY "Numero" CODTAB[7,8]
DISPLAY "Descrizione@50" S0 DISPLAY "Descrizione@50" S0
OUTPUT FLD_CM1_SEZIVD CODTAB[1,1] OUTPUT FLD_CM1_SEZIVD CODTAB[1,1]
OUTPUT FLD_CM1_LETTIVD CODTAB[2,2] OUTPUT FLD_CM1_LETTIVD CODTAB[2,2]
OUTPUT FLD_CM1_NUMRIVD CODTAB[3,10] OUTPUT FLD_CM1_NUMRIVD CODTAB[3,6]
OUTPUT FLD_CM1_NUMIVD CODTAB[11,12] OUTPUT FLD_CM1_NUMIVD CODTAB[7,8]
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "Codice non presente" WARNING "Codice non presente"
END END
@ -197,7 +200,7 @@ BEGIN
PROMPT 4 8 "Classe segno opp.: " PROMPT 4 8 "Classe segno opp.: "
FIELD LF_PCON->SEZIVDOPP FIELD LF_PCON->SEZIVDOPP
GROUP 1 2 4 GROUP 1 2 4
ITEM " |Nessuna" ITEM "0|Nessuna"
ITEM "1|Attivita'" ITEM "1|Attivita'"
ITEM "2|Passivita'" ITEM "2|Passivita'"
ITEM "9|Conto economico" ITEM "9|Conto economico"
@ -212,11 +215,11 @@ BEGIN
GROUP 1 2 4 GROUP 1 2 4
END END
NUMBER FLD_CM1_NUMRIVDOPP 8 NUMBER FLD_CM1_NUMRIVDOPP 8 4
BEGIN BEGIN
PROMPT 55 8 "" PROMPT 55 8 ""
FIELD LF_PCON->NUMRIVDOPP FIELD LF_PCON->NUMRIVDOPP
FLAGS "M" FLAGS "MZ"
GROUP 1 2 4 GROUP 1 2 4
END END
@ -229,13 +232,13 @@ BEGIN
COPY USE FLD_CM1_NUMIVD COPY USE FLD_CM1_NUMIVD
INPUT CODTAB[1,1] FLD_CM1_SEZIVDOPP INPUT CODTAB[1,1] FLD_CM1_SEZIVDOPP
INPUT CODTAB[2,2] FLD_CM1_LETTIVDOPP INPUT CODTAB[2,2] FLD_CM1_LETTIVDOPP
INPUT CODTAB[3,10] FLD_CM1_NUMRIVDOPP INPUT CODTAB[3,6] FLD_CM1_NUMRIVDOPP
INPUT CODTAB[11,12] FLD_CM1_NUMIVDOPP INPUT CODTAB[7,8] FLD_CM1_NUMIVDOPP
COPY DISPLAY FLD_CM1_NUMIVD COPY DISPLAY FLD_CM1_NUMIVD
OUTPUT FLD_CM1_SEZIVDOPP CODTAB[1,1] OUTPUT FLD_CM1_SEZIVDOPP CODTAB[1,1]
OUTPUT FLD_CM1_LETTIVDOPP CODTAB[2,2] OUTPUT FLD_CM1_LETTIVDOPP CODTAB[2,2]
OUTPUT FLD_CM1_NUMRIVDOPP CODTAB[3,10] OUTPUT FLD_CM1_NUMRIVDOPP CODTAB[3,6]
OUTPUT FLD_CM1_NUMIVDOPP CODTAB[11,12] OUTPUT FLD_CM1_NUMIVDOPP CODTAB[7,8]
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "Codice non presente" WARNING "Codice non presente"
END END

View File

@ -3,7 +3,6 @@
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
// #include <scanner.h>
#include <relation.h> #include <relation.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
@ -41,7 +40,8 @@ class CG1100_application : public TPrintapp
stampe _tipo_stampa; stampe _tipo_stampa;
bool _salto_pag; bool _salto_pag;
int _pcont_reclen; int _pcont_reclen;
int _cur_c1, _cur_c2, _cur_c3, _cur_c4; int _cur_c1, _cur_c2;
TString _clivd, _clivdo;
public: public:
@ -66,14 +66,13 @@ public:
void set_senza_ana (); void set_senza_ana ();
const char * decodifica_codanabil (const char * ); const char * decodifica_codanabil (const char * );
// const char * decodifica_IV_sez (const char * );
const char * decodifica_IV_dir (const char * sezivd, const char * decodifica_IV_dir (const char * sezivd,
const char * lettivd = "", const char * lettivd = "",
const char * numrivd = "", int numrivd = 0, int numivd = 0);
int numivd = 0);
void process_link(int id, const char* txt); void process_link(int id, const char* txt);
CG1100_application() : _tab (TAB_IVD), _tab_anabil (TAB_ANABIL) {} CG1100_application() : _tab (TAB_IVD), _tab_anabil (TAB_ANABIL), _clivd(8),
_clivdo(8) {}
}; };
void CG1100_application::process_link(int id, const char* txt) void CG1100_application::process_link(int id, const char* txt)
@ -121,7 +120,10 @@ void CG1100_application::set_page(int file,int counter)
set_completa(); set_completa();
break; break;
case con_IV_direttiva: case con_IV_direttiva:
set_con_IV();
break;
case con_ana_bil: case con_ana_bil:
set_con_ana();
break; break;
case senza_IV_direttiva: case senza_IV_direttiva:
set_senza_IV(); set_senza_IV();
@ -139,8 +141,6 @@ void CG1100_application::set_page(int file,int counter)
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
void CG1100_application::scegli_cur() void CG1100_application::scegli_cur()
{ {
TString c1;
switch (_tipo_stampa) switch (_tipo_stampa)
{ {
case completa: case completa:
@ -163,14 +163,30 @@ void CG1100_application::scegli_cur()
select_cursor (_cur_c1); select_cursor (_cur_c1);
TCursor * cursor = current_cursor(); TCursor * cursor = current_cursor();
TRectype & rec = cursor->curr();
long last = cursor->items(); long last = cursor->items();
TString c1(4), c2(4), c3(4), c4(4);
for ( *cursor = 0; cursor->pos() < last; ++(*cursor) ) for ( *cursor = 0; cursor->pos() < last; ++(*cursor) )
{ {
c1 = cursor->curr(LF_PCON).get(PCN_SEZIVD); if (rec.get(PCN_CONTO).not_empty() && rec.get(PCN_SOTTOCONTO).empty())
if ( c1.trim().not_empty() ) {
_sort->sort (cursor->curr(LF_PCON).string()); c1 = rec.get(PCN_SEZIVD);
c2 = rec.get(PCN_LETTIVD);
c3 = rec.get(PCN_NUMRIVD);
c4 = rec.get(PCN_NUMIVD);
}
else
if (rec.get(PCN_SOTTOCONTO).not_empty() && rec.get(PCN_SEZIVD).empty())
{
rec.put(PCN_SEZIVD, c1);
rec.put(PCN_LETTIVD, c2);
rec.put(PCN_NUMRIVD, c3);
rec.put(PCN_NUMIVD, c4);
}
if (rec.get_int(PCN_SEZIVD) != 0)
_sort->sort (rec.string());
} }
_sort->endsort(); _sort->endsort();
@ -181,7 +197,7 @@ void CG1100_application::scegli_cur()
} }
case senza_IV_direttiva: case senza_IV_direttiva:
select_cursor (_cur_c3); select_cursor (_cur_c1);
break; break;
case con_ana_bil: case con_ana_bil:
@ -192,15 +208,22 @@ void CG1100_application::scegli_cur()
_sort->init(); _sort->init();
select_cursor (_cur_c1); select_cursor (_cur_c1);
TCursor * cursor = current_cursor(); TCursor * cursor = current_cursor();
TRectype & rec = cursor->curr();
long last = cursor->items(); long last = cursor->items();
TString c1(12);
for ( *cursor = 0; cursor->pos() < last; ++(*cursor) ) for ( *cursor = 0; cursor->pos() < last; ++(*cursor) )
{ {
c1 = cursor->curr(LF_PCON).get(PCN_CODCBL); if (rec.get(PCN_CONTO).not_empty() && rec.get(PCN_SOTTOCONTO).empty())
if ( c1.trim().not_empty() ) c1 = rec.get(PCN_CODCBL);
_sort->sort (cursor->curr(LF_PCON).string()); else
if (rec.get(PCN_SOTTOCONTO).not_empty() && rec.get(PCN_CODCBL).empty())
rec.put(PCN_CODCBL, c1);
if (rec.get(PCN_CODCBL).not_empty() )
_sort->sort (rec.string());
} }
_sort->endsort(); _sort->endsort();
@ -208,7 +231,7 @@ void CG1100_application::scegli_cur()
break; break;
} }
case senza_ana_bil: case senza_ana_bil:
select_cursor (_cur_c4); select_cursor (_cur_c1);
break; break;
default: default:
break; break;
@ -241,92 +264,82 @@ bool CG1100_application::preprocess_print (int file,int counter)
void CG1100_application::set_con_IV() void CG1100_application::set_con_IV()
{ {
// campi della classe static char old_sez[3] = "";
TString c1, c2, c3;
int c4;
TString descr_IV_sez, descr_IV_dir;
// campi della classe di segno opposto const TString c1(_rec->get(PCN_SEZIVD));
TString o1, o2,o3; const TString c2(_rec->get(PCN_LETTIVD));
int o4; const int c3 = _rec->get_int(PCN_NUMRIVD);
const int c4 = _rec->get_int(PCN_NUMIVD);
// Descrizioni
TString d1;
// gruppo, conto e sottoconto
int g,c,s;
c1 = _rec->get(PCN_SEZIVD);
c2 = _rec->get(PCN_LETTIVD);
c3 = _rec->get(PCN_NUMRIVD);
c4 = _rec->get_int(PCN_NUMIVD);
descr_IV_sez = decodifica_IV_dir (c1);
descr_IV_dir = decodifica_IV_dir (c1, c2, c3, c4);
o1 = _rec->get (PCN_SEZIVDOPP);
o2 = _rec->get (PCN_LETTIVDOPP);
o3 = _rec->get (PCN_NUMRIVDOPP);
o4 = _rec->get_int (PCN_NUMIVDOPP);
g = _rec->get_int (PCN_GRUPPO);
c = _rec->get_int (PCN_CONTO);
s = _rec->get_int (PCN_SOTTOCONTO);
d1 = _rec->get (PCN_DESCR);
int r = 1;
reset_row (1); reset_row (1);
reset_row (2); reset_row (2);
reset_row (3);
reset_row (4);
if (_rec->get(PCN_SEZIVD) != old_sez)
{
if (*old_sez) r++;
strcpy(old_sez, _rec->get(PCN_SEZIVD));
TString dsez(decodifica_IV_dir(c1));
set_row (r++, "%1s@19g%-50s", (const char *) c1, (const char *) dsez);
}
set_row (r, "@3g%-3s #-8t ", (const char *) c2, &_clivd);
if (c4 != 0) set_row (r, "%2d", c4);
set_row (1, "@1g%50s", (const char *) descr_IV_sez); const TString s(decodifica_IV_dir (c1, c2, c3, c4));
set_row (2, "@1g%3s", (const char *) c2); set_row (r, "@19g%-40s", (const char *) s);
set_row (2, "@5g%8s", (const char *) c3); set_row (r, "@60g$[r]%3d$[n] $[r]%3d$[n] $[r]%6ld$[n]",
set_row (2, "@14g%2d", c4); _rec->get_int (PCN_GRUPPO), _rec->get_int (PCN_CONTO),
_rec->get_long (PCN_SOTTOCONTO));
set_row (2, "@18g%40s", (const char *) descr_IV_dir); TParagraph_string s1(_rec->get (PCN_DESCR), 30);
set_row (2, "@60g$[r]%3d$[n].", (const char *) g); set_row (r, "@78g%-30s", s1.get());
set_row (2, "@64g$[r]%3d$[n].", (const char *) c);
set_row (2, "@68g$[r]%6d$[n]", (const char *) s);
set_row (2, "@78g%2d", (const char *) c4); const TString o1(_rec->get (PCN_SEZIVDOPP));
const TString o2(_rec->get (PCN_LETTIVDOPP));
set_row (r, "@110g%1s %-3s #-8t ", (const char *) o1, (const char *) o2,
&_clivdo);
const int o4 = _rec->get_int (PCN_NUMIVDOPP);
if (o4 != 0) set_row (r, "%2d", o4);
const char * s2 = s1.get();
if (s2)
set_row (++r, "@78g%-30s", s2);
} }
void CG1100_application::set_senza_IV() void CG1100_application::set_senza_IV()
{ {
int lnum = LF_PCON;
reset_row (1); reset_row (1);
set_row (1, "@1g$[r]@n$[n].", FLD(lnum,PCN_GRUPPO) ); set_row (1, "$[r]@3n$[n] $[r]@3n$[n] $[r]@6n$[n]",
set_row (1, "@5g$[r]@n$[n].", FLD(lnum,PCN_CONTO) ); FLD(LF_PCON, PCN_GRUPPO), FLD(LF_PCON,PCN_CONTO),
set_row (1, "@9g$[r]@n$[n]", FLD(lnum, PCN_SOTTOCONTO) ); FLD(LF_PCON, PCN_SOTTOCONTO));
set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) );
set_row (1, "@69g@1s", FLD(lnum, PCN_SEZIVD) ); set_row (1, "@16g@50s", FLD(LF_PCON,PCN_DESCR) );
set_row (1, "@71g@1s", FLD(lnum, PCN_LETTIVD) );
set_row (1, "@73g@8s", FLD(lnum, PCN_NUMRIVD) );
set_row (1, "@82g@pn", FLD(lnum, PCN_NUMIVD, "@@") );
set_row (1, "@87g@pn", FLD(lnum, PCN_INDBIL, "##") ); set_row (1, "@69g@1s", FLD(LF_PCON, PCN_SEZIVD) );
set_row (1, "@92g@1s", FLD(lnum, PCN_TMCF) ); set_row (1, "@71g@1s", FLD(LF_PCON, PCN_LETTIVD) );
set_row (1, "@99g@f", FLD(lnum, PCN_STSOTTBIL) ); set_row (1, "@73g#-8t", &_clivd);
set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) ); set_row (1, "@82g@pn", FLD(LF_PCON, PCN_NUMIVD, "@@") );
set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) ); set_row (1, "@87g@pn", FLD(LF_PCON, PCN_INDBIL, "##") );
// set_row (1, "@118g@f", FLD(lnum, PCN_STSOTTAB)); set_row (1, "@92g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (1, "@99g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (1, "@107g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (1, "@114g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
} }
void CG1100_application::set_con_ana() void CG1100_application::set_con_ana()
{ {
TString CodTabAnabil, DescrCodTabAnabil(30);
// Descrizioni
TString d1;
const char * d;
// gruppo, conto e sottoconto // gruppo, conto e sottoconto
int g,c; int g,c;
long s; long s;
@ -342,117 +355,121 @@ void CG1100_application::set_con_ana()
TipoSpric = _rec->get_int(PCN_TIPOSPRIC); TipoSpric = _rec->get_int(PCN_TIPOSPRIC);
IndBil = _rec->get_int(PCN_INDBIL); IndBil = _rec->get_int(PCN_INDBIL);
d1 = _rec->get (PCN_DESCR); TString cod(_rec->get(PCN_CODCBL));
TParagraph_string desc_conto(d1,25);
CodTabAnabil = _rec->get(PCN_CODCBL); set_row (1, "%-10s", (const char *) cod);
set_row (1, "%-10s", (const char *)CodTabAnabil);
set_row (1, "@15g%-10s", (const char *)DescrCodTabAnabil); set_row (1, "@15g%-40s", "") ; /* TBI */
set_row (1, "@60g$[r]%3d$[n] $[r]%3d$[n] $[r]%6ld$[n]", g, c, s);
TParagraph_string s1(_rec->get (PCN_DESCR), 30);
set_row (1, "@61g$[r]%3d$[n].", g ); set_row (1, "@78g%-30s", s1.get());
set_row (1, "$[r]%3d$[n].", c );
set_row (1, "$[r]%6ld$[n]", s );
int r=1; const char * s2 = s1.get();
while ((d = desc_conto.get()) != NULL)
if (s2)
{ {
if (r>1) reset_row(r); reset_row(2);
set_row (r, "@78g%25s", d); set_row (2, "@78g%-30s", s2);
r++;
} }
} }
void CG1100_application::set_senza_ana() void CG1100_application::set_senza_ana()
{ {
int lnum = LF_PCON;
reset_row (1); reset_row (1);
set_row (1, "@1g$[r]@n$[n].", FLD(lnum,PCN_GRUPPO) ); set_row (1, "$[r]@3n$[n] $[r]@3n$[n] $[r]@6n$[n]",
set_row (1, "@5$[r]g@n$[n].", FLD(lnum,PCN_CONTO) ); FLD(LF_PCON, PCN_GRUPPO), FLD(LF_PCON,PCN_CONTO),
set_row (1, "@9$[r]g@n$[n]", FLD(lnum, PCN_SOTTOCONTO) ); FLD(LF_PCON, PCN_SOTTOCONTO));
set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) );
set_row (1, "@69g@1s", FLD(lnum, PCN_SEZIVD) ); set_row (1, "@16g@50s", FLD(LF_PCON,PCN_DESCR) );
set_row (1, "@71g@1s", FLD(lnum, PCN_LETTIVD) );
set_row (1, "@73g@8s", FLD(lnum, PCN_NUMRIVD) );
set_row (1, "@82g@pn", FLD(lnum, PCN_NUMIVD, "@@") );
set_row (1, "@87g@pn", FLD(lnum, PCN_INDBIL, "##") ); set_row (1, "@69g@1s", FLD(LF_PCON, PCN_SEZIVD) );
set_row (1, "@92g@1s", FLD(lnum, PCN_TMCF) ); set_row (1, "@71g@1s", FLD(LF_PCON, PCN_LETTIVD) );
set_row (1, "@99g@f", FLD(lnum, PCN_STSOTTBIL) ); set_row (1, "@73g#-8t", &_clivd);
set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) ); set_row (1, "@82g@pn", FLD(LF_PCON, PCN_NUMIVD, "@@") );
set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) ); set_row (1, "@87g@pn", FLD(LF_PCON, PCN_INDBIL, "##") );
set_row (1, "@92g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (1, "@99g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (1, "@107g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (1, "@114g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
} }
void CG1100_application::set_completa() void CG1100_application::set_completa()
{ {
int lnum = LF_PCON;
reset_row (1); reset_row (1);
set_row (1, "@1g$[r]@n$[n].", FLD(lnum,PCN_GRUPPO) ); set_row (1, "$[r]@3n$[n] $[r]@3n$[n] $[r]@6n$[n]",
set_row (1, "@5g$[r]@n$[n].", FLD(lnum,PCN_CONTO) ); FLD(LF_PCON, PCN_GRUPPO), FLD(LF_PCON,PCN_CONTO),
set_row (1, "@9g$[r]@n$[n]", FLD(lnum, PCN_SOTTOCONTO) ); FLD(LF_PCON, PCN_SOTTOCONTO));
set_row (1, "@16g@50s", FLD(lnum,PCN_DESCR) ); set_row (1, "@16g@50s", FLD(LF_PCON,PCN_DESCR) );
set_row (1, "@69g@1s", FLD(lnum, PCN_SEZIVD) ); set_row (1, "@69g@1s", FLD(LF_PCON, PCN_SEZIVD) );
set_row (1, "@71g@1s", FLD(lnum, PCN_LETTIVD) ); set_row (1, "@71g@1s", FLD(LF_PCON, PCN_LETTIVD) );
set_row (1, "@73g@8s", FLD(lnum, PCN_NUMRIVD) ); set_row (1, "@73g#-8t", &_clivd );
set_row (1, "@82g@pn", FLD(lnum, PCN_NUMIVD, "@@") ); set_row (1, "@82g@pn", FLD(LF_PCON, PCN_NUMIVD, "@@") );
set_row (1, "@87g@pn", FLD(lnum, PCN_INDBIL, "##") ); set_row (1, "@87g@pn", FLD(LF_PCON, PCN_INDBIL, "##") );
set_row (1, "@92g@1s", FLD(lnum, PCN_TMCF) ); set_row (1, "@92g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (1, "@99g@f", FLD(lnum, PCN_STSOTTBIL) ); set_row (1, "@99g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (1, "@107g@f", FLD(lnum, PCN_COMPENS) ); set_row (1, "@107g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (1, "@114g@1n", FLD(lnum, PCN_TIPOSPRIC) ); set_row (1, "@114g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (1, "@120g@1s", FLD(lnum, PCN_SEZSALDI) ); set_row (1, "@120g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
} }
bool CG1100_application::elabora_riga() bool CG1100_application::elabora_riga()
{ {
static int old_gruppo = 0; static int old_gruppo = 0;
int new_gruppo = 0, new_conto = 0;
long new_sottoc = 0l;
TRectype& curr_rec = *_rec; TRectype& curr_rec = *_rec;
switch (_tipo_stampa) switch (_tipo_stampa)
{ {
case completa: case completa:
case senza_ana_bil:
case senza_IV_direttiva: case senza_IV_direttiva:
curr_rec = current_cursor()->curr(LF_PCON); break; curr_rec = current_cursor()->curr();
case con_ana_bil:
case con_IV_direttiva:
curr_rec = *_rec; break;
default:
break; break;
} case senza_ana_bil:
{
new_gruppo = curr_rec.get_int(PCN_GRUPPO); curr_rec = current_cursor()->curr();
new_conto = curr_rec.get_int(PCN_CONTO); int conto = curr_rec.get_int(PCN_CONTO);
new_sottoc = curr_rec.get_long(PCN_SOTTOCONTO); long sottoc = curr_rec.get_long(PCN_SOTTOCONTO);
if (new_gruppo != 0 && new_conto != 0) if (conto != 0)
{ {
// se e' un sottoconto stampo sotttab in 127 // se e' un sottoconto stampo sotttab in 127
if (new_sottoc != 0) if (sottoc != 0)
{ {
set_row (1, "@127g@f", FLD(LF_PCON, PCN_STSOTTAB)); set_row (1, "@127g@f", FLD(LF_PCON, PCN_STSOTTAB));
set_row (1, "@124g "); set_row (1, "@117g ");
} }
else else
// se e' un conto stampo sotttab in 124 // se e' un conto stampo sotttab in 124
{ {
set_row (1, "@124g@f", FLD(LF_PCON, PCN_STSOTTAB)); set_row (1, "@117g@f", FLD(LF_PCON, PCN_STSOTTAB));
set_row (1, "@127g "); set_row (1, "@127g ");
} }
} }
break;
}
case con_ana_bil:
case con_IV_direttiva:
curr_rec = *_rec;
break;
default:
break;
}
// Gestione salto pagina // Gestione salto pagina
if (_tipo_stampa == con_ana_bil || _tipo_stampa == con_IV_direttiva)
return FALSE;
int new_gruppo = curr_rec.get_int(PCN_GRUPPO);
if (_salto_pag && new_gruppo != old_gruppo) if (_salto_pag && new_gruppo != old_gruppo)
{ {
@ -465,11 +482,43 @@ bool CG1100_application::elabora_riga()
bool CG1100_application::preprocess_page(int file,int counter) bool CG1100_application::preprocess_page(int file,int counter)
{ {
static int c1 = 0;
static TString a1(12);
if (_tipo_stampa == senza_IV_direttiva)
{
TRectype & rec = current_cursor()->curr();
if (rec.get_int(PCN_CONTO) == 0) return FALSE;
if (rec.get_long(PCN_SOTTOCONTO) == 0L)
c1 = rec.get_int(PCN_SEZIVD);
else
if (rec.get_int(PCN_SEZIVD) == 0)
rec.put(PCN_SEZIVD, c1);
if (rec.get_int(PCN_SEZIVD) != 0)
return FALSE;
}
if (_tipo_stampa == senza_ana_bil)
{
TRectype & rec = current_cursor()->curr();
if (rec.get_int(PCN_CONTO) == 0) return FALSE;
if (rec.get_long(PCN_SOTTOCONTO) == 0L)
a1 = rec.get(PCN_CODCBL);
else
if (rec.get(PCN_CODCBL).empty())
rec.put(PCN_CODCBL, a1);
if (rec.get(PCN_CODCBL).not_empty()) return FALSE;
}
if (elabora_riga()) if (elabora_riga())
printer().formfeed(); printer().formfeed();
if (_tipo_stampa == con_IV_direttiva) set_con_IV(); const int c3 = atoi(_rec->get(PCN_NUMRIVD));
if (_tipo_stampa == con_ana_bil) set_con_ana(); const int o3 = atoi(_rec->get(PCN_NUMRIVDOPP));
_clivd = itor(c3);
_clivdo = itor(o3);
return TRUE; return TRUE;
} }
@ -506,7 +555,7 @@ void CG1100_application::intesta (stampe tipo)
TString s(132); TString s(132);
s = ditte.get(NDT_RAGSOC); s = ditte.get(NDT_RAGSOC);
set_header (soh++, "Ditta : %ld %s@125gData : @< Pag. @#", firm, (const char *) s); set_header (soh++, "Ditta : %ld %s@110gData : @< Pag. @#", firm, (const char *) s);
set_header (soh++,"@58gPIANO DEI CONTI"); set_header (soh++,"@58gPIANO DEI CONTI");
@ -518,19 +567,19 @@ void CG1100_application::intesta (stampe tipo)
{ {
case completa: case completa:
set_header (soh++, "Conto @67gSez. Classe@85gTipo@96gDettaglio@112gSpesa @123gDet.bil."); set_header (soh++, "Conto @67gSez. Classe@85gTipo@96gDettaglio@112gSpesa @123gDet.bil.");
set_header (soh++, "Sottoconto @16gDescrizione@68gIV dir. @85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez @123gSot.con."); set_header (soh++, "Sottoconto @16gDescrizione@68gIV dir. @85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez");
break; break;
case con_IV_direttiva: case con_IV_direttiva:
set_header (soh++, "@60gCodici Piano@111gSez. e Classe"); set_header (soh++, "@60gCodici Piano@111gSez. e Classe");
set_header (soh++, "Classe@18gDescrizione@60gdei Conti @78gDescrizione@110g di segno opposto"); set_header (soh++, "Classe@19gDescrizione@60gdei Conti @78gDescrizione@110g classe opposta");
break; break;
case senza_IV_direttiva: case senza_IV_direttiva:
set_header (soh++, "Conto@85gTipo@96gDettaglio@112gSpesa @123gDet.bil."); set_header (soh++, "Conto@85gTipo@96gDettaglio@112gSpesa @123gDet.bil.");
set_header (soh++, "Sottoconto @16gDescrizione@85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez @123gSot.con."); set_header (soh++, "Sottoconto @16gDescrizione@85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez");
break; break;
case con_ana_bil: case con_ana_bil:
@ -542,7 +591,7 @@ void CG1100_application::intesta (stampe tipo)
case senza_ana_bil: case senza_ana_bil:
set_header (soh++, "Conto @67gSez. Classe@85gTipo@96gDettaglio@112gSpesa @123gDet.bil."); set_header (soh++, "Conto @67gSez. Classe@85gTipo@96gDettaglio@112gSpesa @123gDet.bil.");
set_header (soh++, "Sottoconto @16gDescrizione@68gIV dir. @85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez @123gSot.con."); set_header (soh++, "Sottoconto @16gDescrizione@68gIV dir. @85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez");
break; break;
default: default:
@ -554,15 +603,20 @@ void CG1100_application::intesta (stampe tipo)
} }
const char * CG1100_application::decodifica_IV_dir (const char * sezivd, const char * lettivd, const char * numrivd, int numivd) const char * CG1100_application::decodifica_IV_dir (const char * sezivd, const char * lettivd, int numrivd, int numivd)
{ {
TString dep (CODTABLEN); TString dep (CODTABLEN);
_tab.curr().zero(); _tab.curr().zero();
if (numrivd != 0) dep.format("%1s%1s", sezivd, lettivd);
dep.format("%1s%1s%8s%02d", sezivd, lettivd, numrivd, numivd); if (numivd != 0)
{
dep << format("%04d", numrivd);
dep << format("%02d", numivd);
}
else else
dep.format("%1s%1s%8s", sezivd, lettivd, numrivd); if (numrivd != 0)
dep << format("%04d", numrivd);
_tab.curr().put("CODTAB", (const char*)dep); _tab.curr().put("CODTAB", (const char*)dep);
_tab.read(); _tab.read();
@ -582,21 +636,6 @@ const char * CG1100_application::decodifica_codanabil (const char * codpcab)
return _tab_anabil.curr().get ("S0"); return _tab_anabil.curr().get ("S0");
} }
//const char * CG1100_application::decodifica_IV_sez (const char * sezivd)
//{
// TString dep (CODTABLEN);
// TString dep2(CODTABLEN);
// _tab.zero();
// dep << format ("%1s", sezivd);
// _tab.put("CODTAB", dep);
// _tab.read();
// dep2 = _tab.get("CODTAB");
// if (dep != dep2)
// _tab.zero();
// return _tab.get ("S0");
//}
void CG1100_application::user_create() void CG1100_application::user_create()
{ {
_rel = new TRelation (LF_PCON); _rel = new TRelation (LF_PCON);
@ -613,9 +652,6 @@ void CG1100_application::user_create()
_cur_c2 = add_cursor (NULL); _cur_c2 = add_cursor (NULL);
_cur_c3 = add_cursor (new TCursor (_rel,"SEZIVD=\"\"", 1));
_cur_c4 = add_cursor (new TCursor (_rel,"CODCBL=\"\"", 1));
add_file(LF_PCON); add_file(LF_PCON);
_tipo_stampa = completa; _tipo_stampa = completa;
@ -637,4 +673,3 @@ int cg1100(int argc, char* argv[])
a.run(argc, argv, "Stampa Piano dei Conti"); a.run(argc, argv, "Stampa Piano dei Conti");
return 0; return 0;
} }