Correzioni a lista movimenti, mastrini, libro giornale, chiusura/apertura
conti git-svn-id: svn://10.65.10.50/trunk@225 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7986203cba
commit
5ca8379687
470
cg/cg3100.cpp
470
cg/cg3100.cpp
@ -1,4 +1,4 @@
|
||||
//Stampa movimenti
|
||||
//Lista movimenti
|
||||
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
@ -25,9 +25,11 @@
|
||||
#include "cg3100.h"
|
||||
#include "cg3401.h"
|
||||
|
||||
const MAXSTR = 128;
|
||||
static char __tmp [MAXSTR];
|
||||
static TFixed_string tmp (__tmp, MAXSTR);
|
||||
//const MAXSTR = 128;
|
||||
//static char __tmp [MAXSTR];
|
||||
//static TFixed_string tmp (__tmp, MAXSTR);
|
||||
|
||||
static TString256 TMP;
|
||||
|
||||
enum liste {
|
||||
movimenti=1,
|
||||
@ -37,14 +39,20 @@ enum liste {
|
||||
|
||||
bool filter_func (const TRelation *);
|
||||
bool filter_func_fatture (const TRelation *);
|
||||
bool annoes (TMask_field&, KEY);
|
||||
bool data_inizio (TMask_field&, KEY);
|
||||
bool data_fine (TMask_field&, KEY);
|
||||
|
||||
class CG3100_application : public TPrintapp
|
||||
{
|
||||
friend bool filter_func (const TRelation *);
|
||||
friend bool filter_func_fatture (const TRelation *);
|
||||
friend bool annoes (TMask_field&, KEY);
|
||||
friend bool data_inizio (TMask_field&, KEY);
|
||||
friend bool data_fine (TMask_field&, KEY);
|
||||
|
||||
TRigaiva_array _c;
|
||||
TTable * _tabiva, * _tabtpd, * _tabreg;
|
||||
TTable * _tabiva, * _tabtpd, * _tabreg, * _tabes;
|
||||
TLocalisamfile * _caus,* _comuni,* _rmoviva, * _clifo, * _pcon, * _attiv, *_nditte;
|
||||
TRelation * _relmov,* _relmov1,* _relmov2,* _relmov3;
|
||||
TCursor * _curr1, * _curr2, * _curr3;
|
||||
@ -65,7 +73,7 @@ class CG3100_application : public TPrintapp
|
||||
real _op_esenti, _op_non_imp, _impo, _impos;
|
||||
real _tot_dare, _tot_avere, _tot_avere_giornaliero;
|
||||
real _tot_dare_giornaliero, _tot_dare_generale, _tot_avere_generale;
|
||||
bool _intracom, _no_preprocess_page, _salto_pagina;
|
||||
bool _intracom, _no_preprocess_page, _salto_pagina, _stampa_anno_comp;
|
||||
bool _stampa_parte_iva,_alleg_causale,_stampa_mess_alleg_iva,_allegb,_ricser;
|
||||
bool _settata_prima_riga, _causale_gia_stampata;
|
||||
int _cur1,_cur2,_cur2b,_cur3,_cur4,_decidi,_tipod,_controllo_mov_errati;
|
||||
@ -94,11 +102,128 @@ public:
|
||||
void incrementa_totali();
|
||||
void compila_clifo();
|
||||
void compila_comuni();
|
||||
int my_next (TLocalisamfile*);
|
||||
int my_next (TLocalisamfile*);
|
||||
|
||||
CG3100_application() {}
|
||||
};
|
||||
|
||||
TDate InizioEsercizio(int anno)
|
||||
{
|
||||
TTable TabEs ("ESC");
|
||||
TString16 codtab;
|
||||
TDate inizio_es;
|
||||
|
||||
TabEs.zero();
|
||||
codtab.format ("%04d", anno);
|
||||
TabEs.put ("CODTAB", codtab);
|
||||
TabEs.read();
|
||||
if (TabEs.good())
|
||||
inizio_es= TabEs.get_date ("D0");
|
||||
|
||||
return inizio_es;
|
||||
}
|
||||
|
||||
TDate FineEsercizio(int anno)
|
||||
{
|
||||
TTable TabEs ("ESC");
|
||||
TString16 codtab;
|
||||
TDate fine_es;
|
||||
|
||||
TabEs.zero();
|
||||
codtab.format ("%04d", anno);
|
||||
TabEs.put ("CODTAB", codtab);
|
||||
TabEs.read();
|
||||
if (TabEs.good())
|
||||
fine_es = TabEs.get_date ("D1");
|
||||
else fine_es = botime;
|
||||
|
||||
return fine_es;
|
||||
}
|
||||
|
||||
bool annoes(TMask_field& f, KEY k)
|
||||
{
|
||||
// if ( (k == K_SPACE) || (k == K_TAB) )
|
||||
if (k == K_TAB)
|
||||
{
|
||||
int anno = f.mask().get_int (F_ANNO);
|
||||
if ( anno != 0 )
|
||||
{
|
||||
f.mask().field(F_DATAINI).set(InizioEsercizio(anno));
|
||||
TDate fine = FineEsercizio(anno + 1);
|
||||
if (fine == botime)
|
||||
fine = FineEsercizio(anno);
|
||||
f.mask().field(F_DATAFIN).set(fine);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool data_inizio(TMask_field& f, KEY k)
|
||||
{
|
||||
CG3100_application * app = (CG3100_application*)MainApp();
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
int decidi;
|
||||
int anno = f.mask().get_int (F_ANNO);
|
||||
TDate data = f.mask().get(F_DATAINI);
|
||||
if (app->_masc == "cg3100a")
|
||||
decidi = f.mask().get_int (F_DECIDI);
|
||||
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
|
||||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||
{
|
||||
if (!data.ok()) //se la data e' vuota
|
||||
f.mask().field(F_DATAINI).set(InizioEsercizio(anno));
|
||||
else
|
||||
if (data < InizioEsercizio(anno))
|
||||
{
|
||||
f.error_box("La data indicata non deve essere inferiore alla data di inizio esercizio");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool data_fine(TMask_field& f, KEY k)
|
||||
{
|
||||
CG3100_application * app = (CG3100_application*)MainApp();
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
int decidi;
|
||||
int anno = f.mask().get_int (F_ANNO);
|
||||
TDate dataini = f.mask().get(F_DATAINI);
|
||||
TDate datafin = f.mask().get(F_DATAFIN);
|
||||
if (app->_masc == "cg3100a")
|
||||
decidi = f.mask().get_int (F_DECIDI);
|
||||
if ( (app->_masc == "cg3100b") ||
|
||||
((app->_masc == "cg3100a" ) && (decidi == 2)) )
|
||||
if ( dataini.ok() && datafin.ok() )
|
||||
if (dataini > datafin)
|
||||
{
|
||||
f.error_box("La data iniziale non deve essere superiore alla data finale");
|
||||
return FALSE;
|
||||
}
|
||||
if ( anno != 0 && ( (app->_masc == "cg3100b") ||
|
||||
((app->_masc == "cg3100a" ) && (decidi == 2)) ) )
|
||||
{
|
||||
TDate fine = FineEsercizio(anno + 1);
|
||||
if (fine == botime)
|
||||
fine = FineEsercizio(anno);
|
||||
if (!datafin.ok()) //se la data e' vuota
|
||||
f.mask().field(F_DATAFIN).set(fine);
|
||||
else
|
||||
if (datafin > fine)
|
||||
{
|
||||
f.error_box("La data indicata non deve essere superiore alla data di fine esercizio successivo, oppure, in caso questo non esista, dell'esercizio indicato");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CG3100_application::compila_clifo()
|
||||
{
|
||||
_clifo->setkey(1);
|
||||
@ -167,7 +292,7 @@ const char * DescrConto (long gruppo, long conto, long sottoconto,
|
||||
pcon.put(PCN_SOTTOCONTO,sottoconto);
|
||||
pcon.read();
|
||||
if (pcon.good())
|
||||
tmp = pcon.curr().get(PCN_DESCR);
|
||||
TMP = pcon.curr().get(PCN_DESCR);
|
||||
else
|
||||
{
|
||||
clifo.setkey(1);
|
||||
@ -176,9 +301,9 @@ const char * DescrConto (long gruppo, long conto, long sottoconto,
|
||||
clifo.put(CLI_TIPOCF,tipocf);
|
||||
clifo.read();
|
||||
if (clifo.good())
|
||||
tmp = clifo.get(CLI_RAGSOC);
|
||||
TMP = clifo.get(CLI_RAGSOC);
|
||||
}
|
||||
return __tmp;
|
||||
return TMP;
|
||||
}
|
||||
|
||||
bool CausAlleg (const char * cod)
|
||||
@ -208,11 +333,11 @@ const char * TipoAttivita (const char * attreg, long codice_ditta)
|
||||
|
||||
attiv.read();
|
||||
if (attiv.good())
|
||||
tmp = attiv.curr().get(ATT_TIPOATT);
|
||||
TMP = attiv.curr().get(ATT_TIPOATT);
|
||||
else
|
||||
tmp = "";
|
||||
TMP = "";
|
||||
|
||||
return __tmp;
|
||||
return TMP;
|
||||
}
|
||||
|
||||
const char * SimboloValuta (const char * cod)
|
||||
@ -225,11 +350,11 @@ const char * SimboloValuta (const char * cod)
|
||||
tab_val.put("CODTAB", codtab);
|
||||
tab_val.read();
|
||||
if (tab_val.good())
|
||||
tmp = tab_val.get("S7");
|
||||
TMP = tab_val.get("S7");
|
||||
else
|
||||
tmp = "";
|
||||
TMP = "";
|
||||
|
||||
return __tmp;
|
||||
return TMP;
|
||||
}
|
||||
|
||||
const char * DescrDoc (const char * tipo)
|
||||
@ -242,11 +367,11 @@ const char * DescrDoc (const char * tipo)
|
||||
tab_tpd.put("CODTAB", codtab);
|
||||
tab_tpd.read();
|
||||
if (tab_tpd.good())
|
||||
tmp = tab_tpd.get("S0");
|
||||
TMP = tab_tpd.get("S0");
|
||||
else
|
||||
tmp = "";
|
||||
TMP = "";
|
||||
|
||||
return __tmp;
|
||||
return TMP;
|
||||
}
|
||||
|
||||
const char * AttivitaRegistro (const char * cod, int anno)
|
||||
@ -260,11 +385,11 @@ const char * AttivitaRegistro (const char * cod, int anno)
|
||||
tab_reg.read();
|
||||
|
||||
if (tab_reg.good())
|
||||
tmp = tab_reg.get("S8");
|
||||
TMP = tab_reg.get("S8");
|
||||
else
|
||||
tmp = "";
|
||||
TMP = "";
|
||||
|
||||
return __tmp;
|
||||
return TMP;
|
||||
}
|
||||
|
||||
const int CodiceRegistro (const char* cod, int anno)
|
||||
@ -298,22 +423,23 @@ bool filter_func_fatture (const TRelation * rel)
|
||||
TLocalisamfile * mov = rel->lfile(LF_MOV);
|
||||
TRectype from (mov->curr());
|
||||
TRectype to (mov->curr());
|
||||
ann_reg = mov->get_int (MOV_ANNOES);
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOES);
|
||||
tipo_reg = CodiceRegistro (cod_reg, ann_reg);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if (app->_annoes != 0)
|
||||
if (app->_annoes != 0) //anno esercizio specificato nella maschera
|
||||
{
|
||||
from.put(MOV_ANNOES, app->_annoes);
|
||||
to.put(MOV_ANNOES, app->_annoes);
|
||||
}
|
||||
from.put(MOV_DATAREG, app->_data_ini);
|
||||
//if (app->_data_ini.ok())
|
||||
// from.put(MOV_DATAREG, app->_data_ini);
|
||||
from.put(MOV_TIPO, app->_tipo_ini);
|
||||
if (app->_codice_ini != 0)
|
||||
from.put(MOV_CODCF, app->_codice_ini);
|
||||
to.put(MOV_DATAREG, app->_data_fin);
|
||||
//if (app->_data_fin.ok())
|
||||
// to.put(MOV_DATAREG, app->_data_fin);
|
||||
to.put(MOV_TIPO, app->_tipo_fin);
|
||||
if (app->_codice_fin != 0)
|
||||
to.put(MOV_CODCF, app->_codice_fin);
|
||||
@ -332,56 +458,56 @@ bool filter_func (const TRelation * rel)
|
||||
TString cod_reg, causale;
|
||||
TLocalisamfile * mov = rel->lfile(LF_MOV);
|
||||
TRectype from (mov->curr());
|
||||
TRectype to (mov->curr());
|
||||
TRectype to (mov->curr());
|
||||
switch (app->_scelta_stampa)
|
||||
{
|
||||
case 0:
|
||||
ann_reg = mov->get_int(MOV_ANNOES);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if (app->_annoes != 0)
|
||||
{
|
||||
case 0:
|
||||
ann_reg = mov->get_int(MOV_ANNOIVA);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if ( (app->_decidi == 2) && (app->_annoes != 0) )
|
||||
{
|
||||
from.put(MOV_ANNOES, app->_annoes);
|
||||
to.put(MOV_ANNOES, app->_annoes);
|
||||
}
|
||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
||||
from.put(MOV_REG, app->_registro_ini);
|
||||
to.put(MOV_REG, app->_registro_fin);
|
||||
if ((mov->curr() >= from) && (mov->curr() <= to))
|
||||
return TRUE;
|
||||
break;
|
||||
case 1:
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOES);
|
||||
tipo_reg = CodiceRegistro(cod_reg, ann_reg);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if (app->_annoes != 0)
|
||||
{
|
||||
}
|
||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
||||
from.put(MOV_REG, app->_registro_ini);
|
||||
to.put(MOV_REG, app->_registro_fin);
|
||||
if ((mov->curr() >= from) && (mov->curr() <= to))
|
||||
return TRUE;
|
||||
break;
|
||||
case 1:
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
tipo_reg = CodiceRegistro(cod_reg, ann_reg);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
from.zero();
|
||||
to.zero();
|
||||
if ( (app->_decidi == 2) && (app->_annoes != 0) )
|
||||
{
|
||||
from.put(MOV_ANNOES, app->_annoes);
|
||||
to.put(MOV_ANNOES, app->_annoes);
|
||||
}
|
||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
||||
}
|
||||
from.put(MOV_CODCAUS, app->_causale_ini);
|
||||
to.put(MOV_CODCAUS, app->_causale_fin);
|
||||
|
||||
if (((mov->curr() >= from) && (mov->curr() <= to)) &&
|
||||
if (((mov->curr() >= from) && (mov->curr() <= to)) &&
|
||||
((tipo_reg != 1) && (tipo_reg != 2)))
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CG3100_application::stampa_errori_rmov()
|
||||
{
|
||||
if (_scelta_stampa == 0) //stampa tutti i movimenti (iva e non)
|
||||
if (_scelta_stampa == 0) //lista movimenti
|
||||
{
|
||||
if (_controllo_mov_errati != 3)
|
||||
{
|
||||
@ -433,20 +559,24 @@ void CG3100_application::stampa_errori_mov()
|
||||
{
|
||||
if (_scelta_stampa == 0)
|
||||
{
|
||||
if ((_controllo_mov_errati != 3)&&((_tiporegistro == 1)||
|
||||
(_tiporegistro == 2)))//controlli su movimenti iva
|
||||
if (_controllo_mov_errati != 3)
|
||||
{
|
||||
if (_caus->bad())
|
||||
//aggiungere il controllo anno di competenza
|
||||
|
||||
if ( (_tiporegistro == 1)||(_tiporegistro == 2) ) //controlli su mov. iva
|
||||
{
|
||||
if (_caus->bad())
|
||||
set_row(++_n, "@11g%s", ERR_16);
|
||||
|
||||
if (_tipodocumento != _tipodoc)
|
||||
set_row(++_n, "@11g%s", MSG_19);
|
||||
|
||||
if (_tipodocumento != _tipodoc)
|
||||
set_row(++_n, "@11g%s", MSG_19);
|
||||
|
||||
if ((_stampa_mess_alleg_iva)&&(!_alleg_causale))
|
||||
set_row(++_n, "@11g%s", MSG_20);
|
||||
|
||||
if (_tiporegistro == 0)
|
||||
set_row(++_n, "@11g%s", ERR_21);
|
||||
if ((_stampa_mess_alleg_iva)&&(!_alleg_causale))
|
||||
set_row(++_n, "@11g%s", MSG_20);
|
||||
|
||||
if (_registro == "")
|
||||
set_row(++_n, "@11g%s", ERR_21);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -479,14 +609,24 @@ void CG3100_application::set_page(int file, int count)
|
||||
else if (file == LF_MOV)
|
||||
{
|
||||
_n = 1;
|
||||
set_row (_n, "Registrazione n. @18g@7n", FLD(LF_MOV,MOV_NUMREG));
|
||||
// set_row (_n, "@23g@3s",FLD(LF_MOV,MOV_CODCAUS));
|
||||
set_row (_n, "Operazione n. @18g@7n", FLD(LF_MOV,MOV_NUMREG));
|
||||
//set_row (_n, "@23g@3s",FLD(LF_MOV,MOV_CODCAUS));
|
||||
set_row (_n, "@26gdel@30g@d",FLD(LF_MOV,MOV_DATAREG));
|
||||
set_row (_n, "@41g@40s",FLD(LF_MOV,MOV_DESCR));
|
||||
set_row (_n, "@82gdocumento n.@95g@7s",FLD(LF_MOV,MOV_NUMDOC));
|
||||
set_row (_n, "@103gdel@107g@d", FLD(LF_MOV,MOV_DATADOC));
|
||||
set_row (_n, "@118g@4n", FLD(LF_MOV,MOV_ANNOES));
|
||||
set_row (_n, "@130g@f", FLD(LF_MOV,MOV_STAMPATO));
|
||||
set_row (_n, "@82gdoc. @87g@7s",FLD(LF_MOV,MOV_NUMDOC));
|
||||
set_row (_n, "@95gdel@99g@d", FLD(LF_MOV,MOV_DATADOC));
|
||||
TString16 reg = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||
int anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
int tipo = CodiceRegistro(reg, anno);
|
||||
if ( (tipo == 1) || (tipo == 2) )
|
||||
{
|
||||
set_row (_n, "@110greg @3s",FLD(LF_MOV,MOV_REG));
|
||||
set_row (_n, "@118gpr @5n",FLD(LF_MOV,MOV_PROTIVA));
|
||||
}
|
||||
if (_scelta_stampa == 0)
|
||||
if (_stampa_anno_comp)
|
||||
set_row (_n, "@127g@4n", FLD(LF_MOV,MOV_ANNOES));
|
||||
//set_row (_n, "@130g@f", FLD(LF_MOV,MOV_STAMPATO));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -547,7 +687,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
_no_preprocess_page = FALSE;
|
||||
_causale = current_cursor()->curr(LF_MOV).get(MOV_CODCAUS);
|
||||
_registro = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOES);
|
||||
_anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
_tipodoc = current_cursor()->curr(LF_MOV).get(MOV_TIPODOC);
|
||||
_datareg = current_cursor()->file(LF_MOV)->get_date(MOV_DATAREG);
|
||||
_causale_gia_stampata = FALSE;
|
||||
@ -643,7 +783,7 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else //_scelta_stampa == 1
|
||||
{
|
||||
if (file == LF_MOV)
|
||||
@ -713,13 +853,13 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case fatture:
|
||||
{
|
||||
if (file == LF_MOV)
|
||||
{
|
||||
int anno = cur->curr(LF_MOV).get_int(MOV_ANNOES);
|
||||
int anno = cur->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
TString codreg = cur->curr(LF_MOV).get(MOV_REG);
|
||||
|
||||
_tipo_elenco = current_cursor()->curr(LF_MOV).get(MOV_TIPO);
|
||||
@ -747,16 +887,18 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
||||
da.zero();
|
||||
a.zero();
|
||||
|
||||
if (_annoes != 0)
|
||||
if (_annoes != 0) //anno specificato nella maschera
|
||||
{
|
||||
da.put(MOV_ANNOES, _annoes);
|
||||
a.put(MOV_ANNOES, _annoes);
|
||||
}
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
if (_data_ini.ok())
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
da.put(MOV_TIPO, _tipo_ini);
|
||||
if (_codice_ini != 0)
|
||||
da.put(MOV_CODCF, _codice_ini);
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
if (_data_fin.ok())
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
a.put(MOV_TIPO, _tipo_fin);
|
||||
if (_codice_fin != 0)
|
||||
a.put(MOV_CODCF, _codice_fin);
|
||||
@ -1030,11 +1172,13 @@ int CG3100_application::my_next(TLocalisamfile * mov)
|
||||
case 1:
|
||||
while (!mov->eof())
|
||||
{
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOES);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
cod_reg = mov->get (MOV_REG);
|
||||
ann_reg = mov->get_int (MOV_ANNOIVA);
|
||||
causale = mov->get (MOV_CODCAUS);
|
||||
|
||||
if ( ( ( _annoes != 0l) && (ann_reg != _annoes) )
|
||||
//if ( ( ( _annoes != 0l) && (ann_reg != _annoes) )
|
||||
// || ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||
if ( ( _annoes != 0l)
|
||||
|| ( (causale < (const char*)_causale_ini) || (causale > (const char*)_causale_fin)) )
|
||||
{
|
||||
esito=mov->next();
|
||||
@ -1168,7 +1312,7 @@ bool CG3100_application::segnala_errori_primariga()
|
||||
{
|
||||
int tiporeg;
|
||||
|
||||
if ((_tiporegistro == 1)||(_tiporegistro == 2))
|
||||
if ((_tiporegistro == 1)||(_tiporegistro == 2)) //movimento iva
|
||||
{
|
||||
tiporeg = CodiceRegistro (_registro, _anno);
|
||||
|
||||
@ -1187,11 +1331,10 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
bool trovato = FALSE;
|
||||
TString dep1;
|
||||
|
||||
if ((_tiporegistro == 1)||(_tiporegistro == 2))
|
||||
if ((_tiporegistro == 1)||(_tiporegistro == 2)) //movimento iva
|
||||
{
|
||||
long record, numreg;
|
||||
TLocalisamfile* rmoviva;
|
||||
// int conta = 0;
|
||||
|
||||
rmoviva = current_cursor()->file(LF_RMOVIVA);
|
||||
_numreg = current_cursor()->file(LF_MOV)->get_long(MOV_NUMREG);
|
||||
@ -1215,20 +1358,20 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
if (_tiporegistro == 1)
|
||||
switch (_tipocr)
|
||||
{
|
||||
case 2 : case 3: case 5: case 8: case 9: _err1 = ERR_09;
|
||||
trovato = TRUE;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
case 2 : case 3: case 5: case 8: case 9: _err1 = ERR_09;
|
||||
trovato = TRUE;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
else
|
||||
if (_tiporegistro == 2)
|
||||
switch (_tipocr)
|
||||
{
|
||||
case 4: case 9: _err1 = ERR_09;
|
||||
case 4: case 9: _err1 = ERR_09;
|
||||
trovato = TRUE;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
if (_tipodoc != "AN")
|
||||
{
|
||||
_tabiva->setkey(1);
|
||||
@ -1238,7 +1381,6 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
_tabiva->read();
|
||||
if (_tabiva->good())
|
||||
{
|
||||
//conta += 1;
|
||||
TString colonnac = _tabiva->get("S7");
|
||||
TString colonnaf = _tabiva->get("S8");
|
||||
bool sospeso = _tabiva->get_bool("B2");
|
||||
@ -1256,13 +1398,13 @@ bool CG3100_application::segnala_errori_ogniriga()
|
||||
// break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_err2 = ERR_1;
|
||||
trovato = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// if (conta)
|
||||
// _err2 = "";
|
||||
} //for
|
||||
rmoviva->readat (record);
|
||||
}
|
||||
}
|
||||
@ -1316,12 +1458,10 @@ bool CG3100_application::set_print(int m)
|
||||
switch(m)
|
||||
{
|
||||
case 1:
|
||||
// case 2:
|
||||
_masc = "cg3100a";
|
||||
_tipo_lista = movimenti;
|
||||
break;
|
||||
case 2:
|
||||
// case 1:
|
||||
_masc = "cg3100b";
|
||||
_tipo_lista = fatture;
|
||||
break;
|
||||
@ -1334,6 +1474,11 @@ bool CG3100_application::set_print(int m)
|
||||
}
|
||||
|
||||
TMask msk(_masc);
|
||||
|
||||
msk.set_handler(F_ANNO, annoes);
|
||||
msk.set_handler(F_DATAINI, data_inizio);
|
||||
msk.set_handler(F_DATAFIN, data_fine);
|
||||
|
||||
if (msk.run() != K_ENTER) return FALSE;
|
||||
|
||||
reset_files();
|
||||
@ -1343,8 +1488,8 @@ bool CG3100_application::set_print(int m)
|
||||
_curr3->set_filterfunction (filter_func_fatture);
|
||||
switch (_tipo_lista)
|
||||
{
|
||||
case movimenti:
|
||||
{
|
||||
case movimenti:
|
||||
{
|
||||
_scelta_stampa = atoi(msk.get(F_MOVIMENTI));
|
||||
_annoes = msk.get_int (F_ANNO);
|
||||
_decidi = msk.get_int(F_DECIDI);
|
||||
@ -1390,8 +1535,10 @@ bool CG3100_application::set_print(int m)
|
||||
TRectype a (fl->curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
if (_data_ini.ok())
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
if (_data_fin.ok())
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
current_cursor()->setregion(da,a);
|
||||
add_file(LF_MOV);
|
||||
add_file(LF_RMOV,LF_MOV);
|
||||
@ -1440,8 +1587,10 @@ bool CG3100_application::set_print(int m)
|
||||
a.put(MOV_TIPO, _tipo_fin);
|
||||
if (_codice_fin != 0)
|
||||
a.put(MOV_CODCF, _codice_fin);
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
if (_data_ini.ok())
|
||||
da.put(MOV_DATAREG, _data_ini);
|
||||
if (_data_fin.ok())
|
||||
a.put(MOV_DATAREG, _data_fin);
|
||||
da.put(MOV_TIPO, _tipo_ini);
|
||||
current_cursor()->setregion(da,a);
|
||||
add_file(LF_MOV);
|
||||
@ -1455,8 +1604,8 @@ break;
|
||||
case movimenti_sezionale:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
init_print(msk);
|
||||
@ -1500,6 +1649,7 @@ void CG3100_application::user_create()
|
||||
_tabiva = new TTable(TAB_IVA);
|
||||
_tabtpd = new TTable(TAB_TPD);
|
||||
_tabreg = new TTable("REG");
|
||||
_tabes = new TTable("ESC");
|
||||
}
|
||||
|
||||
void CG3100_application::user_destroy() // releasev e arrmask
|
||||
@ -1524,7 +1674,6 @@ void CG3100_application::init_print(const TMask& msk)
|
||||
TDate data (msk.get(F_DATASTAMPA));
|
||||
printer().setdate(data);
|
||||
|
||||
|
||||
switch (_tipo_lista)
|
||||
{
|
||||
case movimenti:
|
||||
@ -1544,6 +1693,9 @@ void CG3100_application::init_print(const TMask& msk)
|
||||
_stampa_mess_alleg_iva = (bool)(msk.get(F_ALLEGATO)=="X");
|
||||
if (_stampa_mess_alleg_iva)
|
||||
_flags |= ST_MESS_ALLEG;
|
||||
_stampa_anno_comp = (bool)(msk.get(F_ANNOC)=="X");
|
||||
if (_stampa_anno_comp)
|
||||
_flags |= ST_ANNO_COMP;
|
||||
_controllo_mov_errati = atoi(msk.get(F_CONTROLLO));
|
||||
if (_controllo_mov_errati == 1)
|
||||
_flags |= ST_SOLO_MOVERR;
|
||||
@ -1688,13 +1840,23 @@ void CG3100_application::preprocess_header()
|
||||
set_header (soh++, (const char*)sep);
|
||||
if (_decidi == 2)
|
||||
{
|
||||
if (_flags & ST_DATA)
|
||||
if (_annoes != 0)
|
||||
{
|
||||
set_header (soh, "Dalla data@12g%s",_data_ini.string());
|
||||
set_header (soh, "@24galla data@34g%s",_data_fin.string());
|
||||
set_header (soh, "Anno %d", _annoes);
|
||||
if (_flags & ST_DATA)
|
||||
{
|
||||
set_header (soh, "@10gda@13g%s",_data_ini.string());
|
||||
set_header (soh, "@24ga@26g%s",_data_fin.string());
|
||||
}
|
||||
}
|
||||
else
|
||||
set_header (soh, "Completa in ordine di data");
|
||||
else
|
||||
if (_flags & ST_DATA)
|
||||
{
|
||||
set_header (soh, "Dalla data@12g%s",_data_ini.string());
|
||||
set_header (soh, "@24galla data@34g%s",_data_fin.string());
|
||||
}
|
||||
else
|
||||
set_header (soh, "Completa in ordine di data");
|
||||
}
|
||||
else
|
||||
if (_flags & ST_NUMERO)
|
||||
@ -1728,9 +1890,9 @@ void CG3100_application::preprocess_header()
|
||||
if ((_flags & (ST_ANNO_COMP|ST_MESS_ALLEG)) == 1)
|
||||
set_header (soh, "@78gcon messaggi: anno di competenza, allegato iva");
|
||||
else if (_flags & ST_ANNO_COMP)
|
||||
set_header (soh, "@78gcon messaggi: anno di competenza");
|
||||
set_header (soh, "@78gcon messaggio: anno di competenza");
|
||||
else if (_flags & ST_MESS_ALLEG)
|
||||
set_header (soh, "@78gcon messaggi: allegato iva");
|
||||
set_header (soh, "@78gcon messaggio: allegato iva");
|
||||
sep.fill('-');
|
||||
set_header (++soh, (const char *) sep);
|
||||
set_header (++soh, "Rg Cod Causale@30gDescrizione@56gCodice conto@72gDescrizione conto@98gDare@116gAvere@130gSB");
|
||||
@ -1739,20 +1901,34 @@ void CG3100_application::preprocess_header()
|
||||
{
|
||||
sep.overwrite ("Lista movimenti di sola prima nota");
|
||||
set_header (soh++, (const char*)sep);
|
||||
if (_flags & ST_DATA)
|
||||
if (_decidi == 2)
|
||||
{
|
||||
set_header (soh, "Dalla data@12g%s",_data_ini.string());
|
||||
set_header (soh, "@24galla data@34g%s",_data_fin.string());
|
||||
}
|
||||
if (_annoes != 0)
|
||||
{
|
||||
set_header (soh, "Anno %d", (const char*)_annoes);
|
||||
if (_flags & ST_DATA)
|
||||
{
|
||||
set_header (soh, "@10gda@13g%s",_data_ini.string());
|
||||
set_header (soh, "@24ga@26g%s",_data_fin.string());
|
||||
}
|
||||
}
|
||||
else
|
||||
if (_flags & ST_DATA)
|
||||
{
|
||||
set_header (soh, "Dalla data@12g%s",_data_ini.string());
|
||||
set_header (soh, "@24galla data@34g%s",_data_fin.string());
|
||||
}
|
||||
else
|
||||
set_header (soh, "Completa in ordine di data");
|
||||
}
|
||||
else
|
||||
set_header (soh, "Completa in ordine di data");
|
||||
if (_flags & ST_NUMERO)
|
||||
{
|
||||
set_header (soh, "@46gdal numero@57g%d", (const char*)_numreg_ini);
|
||||
set_header (soh, "@65gal numero@75g%d",(const char*)_numreg_fin);
|
||||
}
|
||||
else
|
||||
set_header (soh, "@46gcompleta in ordine di numero");
|
||||
if (_flags & ST_NUMERO)
|
||||
{
|
||||
set_header (soh, "@46gdal numero@57g%d", (const char*)_numreg_ini);
|
||||
set_header (soh, "@65gal numero@75g%d",(const char*)_numreg_fin);
|
||||
}
|
||||
else
|
||||
set_header (soh, "@46gCompleta in ordine di numero");
|
||||
if (_flags & ST_CAUSALE)
|
||||
{
|
||||
set_header(soh, "@86gdalla causale@100g%3s",(const char*)_causale_ini);
|
||||
@ -1769,13 +1945,23 @@ void CG3100_application::preprocess_header()
|
||||
case fatture:
|
||||
sep.overwrite ("Lista fatture");
|
||||
set_header (soh, (const char*)sep);
|
||||
if (_flags & ST_DATA)
|
||||
if (_annoes != 0)
|
||||
{
|
||||
set_header (soh, "@15gdalla data@26g%s",_data_ini.string());
|
||||
set_header (soh, "@37galla data@47g%s",_data_fin.string());
|
||||
set_header (soh, "@15gAnno %d", (const char*)_annoes);
|
||||
if (_flags & ST_DATA)
|
||||
{
|
||||
set_header (soh, "@25gdalla data@36g%s",_data_ini.string());
|
||||
set_header (soh, "@47galla data@57g%s",_data_fin.string());
|
||||
}
|
||||
}
|
||||
else
|
||||
set_header (soh, "@15gcompleta in ordine di data");
|
||||
else
|
||||
if (_flags & ST_DATA)
|
||||
{
|
||||
set_header (soh, "@15gdalla data@26g%s",_data_ini.string());
|
||||
set_header (soh, "@37galla data@47g%s",_data_fin.string());
|
||||
}
|
||||
else
|
||||
set_header (soh, "@15gcompleta in ordine di data");
|
||||
if (_flags & ST_CODICE)
|
||||
{
|
||||
set_header (soh, "@99gdal codice@110g%d",_codice_ini);
|
||||
|
@ -47,7 +47,7 @@
|
||||
#define ST_COMPLETA_NUM 0x1000
|
||||
#define ST_COMPLETA_CAUS 0x2000
|
||||
#define ST_COMPLETA_REG 0x4000
|
||||
#define ST_CODICE 0x8000
|
||||
#define ST_CODICE 0x8000
|
||||
|
||||
#endif // __CG3100_H
|
||||
|
||||
|
@ -29,8 +29,8 @@ END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
GROUP 3
|
||||
PROMPT 2 3 "Anno esercizio "
|
||||
//HELP "Se non indicato nessun anno esercizio significa che si richiede la stampa come specificato nei campi: dalla data, alla data"
|
||||
USE ESC
|
||||
CHECKTYPE NORMAL
|
||||
INPUT CODTAB F_ANNO
|
||||
@ -38,6 +38,7 @@ BEGIN
|
||||
DISPLAY "Data inizio esercizio" D0
|
||||
DISPLAY "Data fine esercizio" D1
|
||||
OUTPUT F_ANNO CODTAB
|
||||
FLAGS "RZ"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_MOVIMENTI 38
|
||||
@ -54,10 +55,10 @@ END
|
||||
LIST F_CONTROLLO 23
|
||||
BEGIN
|
||||
PROMPT 2 7 "Controllo movimenti errati "
|
||||
HELP "La scelta 1 stampa solo le registrazioni errate; la scelta 2 permette di listare tutte le registrazioni inserite, segnalando quelle errate; la scelta 3 stampa solo le registrazioni non errate"
|
||||
ITEM "1|Stampa movimenti errati" MESSAGE SHOW,1@
|
||||
ITEM "2|Si" MESSAGE SHOW,1@
|
||||
HELP "La scelta 1 stampa solo le registrazioni non errate; la scelta 2 permette di listare tutte le registrazioni inserite, segnalando quelle errate; la scelta 3 stampa solo le registrazioni errate"
|
||||
ITEM "3|No" MESSAGE HIDE,1@
|
||||
ITEM "2|Si" MESSAGE SHOW,1@
|
||||
ITEM "1|Stampa movimenti errati" MESSAGE SHOW,1@
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
@ -83,14 +84,14 @@ END
|
||||
RADIOBUTTON F_DECIDI 10
|
||||
BEGIN
|
||||
PROMPT 2 10 "Stampa "
|
||||
ITEM "2|data" MESSAGE DISABLE,2@|RESET,2@|ENABLE,3@
|
||||
ITEM "2|data" MESSAGE DISABLE,2@|RESET,2@|ENABLE,3@
|
||||
ITEM "1|numero" MESSAGE DISABLE,3@|RESET,3@|ENABLE,2@
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 19 11 "Stampa mov. dalla data "
|
||||
HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data"
|
||||
//HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data"
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
@ -125,7 +126,7 @@ BEGIN
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
NUMBER F_CAUSALEINI 3
|
||||
STRING F_CAUSALEINI 3
|
||||
BEGIN
|
||||
PROMPT 2 14 "Stampa dalla causale "
|
||||
USE LF_CAUSALI KEY 1
|
||||
@ -133,11 +134,11 @@ BEGIN
|
||||
DISPLAY "Codice causale" CODCAUS
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_CAUSALEINI CODCAUS
|
||||
FLAGS "R"
|
||||
FLAGS "UR"
|
||||
HELP "Introdurre codice causale di inizio stampa: vuoto = inizio archivio"
|
||||
END
|
||||
|
||||
NUMBER F_CAUSALEFIN 3
|
||||
STRING F_CAUSALEFIN 3
|
||||
BEGIN
|
||||
PROMPT 40 14 "alla causale "
|
||||
COPY USE F_CAUSALEINI
|
||||
@ -145,7 +146,7 @@ BEGIN
|
||||
DISPLAY "Codice causale" CODCAUS
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_CAUSALEFIN CODCAUS
|
||||
FLAGS "R"
|
||||
FLAGS "UR"
|
||||
HELP "Introdurre codice causale di fine stampa: vuoto = fine archivio"
|
||||
END
|
||||
|
||||
@ -153,13 +154,15 @@ STRING F_REGISTROINI 3
|
||||
BEGIN
|
||||
PROMPT 2 15 "Stampa dal registro iva "
|
||||
USE REG SELECT I0<"3"
|
||||
INPUT CODTAB[1,5] F_ANNO SELECT
|
||||
//INPUT CODTAB[1,5] F_ANNO SELECT
|
||||
//INPUT CODTAB[1,5] ""
|
||||
INPUT CODTAB[5,7] F_REGISTROINI
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Cod. registro iva" CODTAB[5,7]
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_REGISTROINI CODTAB[5,7]
|
||||
FLAGS "R"
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "UR"
|
||||
//CHECKTYPE NORMAL
|
||||
HELP "Introdurre cod. registro iva di inizio stampa: vuoto = inizio archivio"
|
||||
END
|
||||
|
||||
@ -167,13 +170,15 @@ STRING F_REGISTROFIN 3
|
||||
BEGIN
|
||||
PROMPT 40 15 "al reg. iva "
|
||||
COPY USE F_REGISTROINI
|
||||
INPUT CODTAB[1,5] F_ANNO SELECT
|
||||
//INPUT CODTAB[1,5] F_ANNO SELECT
|
||||
//INPUT CODTAB[1,5] ""
|
||||
INPUT CODTAB[5,7] F_REGISTROFIN
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Cod. registro iva" CODTAB[5,7]
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_REGISTROFIN CODTAB[5,7]
|
||||
FLAGS "R"
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "UR"
|
||||
//CHECKTYPE NORMAL
|
||||
HELP "Introdurre cod. registro iva di fine stampa: vuoto = fine archivio"
|
||||
END
|
||||
|
||||
@ -184,7 +189,7 @@ END
|
||||
|
||||
BOOLEAN F_STAMPAMOVP
|
||||
BEGIN
|
||||
PROMPT 2 17 "Stampa movimenti provvisori "
|
||||
PROMPT 2 17 "Stampa movimenti provvisori "
|
||||
END
|
||||
|
||||
/*
|
||||
|
@ -39,12 +39,13 @@ BEGIN
|
||||
DISPLAY "Data inizio esercizio" D0
|
||||
DISPLAY "Data fine esercizio" D1
|
||||
OUTPUT F_ANNO CODTAB
|
||||
FLAGS "RZ"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 6 "Stampa movimenti dalla data "
|
||||
HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data"
|
||||
//HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data"
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
@ -67,7 +68,7 @@ END
|
||||
NUMBER F_CODICEINI 6
|
||||
BEGIN
|
||||
PROMPT 2 8 "Stampa dal codice "
|
||||
HELP "Se si desidera l'elenco per clienti e fornitori, specificare prima il codice del cliente da cui iniziare la stampa e poi quello del fornitore"
|
||||
//HELP "Se si desidera l'elenco per clienti e fornitori, specificare prima il codice del cliente da cui iniziare la stampa e poi quello del fornitore"
|
||||
GROUP 1
|
||||
USE LF_CLIFO
|
||||
INPUT TIPOCF F_TIPOELENCO SELECT
|
||||
@ -119,6 +120,7 @@ END
|
||||
|
||||
BOOLEAN F_CAMBIO
|
||||
BEGIN
|
||||
GROUP 2
|
||||
PROMPT 2 10 "Cambio pagina per cliente/fornitore "
|
||||
END
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
#include "cg3100.h"
|
||||
|
||||
PAGE "" -1 -1 76 19
|
||||
|
480
cg/cg3200.cpp
480
cg/cg3200.cpp
@ -27,8 +27,13 @@ const MAXSTR = 128;
|
||||
static char __tmp [MAXSTR];
|
||||
static TFixed_string tmp (__tmp, MAXSTR);
|
||||
|
||||
int date2esc(const TDate& d, int* prevesc = NULL);
|
||||
|
||||
class CG3200_application : public TPrintapp
|
||||
{
|
||||
static bool data_inizio (TMask_field& f, KEY k);
|
||||
static bool data_fine (TMask_field& f, KEY k);
|
||||
|
||||
TDociva_array _b;
|
||||
TRelation* _rel;
|
||||
TRelation* _rel_clifo;
|
||||
@ -43,7 +48,7 @@ class CG3200_application : public TPrintapp
|
||||
Saldo _sld;
|
||||
|
||||
TDate _data_ini,_data_fine,_data_finese,_data_finesesucc,_ultima_data_reg;
|
||||
TDate _datareg,_datadoc,_data_inizioese;
|
||||
TDate _datareg,_datadoc,_data_inizioese,_datareg_stampa;
|
||||
int _cur1,_cur2,_cur3,_gruppo,_conto,_numcarat,_stampanum,_numivd;
|
||||
int _numrig,_natdoc,_tipo,_tipostampa;
|
||||
real _progredare,_progreavere,_totprogre_dare_al,_totprogre_avere_al;
|
||||
@ -60,10 +65,9 @@ class CG3200_application : public TPrintapp
|
||||
|
||||
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
|
||||
|
||||
long _annomsk,_annoesmsk,_sottoc,_numreg,_annoes;
|
||||
long _annomsksucc,_numgio,_protiva;
|
||||
int _annomsk,_annoesmsk,_annomsksucc,_tipocf;
|
||||
long _sottoc,_numreg,_annoes,_numgio,_protiva;
|
||||
bool _stampa_progressivi_si,_competenza,_inizio_stampa,_puoi_stampare;
|
||||
int _tipocf;
|
||||
char _ricerca;
|
||||
|
||||
TDate _dataregrmov;
|
||||
@ -83,6 +87,7 @@ protected:
|
||||
virtual void process_link(int id, const char* txt);
|
||||
|
||||
public:
|
||||
TDate _inizioEs,_fineEs;
|
||||
bool preprocess_pconti(int file, int counter);
|
||||
bool preprocess_clifo(int file, int counter);
|
||||
void set_page_pconti(int file, int counter);
|
||||
@ -101,7 +106,7 @@ public:
|
||||
void stampa_totali132();
|
||||
void stampa_totali198();
|
||||
void stampa_totaliiva();
|
||||
void data_fine_esercizio();
|
||||
void data_fine_esercizio(int);
|
||||
void data_fine_esercizio_succ();
|
||||
const char* descrizione_gruppo();
|
||||
const char* descrizione_conto();
|
||||
@ -113,6 +118,8 @@ public:
|
||||
CG3200_application();
|
||||
};
|
||||
|
||||
HIDDEN CG3200_application * app() { return (CG3200_application*) MainApp(); }
|
||||
|
||||
void CG3200_application::process_link(int id, const char* txt)
|
||||
{
|
||||
TToken_string ss(10);
|
||||
@ -129,6 +136,24 @@ void CG3200_application::process_link(int id, const char* txt)
|
||||
if (pn.run()) beep();
|
||||
}
|
||||
|
||||
int date2esc(const TDate& d, int* prevesc)
|
||||
{
|
||||
if (prevesc) *prevesc = 0;
|
||||
TTable esc("ESC");
|
||||
for (int err = esc.first(); err == NOERR; err = esc.next())
|
||||
{
|
||||
const TDate ia(esc.get("D0")); // Data inizio esercizio
|
||||
const TDate fa(esc.get("D1")); // Data fine esercizio
|
||||
app()->_inizioEs = ia;
|
||||
app()->_fineEs = fa;
|
||||
const anno = esc.get_int("CODTAB");
|
||||
if (d >= ia && d <= fa)
|
||||
return anno;
|
||||
if (prevesc) *prevesc = anno;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Questa funzione restituisce vero se il record su piano dei conti ha almeno un
|
||||
//record figlio (e che soddisfa la condizione riguardante la data di registr.).
|
||||
//Viene successivamente utilizzata per stampare l'intestazione (e i totali)
|
||||
@ -153,8 +178,23 @@ bool CG3200_application::almeno_un_record()
|
||||
rmov->put(RMV_SOTTOCONTO,_sottoc);
|
||||
for (rmov->read(); ;rmov->next())
|
||||
{
|
||||
long annoes = rmov->get_long(RMV_ANNOES);
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
int annoes = rmov->get_int (RMV_ANNOES);
|
||||
long numreg = rmov->get_long(RMV_NUMREG);
|
||||
|
||||
_mov->setkey(1);
|
||||
_mov->curr().zero();
|
||||
_mov->curr().put(MOV_NUMREG,numreg);
|
||||
_mov->read();
|
||||
if (_mov->bad())
|
||||
_mov->zero();
|
||||
TDate datacomp = (_mov->curr().get(MOV_DATACOMP));
|
||||
|
||||
if (_annomsk == 0)
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
datareg = datacomp;
|
||||
|
||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
||||
conto = rmov->get_int(RMV_CONTO);
|
||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
||||
@ -172,13 +212,104 @@ bool CG3200_application::almeno_un_record()
|
||||
return trovato;
|
||||
}
|
||||
|
||||
HIDDEN bool our_handler(TMask_field& field, KEY key)
|
||||
bool CG3200_application::data_inizio(TMask_field& f, KEY k)
|
||||
{
|
||||
if (key == K_TAB)
|
||||
int anno;
|
||||
TDate data;
|
||||
|
||||
anno = f.mask().get_int(F_ANNO);
|
||||
data = f.mask().get (F_DATAINI);
|
||||
app()->_annomsk = anno;
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
const long anno = atol(field.get());
|
||||
field.mask().enable(F_COMPESE);
|
||||
}
|
||||
if (anno != 0)
|
||||
{
|
||||
app()->data_fine_esercizio(anno);
|
||||
|
||||
if (data == botime)
|
||||
app()->_data_ini = app()->_data_inizioese;
|
||||
else
|
||||
if (data < app()->_data_inizioese || data > app()->_data_finese)
|
||||
{
|
||||
f.error_box("La data non appartiene all' esercizio indicato");
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
app()->_data_ini = data;
|
||||
}
|
||||
else
|
||||
if (anno == 0)
|
||||
{
|
||||
if (data == botime)
|
||||
{
|
||||
f.error_box("La data deve essere obbligatoriamente indicata");
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
app()->_data_ini = data;
|
||||
}
|
||||
}
|
||||
TString datastr = app()->_data_ini.string();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CG3200_application::data_fine(TMask_field& f, KEY k)
|
||||
{
|
||||
int annoes;
|
||||
TDate data, data_ini;
|
||||
|
||||
annoes = f.mask().get_int(F_ANNO);
|
||||
data = f.mask().get (F_DATAFINE);
|
||||
data_ini = f.mask().get (F_DATAINI);
|
||||
app()->_annomsk = annoes;
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
if (annoes != 0)
|
||||
{
|
||||
app()->data_fine_esercizio(annoes);
|
||||
|
||||
if (data == botime)
|
||||
app()->_data_fine = app()->_data_finese;
|
||||
else
|
||||
if (data < app()->_data_inizioese || data > app()->_data_finese)
|
||||
{
|
||||
f.error_box("La data non appartiene all' esercizio indicato");
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
app()->_data_fine = data;
|
||||
}
|
||||
else
|
||||
if (annoes == 0)
|
||||
{
|
||||
if (data == botime)
|
||||
{
|
||||
f.error_box("La data deve essere obbligatoriamente indicata");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
date2esc(data_ini);
|
||||
|
||||
if (data < app()->_inizioEs || data > app()->_fineEs)
|
||||
{
|
||||
f.error_box("La data non appartiene all' esercizio indicato");
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
app()->_data_fine = data;
|
||||
}
|
||||
|
||||
if (data < data_ini)
|
||||
{
|
||||
f.error_box("La data finale non puo' essere inferiore alla data di partenza");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
TString datastr = app()->_data_fine.string();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -230,11 +361,11 @@ void CG3200_application::fai_stampa132()
|
||||
set_row (1,"@30g#7t", &_numdoc);
|
||||
set_row (1,"@38g#3t", &_codcaus);
|
||||
|
||||
_sezione = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
||||
if (_sezione == "D")
|
||||
set_row (1,"@85g#t", &_importo_str);
|
||||
else if (_sezione == "A")
|
||||
set_row (1,"@101g#t", &_importo_str);
|
||||
// _sezione = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
||||
// if (_sezione == "D")
|
||||
// set_row (1,"@85g#t", &_importo_str);
|
||||
// else if (_sezione == "A")
|
||||
// set_row (1,"@101g#t", &_importo_str);
|
||||
|
||||
set_row (1,"@117g#3t", &_gruppocontr);
|
||||
set_row (1,"@120g#3t", &_contocontr);
|
||||
@ -428,7 +559,7 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||
_mov->read();
|
||||
if (_mov->bad())
|
||||
_mov->zero();
|
||||
_annoes = atol(_mov->curr().get(MOV_ANNOES));
|
||||
_annoes = atoi(_mov->curr().get(MOV_ANNOES));
|
||||
_regiva = _mov->curr().get(MOV_REG);
|
||||
|
||||
// Controlla se saldo e' diverso da 0
|
||||
@ -437,10 +568,21 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||
{
|
||||
_sezione = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
||||
|
||||
_datareg = (_mov->curr().get(MOV_DATAREG));
|
||||
if (_annomsk == 0)
|
||||
{
|
||||
_datareg = (_mov->curr().get(MOV_DATAREG));
|
||||
_datareg_stampa = _datareg;
|
||||
}
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
_datareg = _mov->curr().get(MOV_DATACOMP);
|
||||
_datareg_stampa = _mov->curr().get(MOV_DATAREG);
|
||||
}
|
||||
|
||||
provvis = _mov->curr().get(MOV_PROVVIS);
|
||||
|
||||
_dataregs = _datareg.string();
|
||||
_dataregs = _datareg_stampa.string();
|
||||
|
||||
if ((_stampa_mov_prov)||((!_stampa_mov_prov)&&(provvis.trim().empty())))
|
||||
{
|
||||
@ -515,6 +657,7 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||
_saldo_progressivi += _importo;
|
||||
_saldo_movimenti += _importo;
|
||||
}
|
||||
set_row (1,"@85g%s", (const char*) _importo_str);
|
||||
}
|
||||
else if (_sezione == "A")
|
||||
{
|
||||
@ -525,7 +668,9 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||
_saldo_progressivi -= _importo;
|
||||
_saldo_movimenti -= _importo;
|
||||
}
|
||||
set_row (1,"@101g%s", (const char*) _importo_str);
|
||||
}
|
||||
|
||||
_saldo_progressivi_str=_saldo_progressivi.string("###############");
|
||||
_saldo_movimenti_str=_saldo_movimenti.string("###############");
|
||||
if (_numcarat == 2)
|
||||
@ -538,9 +683,9 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -631,7 +776,7 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
||||
_mov->read();
|
||||
if (_mov->bad())
|
||||
_mov->zero();
|
||||
_annoes = atol(_mov->curr().get(MOV_ANNOES));
|
||||
_annoes = atoi(_mov->curr().get(MOV_ANNOES));
|
||||
_regiva = _mov->curr().get(MOV_REG);
|
||||
|
||||
// Controlla se saldo e' diverso da 0
|
||||
@ -640,10 +785,21 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
||||
{
|
||||
_sezione = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
||||
|
||||
_datareg = (_mov->curr().get(MOV_DATAREG));
|
||||
if (_annomsk == 0)
|
||||
{
|
||||
_datareg = (_mov->curr().get(MOV_DATAREG));
|
||||
_datareg_stampa = _datareg;
|
||||
}
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
_datareg = _mov->curr().get(MOV_DATACOMP);
|
||||
_datareg_stampa = _mov->curr().get(MOV_DATAREG);
|
||||
}
|
||||
|
||||
provvis = _mov->curr().get(MOV_PROVVIS);
|
||||
|
||||
_dataregs = _datareg.string();
|
||||
_dataregs = _datareg_stampa.string();
|
||||
|
||||
if ((_stampa_mov_prov)||((!_stampa_mov_prov)&&(provvis.trim().empty())))
|
||||
{
|
||||
@ -741,9 +897,9 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -1008,33 +1164,39 @@ bool CG3200_application::set_print(int)
|
||||
TString data1,data2;
|
||||
|
||||
_puoi_stampare = TRUE;
|
||||
|
||||
|
||||
_msk->set_handler (F_DATAINI , data_inizio);
|
||||
_msk->set_handler (F_DATAFINE , data_fine);
|
||||
|
||||
|
||||
tasto = _msk->run();
|
||||
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_data_ini = (_msk->get(F_DATAINI));
|
||||
_data_fine = (_msk->get(F_DATAFINE));
|
||||
// _data_ini = (_msk->get(F_DATAINI));
|
||||
// _data_fine = (_msk->get(F_DATAFINE));
|
||||
|
||||
_annomsk = atol(_msk->get(F_ANNO));
|
||||
|
||||
if (_annomsk == 0)
|
||||
_annomsk = atoi(_msk->get(F_ANNO));
|
||||
|
||||
/*****
|
||||
if (_annomsk == 0)
|
||||
if (_data_fine == botime) //Se data_fine e' vuota
|
||||
_data_fine = eotime;
|
||||
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
_data_fine = eotime;
|
||||
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
_annoesmsk = _annomsk - 1;
|
||||
data_fine_esercizio();
|
||||
if (_data_ini == botime)
|
||||
_data_ini = _data_inizioese;
|
||||
_data_ini = _data_inizioese;
|
||||
if (_data_fine == botime)
|
||||
_data_fine = _data_finese;
|
||||
}
|
||||
_data_fine = _data_finese;
|
||||
}
|
||||
|
||||
data1 = _data_ini.string();
|
||||
data2 = _data_fine.string();
|
||||
data1 = _data_ini.string();
|
||||
data2 = _data_fine.string();
|
||||
|
||||
*****/
|
||||
_stampaprogre = (bool)(_msk->get(F_STAMPAPROGRE) == "X");
|
||||
_stampatotiva = (bool)(_msk->get(F_STAMPATOTIVA) == "X");
|
||||
_stampanum = atoi(_msk->get(F_STAMPANUM));
|
||||
@ -1045,7 +1207,6 @@ bool CG3200_application::set_print(int)
|
||||
int gruppofine = atoi(_msk->get(F_GRUPPOFINE));
|
||||
int contofine = atoi(_msk->get(F_CONTOFINE));
|
||||
long sottocontofine = atol(_msk->get(F_SOTTOCONTOFINE));
|
||||
_competenza = (bool)(_msk->get(F_COMPESE) == "X");
|
||||
_tipostampa = atoi(_msk->get(F_TIPOSTAMPA));
|
||||
_numcarat = atoi(_msk->get(F_NUMCARAT));
|
||||
int formato = atoi(_msk->get(F_FORMATO));
|
||||
@ -1123,15 +1284,18 @@ bool CG3200_application::set_print(int)
|
||||
if (_stampatotiva)
|
||||
_b.destroy();
|
||||
|
||||
if (_competenza)
|
||||
/******
|
||||
if (_competenza)
|
||||
if (_data_fine == _data_finese)
|
||||
{
|
||||
TDate datafinesucc = _data_fine;
|
||||
datafinesucc.addyear(1);
|
||||
data_fine_esercizio_succ();
|
||||
if (datafinesucc == _data_finesesucc)
|
||||
_data_fine = datafinesucc;
|
||||
}
|
||||
TDate datafinesucc = _data_fine;
|
||||
datafinesucc.addyear(1);
|
||||
data_fine_esercizio_succ();
|
||||
if (datafinesucc == _data_finesesucc)
|
||||
_data_fine = datafinesucc;
|
||||
}
|
||||
|
||||
*********/
|
||||
|
||||
switch (_tipostampa)
|
||||
{
|
||||
@ -1157,12 +1321,12 @@ else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CG3200_application::data_fine_esercizio()
|
||||
void CG3200_application::data_fine_esercizio(int anno)
|
||||
{
|
||||
TString dep;
|
||||
|
||||
_tabesc->curr().zero();
|
||||
dep << format ("%04d",_annomsk);
|
||||
dep << format ("%04d", anno);
|
||||
_tabesc->curr().put("CODTAB", (const char*) dep);
|
||||
_tabesc->read();
|
||||
_data_finese = _tabesc->curr().get("D1");
|
||||
@ -1287,8 +1451,8 @@ void CG3200_application::crea_intestazione()
|
||||
{
|
||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||
set_header (6, (const char *) sep);
|
||||
set_header (7,"Data@11gNumero@19gDocumento@117gContro@130gAn");
|
||||
set_header (8,"Registr.@11gregistr@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita@130gCo");
|
||||
set_header (7,"Operazione@19gDocumento@117gContro@130gAn");
|
||||
set_header (8,"Data@11gnumero@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita@130gCo");
|
||||
sep.fill('-');
|
||||
set_header (9, (const char *) sep);
|
||||
}
|
||||
@ -1296,8 +1460,8 @@ void CG3200_application::crea_intestazione()
|
||||
{
|
||||
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
||||
set_header (6,"@1g%s", (const char *) sep1);
|
||||
set_header (7,"Data@11gNumero@19gData@30gNumero@172gContro@183gA@185gReg@193gNumero");
|
||||
set_header (8,"Registr.@11gregistr.@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@183gC@185gIva@189gProtocollo");
|
||||
set_header (7,"Operazione@19gData@30gNumero@172gContro@183gA@185gReg@193gNumero");
|
||||
set_header (8,"Data@11gnumero@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@183gC@185gIva@189gProtocollo");
|
||||
sep1.fill('-');
|
||||
set_header (9,"@1g%s", (const char *) sep1);
|
||||
}
|
||||
@ -1344,36 +1508,66 @@ void CG3200_application::crea_intestazione()
|
||||
void CG3200_application::calcola_progressivi_al()
|
||||
{
|
||||
long record,sottoc,annoes;
|
||||
int gruppo,conto;
|
||||
int gruppo,conto;
|
||||
TDate datareg;
|
||||
TLocalisamfile* rmov;
|
||||
char sezione;
|
||||
real importo;
|
||||
TDate data;
|
||||
|
||||
rmov = current_cursor()->file(LF_RMOV);
|
||||
|
||||
if (current_cursor()->is_first_match(LF_RMOV))
|
||||
// if (current_cursor()->is_first_match(LF_RMOV))
|
||||
// {
|
||||
record = rmov->recno();
|
||||
rmov->zero();
|
||||
rmov->put(RMV_GRUPPO, _gruppo);
|
||||
rmov->put(RMV_CONTO, _conto);
|
||||
rmov->put(RMV_SOTTOCONTO, _sottoc);
|
||||
for (rmov->read(); ;rmov->next())
|
||||
{
|
||||
record = rmov->recno();
|
||||
rmov->zero();
|
||||
rmov->put(RMV_GRUPPO, _gruppo);
|
||||
rmov->put(RMV_CONTO, _conto);
|
||||
rmov->put(RMV_SOTTOCONTO, _sottoc);
|
||||
for (rmov->read(); ;rmov->next())
|
||||
annoes = rmov->get_int (RMV_ANNOES);
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
sezione = rmov->get (RMV_SEZIONE)[0];
|
||||
importo = rmov->get_real(RMV_IMPORTO);
|
||||
long numreg = rmov->get_long(RMV_NUMREG);
|
||||
|
||||
_mov->setkey(1);
|
||||
_mov->curr().zero();
|
||||
_mov->curr().put(MOV_NUMREG,numreg);
|
||||
_mov->read();
|
||||
if (_mov->bad())
|
||||
_mov->zero();
|
||||
TDate datacomp = (_mov->curr().get(MOV_DATACOMP));
|
||||
|
||||
if (_annomsk == 0)
|
||||
{
|
||||
annoes = rmov->get_long(RMV_ANNOES);
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
||||
conto = rmov->get_int(RMV_CONTO);
|
||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
||||
if ((gruppo != _gruppo)&&(conto != _conto)&&(sottoc != _sottoc))
|
||||
break;
|
||||
else if ((annoes==_annomsk)&&(_datareg < _data_ini)) //Legge movimenti con data < data iniziale
|
||||
if (_sezione == "D")
|
||||
_totale_prima_dare += _importo;
|
||||
else if (_sezione == "A")
|
||||
_totale_prima_avere += _importo;
|
||||
datareg = rmov->get_date(RMV_DATAREG);
|
||||
data = _inizioEs;
|
||||
}
|
||||
rmov->readat(record);
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
datareg = datacomp;
|
||||
data = _data_inizioese;
|
||||
}
|
||||
TString data1 = datareg.string();
|
||||
TString data2 = _data_ini.string();
|
||||
TString data3 = data.string();
|
||||
|
||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
||||
conto = rmov->get_int(RMV_CONTO);
|
||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
||||
if ((gruppo != _gruppo)&&(conto != _conto)&&(sottoc != _sottoc))
|
||||
break;
|
||||
else if (((annoes==_annomsk)||(_annomsk == 0))&&(datareg >= data)&&(datareg < _data_ini)) //Legge movimenti con data < data iniziale
|
||||
if (sezione == 'D')
|
||||
_totale_prima_dare += importo;
|
||||
else if (sezione == 'A')
|
||||
_totale_prima_avere += importo;
|
||||
}
|
||||
rmov->readat(record);
|
||||
// }
|
||||
}
|
||||
|
||||
void CG3200_application::calcola_progressivi()
|
||||
@ -1431,7 +1625,7 @@ void CG3200_application::calcola_progressivi()
|
||||
((saldi.curr()==record) && !saldi.eof());
|
||||
saldi.next())
|
||||
{
|
||||
long annoes_saldi = saldi.curr().get_long(SLD_ANNOES);
|
||||
int annoes_saldi = saldi.curr().get_int(SLD_ANNOES);
|
||||
|
||||
//Calcola i progressivi dell'esercizio attuale
|
||||
|
||||
@ -1444,52 +1638,60 @@ void CG3200_application::calcola_progressivi()
|
||||
}
|
||||
|
||||
//Calcola i progressivi dell'esercizio precedente
|
||||
|
||||
if (annoes_saldi == _annoesmsk)
|
||||
{
|
||||
pdarescap = saldi.curr().get_real(SLD_PDARESCA);
|
||||
pdarep = saldi.curr().get_real(SLD_PDARE);
|
||||
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
||||
paverep = saldi.curr().get_real(SLD_PAVERE);
|
||||
|
||||
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
||||
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
||||
// i progressivi dell'esercizio precedente devo a questo punto sommare i
|
||||
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
||||
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
||||
|
||||
if (saldo != 0)
|
||||
{
|
||||
if (salini == 'D')
|
||||
{
|
||||
progredare_eseprec = saldo + pdarescap + pdarep;
|
||||
progreavere_eseprec = paverescap + paverep;
|
||||
}
|
||||
else if (salini == 'A')
|
||||
{
|
||||
progredare_eseprec = pdarescap + pdarep;
|
||||
progreavere_eseprec = saldo + paverescap + paverep;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
if (annoes_saldi == _annoesmsk)
|
||||
{
|
||||
pdarescap = saldi.curr().get_real(SLD_PDARESCA);
|
||||
pdarep = saldi.curr().get_real(SLD_PDARE);
|
||||
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
||||
paverep = saldi.curr().get_real(SLD_PAVERE);
|
||||
|
||||
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
||||
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
||||
// i progressivi dell'esercizio precedente devo a questo punto sommare i
|
||||
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
||||
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
||||
|
||||
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
||||
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
||||
|
||||
if ((indbil == 1) || (indbil == 2) || (indbil == 5))
|
||||
if (saldo != 0)
|
||||
{
|
||||
saldo = _sld.saldofin_esprec(_annomsk,_gruppo,_conto,_sottoc);
|
||||
|
||||
if (saldo.sign() > 0)
|
||||
if (salini == 'D')
|
||||
{
|
||||
progredare_eseprec = saldo + pdarescap + pdarep;
|
||||
progreavere_eseprec = paverescap + paverep;
|
||||
progredare_eseprec = saldo;// + pdarescap + pdarep;
|
||||
progdare_prec = saldo;
|
||||
// progreavere_eseprec = paverescap;// + paverep;
|
||||
}
|
||||
else if (saldo.sign() < 0)
|
||||
else if (salini == 'A')
|
||||
{
|
||||
progredare_eseprec = pdarescap + pdarep;
|
||||
progreavere_eseprec = saldo + paverescap + paverep;
|
||||
// progredare_eseprec = pdarescap;// + pdarep;
|
||||
progreavere_eseprec = saldo;// + paverescap + paverep;
|
||||
progavere_prec = saldo;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
||||
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
||||
|
||||
if ((indbil == 1) || (indbil == 2) || (indbil == 5))
|
||||
{
|
||||
saldo = _sld.saldofin_esprec(_annomsk,_gruppo,_conto,_sottoc);
|
||||
|
||||
if (saldo.sign() > 0)
|
||||
{
|
||||
progredare_eseprec = saldo;// + pdarescap + pdarep;
|
||||
progdare_prec = saldo;
|
||||
// progreavere_eseprec = paverescap + paverep;
|
||||
}
|
||||
else if (saldo.sign() < 0)
|
||||
{
|
||||
// progredare_eseprec = pdarescap + pdarep;
|
||||
saldo = -saldo;
|
||||
progreavere_eseprec = saldo;// + paverescap + paverep;
|
||||
progavere_prec = saldo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1500,13 +1702,19 @@ void CG3200_application::calcola_progressivi()
|
||||
//dei progressivi dell'anno esercizio precedente, e dei progressivi dei
|
||||
//movimenti scaricati dell'esercizio attuale.
|
||||
|
||||
calcola_progressivi_al();
|
||||
// calcola_progressivi_al();
|
||||
|
||||
_progredare = pdaresca + progredare_eseprec + _totale_prima_dare;
|
||||
_progreavere = paveresca + progreavere_eseprec + _totale_prima_avere;
|
||||
_saldo_progre_prec = _progredare - _progreavere;
|
||||
// _progredare = pdaresca + progredare_eseprec + _totale_prima_dare;
|
||||
// _progreavere = paveresca + progreavere_eseprec + _totale_prima_avere;
|
||||
// _saldo_progre_prec = _progredare - _progreavere;
|
||||
} // FOR
|
||||
|
||||
calcola_progressivi_al();
|
||||
|
||||
_progredare = pdaresca + progredare_eseprec + _totale_prima_dare;
|
||||
_progreavere = paveresca + progreavere_eseprec + _totale_prima_avere;
|
||||
_saldo_progre_prec = _progredare - _progreavere;
|
||||
|
||||
if (_numcarat == 1)
|
||||
{
|
||||
TString string = _saldo_progre_prec.string("###############");
|
||||
@ -1531,7 +1739,7 @@ void CG3200_application::calcola_progressivi()
|
||||
//Sommo i progressivi dell'esercizio precedente e quelli dell'esercizio attuale
|
||||
//altrimenti solo quelli dell'esercizio attuale
|
||||
|
||||
if (_competenza)
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
_totprogre_dare_al = progdare_attuale + progdare_prec;
|
||||
_totprogre_avere_al = progavere_attuale + progavere_prec;
|
||||
@ -1609,12 +1817,20 @@ void CG3200_application::ricerca_clifo()
|
||||
set_header(4,"@23g%-50s",(const char*) descriz);
|
||||
|
||||
dataini = _data_ini.string();
|
||||
set_header (5, "@1gPeriodo@10g%s", (const char*) dataini);
|
||||
if (_data_fine != eotime)
|
||||
datafine = _data_fine.string();
|
||||
|
||||
if (_annomsk == 0)
|
||||
{
|
||||
datafine = _data_fine.string();
|
||||
set_header (5, "Periodo@10g%s", (const char*) dataini);
|
||||
set_header (5, "@22g%s", (const char*) datafine);
|
||||
}
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
set_header (5, "Periodo di competenza@23g%s", (const char*) dataini);
|
||||
set_header (5, "@35g%s", (const char*) datafine);
|
||||
}
|
||||
|
||||
set_header (5, "@34g%-11s",(const char*) paiv);
|
||||
set_header (5, "@46g%-16s",(const char*) cofi);
|
||||
set_header (5, "@63g%-25s",(const char*) indcf);
|
||||
@ -1673,12 +1889,19 @@ void CG3200_application::ricerca_gruppo()
|
||||
set_header(4,"@27g%-50s",(const char*) descriz);
|
||||
|
||||
dataini = _data_ini.string();
|
||||
set_header (5, "@0gPeriodo@12g%s", (const char*) dataini);
|
||||
if (_data_fine != eotime)
|
||||
datafine = _data_fine.string();
|
||||
|
||||
if (_annomsk == 0)
|
||||
{
|
||||
datafine = _data_fine.string();
|
||||
set_header (5, "Periodo@12g%s", (const char*) dataini);
|
||||
set_header (5, "@24g%s", (const char*) datafine);
|
||||
}
|
||||
else
|
||||
if (_annomsk != 0)
|
||||
{
|
||||
set_header (5, "Periodo di competenza@23g%s", (const char*) dataini);
|
||||
set_header (5, "@35g%s", (const char*) datafine);
|
||||
}
|
||||
}
|
||||
|
||||
//Ricerca la descrizione relativa al gruppo da stampare
|
||||
@ -1779,7 +2002,6 @@ void CG3200_application::user_create()
|
||||
_tabesc = new TTable (TAB_ESC);
|
||||
|
||||
_msk = new TMask("cg3200a");
|
||||
_msk->set_handler(F_ANNO, our_handler);
|
||||
|
||||
_inizio_stampa = TRUE;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
#define F_SOTTOCONTOFINE 108
|
||||
#define F_DATAINI 109
|
||||
#define F_DATAFINE 110
|
||||
#define F_COMPESE 111
|
||||
#define F_STAMPANUM 112
|
||||
#define F_STAMPAPROGRE 113
|
||||
#define F_STAMPATOTIVA 114
|
||||
|
@ -22,15 +22,40 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
TEXT 96
|
||||
BEGIN
|
||||
PROMPT 4 10 "Dalla data competenza "
|
||||
END
|
||||
|
||||
TEXT 97
|
||||
BEGIN
|
||||
PROMPT 40 10 "Alla data competenza "
|
||||
END
|
||||
|
||||
TEXT 98
|
||||
BEGIN
|
||||
PROMPT 4 10 "Dalla data operazione "
|
||||
END
|
||||
|
||||
TEXT 99
|
||||
BEGIN
|
||||
PROMPT 40 10 "Alla data operazione "
|
||||
END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
PROMPT 47 1 "Anno esercizio "
|
||||
HELP "Inserire un anno esercizio presente nella tabella oppure niente: in quest'ultimo caso non e' possibile fare il controllo competenza esercizio"
|
||||
USE ESC
|
||||
INPUT CODTAB F_ANNO
|
||||
DISPLAY "Anno Esercizio@50" CODTAB
|
||||
DISPLAY "Anno Esercizio" CODTAB
|
||||
DISPLAY "Data inizio esercizio" D0
|
||||
DISPLAY "Data fine esercizio " D1
|
||||
OUTPUT F_ANNO CODTAB
|
||||
CHECKTYPE NORMAL
|
||||
MESSAGE HIDE,98|HIDE,99|SHOW,96|SHOW,97
|
||||
MESSAGE EMPTY HIDE,96|HIDE,97|SHOW,98|SHOW,99
|
||||
FLAGS "RZ"
|
||||
END
|
||||
|
||||
LIST F_RICERCA 25
|
||||
@ -454,32 +479,27 @@ END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 4 10 "Data inizio "
|
||||
PROMPT 26 10 ""
|
||||
END
|
||||
|
||||
DATE F_DATAFINE
|
||||
BEGIN
|
||||
PROMPT 51 10 "Data fine "
|
||||
END
|
||||
|
||||
BOOLEAN F_COMPESE
|
||||
BEGIN
|
||||
PROMPT 4 12 "Controllo competenza esercizio"
|
||||
PROMPT 62 10 ""
|
||||
END
|
||||
|
||||
BOOLEAN F_STAMPATOTIVA
|
||||
BEGIN
|
||||
PROMPT 4 12 "Stampa totali documenti IVA"
|
||||
END
|
||||
|
||||
BOOLEAN F_STAMPAPROGRE
|
||||
BEGIN
|
||||
PROMPT 44 12 "Stampa progressivi attuali"
|
||||
END
|
||||
|
||||
BOOLEAN F_STAMPATOTIVA
|
||||
BEGIN
|
||||
PROMPT 4 13 "Stampa totali documenti IVA"
|
||||
END
|
||||
|
||||
BOOLEAN F_STAMPAMOVPROV
|
||||
BEGIN
|
||||
PROMPT 44 13 "Stampa movimenti provvisori"
|
||||
PROMPT 4 13 "Stampa movimenti provvisori"
|
||||
END
|
||||
|
||||
LIST F_STAMPANUM 15
|
||||
|
197
cg/cg3400.cpp
197
cg/cg3400.cpp
@ -1,5 +1,4 @@
|
||||
// cg3400
|
||||
// Stampa libro giornale
|
||||
// cg3400 - Stampa libro giornale
|
||||
|
||||
#include <applicat.h>
|
||||
#include <isam.h>
|
||||
@ -26,32 +25,27 @@
|
||||
#include <clifo.h>
|
||||
#include <occas.h>
|
||||
|
||||
#ifndef __CG3401_H
|
||||
#include "cg3401.h" // qui c'e' TRigaiva_array
|
||||
#endif
|
||||
|
||||
#include "cglib03.h"
|
||||
#include "cg2103.h"
|
||||
#include "cg3400a.h"
|
||||
#include "cg3400b.h"
|
||||
|
||||
#define RIGHE_FOOTER 10
|
||||
#define REAL_PICTURE "###.###.###.###"
|
||||
|
||||
const MAXSTR = 128;
|
||||
static char __tmp [MAXSTR];
|
||||
static TFixed_string tmp (__tmp, MAXSTR);
|
||||
static TString256 tmp;
|
||||
|
||||
HIDDEN int date2esc(const TDate& d, int* prevesc = NULL);
|
||||
|
||||
enum descr { causale, conto, operazione };
|
||||
|
||||
bool mask_a_cod_reg (TMask_field& f, KEY k);
|
||||
bool mask_a_data (TMask_field& f, KEY k);
|
||||
bool mask_b_ripristina (TMask_field& f, KEY k);
|
||||
|
||||
class CG3400_application : public TPrintapp
|
||||
{
|
||||
friend bool mask_a_cod_reg (TMask_field& f, KEY k);
|
||||
friend bool mask_a_data (TMask_field& f, KEY k);
|
||||
friend bool mask_b_ripristina(TMask_field& f, KEY k);
|
||||
static bool mask_a_cod_reg (TMask_field& f, KEY k);
|
||||
static bool mask_a_data (TMask_field& f, KEY k);
|
||||
static bool mask_b_ripristina(TMask_field& f, KEY k);
|
||||
|
||||
public:
|
||||
TRigaiva_array _iva_array;
|
||||
TRelation * _rel;
|
||||
TCursor * _cur;
|
||||
@ -59,7 +53,6 @@ class CG3400_application : public TPrintapp
|
||||
|
||||
TString _reg_cod, _reg_anno, _reg_descr;
|
||||
TDate _data_da, _data_a, _last_data;
|
||||
bool _stampa_definitiva;
|
||||
real _tot_dare, _tot_avere; // valori di partenza
|
||||
real _tot_dare_progr, _tot_avere_progr; // progressivi
|
||||
real _tot_dare_gg , _tot_avere_gg ; // giornalieri
|
||||
@ -86,6 +79,10 @@ class CG3400_application : public TPrintapp
|
||||
TTable *_tabreg, *_tabval, *_tabes;
|
||||
|
||||
public:
|
||||
bool _stampa_definitiva;
|
||||
TDate _inizioEs, _fineEs; // date inizio e fine esercizio
|
||||
TString256 _riporto; // riga di stampa per i riporti
|
||||
TString256 _intes; // riga di stampa per intestazione
|
||||
virtual void preprocess_header();
|
||||
virtual void preprocess_footer();
|
||||
virtual bool preprocess_page(int, int);
|
||||
@ -126,26 +123,37 @@ public:
|
||||
const char * get_descr_caus (const char * codcaus);
|
||||
|
||||
CG3400_application() : _reg_cod(3), _reg_anno(4), _tot_dare_progr(0.00),
|
||||
_tot_avere_progr (0.00), _data_da(""), _data_a("")
|
||||
{};
|
||||
_tot_avere_progr (0.00), _data_da(""), _data_a("") {};
|
||||
virtual ~CG3400_application() {};
|
||||
};
|
||||
|
||||
HIDDEN CG3400_application * app() { return (CG3400_application*) MainApp(); }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Funzioni legate ai parametri ditta
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool libro_giornale_iva_unico()
|
||||
HIDDEN bool libro_giornale_iva_unico()
|
||||
{
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
static bool lgiu = 2;
|
||||
|
||||
return conf.get("StLgiU") == "X";
|
||||
if (lgiu == 2)
|
||||
{
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
lgiu = conf.get_bool("StLgiU");
|
||||
}
|
||||
return lgiu;
|
||||
}
|
||||
|
||||
bool libro_cronologico()
|
||||
HIDDEN bool libro_cronologico()
|
||||
{
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
static bool lc = 2;
|
||||
|
||||
return conf.get("GsLbCr") == "X";
|
||||
if (lc == 2)
|
||||
{
|
||||
TConfig conf(CONFIG_DITTA);
|
||||
lc = conf.get_bool("GsLbCn");
|
||||
}
|
||||
return lc;
|
||||
}
|
||||
|
||||
TRectype& look_com (const char * cod, TLocalisamfile *comuni)
|
||||
@ -162,29 +170,20 @@ TRectype& look_com (const char * cod, TLocalisamfile *comuni)
|
||||
bool CG3400_application::IsInEsercizio (TDate& da, TDate& a, int anno_eser)
|
||||
{
|
||||
TTable& TabEs = *_tabes;
|
||||
TString codtab;
|
||||
TDate inizio, fine;
|
||||
TString16 codtab;
|
||||
|
||||
if (!da.ok() || !a.ok()) return FALSE;
|
||||
|
||||
codtab.format ("%-4d", anno_eser);
|
||||
TabEs.zero();
|
||||
|
||||
codtab << format ("%-4d", anno_eser);
|
||||
TabEs.put ("CODTAB", codtab);
|
||||
TabEs.read();
|
||||
|
||||
if (TabEs.good())
|
||||
{
|
||||
inizio = TabEs.get_date ("D0");
|
||||
fine = TabEs.get_date ("D1");
|
||||
if ((da >= inizio) && (a <= fine))
|
||||
return TRUE;
|
||||
else
|
||||
{
|
||||
TString da(inizio.string());
|
||||
TString a(fine.string());
|
||||
warning_box("Le date devono essere comprese tra %s e %s", (const char*)da, (const char*)a);
|
||||
return FALSE;
|
||||
}
|
||||
_inizioEs = TabEs.get_date ("D0");
|
||||
_fineEs = TabEs.get_date ("D1");
|
||||
return (da >= _inizioEs && a <= _fineEs);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -192,19 +191,20 @@ bool CG3400_application::IsInEsercizio (TDate& da, TDate& a, int anno_eser)
|
||||
const char * CG3400_application::SimboloValuta (const char * cod)
|
||||
{
|
||||
TTable& tab_val = *_tabval;
|
||||
TString codtab = format ("%-3s", cod);
|
||||
// static char simbolo;
|
||||
TString16 codtab;
|
||||
|
||||
codtab.format ("%-3s", cod);
|
||||
|
||||
tab_val.zero();
|
||||
|
||||
tab_val.put("CODTAB", codtab);
|
||||
tab_val.read();
|
||||
|
||||
if (tab_val.good())
|
||||
tmp = tab_val.get("S7");
|
||||
else
|
||||
tmp = "";
|
||||
|
||||
return __tmp;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
const char * CG3400_application::get_descr_caus (const char * codcaus)
|
||||
@ -213,14 +213,10 @@ const char * CG3400_application::get_descr_caus (const char * codcaus)
|
||||
|
||||
caus.zero();
|
||||
caus.put (CAU_CODCAUS, codcaus);
|
||||
|
||||
caus.read();
|
||||
|
||||
if (caus.bad())
|
||||
caus.zero();
|
||||
if (caus.read() != NOERR) caus.zero();
|
||||
|
||||
tmp = caus.get(CAU_DESCR);
|
||||
return __tmp;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
TLocalisamfile * CG3400_application::get_descr (TLocalisamfile *pconti,
|
||||
@ -626,17 +622,16 @@ void CG3400_application::preprocess_footer()
|
||||
int CG3400_application::stampa_intestazione_ditta()
|
||||
{
|
||||
int r=1;
|
||||
TString riga(_stampa_width);
|
||||
|
||||
get_dati_ditta();
|
||||
set_header (r, "Ditta: %s Via %s %s %s %s", (const char *)_ragsoc,
|
||||
(const char *)_viafis, (const char *)_cap,
|
||||
(const char *)_comunefis, (const char *)_provfis);
|
||||
r++;
|
||||
riga = "Data @>";
|
||||
riga.right_just(_stampa_width-15); // perche' il codice viene espanso nella data con l'anno in 4 caratteri
|
||||
riga.overwrite (format ("Partita iva %s @24gCodice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
||||
set_header (r, "%s", (const char*) riga);
|
||||
_intes = "Data @>";
|
||||
_intes.right_just(_stampa_width-15); // perche' il codice viene espanso nella data con l'anno in 4 caratteri
|
||||
_intes.overwrite (format ("Partita iva %s @24gCodice fiscale %s", (const char*)_paiva, (const char*)_cofi));
|
||||
set_header (r, "%s", (const char*) _intes);
|
||||
r++;
|
||||
|
||||
return r;
|
||||
@ -709,6 +704,9 @@ int CG3400_application::set_header_132()
|
||||
set_header(r, riga);
|
||||
r++;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// LIBRO GIORNALE IVA UNICO
|
||||
////////////////////////////////////////////////////////////////////
|
||||
if (_libro_giornale_iva_unico)
|
||||
{
|
||||
set_header(r, "Ri");
|
||||
@ -756,16 +754,16 @@ void CG3400_application::preprocess_header()
|
||||
|
||||
if (pag > 0) // Stampa riporti
|
||||
{
|
||||
TString dep (_stampa_width);
|
||||
dare.right_just();
|
||||
avere.right_just();
|
||||
if (_stampa_width == 132)
|
||||
dep = format ("@86gRiporto:@95g %15s @112g %15s", (const char *) dare,
|
||||
(const char *) avere );
|
||||
_riporto.format ("@86gRiporto:@95g %15s @112g %15s",
|
||||
(const char *) dare,
|
||||
(const char *) avere );
|
||||
else
|
||||
dep = format ("@100gRiporto %s @140g %s", (const char *) dare,
|
||||
(const char *) avere );
|
||||
set_header (r, "%s", (const char *) dep);
|
||||
_riporto.format ("@100gRiporto %s @140g %s", (const char *) dare,
|
||||
(const char *) avere );
|
||||
set_header (r, "%s", (const char *) _riporto);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1226,8 +1224,11 @@ void CG3400_application::setta_righe_indirizzo()
|
||||
//
|
||||
void CG3400_application::aggiorna_tabreg(int partito_da, int stampate)
|
||||
{
|
||||
TString codtab = format ("%4s%-3s", (const char*) _reg_anno,
|
||||
(const char*) _reg_cod);
|
||||
TString16 codtab;
|
||||
|
||||
codtab.format ("%4s%-3s", (const char*) _reg_anno,
|
||||
(const char*) _reg_cod);
|
||||
|
||||
_tabreg->zero();
|
||||
_tabreg->put("CODTAB", codtab);
|
||||
_tabreg->read();
|
||||
@ -1247,7 +1248,9 @@ void CG3400_application::aggiorna_tabreg(int partito_da, int stampate)
|
||||
bool CG3400_application::leggi_tabreg(const char * reg_cod,
|
||||
const char * reg_anno)
|
||||
{
|
||||
TString codtab = format ("%4s%-3s", reg_anno, reg_cod);
|
||||
TString16 codtab;
|
||||
|
||||
codtab.format ("%4s%-3s", reg_anno, reg_cod);
|
||||
|
||||
_tabreg->zero();
|
||||
_tabreg->put("CODTAB", codtab);
|
||||
@ -1268,24 +1271,60 @@ bool CG3400_application::leggi_tabreg(const char * reg_cod,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Calcola l'anno di esercizio di una data
|
||||
// Certified 99%
|
||||
HIDDEN int date2esc(const TDate& d, int* prevesc)
|
||||
{
|
||||
if (prevesc) *prevesc = 0;
|
||||
TTable esc("ESC");
|
||||
for (int err = esc.first(); err == NOERR; err = esc.next())
|
||||
{
|
||||
const TDate ia(esc.get("D0")); // Data inizio esercizio
|
||||
const TDate fa(esc.get("D1")); // Data fine esercizio
|
||||
app()->_inizioEs = ia;
|
||||
app()->_fineEs = fa;
|
||||
const anno = esc.get_int("CODTAB");
|
||||
if (d >= ia && d <= fa)
|
||||
return anno;
|
||||
if (prevesc) *prevesc = anno;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
//
|
||||
// MASCHERE
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
bool mask_a_data (TMask_field& f, KEY k)
|
||||
bool CG3400_application::mask_a_data (TMask_field& f, KEY k)
|
||||
{
|
||||
CG3400_application * app = (CG3400_application*) MainApp();
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
TDate da(f.mask().get(DATA_DA));
|
||||
TDate a(f.mask().get(DATA_A));
|
||||
int anno = atoi(f.mask().field(ANNO_ESER).get());
|
||||
if ( (f.dlg() == DATA_DA) && (anno == 0 ) )
|
||||
f.mask().field(ANNO_ESER).set (format ("%4d",da.year()));
|
||||
if (!app->IsInEsercizio(da,a,anno))
|
||||
return FALSE;
|
||||
TMask& m = f.mask();
|
||||
const TDate data_a(f.get());
|
||||
const TString16 codreg(m.get(CODREG));
|
||||
const int ae = date2esc(data_a); // Anno esercizio
|
||||
if (ae == 0)
|
||||
return f.error_box("La data specificata non appartiene a nessun esercizio");
|
||||
|
||||
TRegistro reg(codreg, ae);
|
||||
if (!reg.ok())
|
||||
return f.warning_box("Non trovo il registro %s per l'esercizio %d",
|
||||
(const char *) codreg, ae);
|
||||
if (reg.tipo() != 5)
|
||||
return f.warning_box("Il registro %s non e' di tipo libro giornale",
|
||||
(const char *) codreg);
|
||||
|
||||
if (!app()->_stampa_definitiva)
|
||||
{
|
||||
const TDate data_da(m.get(DATA_DA));
|
||||
const TString16 ie(app()->_inizioEs.string());
|
||||
const TString16 fe(app()->_fineEs.string());
|
||||
if (data_da < app()->_inizioEs || data_a > app()->_fineEs);
|
||||
return f.warning_box("Le date devono essere comprese tra %s e %s",
|
||||
(const char*)ie, (const char*)fe);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -1300,7 +1339,7 @@ bool mask_a_data (TMask_field& f, KEY k)
|
||||
// Se no, riempie il campo PAGINA_DA con il valore precedente.
|
||||
// Se si', mette semplicemente l'ultimo numero di pagina precedente + 1
|
||||
//
|
||||
bool mask_a_cod_reg (TMask_field& f, KEY k)
|
||||
bool CG3400_application::mask_a_cod_reg (TMask_field& f, KEY k)
|
||||
{
|
||||
TString reg_cod(""),reg_anno("");
|
||||
|
||||
@ -1308,7 +1347,7 @@ bool mask_a_cod_reg (TMask_field& f, KEY k)
|
||||
{
|
||||
CG3400_application * a = (CG3400_application*) MainApp();
|
||||
|
||||
reg_cod = f.mask().field(REG_COD).get();
|
||||
reg_cod = f.mask().field(CODREG).get();
|
||||
reg_anno = f.mask().field(ANNO_ESER).get();
|
||||
|
||||
a->leggi_tabreg(reg_cod, reg_anno);
|
||||
@ -1333,7 +1372,7 @@ bool mask_a_cod_reg (TMask_field& f, KEY k)
|
||||
// Se premo il bottone <Ripristina> rimetto i valori precedenti
|
||||
// dentro ai campi (per ripetere la stampa)
|
||||
//
|
||||
bool mask_b_ripristina (TMask_field& f, KEY k)
|
||||
bool CG3400_application::mask_b_ripristina (TMask_field& f, KEY k)
|
||||
{
|
||||
CG3400_application * a = (CG3400_application*) MainApp();
|
||||
|
||||
@ -1352,8 +1391,8 @@ bool CG3400_application::set_print(int)
|
||||
TMask mb ("cg3400b");
|
||||
KEY tasto;
|
||||
|
||||
ma.set_handler (REG_COD, mask_a_cod_reg);
|
||||
ma.set_handler (DATA_DA, mask_a_data);
|
||||
ma.set_handler (CODREG, mask_a_cod_reg);
|
||||
// ma.set_handler (DATA_DA, mask_a_data);
|
||||
ma.set_handler (DATA_A, mask_a_data);
|
||||
mb.set_handler (DLG_RIPRISTINA, mask_b_ripristina);
|
||||
|
||||
@ -1364,7 +1403,7 @@ bool CG3400_application::set_print(int)
|
||||
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_reg_cod = ma.get(REG_COD);
|
||||
_reg_cod = ma.get(CODREG);
|
||||
_reg_anno = ma.get(ANNO_ESER);
|
||||
_stampa_definitiva = (bool) (ma.get(STAMPA_DEF) == "X");
|
||||
_data_da = ma.get(DATA_DA);
|
||||
|
@ -1,6 +1,6 @@
|
||||
// cg3400a.h
|
||||
|
||||
#define REG_COD 100
|
||||
#define CODREG 100
|
||||
#define DATA_DA 101
|
||||
#define DATA_A 102
|
||||
#define STAMPA_DEF 103
|
||||
|
218
cg/cg3400a.uml
218
cg/cg3400a.uml
@ -1,112 +1,112 @@
|
||||
#include "cg3400a.h"
|
||||
|
||||
PAGE "" -1 -1 70 15
|
||||
|
||||
STRING REG_COD 3
|
||||
BEGIN
|
||||
PROMPT 1 1 "Codice registro "
|
||||
FLAGS "U"
|
||||
USE REG SELECT (I0 = 5) || (I0 = 4)
|
||||
INPUT CODTAB[1,4] ANNO_ESER SELECT
|
||||
INPUT CODTAB[5,7] REG_COD
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Codice" CODTAB[5,7]
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Tipo" I0
|
||||
OUTPUT ANNO_ESER CODTAB[1,4]
|
||||
OUTPUT REG_COD CODTAB[5,7]
|
||||
OUTPUT REG_DESC S0
|
||||
OUTPUT PAGINA_DA I1
|
||||
#include "cg3400a.h"
|
||||
|
||||
PAGE "" -1 -1 70 15
|
||||
|
||||
STRING REG_COD 3
|
||||
BEGIN
|
||||
PROMPT 1 1 "Codice registro "
|
||||
FLAGS "U"
|
||||
USE REG SELECT (I0 = 5) || (I0 = 4)
|
||||
INPUT CODTAB[1,4] ANNO_ESER
|
||||
INPUT CODTAB[5,7] REG_COD
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Codice" CODTAB[5,7]
|
||||
DISPLAY "Descrizione@50" S0
|
||||
DISPLAY "Tipo" I0
|
||||
OUTPUT ANNO_ESER CODTAB[1,4]
|
||||
OUTPUT REG_COD CODTAB[5,7]
|
||||
OUTPUT REG_DESC S0
|
||||
OUTPUT PAGINA_DA I1
|
||||
// OUTPUT DATA_DA D0
|
||||
OUTPUT DATA_A D1
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER ANNO_ESER 4
|
||||
BEGIN
|
||||
PROMPT 30 1 "Esercizio "
|
||||
USE ESC
|
||||
INPUT CODTAB ANNO_ESER
|
||||
DISPLAY "Anno" CODTAB
|
||||
DISPLAY "Data inizio " D0
|
||||
DISPLAY "Data fine " D1
|
||||
DISPLAY "Data scarico" D2
|
||||
OUTPUT ANNO_ESER CODTAB
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "A"
|
||||
END
|
||||
|
||||
STRING REG_DESC 50
|
||||
BEGIN
|
||||
PROMPT 1 3 "Descrizione: "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 25 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Intervallo"
|
||||
END
|
||||
|
||||
RADIOBUTTON DLG_NULL 20
|
||||
BEGIN
|
||||
PROMPT 1 5 ""
|
||||
ITEM "1|Tutto" MESSAGE DISABLE, PAGINA_DA
|
||||
ITEM "2|Da pagina" MESSAGE ENABLE, PAGINA_DA
|
||||
END
|
||||
|
||||
NUMBER PAGINA_DA 5
|
||||
BEGIN
|
||||
PROMPT 13 8 ""
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 33 5
|
||||
BEGIN
|
||||
PROMPT 33 5 "Formato pagina"
|
||||
END
|
||||
|
||||
LISTBOX STAMPA_WIDTH 3
|
||||
BEGIN
|
||||
PROMPT 35 6 "Numero di colonne "
|
||||
ITEM "1|132 colonne"
|
||||
ITEM "2|198 colonne"
|
||||
END
|
||||
|
||||
NUMBER STAMPA_LEN 3
|
||||
BEGIN
|
||||
PROMPT 35 7 "Numero di righe "
|
||||
END
|
||||
|
||||
DATE DATA_DA
|
||||
BEGIN
|
||||
PROMPT 2 10 "Dalla data "
|
||||
END
|
||||
|
||||
DATE DATA_A
|
||||
BEGIN
|
||||
PROMPT 2 11 "Alla data "
|
||||
OUTPUT DATA_A D1
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER ANNO_ESER 4
|
||||
BEGIN
|
||||
PROMPT 30 1 "Esercizio "
|
||||
USE ESC
|
||||
INPUT CODTAB ANNO_ESER
|
||||
DISPLAY "Anno" CODTAB
|
||||
DISPLAY "Data inizio " D0
|
||||
DISPLAY "Data fine " D1
|
||||
DISPLAY "Data scarico" D2
|
||||
OUTPUT ANNO_ESER CODTAB
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING REG_DESC 50
|
||||
BEGIN
|
||||
PROMPT 1 3 "Descrizione: "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 25 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Intervallo"
|
||||
END
|
||||
|
||||
RADIOBUTTON DLG_NULL 20
|
||||
BEGIN
|
||||
PROMPT 1 5 ""
|
||||
ITEM "1|Tutto" MESSAGE DISABLE, PAGINA_DA
|
||||
ITEM "2|Da pagina" MESSAGE ENABLE, PAGINA_DA
|
||||
END
|
||||
|
||||
NUMBER PAGINA_DA 5
|
||||
BEGIN
|
||||
PROMPT 13 8 ""
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 33 5
|
||||
BEGIN
|
||||
PROMPT 33 5 "Formato pagina"
|
||||
END
|
||||
|
||||
LISTBOX STAMPA_WIDTH 3
|
||||
BEGIN
|
||||
PROMPT 35 6 "Numero di colonne "
|
||||
ITEM "1|132 colonne"
|
||||
ITEM "2|198 colonne"
|
||||
END
|
||||
|
||||
NUMBER STAMPA_LEN 3
|
||||
BEGIN
|
||||
PROMPT 35 7 "Numero di righe "
|
||||
END
|
||||
|
||||
DATE DATA_DA
|
||||
BEGIN
|
||||
PROMPT 2 10 "Dalla data "
|
||||
END
|
||||
|
||||
DATE DATA_A
|
||||
BEGIN
|
||||
PROMPT 2 11 "Alla data "
|
||||
VALIDATE DATE_CMP_FUNC >= DATA_DA
|
||||
WARNING "Questa data deve essere posteriore alla precedente"
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
BOOLEAN STAMPA_DEF
|
||||
BEGIN
|
||||
PROMPT 34 10 "Stampa definitiva"
|
||||
MESSAGE TRUE DISABLE,DATA_DA
|
||||
MESSAGE FALSE ENABLE,DATA_DA
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
BOOLEAN STAMPA_DEF
|
||||
BEGIN
|
||||
PROMPT 34 10 "Stampa definitiva"
|
||||
MESSAGE TRUE DISABLE,DATA_DA
|
||||
MESSAGE FALSE ENABLE,DATA_DA
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
|
@ -9,25 +9,25 @@
|
||||
|
||||
bool TRigaiva_array::add_riga(const real& imponibile, const real& imposta, const char* codiva, const int tipodet, const real& imponibilep, const real& impostap)
|
||||
{
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
TRigaiva& r = (TRigaiva&)(*this)[i];
|
||||
if ((r._codiva==codiva) && (tipodet==r._tipodet))
|
||||
bool found = FALSE;
|
||||
for (int i = 0; i < items(); i++)
|
||||
{
|
||||
TRigaiva& r = (TRigaiva&)(*this)[i];
|
||||
if ((r._codiva==codiva) && (tipodet==r._tipodet))
|
||||
{
|
||||
found = TRUE;
|
||||
r._imponibile += imponibile;
|
||||
r._imposta += imposta;
|
||||
r._imponibilep += imponibilep;
|
||||
r._impostap += impostap;
|
||||
found = TRUE;
|
||||
r._imponibile += imponibile;
|
||||
r._imposta += imposta;
|
||||
r._imponibilep += imponibilep;
|
||||
r._impostap += impostap;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
TRigaiva* r = new TRigaiva(imponibile,imposta,codiva,tipodet, imponibilep, impostap);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
{
|
||||
TRigaiva* r = new TRigaiva(imponibile,imposta,codiva,tipodet, imponibilep, impostap);
|
||||
add(r);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
bool TDociva_array::add_riga(const char* _descrdociva, const real& _importo,const int _natdoc)
|
||||
@ -45,11 +45,11 @@ bool TDociva_array::add_riga(const char* _descrdociva, const real& _importo,cons
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
if ((_natdoc == 1)||(_natdoc == 2)||(_natdoc == 3)||(_natdoc == 4))
|
||||
{
|
||||
TDociva* r = new TDociva(_descrdociva,_importo,_natdoc);
|
||||
add(r);
|
||||
}
|
||||
if ((_natdoc == 1)||(_natdoc == 2)||(_natdoc == 3)||(_natdoc == 4))
|
||||
{
|
||||
TDociva* r = new TDociva(_descrdociva,_importo,_natdoc);
|
||||
add(r);
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
20
cg/cg3401.h
20
cg/cg3401.h
@ -22,24 +22,24 @@ struct TDociva : public TObject
|
||||
class TDociva_array : public TArray
|
||||
{
|
||||
public:
|
||||
bool add_riga(const char* _descrdociva,const real& _importo,const int _natdoc);
|
||||
bool add_riga(const char* _descrdociva,const real& _importo,const int _natdoc);
|
||||
};
|
||||
|
||||
struct TRigaiva : public TObject
|
||||
{
|
||||
real _imponibile, _imposta, _imponibilep, _impostap;
|
||||
TString _codiva;
|
||||
int _tipodet;
|
||||
|
||||
TRigaiva (const real& imponibile, const real& imposta, const char* codiva, int tipodet, const real& imponibilep, const real& impostap):
|
||||
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_tipodet(tipodet),_imponibilep(imponibilep),_impostap(impostap)
|
||||
{}
|
||||
real _imponibile, _imposta, _imponibilep, _impostap;
|
||||
TString _codiva;
|
||||
int _tipodet;
|
||||
|
||||
TRigaiva (const real& imponibile, const real& imposta, const char* codiva, int tipodet, const real& imponibilep, const real& impostap):
|
||||
_imponibile(imponibile),_imposta(imposta),_codiva(codiva),_tipodet(tipodet),_imponibilep(imponibilep),_impostap(impostap)
|
||||
{}
|
||||
};
|
||||
|
||||
class TRigaiva_array : public TArray
|
||||
{
|
||||
public:
|
||||
bool add_riga(const real& imponibile, const real& imposta, const char* codiva, const int tipodet, const real& imponibilep, const real& impostap);
|
||||
public:
|
||||
bool add_riga(const real& imponibile, const real& imposta, const char* codiva, const int tipodet, const real& imponibilep, const real& impostap);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -46,7 +46,7 @@ class CG4600_application : public TApplication
|
||||
real _saldo, _totale_saldo;
|
||||
int _annoesch, _annoesap;
|
||||
long _numreg;
|
||||
TDate _dataregap, _dataregch;
|
||||
TDate _dataregap, _dataregch, _data_inizioap, _data_finech;
|
||||
TString _codcausap, _codcausch;
|
||||
|
||||
public:
|
||||
@ -59,7 +59,7 @@ public:
|
||||
void passivita();
|
||||
void rmov_proper (int, long, TDate&, TRectype&, TConto&, real&, bool);
|
||||
void ultima_registrazione();
|
||||
void compila_testata(int,TDate&,TString&);
|
||||
void compila_testata(int,TDate&,TDate&,TString&);
|
||||
void chiusura_conto_economico();
|
||||
void chiusura_conto_patrimoniale();
|
||||
bool set();
|
||||
@ -315,10 +315,12 @@ bool CG4600_application::set()
|
||||
|
||||
TabEs.last();
|
||||
int annoap = TabEs.get_int ("CODTAB");
|
||||
TDate inizio = TabEs.get_date("D0"); //data inizio es. in corso
|
||||
TDate inizio = TabEs.get_date("D0"); //data inizio es. in corso
|
||||
_data_inizioap = inizio;
|
||||
TabEs.prev();
|
||||
int annoch = TabEs.get_int ("CODTAB");
|
||||
TDate fine = TabEs.get_date("D1"); //data fine es. precedente
|
||||
TDate fine = TabEs.get_date("D1"); //data fine es. precedente
|
||||
_data_finech = fine;
|
||||
m.set(F_ANNO, annoap);
|
||||
m.set(F_ANNOCH, annoch);
|
||||
m.set(F_DATAC, fine.string());
|
||||
@ -433,16 +435,17 @@ bool CG4600_application::set()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CG4600_application::compila_testata(int annoes,TDate& datareg, TString& codcaus)
|
||||
void CG4600_application::compila_testata(int annoes,TDate& datareg,TDate& datacomp,TString& codcaus)
|
||||
{
|
||||
_pn->lfile()->zero();
|
||||
_pn->lfile()->put(MOV_ANNOES, annoes); //Viene generato un mov
|
||||
_pn->lfile()->put(MOV_DATAREG, datareg); //quando si incontra il
|
||||
_pn->lfile()->put(MOV_CODCAUS, codcaus); //primo conto con indbil
|
||||
_pn->lfile()->put(MOV_NUMREG, _numreg);
|
||||
_pn->lfile()->put(MOV_ANNOES, annoes); //Viene generato un mov
|
||||
_pn->lfile()->put(MOV_DATAREG, datareg); //quando si incontra il
|
||||
_pn->lfile()->put(MOV_CODCAUS, codcaus); //primo conto con indbil
|
||||
_pn->lfile()->put(MOV_NUMREG, _numreg);
|
||||
_pn->lfile()->put(MOV_DATACOMP, datacomp);
|
||||
}
|
||||
|
||||
void CG4600_application::rmov_proper(int anno,long numrig,TDate& datareg,TRectype& rmov, TConto& tc,real& tot_saldo, bool sezione_opposta)
|
||||
void CG4600_application::rmov_proper(int anno,long numrig,TDate& datareg,TRectype& rmov,TConto& tc,real& tot_saldo, bool sezione_opposta)
|
||||
{
|
||||
char sez_rmov = ' ';
|
||||
char sezione = ' ';
|
||||
@ -509,7 +512,7 @@ void CG4600_application::costi()
|
||||
{
|
||||
if (compila_mov)
|
||||
{
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 1
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 1
|
||||
compila_mov = FALSE;
|
||||
}
|
||||
_saldi->setkey(1);
|
||||
@ -639,7 +642,7 @@ void CG4600_application::ricavi()
|
||||
{
|
||||
if (compila_mov)
|
||||
{
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 2
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 2
|
||||
compila_mov = FALSE;
|
||||
}
|
||||
_saldi->setkey(1);
|
||||
@ -757,7 +760,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 3
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 3
|
||||
|
||||
TRectype& rmov1 = _pn->cg(j);
|
||||
long numrig = 1;
|
||||
@ -778,7 +781,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 4
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 4
|
||||
|
||||
TRectype& rmov3 = _pn->cg(j);
|
||||
numrig = 1;
|
||||
@ -800,7 +803,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
|
||||
compila_testata(_annoesap,_dataregap,_codcausap); //Reg. 10
|
||||
compila_testata(_annoesap,_dataregap,_data_inizioap,_codcausap); //Reg. 10
|
||||
|
||||
TRectype& rmov5 = _pn->cg(j);
|
||||
numrig = 1;
|
||||
@ -825,7 +828,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
_pn->destroy_rows(); //Azzero l'oggetto pn.
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 3
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 3
|
||||
|
||||
TRectype& rmov1 = _pn->cg(j);
|
||||
long numrig = 1;
|
||||
@ -845,7 +848,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
_pn->destroy_rows(); //Azzero l'oggetto pn.
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 4
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 4
|
||||
|
||||
TRectype& rmov3 = _pn->cg(j);
|
||||
numrig = 1;
|
||||
@ -867,7 +870,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
|
||||
compila_testata(_annoesap,_dataregap,_codcausap); //Reg. 10
|
||||
compila_testata(_annoesap,_dataregap,_data_inizioap,_codcausap); //Reg. 10
|
||||
|
||||
TRectype& rmov5 = _pn->cg(j);
|
||||
numrig = 1;
|
||||
@ -898,7 +901,7 @@ void CG4600_application::chiusura_conto_patrimoniale()
|
||||
_pn->destroy_rows(); //Azzero l'oggetto pn.
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 7
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 7
|
||||
|
||||
TRectype& rmov1 = _pn->cg(j);
|
||||
numrig = 1;
|
||||
@ -921,7 +924,7 @@ void CG4600_application::chiusura_conto_patrimoniale()
|
||||
_pn->destroy_rows(); //Azzero l'oggetto pn.
|
||||
j = 0;
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 7
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 7
|
||||
|
||||
TRectype& rmov1 = _pn->cg(j);
|
||||
numrig = 1;
|
||||
@ -962,7 +965,7 @@ void CG4600_application::attivita()
|
||||
{
|
||||
if (compila_mov_ch)
|
||||
{
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 5 Chiusura
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 5 Chiusura
|
||||
compila_mov_ch = FALSE;
|
||||
}
|
||||
_saldi->setkey(1);
|
||||
@ -1070,7 +1073,7 @@ void CG4600_application::attivita()
|
||||
if (compila_mov_ap)
|
||||
{
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesap,_dataregap,_codcausap); //Reg. 8 Apertura
|
||||
compila_testata(_annoesap,_dataregap,_data_inizioap,_codcausap); //Reg. 8 Apertura
|
||||
compila_mov_ap = FALSE;
|
||||
}
|
||||
|
||||
@ -1147,7 +1150,7 @@ void CG4600_application::passivita()
|
||||
{
|
||||
if (compila_mov_ch)
|
||||
{
|
||||
compila_testata(_annoesch,_dataregch,_codcausch); //Reg. 6 Chiusura
|
||||
compila_testata(_annoesch,_dataregch,_data_finech,_codcausch); //Reg. 6 Chiusura
|
||||
compila_mov_ch = FALSE;
|
||||
}
|
||||
_saldi->setkey(1);
|
||||
@ -1255,7 +1258,7 @@ void CG4600_application::passivita()
|
||||
if (compila_mov_ap)
|
||||
{
|
||||
ultima_registrazione();
|
||||
compila_testata(_annoesap,_dataregap,_codcausap); //Reg. 9 Apertura
|
||||
compila_testata(_annoesap,_dataregap,_data_inizioap,_codcausap); //Reg. 9 Apertura
|
||||
compila_mov_ap = FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user