Eliminati conto.h conto.cpp cgglib.h
Aggiunti cglib01.h git-svn-id: svn://10.65.10.50/trunk@4719 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
72d5e5fb6f
commit
ceb81b6181
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
// Definizione dei metodi relativi alla classe TClifoVI
|
// Definizione dei metodi relativi alla classe TClifoVI
|
||||||
|
|
||||||
TClifoVI::TClifoVI():TRelation(LF_CLIFO), _oldindirizzi(0), _gesven(FALSE)
|
TClifoVI::TClifoVI() : TRelation(LF_CLIFO), _oldindirizzi(0), _gesven(FALSE)
|
||||||
{
|
{
|
||||||
add(LF_CFVEN,"TIPOCF=TIPOCF|CODCF=CODCF");
|
add(LF_CFVEN,"TIPOCF=TIPOCF|CODCF=CODCF");
|
||||||
add(LF_INDSP,"TIPOCF=TIPOCF|CODCF=CODCF");
|
add(LF_INDSP,"TIPOCF=TIPOCF|CODCF=CODCF");
|
||||||
@ -44,9 +44,9 @@ int TClifoVI::read_indirizzi()
|
|||||||
return NOERR;
|
return NOERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::read(TIsamop op, TReclock lockop, TDate& atdate)
|
int TClifoVI::read(TIsamop op, TReclock lockop)
|
||||||
{
|
{
|
||||||
int err = file().read(op,lockop,atdate);
|
int err = file().read(op,lockop);
|
||||||
position_rels();
|
position_rels();
|
||||||
|
|
||||||
if (err == NOERR)
|
if (err == NOERR)
|
||||||
@ -116,18 +116,18 @@ int TClifoVI::registra(bool re, bool force)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::write(bool force, TDate&)
|
int TClifoVI::write(bool force)
|
||||||
{
|
{
|
||||||
_oldindirizzi=0;
|
_oldindirizzi=0;
|
||||||
return registra(FALSE,force);
|
return registra(FALSE,force);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::rewrite(bool force, TDate&)
|
int TClifoVI::rewrite(bool force)
|
||||||
{
|
{
|
||||||
return registra(TRUE,force);
|
return registra(TRUE,force);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TClifoVI::remove(TDate&)
|
int TClifoVI::remove()
|
||||||
{
|
{
|
||||||
TLocalisamfile& c=lfile(LF_CLIFO);
|
TLocalisamfile& c=lfile(LF_CLIFO);
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ public:
|
|||||||
virtual int first(TReclock lockop=_nolock) {return (lfile().first(lockop) || read_indirizzi());}
|
virtual int first(TReclock lockop=_nolock) {return (lfile().first(lockop) || read_indirizzi());}
|
||||||
virtual int last(TReclock lockop=_nolock) {return (lfile().last(lockop) || read_indirizzi());}
|
virtual int last(TReclock lockop=_nolock) {return (lfile().last(lockop) || read_indirizzi());}
|
||||||
virtual int skip(TReclock lockop=_nolock) {return (lfile().skip(lockop) || read_indirizzi());}
|
virtual int skip(TReclock lockop=_nolock) {return (lfile().skip(lockop) || read_indirizzi());}
|
||||||
virtual int read(TIsamop = _isgteq, TReclock lockop = _nolock, TDate& atdate = (TDate&) botime);
|
virtual int read(TIsamop = _isgteq, TReclock lockop = _nolock);
|
||||||
virtual int write(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
virtual int write(bool force=TRUE);
|
||||||
virtual int rewrite(bool force=TRUE, TDate& atdate = (TDate&) botime);
|
virtual int rewrite(bool force=TRUE);
|
||||||
virtual int remove(TDate& atdate = (TDate&) botime);
|
virtual int remove();
|
||||||
|
|
||||||
TRectype& indirizzo(int i);
|
TRectype& indirizzo(int i);
|
||||||
int indirizzi_items() const {return _indirizzi.items();}
|
int indirizzi_items() const {return _indirizzi.items();}
|
||||||
|
@ -12,14 +12,13 @@
|
|||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
#include "cg2103.h"
|
|
||||||
#include "cg0500.h"
|
#include "cg0500.h"
|
||||||
|
|
||||||
typedef enum { no_descr, acquisto, vendita, incasso_pagamento,
|
typedef enum { no_descr, acquisto, vendita, incasso_pagamento,
|
||||||
ritenuta_occas } tipo_descr;
|
ritenuta_occas } tipo_descr;
|
||||||
|
|
||||||
class TCaus_app : public TRelation_application
|
class TCaus_app : public TRelation_application
|
||||||
{
|
{
|
||||||
TRelation* _rel; // Relazione principale
|
TRelation* _rel; // Relazione principale
|
||||||
TLocalisamfile * _rcaus;
|
TLocalisamfile * _rcaus;
|
||||||
@ -95,7 +94,7 @@ public:
|
|||||||
TSheet_field& ss() const { return *_sheet; }
|
TSheet_field& ss() const { return *_sheet; }
|
||||||
TMask& ss_mask() const { return _sheet->sheet_mask(); }
|
TMask& ss_mask() const { return _sheet->sheet_mask(); }
|
||||||
|
|
||||||
void add_riga (int numrig, char sz, TConto& tc, const TString& d, const TString& da);
|
void add_riga (int numrig, char sz, TBill& tc, const TString& d, const TString& da);
|
||||||
bool mostra_campi();
|
bool mostra_campi();
|
||||||
|
|
||||||
bool valuta() const { return _valuta; }
|
bool valuta() const { return _valuta; }
|
||||||
@ -662,7 +661,7 @@ int TCaus_app::read(TMask& m)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCaus_app::add_riga(int numrig, char sz, TConto& tc, const TString& d, const TString& da)
|
void TCaus_app::add_riga(int numrig, char sz, TBill& tc, const TString& d, const TString& da)
|
||||||
{
|
{
|
||||||
TToken_string& riga = ss().row(numrig);
|
TToken_string& riga = ss().row(numrig);
|
||||||
riga = riga.get(0); // Lascia invariata la descrizione ...
|
riga = riga.get(0); // Lascia invariata la descrizione ...
|
||||||
@ -698,7 +697,7 @@ void TCaus_app::load_rcaus(TMask& m)
|
|||||||
da = dpn.get("S0");
|
da = dpn.get("S0");
|
||||||
}
|
}
|
||||||
|
|
||||||
TConto tc(g,c,s,cf);
|
TBill tc(g,c,s,cf);
|
||||||
add_riga(i-1, sz, tc, d, da);
|
add_riga(i-1, sz, tc, d, da);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include "../ba/batbesc.h"
|
#include "../ba/batbesc.h"
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
|
|
||||||
class CGTab_application : public Tab_application
|
class CGTab_application : public Tab_application
|
||||||
{
|
{
|
||||||
|
@ -722,7 +722,7 @@ void TPrintclifo_app::set_vendite(int f, int c)
|
|||||||
set_header(3, (const char *)(TString(132).fill('-')));
|
set_header(3, (const char *)(TString(132).fill('-')));
|
||||||
set_header(4," Codice Ragione sociale");
|
set_header(4," Codice Ragione sociale");
|
||||||
set_header(5,"@9gNote Cli/For @25gLegale per contenz. @46gCat.Finanziaria @63gCat.Vendita @76gAss.Fiscale @93gZona @101gAgente @112gProvvigione");
|
set_header(5,"@9gNote Cli/For @25gLegale per contenz. @46gCat.Finanziaria @63gCat.Vendita @76gAss.Fiscale @93gZona @101gAgente @112gProvvigione");
|
||||||
set_header(6,"@9gCod.Listino @25gCod. Magazzino @46gSpese da Addeb. @63gBolli Tr. @76gBolli R.B. @93gSpese incasso @112gBolli sup. 50.000");
|
set_header(6,"@9gCod.Listino @25gCod. Magazzino @46gSpese da Addeb. @63gBolli @76gSpese incasso @93gBolli sup. 50.000");
|
||||||
set_header(7,"@9gCli/For ass. @25gCod. Meccanografico @46gGest. Contratto @63gRid. Iva @76gUltimo sollecito @93gUltimo estr. conto @112gTitolo onorifico");
|
set_header(7,"@9gCli/For ass. @25gCod. Meccanografico @46gGest. Contratto @63gRid. Iva @76gUltimo sollecito @93gUltimo estr. conto @112gTitolo onorifico");
|
||||||
set_header(8,"@9gSconto cliente @25gSconto di riga @46gSconto incond. @63gFatt. Sosp. @76gVs. Lettera Esenzione @112gNs. Lettera Esenz.");
|
set_header(8,"@9gSconto cliente @25gSconto di riga @46gSconto incond. @63gFatt. Sosp. @76gVs. Lettera Esenzione @112gNs. Lettera Esenz.");
|
||||||
set_header(9,"@9gCod. ABI p.e. @25gCod. CAB p.e. @46gInd. Effetti @63gEmiss. Eff. @76gImporto Minimo @93gEffetti non acc. @112gScadenza effetti");
|
set_header(9,"@9gCod. ABI p.e. @25gCod. CAB p.e. @46gInd. Effetti @63gEmiss. Eff. @76gImporto Minimo @93gEffetti non acc. @112gScadenza effetti");
|
||||||
@ -737,14 +737,14 @@ void TPrintclifo_app::set_vendite(int f, int c)
|
|||||||
FLD(LF_CFVEN, CFV_CODNOTE),FLD(LF_CFVEN,CFV_CODLEG),
|
FLD(LF_CFVEN, CFV_CODNOTE),FLD(LF_CFVEN,CFV_CODLEG),
|
||||||
FLD(LF_CFVEN,CFV_CATFIN),FLD(LF_CFVEN,CFV_CATVEN),
|
FLD(LF_CFVEN,CFV_CATFIN),FLD(LF_CFVEN,CFV_CATVEN),
|
||||||
FLD(LF_CFVEN,CFV_ASSFIS),FLD(LF_CFVEN,CFV_CODZONA),
|
FLD(LF_CFVEN,CFV_ASSFIS),FLD(LF_CFVEN,CFV_CODZONA),
|
||||||
FLD(LF_CFVEN,CFV_CODAG),FLD(LF_CFVEN,CFV_PROVV));
|
FLD(LF_CFVEN,CFV_CODAG),FLD(LF_CFVEN,CFV_PERCPROVV));
|
||||||
|
|
||||||
set_row(3,"@9g@5s @25g@3s @46g@3s @3s @3s @3s @63g@f @76g@f @93g@f @112g@f",
|
set_row(3,"@9g@5s @25g@3s @46g@3s @3s @3s @3s @63g@f @76g@n @93g@f",
|
||||||
FLD(LF_CFVEN,CFV_CODLIST),FLD(LF_CFVEN,CFV_CODMAG),
|
FLD(LF_CFVEN,CFV_CODLIST),FLD(LF_CFVEN,CFV_CODMAG),
|
||||||
FLD(LF_CFVEN,CFV_CODSP1),FLD(LF_CFVEN,CFV_CODSP2),
|
FLD(LF_CFVEN,CFV_CODSP1),FLD(LF_CFVEN,CFV_CODSP2),
|
||||||
FLD(LF_CFVEN,CFV_CODSP3),FLD(LF_CFVEN,CFV_CODSP4),
|
FLD(LF_CFVEN,CFV_CODSP3),FLD(LF_CFVEN,CFV_CODSP4),
|
||||||
FLD(LF_CFVEN,CFV_ADDBOLLITR),FLD(LF_CFVEN,CFV_ADDBOLLIRB),
|
FLD(LF_CFVEN,CFV_ADDBOLLI),
|
||||||
FLD(LF_CFVEN,CFV_ADDSPINC),FLD(LF_CFVEN,CFV_ADDBNS1500));
|
FLD(LF_CFVEN,CFV_PERCSPINC),FLD(LF_CFVEN,CFV_ADDBNS1500));
|
||||||
|
|
||||||
set_row(4,"@9g@pn @25g@s @46g@f @63g@f @76g@d @93g@d @112g@2s",
|
set_row(4,"@9g@pn @25g@s @46g@f @63g@f @76g@d @93g@d @112g@2s",
|
||||||
FLD(LF_CFVEN,CFV_CODCFASS,"@@@@@@"),
|
FLD(LF_CFVEN,CFV_CODCFASS,"@@@@@@"),
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include "conto.h"
|
|
||||||
#include "cg2103.h"
|
|
||||||
#include "cg1301.h"
|
#include "cg1301.h"
|
||||||
#include "cg1302.h"
|
#include "cg1302.h"
|
||||||
#include "cg1303.h"
|
#include "cg1303.h"
|
||||||
@ -20,6 +19,7 @@
|
|||||||
#include "cg1305.h"
|
#include "cg1305.h"
|
||||||
#include "cg1306.h"
|
#include "cg1306.h"
|
||||||
#include "cg1.h"
|
#include "cg1.h"
|
||||||
|
#include "cglib01.h"
|
||||||
|
|
||||||
class TAgg_attiv : public TApplication
|
class TAgg_attiv : public TApplication
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include "cg2103.h"
|
|
||||||
#include "cg1301.h"
|
#include "cg1301.h"
|
||||||
|
|
||||||
bool TAgg_opintra::create()
|
bool TAgg_opintra::create()
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include "conto.h"
|
|
||||||
#include "cg1302.h"
|
#include "cg1302.h"
|
||||||
|
#include "cglib01.h"
|
||||||
|
|
||||||
const int TAgg_tconto::look_reg (const char* cod, int anno)
|
const int TAgg_tconto::look_reg (const char* cod, int anno)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
//*****************************************************
|
//*****************************************************
|
||||||
//* Aggiornamento codice attivita' su progressivi IVA *
|
//* Aggiornamento codice attivita' su progressivi IVA *
|
||||||
//*****************************************************
|
//*****************************************************
|
||||||
#include <prefix.h>
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
|
||||||
#include "cg1300.h"
|
#include "cg1300.h"
|
||||||
#include "cg1304.h"
|
#include "cg1304.h"
|
||||||
#include "cg2103.h"
|
#include "cglib01.h"
|
||||||
|
|
||||||
HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); }
|
HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); }
|
||||||
|
|
||||||
@ -31,12 +32,6 @@ bool TAgg_codatt::menu(MENU_TAG m)
|
|||||||
TProgind* pri;
|
TProgind* pri;
|
||||||
TMask msk("cg1300c");
|
TMask msk("cg1300c");
|
||||||
|
|
||||||
/*
|
|
||||||
TConfig conf(CONFIG_DITTA);
|
|
||||||
int annoiva = conf.get_int("AnLiIv");
|
|
||||||
|
|
||||||
msk.set(F_ANNO, annoiva);
|
|
||||||
*/
|
|
||||||
while (msk.run() == K_ENTER)
|
while (msk.run() == K_ENTER)
|
||||||
{
|
{
|
||||||
pri = new TProgind(2,"Aggiornamento in corso...",FALSE,TRUE,50);
|
pri = new TProgind(2,"Aggiornamento in corso...",FALSE,TRUE,50);
|
||||||
@ -126,7 +121,7 @@ void TAgg_codatt::cancella_rec()
|
|||||||
|
|
||||||
TTable pla("%PLA");
|
TTable pla("%PLA");
|
||||||
TRecfield r_ditta(pla.curr(),"CODTAB",0,4);
|
TRecfield r_ditta(pla.curr(),"CODTAB",0,4);
|
||||||
const long firm = prefix().get_codditta();
|
const long firm = get_firm();
|
||||||
for (pla.first(); !pla.eof(); pla.next())
|
for (pla.first(); !pla.eof(); pla.next())
|
||||||
{
|
{
|
||||||
if (firm != (long)r_ditta)
|
if (firm != (long)r_ditta)
|
||||||
@ -143,7 +138,7 @@ void TAgg_codatt::cancella_rec()
|
|||||||
void TAgg_codatt::aggiorna_att(const char* nome)
|
void TAgg_codatt::aggiorna_att(const char* nome)
|
||||||
{
|
{
|
||||||
const bool is_pla = nome == "%PLA";
|
const bool is_pla = nome == "%PLA";
|
||||||
const long firm = prefix().get_codditta();
|
const long firm = get_firm();
|
||||||
TTable tab(nome);
|
TTable tab(nome);
|
||||||
tab.setkey(1);
|
tab.setkey(1);
|
||||||
tab.zero();
|
tab.zero();
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
// sistema il codice esercizio di tutti i movimenti
|
// sistema il codice esercizio di tutti i movimenti
|
||||||
|
|
||||||
|
#include <recarray.h>
|
||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include "cglib.h"
|
|
||||||
|
#include "cglib01.h"
|
||||||
#include "cg1300.h"
|
#include "cg1300.h"
|
||||||
#include "cg1305.h"
|
#include "cg1305.h"
|
||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// sistema la data di competenza di tutti i movimenti
|
// sistema la data di competenza di tutti i movimenti
|
||||||
|
|
||||||
#include "cg1306.h"
|
#include "cg1306.h"
|
||||||
#include "cglib.h"
|
|
||||||
#include "cg1300.h"
|
#include "cg1300.h"
|
||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
|
||||||
inline TAgg_datacomp& app() { return (TAgg_datacomp&) main_app(); }
|
inline TAgg_datacomp& app() { return (TAgg_datacomp&) main_app(); }
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
// - leggi_file_tmp();
|
// - leggi_file_tmp();
|
||||||
// - UltimaData();
|
// - UltimaData();
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
@ -39,26 +38,19 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
|
||||||
#include "cglib04.h"
|
|
||||||
#include "cg1.h"
|
#include "cg1.h"
|
||||||
#include "cg1500.h"
|
#include "cg1500.h"
|
||||||
|
#include "cglib01.h"
|
||||||
bool my_handler (TMask_field& f, KEY k);
|
#include "cglib02.h"
|
||||||
bool mask_anno (TMask_field& f, KEY k);
|
|
||||||
bool mask_datalim (TMask_field& f, KEY k);
|
|
||||||
bool mask_date (TMask_field& f, KEY k);
|
|
||||||
bool mask_bilancio (TMask_field& f, KEY k);
|
|
||||||
bool mask_tipost (TMask_field& f, KEY k);
|
|
||||||
|
|
||||||
class CG1500_application : public TPrintapp
|
class CG1500_application : public TPrintapp
|
||||||
{
|
{
|
||||||
friend bool mask_anno (TMask_field& f, KEY k);
|
static bool mask_anno (TMask_field& f, KEY k);
|
||||||
friend bool mask_datalim (TMask_field& f, KEY k);
|
static bool mask_datalim (TMask_field& f, KEY k);
|
||||||
friend bool my_handler (TMask_field& f, KEY k);
|
static bool my_handler (TMask_field& f, KEY k);
|
||||||
friend bool mask_date (TMask_field& f, KEY k);
|
static bool mask_date (TMask_field& f, KEY k);
|
||||||
friend bool mask_bilancio(TMask_field& f, KEY k);
|
static bool mask_bilancio(TMask_field& f, KEY k);
|
||||||
friend bool mask_tipost (TMask_field& f, KEY k);
|
static bool mask_tipost (TMask_field& f, KEY k);
|
||||||
|
|
||||||
struct cli_for
|
struct cli_for
|
||||||
{
|
{
|
||||||
@ -257,7 +249,7 @@ int CG1500_application::date2esc(const TDate& d, int* prevesc)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mask_anno(TMask_field& f, KEY k)
|
bool CG1500_application::mask_anno(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
@ -326,7 +318,7 @@ bool mask_anno(TMask_field& f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mask_bilancio(TMask_field& f, KEY k)
|
bool CG1500_application::mask_bilancio(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
int tipo_bil, tipo_stp;
|
int tipo_bil, tipo_stp;
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
@ -395,7 +387,7 @@ else
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mask_datalim (TMask_field& f, KEY k)
|
bool CG1500_application::mask_datalim (TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
@ -435,7 +427,7 @@ bool mask_datalim (TMask_field& f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mask_date(TMask_field& f, KEY k)
|
bool CG1500_application::mask_date(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_TAB)
|
if (k == K_TAB)
|
||||||
{
|
{
|
||||||
@ -530,7 +522,7 @@ bool mask_date(TMask_field& f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool my_handler (TMask_field& f, KEY k)
|
bool CG1500_application::my_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
@ -1127,7 +1119,11 @@ bool CG1500_application::ricerca_sottoc_clifo(int g,int c, bool compensa, int in
|
|||||||
bool esiste_sc = FALSE;
|
bool esiste_sc = FALSE;
|
||||||
bool movimentato = FALSE;
|
bool movimentato = FALSE;
|
||||||
|
|
||||||
if (_annoes) aep = EsePre(_annoes);
|
if (_annoes)
|
||||||
|
{
|
||||||
|
TEsercizi_contabili ese;
|
||||||
|
aep = ese.pred(_annoes);
|
||||||
|
}
|
||||||
sld.set_annoes(_annoes);
|
sld.set_annoes(_annoes);
|
||||||
_listacf = new TSaldi_list(g, c, _annoes, aep);
|
_listacf = new TSaldi_list(g, c, _annoes, aep);
|
||||||
|
|
||||||
@ -2267,7 +2263,9 @@ void CG1500_application::leggi_clifo(const TArray& gccf)
|
|||||||
ragsoc = cognome;
|
ragsoc = cognome;
|
||||||
ragsoc << " " << nome;
|
ragsoc << " " << nome;
|
||||||
}
|
}
|
||||||
int aprec = EsePre(anno);
|
|
||||||
|
TEsercizi_contabili ese;
|
||||||
|
int aprec = ese.pred(anno);
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
saldi.put(SLD_ANNOES, anno); // W96SALDI del 05-06-96
|
saldi.put(SLD_ANNOES, anno); // W96SALDI del 05-06-96
|
||||||
saldi.put(SLD_FLSCA, FALSE);
|
saldi.put(SLD_FLSCA, FALSE);
|
||||||
@ -3830,14 +3828,6 @@ bool CG1500_application::set_print(int)
|
|||||||
{
|
{
|
||||||
TMask m ("cg1500a");
|
TMask m ("cg1500a");
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
/*
|
|
||||||
{
|
|
||||||
TConfig conf(CONFIG_DITTA);
|
|
||||||
|
|
||||||
_causale_ap = conf.get("CoCaAp");
|
|
||||||
_causale_chi = conf.get("CoCaCh");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
m.set_handler (F_VERIFICA, my_handler);
|
m.set_handler (F_VERIFICA, my_handler);
|
||||||
m.set_handler (F_BILANCIO, mask_bilancio);
|
m.set_handler (F_BILANCIO, mask_bilancio);
|
||||||
m.set_handler (F_STAMPA1, mask_bilancio);
|
m.set_handler (F_STAMPA1, mask_bilancio);
|
||||||
|
684
cg/cg1600.cpp
684
cg/cg1600.cpp
@ -1,12 +1,12 @@
|
|||||||
#include <assoc.h>
|
|
||||||
#include <config.h>
|
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
|
#include <recarray.h>
|
||||||
#include <sort.h>
|
#include <sort.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
|
#include <causali.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <unloc.h>
|
#include <unloc.h>
|
||||||
@ -17,113 +17,15 @@
|
|||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
|
||||||
#include "cglib04.h"
|
|
||||||
#include "cg1.h"
|
#include "cg1.h"
|
||||||
#include "cg1600.h"
|
#include "cg1600.h"
|
||||||
|
#include "cglib01.h"
|
||||||
bool our_handler (TMask_field & f,KEY k);
|
#include "cglib02.h"
|
||||||
|
|
||||||
class Anno_es : public TObject
|
|
||||||
{
|
|
||||||
TDate _inizio, _fine;
|
|
||||||
TToken_string *_str;
|
|
||||||
public:
|
|
||||||
long anno();
|
|
||||||
TDate inizio();
|
|
||||||
TDate fine() ;
|
|
||||||
Anno_es(long anno, TDate& inizio, TDate& fine);
|
|
||||||
~Anno_es() { delete _str; }
|
|
||||||
};
|
|
||||||
|
|
||||||
TDate Anno_es::inizio()
|
|
||||||
{
|
|
||||||
_inizio = _str->get(1);
|
|
||||||
return _inizio;
|
|
||||||
}
|
|
||||||
|
|
||||||
TDate Anno_es::fine()
|
|
||||||
{
|
|
||||||
_fine = _str->get(2);
|
|
||||||
return _fine;
|
|
||||||
}
|
|
||||||
|
|
||||||
long Anno_es::anno()
|
|
||||||
{
|
|
||||||
return _str->get_int(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Anno_es::Anno_es(long anno, TDate& inizio, TDate& fine)
|
|
||||||
{
|
|
||||||
_str = new TToken_string(35);
|
|
||||||
_inizio = inizio;
|
|
||||||
_fine = fine;
|
|
||||||
_str->add(anno); _str->add(_inizio.string()); _str->add(_fine.string());
|
|
||||||
}
|
|
||||||
|
|
||||||
class Anni_es : public TAssoc_array
|
|
||||||
{
|
|
||||||
TTable * _tabesc;
|
|
||||||
public:
|
|
||||||
void add(long anno, TDate& inizio, TDate& fine);
|
|
||||||
void aggiungi_anno(long anno, TDate& inizio, TDate& fine);
|
|
||||||
Anno_es * trova(long anno, TDate& inizio, TDate& fine);
|
|
||||||
Anni_es();
|
|
||||||
~Anni_es() { delete _tabesc; }
|
|
||||||
};
|
|
||||||
|
|
||||||
Anni_es::Anni_es()
|
|
||||||
{
|
|
||||||
_tabesc = new TTable (TAB_ESC);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Anni_es::add(long annoe, TDate& in, TDate& fin)
|
|
||||||
{
|
|
||||||
TString key = format("%04ld", annoe);
|
|
||||||
Anno_es anno(annoe, in, fin);
|
|
||||||
TAssoc_array::add(key, anno);
|
|
||||||
}
|
|
||||||
|
|
||||||
Anno_es * Anni_es::trova(long annoe, TDate& in, TDate& fin)
|
|
||||||
{
|
|
||||||
TString key = format("%04ld", annoe);
|
|
||||||
Anno_es *anno = (Anno_es*) objptr ((const char*) key);
|
|
||||||
if (anno == NULL) {
|
|
||||||
in = ""; fin = "";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
in = anno->inizio();
|
|
||||||
fin = anno->fine();
|
|
||||||
}
|
|
||||||
return anno;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Anni_es::aggiungi_anno(long annoese, TDate& inizio, TDate& fine)
|
|
||||||
{
|
|
||||||
TString dep;
|
|
||||||
TString key = format("%04ld", annoese);
|
|
||||||
Anno_es * anno;
|
|
||||||
|
|
||||||
if (!is_key((const char *) key))
|
|
||||||
{
|
|
||||||
_tabesc->curr().zero();
|
|
||||||
dep = format ("%04d",annoese);
|
|
||||||
_tabesc->curr().put("CODTAB", (const char*) dep);
|
|
||||||
_tabesc->read();
|
|
||||||
if (_tabesc->bad())
|
|
||||||
_tabesc->curr().zero();
|
|
||||||
inizio = _tabesc->curr().get_date("D0");
|
|
||||||
fine = _tabesc->curr().get_date("D1");
|
|
||||||
anno = new Anno_es(annoese, inizio, fine);
|
|
||||||
TAssoc_array::add(key, anno);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
anno = trova (annoese, inizio, fine);
|
|
||||||
}
|
|
||||||
|
|
||||||
class _riga_sez_opp : public TObject
|
class _riga_sez_opp : public TObject
|
||||||
{
|
{
|
||||||
TToken_string * _str;
|
TToken_string * _str;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int gruppo() { return atoi(_str->get(0)); }
|
int gruppo() { return atoi(_str->get(0)); }
|
||||||
int conto() { return atoi(_str->get(1)); }
|
int conto() { return atoi(_str->get(1)); }
|
||||||
@ -225,13 +127,13 @@ void Righe_sez_opp::add(int g, int c, long s,
|
|||||||
|
|
||||||
class CG1600_application : public TPrintapp
|
class CG1600_application : public TPrintapp
|
||||||
{
|
{
|
||||||
friend bool data_limite (TMask_field & f,KEY k);
|
static bool data_limite (TMask_field & f,KEY k);
|
||||||
friend bool tipo_stampa (TMask_field & f,KEY k);
|
static bool tipo_stampa (TMask_field & f,KEY k);
|
||||||
friend bool data_bil_raff (TMask_field & f,KEY k);
|
static bool data_bil_raff (TMask_field & f,KEY k);
|
||||||
friend bool tipo_bilancio (TMask_field & f,KEY k);
|
static bool tipo_bilancio (TMask_field & f,KEY k);
|
||||||
friend bool data_inizio (TMask_field & f,KEY k);
|
static bool data_inizio (TMask_field & f,KEY k);
|
||||||
friend bool data_fine (TMask_field & f,KEY k);
|
static bool data_fine (TMask_field & f,KEY k);
|
||||||
friend bool anno_esercizio (TMask_field & f,KEY k);
|
static bool anno_esercizio (TMask_field & f,KEY k);
|
||||||
|
|
||||||
struct bil_ivd
|
struct bil_ivd
|
||||||
{
|
{
|
||||||
@ -254,7 +156,6 @@ class CG1600_application : public TPrintapp
|
|||||||
|
|
||||||
bil_ivd* _bil;
|
bil_ivd* _bil;
|
||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TTable* _tabesc;
|
|
||||||
TTable* _tabivd;
|
TTable* _tabivd;
|
||||||
TLocalisamfile* _nditte;
|
TLocalisamfile* _nditte;
|
||||||
TLocalisamfile* _comuni;
|
TLocalisamfile* _comuni;
|
||||||
@ -266,7 +167,6 @@ class CG1600_application : public TPrintapp
|
|||||||
TLocalisamfile* _caus;
|
TLocalisamfile* _caus;
|
||||||
const char* _buff;
|
const char* _buff;
|
||||||
TSort* _sort;
|
TSort* _sort;
|
||||||
Anni_es* _anni_es;
|
|
||||||
Righe_sez_opp _sezopps;
|
Righe_sez_opp _sezopps;
|
||||||
TSaldi_list* _listasld;
|
TSaldi_list* _listasld;
|
||||||
TProgind* _prog, *_prog_stampa;
|
TProgind* _prog, *_prog_stampa;
|
||||||
@ -312,13 +212,15 @@ class CG1600_application : public TPrintapp
|
|||||||
bool _reset_righe_stampa,_totale_attivita_gia_stampato,_totale_passivita_gia_stampato,_statopatr_no_stamp;
|
bool _reset_righe_stampa,_totale_attivita_gia_stampato,_totale_passivita_gia_stampato,_statopatr_no_stamp;
|
||||||
bool _sbilancio_ordine, _quadratura;
|
bool _sbilancio_ordine, _quadratura;
|
||||||
long _items_sort;
|
long _items_sort;
|
||||||
//TString _causale_ap, _causale_chi;
|
|
||||||
|
protected:
|
||||||
|
void aggiungi_anno(int anno, TDate& inizio, TDate& fine);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TDate _inizioEs, _fineEs;
|
TDate _inizioEs, _fineEs;
|
||||||
|
|
||||||
int date2esc(const TDate& d, int* prevesc = NULL);
|
int date2esc(const TDate& d);
|
||||||
void esc2date(const int anno, TDate& d1, TDate& d2);
|
void esc2date(const int anno, TDate& d1, TDate& d2);
|
||||||
|
|
||||||
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
|
bool menu (MENU_TAG m) { return TPrintapp::menu(m) ; }
|
||||||
@ -364,8 +266,6 @@ public:
|
|||||||
bool calcola(int,int,long,const TDate&,const TDate&);
|
bool calcola(int,int,long,const TDate&,const TDate&);
|
||||||
bool sottoc_clifo_scalare (int,int,int,int,real&,real&);
|
bool sottoc_clifo_scalare (int,int,int,int,real&,real&);
|
||||||
void sottoc_clifo_verifica(int,int,int,char,TString&,TString&,TString&,int,int,bool);
|
void sottoc_clifo_verifica(int,int,int,char,TString&,TString&,TString&,int,int,bool);
|
||||||
//const char* causale_apertura() { return _causale_ap;}
|
|
||||||
//const char* causale_chiusura() { return _causale_chi;}
|
|
||||||
void stampa_saldo_132(const real&);
|
void stampa_saldo_132(const real&);
|
||||||
void stampa_saldo_198(real&, real&);
|
void stampa_saldo_198(real&, real&);
|
||||||
void set_bil_key(bil_ivd* b, char sezione, char lettera,
|
void set_bil_key(bil_ivd* b, char sezione, char lettera,
|
||||||
@ -388,37 +288,22 @@ void CG1600_application::postclose_print()
|
|||||||
delete _sort;
|
delete _sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CG1600_application::date2esc(const TDate& d, int* prevesc)
|
void CG1600_application::aggiungi_anno(int anno, TDate& inizio, TDate& fine)
|
||||||
{
|
{
|
||||||
if (prevesc) *prevesc = 0;
|
TEsercizi_contabili ese;
|
||||||
TTable esc("ESC");
|
if (ese.exist(anno))
|
||||||
for (int err = esc.first(); err == NOERR; err = esc.next())
|
|
||||||
{
|
{
|
||||||
const TDate ia(esc.get("D0")); // Data inizio esercizio
|
inizio = ese[anno].inizio();
|
||||||
const TDate fa(esc.get("D1")); // Data fine esercizio
|
fine = ese[anno].fine();
|
||||||
a()._inizioEs = ia;
|
}
|
||||||
a()._fineEs = fa;
|
else
|
||||||
const anno = esc.get_int("CODTAB");
|
inizio = fine = botime;
|
||||||
if (d >= ia && d <= fa)
|
|
||||||
return anno;
|
|
||||||
if (prevesc) *prevesc = anno;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG1600_application::esc2date(const int anno, TDate& d1, TDate& d2)
|
int CG1600_application::date2esc(const TDate& d)
|
||||||
{
|
{
|
||||||
_tabesc->put("CODTAB",format("%04d",anno));
|
TEsercizi_contabili ese;
|
||||||
if (_tabesc->read() == NOERR)
|
return ese.date2esc(d);
|
||||||
{
|
|
||||||
d1 = _tabesc->get_date("D0");
|
|
||||||
d2 = _tabesc->get_date("D1");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
d1 = "";
|
|
||||||
d2 = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG1600_application::set_bil_key(bil_ivd* b, char sezione, char lettera,
|
void CG1600_application::set_bil_key(bil_ivd* b, char sezione, char lettera,
|
||||||
@ -476,7 +361,7 @@ void CG1600_application::set_bil_val(bil_ivd* b, const real& saldo,
|
|||||||
b->conto_dettagliato = conto_dettagliato;
|
b->conto_dettagliato = conto_dettagliato;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool data_limite (TMask_field& f, KEY key)
|
bool CG1600_application::data_limite (TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
if (key == K_ENTER)
|
if (key == K_ENTER)
|
||||||
{
|
{
|
||||||
@ -495,9 +380,9 @@ bool data_limite (TMask_field& f, KEY key)
|
|||||||
|
|
||||||
if (annoese != 0)
|
if (annoese != 0)
|
||||||
{
|
{
|
||||||
a()._anni_es->aggiungi_anno(annoese, in, fin);
|
a().aggiungi_anno(annoese, in, fin);
|
||||||
a()._data_fine_ese = fin;
|
|
||||||
a()._data_ini_ese = in;
|
a()._data_ini_ese = in;
|
||||||
|
a()._data_fine_ese = fin;
|
||||||
|
|
||||||
a()._anno_esercizio = annoese;
|
a()._anno_esercizio = annoese;
|
||||||
|
|
||||||
@ -543,7 +428,7 @@ bool data_limite (TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool data_bil_raff (TMask_field& f, KEY key)
|
bool CG1600_application::data_bil_raff (TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
int tipobil,tipostampa;
|
int tipobil,tipostampa;
|
||||||
@ -574,7 +459,7 @@ bool data_bil_raff (TMask_field& f, KEY key)
|
|||||||
in = a()._inizioEs;
|
in = a()._inizioEs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
a()._anni_es->aggiungi_anno(annoese, in, fin);
|
a().aggiungi_anno(annoese, in, fin);
|
||||||
|
|
||||||
TString instr = in.string();
|
TString instr = in.string();
|
||||||
if (dataraf != botime)
|
if (dataraf != botime)
|
||||||
@ -613,26 +498,25 @@ bool data_bil_raff (TMask_field& f, KEY key)
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (annoraf != 0)
|
{
|
||||||
{
|
a().aggiungi_anno(annoraf, in_raf, fin_raf);
|
||||||
a()._anni_es->aggiungi_anno(annoraf, in_raf, fin_raf);
|
a()._data_ini_raf = in_raf;
|
||||||
a()._data_fine_raf = fin_raf;
|
a()._data_fine_raf = fin_raf;
|
||||||
a()._data_ini_raf = in_raf;
|
a().aggiungi_anno(annoese,a()._data_ini_ese,a()._data_fine_ese);
|
||||||
a().esc2date(annoese,a()._data_ini_ese,a()._data_fine_ese);
|
|
||||||
|
|
||||||
if (dataraf == botime)
|
if (dataraf == botime)
|
||||||
a()._databilrafr = fin_raf;
|
a()._databilrafr = fin_raf;
|
||||||
|
|
||||||
|
else
|
||||||
|
if (dataraf < in_raf || dataraf > fin_raf)
|
||||||
|
{
|
||||||
|
f.error_box("La data bilancio da raffrontare deve appartenere all' esercizio da raffrontare");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (dataraf < in_raf || dataraf > fin_raf)
|
a()._databilrafr = dataraf;
|
||||||
{
|
a()._anno_esercizio_raf = annoraf;
|
||||||
f.error_box("La data bilancio da raffrontare deve appartenere all' esercizio da raffrontare");
|
}
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
a()._databilrafr = dataraf;
|
|
||||||
a()._anno_esercizio_raf = annoraf;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // IF (key == K_ENTER)
|
} // IF (key == K_ENTER)
|
||||||
TString data1 = in.string();
|
TString data1 = in.string();
|
||||||
@ -685,7 +569,7 @@ bool anno_ese_raff (TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tipo_bilancio (TMask_field& f, KEY key)
|
bool CG1600_application::tipo_bilancio (TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
int tipo_bil, anno, tipo_stampa;
|
int tipo_bil, anno, tipo_stampa;
|
||||||
|
|
||||||
@ -741,7 +625,7 @@ bool tipo_bilancio (TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool anno_esercizio (TMask_field& f, KEY key)
|
bool CG1600_application::anno_esercizio (TMask_field& f, KEY key)
|
||||||
{
|
{
|
||||||
int tipo_bil, anno;
|
int tipo_bil, anno;
|
||||||
|
|
||||||
@ -813,7 +697,7 @@ bool anno_esercizio (TMask_field& f, KEY key)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tipo_stampa(TMask_field& f,KEY k)
|
bool CG1600_application::tipo_stampa(TMask_field& f,KEY k)
|
||||||
{
|
{
|
||||||
int tipo_bil, tipo_stampa;
|
int tipo_bil, tipo_stampa;
|
||||||
|
|
||||||
@ -885,7 +769,7 @@ bool tipo_stampa(TMask_field& f,KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool data_inizio(TMask_field& f, KEY k)
|
bool CG1600_application::data_inizio(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
int anno;
|
int anno;
|
||||||
TDate data;
|
TDate data;
|
||||||
@ -899,7 +783,7 @@ bool data_inizio(TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (anno != 0)
|
if (anno != 0)
|
||||||
{
|
{
|
||||||
a()._anni_es->aggiungi_anno(anno, in, fin);
|
a().aggiungi_anno(anno, in, fin);
|
||||||
a()._data_ini_ese = in;
|
a()._data_ini_ese = in;
|
||||||
a()._data_fine_ese = fin;
|
a()._data_fine_ese = fin;
|
||||||
a()._anno_esercizio = anno;
|
a()._anno_esercizio = anno;
|
||||||
@ -907,126 +791,111 @@ bool data_inizio(TMask_field& f, KEY k)
|
|||||||
if (data == botime)
|
if (data == botime)
|
||||||
a()._dataini = in;
|
a()._dataini = in;
|
||||||
else
|
else
|
||||||
if (data < in || data > fin)
|
if (data < in || data > fin)
|
||||||
|
{
|
||||||
|
f.error_box("La data non appartiene all' esercizio indicato");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
a()._dataini = data;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
f.error_box("La data non appartiene all' esercizio indicato");
|
if (data == botime)
|
||||||
return FALSE;
|
{
|
||||||
}
|
f.error_box("La data deve essere obbligatoriamente indicata");
|
||||||
else
|
return FALSE;
|
||||||
a()._dataini = data;
|
}
|
||||||
}
|
|
||||||
else
|
int anno = a().date2esc(data);
|
||||||
|
|
||||||
if (anno == 0)
|
if (anno == 0)
|
||||||
{
|
{
|
||||||
if (data == botime)
|
f.error_box("La data limite indicata non appartiene ad alcun esercizio attivo della ditta");
|
||||||
{
|
return FALSE;
|
||||||
f.error_box("La data deve essere obbligatoriamente indicata");
|
}
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int anno = a().date2esc(data);
|
a()._anno_esercizio = anno;
|
||||||
|
a()._dataini = data;
|
||||||
if (anno == 0)
|
a()._data_ini_ese = a()._inizioEs;
|
||||||
{
|
a()._data_fine_ese = a()._fineEs;
|
||||||
f.error_box("La data limite indicata non appartiene ad alcun esercizio attivo della ditta");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
a()._anno_esercizio = anno;
|
|
||||||
a()._dataini = data;
|
|
||||||
a()._data_ini_ese = a()._inizioEs;
|
|
||||||
a()._data_fine_ese = a()._fineEs;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TString datastr = a()._dataini.string();
|
|
||||||
TString data1 = a()._data_ini_ese.string();
|
|
||||||
TString data2 = a()._data_fine_ese.string();
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool data_fine(TMask_field& f, KEY k)
|
bool CG1600_application::data_fine(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
int annoes;
|
int annoes;
|
||||||
TDate data, data_ini;
|
TDate data, data_ini;
|
||||||
TDate in="", fin="";
|
TDate in="", fin="";
|
||||||
|
|
||||||
annoes = f.mask().get_int(F_ANNOESE);
|
annoes = m.get_int(F_ANNOESE);
|
||||||
data = f.mask().get (F_DATAFINE);
|
data = m.get (F_DATAFINE);
|
||||||
data_ini = f.mask().get (F_DATAINI);
|
data_ini = m.get (F_DATAINI);
|
||||||
//a()._anno_esercizio = annoes;
|
//a()._anno_esercizio = annoes;
|
||||||
|
|
||||||
if (k == K_TAB)
|
if (k == K_TAB)
|
||||||
{
|
{
|
||||||
TDate data (f.get());
|
TDate data (f.get());
|
||||||
int bil = f.mask().get_int(F_TIPOBIL);
|
int bil = m.get_int(F_TIPOBIL);
|
||||||
int anno = date2esc(data);
|
int anno = a().date2esc(data);
|
||||||
TTable esc ("ESC");
|
|
||||||
|
TDate dataini, datafin;
|
||||||
TString dep (format("%04d", anno));
|
a().aggiungi_anno(anno, dataini, datafin);
|
||||||
esc.zero();
|
|
||||||
esc.put("CODTAB", dep);
|
if (data == datafin && bil == 2 && annoes == 0)
|
||||||
if (esc.read() == NOERR)
|
m.show(F_QUADRATURA);
|
||||||
{
|
else
|
||||||
TDate dataini (esc.get_date("D1"));
|
m.hide(F_QUADRATURA);
|
||||||
if (data == dataini && bil == 2 && f.mask().get_int(F_ANNOESE) == 0)
|
|
||||||
f.mask().show(F_QUADRATURA);
|
|
||||||
else
|
|
||||||
f.mask().hide(F_QUADRATURA);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
if (annoes != 0)
|
if (annoes != 0)
|
||||||
{
|
{
|
||||||
a()._anni_es->aggiungi_anno(annoes, in, fin);
|
a().aggiungi_anno(annoes, in, fin);
|
||||||
a()._data_ini_ese = in;
|
a()._data_ini_ese = in;
|
||||||
a()._data_fine_ese = fin;
|
a()._data_fine_ese = fin;
|
||||||
|
|
||||||
if (data == botime)
|
if (data == botime)
|
||||||
a()._datafine = fin;
|
a()._datafine = fin;
|
||||||
else
|
else
|
||||||
if (data < in || data > fin)
|
if (data < in || data > fin)
|
||||||
{
|
|
||||||
f.error_box("La data non appartiene all' esercizio indicato");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
a()._datafine = data;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (annoes == 0)
|
|
||||||
{
|
{
|
||||||
if (data == botime)
|
f.error_box("La data non appartiene all' esercizio indicato");
|
||||||
{
|
return FALSE;
|
||||||
f.error_box("La data deve essere obbligatoriamente indicata");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
a().date2esc(data_ini);
|
|
||||||
TString data3 = a()._inizioEs.string();
|
|
||||||
TString data4 = a()._fineEs.string();
|
|
||||||
|
|
||||||
if (data < a()._inizioEs || data > a()._fineEs)
|
|
||||||
{
|
|
||||||
f.error_box("La data non appartiene all' esercizio indicato");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
a()._datafine = data;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
a()._datafine = data;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (data == botime)
|
||||||
|
{
|
||||||
|
f.error_box("La data deve essere obbligatoriamente indicata");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
a().date2esc(data_ini);
|
||||||
|
|
||||||
|
if (data < a()._inizioEs || data > a()._fineEs)
|
||||||
|
{
|
||||||
|
f.error_box("La data non appartiene all' esercizio indicato");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
a()._datafine = data;
|
||||||
|
}
|
||||||
|
|
||||||
if (data < data_ini)
|
if (data < data_ini)
|
||||||
{
|
{
|
||||||
f.error_box("La data finale non puo' essere inferiore alla data di partenza");
|
f.error_box("La data finale non puo' essere inferiore alla data di partenza");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
TString datastr = a()._datafine.string();
|
|
||||||
TString data1 = a()._data_ini_ese.string();
|
|
||||||
TString data2 = a()._data_fine_ese.string();
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2087,6 +1956,10 @@ bool CG1600_application::calcola_saldo(real& saldo, real& saldo_raf,int g,int c,
|
|||||||
bool CG1600_application::calcola(int g, int c, long s,
|
bool CG1600_application::calcola(int g, int c, long s,
|
||||||
const TDate& fine_es, const TDate& fine_es_prec)
|
const TDate& fine_es, const TDate& fine_es_prec)
|
||||||
{
|
{
|
||||||
|
TLocalisamfile rmov(LF_RMOV);
|
||||||
|
TLocalisamfile mov (LF_MOV);
|
||||||
|
TDecoder causali(LF_CAUSALI, CAU_MOVAP);
|
||||||
|
|
||||||
TString sezione;
|
TString sezione;
|
||||||
real importo;
|
real importo;
|
||||||
int annoe;
|
int annoe;
|
||||||
@ -2094,8 +1967,6 @@ bool CG1600_application::calcola(int g, int c, long s,
|
|||||||
char provvis;
|
char provvis;
|
||||||
TDate datareg, datacomp, data;
|
TDate datareg, datacomp, data;
|
||||||
bool conto_mov = FALSE;
|
bool conto_mov = FALSE;
|
||||||
TLocalisamfile rmov(LF_RMOV);
|
|
||||||
TLocalisamfile mov (LF_MOV);
|
|
||||||
|
|
||||||
_mov_periodo_dare = ZERO;
|
_mov_periodo_dare = ZERO;
|
||||||
_mov_periodo_avere = ZERO;
|
_mov_periodo_avere = ZERO;
|
||||||
@ -2138,20 +2009,12 @@ bool CG1600_application::calcola(int g, int c, long s,
|
|||||||
if (_stampa_mov_prov == 3 && provvis == '\0') //bilancio dei soli provvisori
|
if (_stampa_mov_prov == 3 && provvis == '\0') //bilancio dei soli provvisori
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const TString codcaus(mov.get(MOV_CODCAUS));
|
const TString& codcaus = mov.get(MOV_CODCAUS);
|
||||||
|
const char movap = toupper(causali.decode(codcaus)[0]);
|
||||||
|
|
||||||
// if (codcaus.not_empty())
|
if (movap == 'C' && // la causale e' di chiusura
|
||||||
// if (codcaus == causale_chiusura()) //la causale e' uguale a quella di chiusura
|
!_quadratura) // Non e' richiesta la quadratura con il Libro Giornale (Modifica
|
||||||
// continue;
|
continue; // del 18-06-96 richiesta da Patrizia in seguito alla modifica dei SALDI
|
||||||
|
|
||||||
// Modifica del 03-03-95
|
|
||||||
|
|
||||||
TCaus cau (codcaus);
|
|
||||||
|
|
||||||
if (codcaus.not_empty())
|
|
||||||
if (cau.chiusura()) //la causale e' uguale a quella di chiusura
|
|
||||||
if (!_quadratura) // Non e' richiesta la quadratura con il Libro Giornale (Modifica
|
|
||||||
continue; // del 18-06-96 richiesta da Patrizia in seguito alla modifica dei SALDI
|
|
||||||
|
|
||||||
if (_annoese == 0)
|
if (_annoese == 0)
|
||||||
data = datareg;
|
data = datareg;
|
||||||
@ -2162,22 +2025,9 @@ bool CG1600_application::calcola(int g, int c, long s,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
//calcolo i movimenti del periodo
|
//calcolo i movimenti del periodo
|
||||||
/*
|
|
||||||
if ( (data >= _dataini) && (data <= _datafine) )
|
|
||||||
if ((codcaus == causale_apertura() && _data_ini_ese != _dataini) ||
|
|
||||||
(codcaus != causale_apertura()))
|
|
||||||
{
|
|
||||||
conto_mov = TRUE;
|
|
||||||
if (sezione == "D")
|
|
||||||
_mov_periodo_dare += importo;
|
|
||||||
else _mov_periodo_avere += importo;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// Modifica del 03-03-95
|
|
||||||
|
|
||||||
if ( (data >= _dataini) && (data <= _datafine) )
|
if ( (data >= _dataini) && (data <= _datafine) )
|
||||||
if ((cau.apertura() && _data_ini_ese != _dataini) ||
|
if ((movap == 'A' && _data_ini_ese != _dataini) || (movap != 'A'))
|
||||||
(!cau.apertura()))
|
|
||||||
{
|
{
|
||||||
conto_mov = TRUE;
|
conto_mov = TRUE;
|
||||||
if (sezione == "D")
|
if (sezione == "D")
|
||||||
@ -2190,7 +2040,7 @@ bool CG1600_application::calcola(int g, int c, long s,
|
|||||||
if (_dataini == _data_ini_ese) //calcolo il saldo iniziale
|
if (_dataini == _data_ini_ese) //calcolo il saldo iniziale
|
||||||
{
|
{
|
||||||
//if (codcaus == causale_apertura())
|
//if (codcaus == causale_apertura())
|
||||||
if (cau.apertura())
|
if (movap == 'A')
|
||||||
{
|
{
|
||||||
if (data >= _data_ini_ese && data <= _datafine)
|
if (data >= _data_ini_ese && data <= _datafine)
|
||||||
{
|
{
|
||||||
@ -2217,145 +2067,137 @@ bool CG1600_application::calcola(int g, int c, long s,
|
|||||||
bool CG1600_application::set_print(int)
|
bool CG1600_application::set_print(int)
|
||||||
{
|
{
|
||||||
KEY tasto;
|
KEY tasto;
|
||||||
/*
|
|
||||||
{
|
|
||||||
TConfig conf(CONFIG_DITTA);
|
|
||||||
|
|
||||||
_causale_ap = conf.get("CoCaAp");
|
_msk->set_handler(F_DATALIM, data_limite);
|
||||||
_causale_chi = conf.get("CoCaCh");
|
_msk->set_handler(F_TIPOSTAMPA, tipo_stampa);
|
||||||
}
|
_msk->set_handler(F_TIPOSTAMPA1, tipo_stampa);
|
||||||
*/
|
_msk->set_handler(F_TIPOBIL, tipo_bilancio);
|
||||||
|
_msk->set_handler(F_ANNOESE, anno_esercizio);
|
||||||
_msk->set_handler(F_DATALIM, data_limite);
|
_msk->set_handler(F_DATAINI, data_inizio);
|
||||||
_msk->set_handler(F_TIPOSTAMPA, tipo_stampa);
|
_msk->set_handler(F_DATAFINE, data_fine);
|
||||||
_msk->set_handler(F_TIPOSTAMPA1, tipo_stampa);
|
_msk->set_handler(F_DATABILRAF, data_bil_raff);
|
||||||
_msk->set_handler(F_TIPOBIL, tipo_bilancio);
|
_msk->set_handler(F_ANNORAFFR, anno_ese_raff);
|
||||||
_msk->set_handler(F_ANNOESE, anno_esercizio);
|
|
||||||
_msk->set_handler(F_DATAINI, data_inizio);
|
tasto = _msk->run();
|
||||||
_msk->set_handler(F_DATAFINE, data_fine);
|
|
||||||
_msk->set_handler(F_DATABILRAF, data_bil_raff);
|
if (tasto == K_ENTER)
|
||||||
_msk->set_handler(F_ANNORAFFR, anno_ese_raff);
|
{
|
||||||
|
_datastampa = (_msk->get(F_DATASTAMPA));
|
||||||
tasto = _msk->run();
|
_annoese = _msk->get_int(F_ANNOESE);
|
||||||
|
_annoeserafr = _msk->get_int(F_ANNORAFFR);
|
||||||
if (tasto == K_ENTER)
|
_intera_struttura = (bool)(_msk->get(F_STAMPAINT) == "X");
|
||||||
{
|
_stampamov = (bool)(_msk->get(F_STAMPAMOV) == "X");
|
||||||
_datastampa = (_msk->get(F_DATASTAMPA));
|
_stampacod = (bool)(_msk->get(F_STAMPACOD) == "X");
|
||||||
_annoese = _msk->get_int(F_ANNOESE);
|
_stampa_modulo = (bool)(_msk->get(F_STAMPAMODULO) == "X");
|
||||||
_annoeserafr = _msk->get_int(F_ANNORAFFR);
|
_tipo_bilancio = atoi(_msk->get(F_TIPOBIL));
|
||||||
_intera_struttura = (bool)(_msk->get(F_STAMPAINT) == "X");
|
_stampa_mov_prov = _msk->get_int(F_STAMPAMOVPROV);
|
||||||
_stampamov = (bool)(_msk->get(F_STAMPAMOV) == "X");
|
_quadratura = _msk->get_bool(F_QUADRATURA);
|
||||||
_stampacod = (bool)(_msk->get(F_STAMPACOD) == "X");
|
if (_tipo_bilancio == 1)
|
||||||
_stampa_modulo = (bool)(_msk->get(F_STAMPAMODULO) == "X");
|
|
||||||
_tipo_bilancio = atoi(_msk->get(F_TIPOBIL));
|
|
||||||
_stampa_mov_prov = _msk->get_int(F_STAMPAMOVPROV);
|
|
||||||
_quadratura = _msk->get_bool(F_QUADRATURA);
|
|
||||||
if (_tipo_bilancio == 1)
|
|
||||||
{
|
|
||||||
_tipo_stampa = atoi(_msk->get(F_TIPOSTAMPA));
|
|
||||||
_prog = new TProgind(_pconti->items(),"Elaborazione in corso... prego attendere",FALSE);
|
|
||||||
if (_tipo_stampa == 2)
|
|
||||||
{
|
{
|
||||||
_anno_esercizio = _annoese;
|
_tipo_stampa = atoi(_msk->get(F_TIPOSTAMPA));
|
||||||
_anno_esercizio_raf = _annoeserafr;
|
_prog = new TProgind(_pconti->items(),"Elaborazione in corso... prego attendere",FALSE);
|
||||||
}
|
if (_tipo_stampa == 2)
|
||||||
}
|
{
|
||||||
else if (_tipo_bilancio == 2)
|
_anno_esercizio = _annoese;
|
||||||
{
|
_anno_esercizio_raf = _annoeserafr;
|
||||||
_tipo_stampa = atoi(_msk->get(F_TIPOSTAMPA1));
|
}
|
||||||
_prog = new TProgind(_pconti->items(),"Elaborazione in corso... prego attendere",FALSE);
|
}
|
||||||
if (_tipo_stampa == 2)
|
else if (_tipo_bilancio == 2)
|
||||||
{
|
{
|
||||||
_anno_esercizio = _annoese;
|
_tipo_stampa = atoi(_msk->get(F_TIPOSTAMPA1));
|
||||||
_anno_esercizio_raf = _annoeserafr;
|
_prog = new TProgind(_pconti->items(),"Elaborazione in corso... prego attendere",FALSE);
|
||||||
}
|
if (_tipo_stampa == 2)
|
||||||
|
{
|
||||||
|
_anno_esercizio = _annoese;
|
||||||
|
_anno_esercizio_raf = _annoeserafr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_cont_let = 0;
|
||||||
|
_cont_numr = 0;
|
||||||
|
_cont_num = 0;
|
||||||
|
_cont_gcs = 0;
|
||||||
|
_reset_righe_stampa = TRUE;
|
||||||
|
|
||||||
|
//17/11/1995
|
||||||
|
if (_tipo_bilancio == 1)
|
||||||
|
set_real_picture("#.###.###.###.###");
|
||||||
|
else set_real_picture("###.###.###.###");
|
||||||
|
//fine
|
||||||
|
|
||||||
|
// if (_stampamov)
|
||||||
|
// set_print_zero(FALSE);
|
||||||
|
// else
|
||||||
|
set_print_zero(TRUE);
|
||||||
|
|
||||||
|
_totale_attivita_gia_stampato = FALSE;
|
||||||
|
_totale_passivita_gia_stampato = FALSE;
|
||||||
|
_statopatr_no_stamp = TRUE;
|
||||||
|
_diffprod_fatto = TRUE;
|
||||||
|
_risimp_fatto = TRUE;
|
||||||
|
_sbilancio_ordine = FALSE;
|
||||||
|
_sbilancio_patr_gia_stampato = FALSE;
|
||||||
|
_attivo_o_passivo = FALSE;
|
||||||
|
|
||||||
|
_sez_stamp = ' ';
|
||||||
|
_let_stamp = ' ';
|
||||||
|
_numr_stamp = "";
|
||||||
|
_num_stamp = "";
|
||||||
|
_sez_tot = ' ';
|
||||||
|
_let_tot = ' ';
|
||||||
|
_numr_tot = "";
|
||||||
|
_num_tot = "";
|
||||||
|
|
||||||
|
_sale = _salerafr = _totale_ordine = _totale_economico = ZERO;
|
||||||
|
_totale_ordine_raf = _totale_economico_raf = _totale_numero = ZERO;
|
||||||
|
_totale_numr = _totale_lettera = _totale_sezione = ZERO;
|
||||||
|
_totale_patrimoniale = _totale_attivita = _totale_passivita = ZERO;
|
||||||
|
_totale_num_raf = _totale_numr_raf = _totale_let_raf = ZERO;
|
||||||
|
_totale_sez_raf = _totale_patrim_raf = _totale_attiv_raf = ZERO;
|
||||||
|
_totale_passiv_raf = _totale_ordine_attivo = _totale_ordine_passivo = ZERO;
|
||||||
|
_totale_ordine_attivo_raf = _totale_ordine_passivo_raf = ZERO;
|
||||||
|
_mov_periodo_dare = _mov_periodo_avere = _prg_prec_dare = ZERO;
|
||||||
|
_prg_prec_avere = _saldo_ini_dare = _saldo_ini_avere = ZERO;
|
||||||
|
_sld_prg_dare = _sld_prg_avere = _mov_dare = _mov_avere = ZERO;
|
||||||
|
_tot_num_saldo = _tot_numr_saldo = _tot_let_saldo = _tot_gen_saldo = ZERO;
|
||||||
|
_tot_num_prg_d = _tot_numr_prg_d = _tot_let_prg_d = _tot_gen_prg_d = ZERO;
|
||||||
|
_tot_num_prg_a = _tot_numr_prg_a = _tot_let_prg_a = _tot_gen_prg_a = ZERO;
|
||||||
|
_tot_num_mov_d = _tot_numr_mov_d = _tot_let_mov_d = _tot_gen_mov_d = ZERO;
|
||||||
|
_tot_num_mov_a = _tot_numr_mov_a = _tot_let_mov_a = _tot_gen_mov_a = ZERO;
|
||||||
|
_tot_num_saldo_d = _tot_numr_saldo_d = _tot_let_saldo_d = ZERO;
|
||||||
|
_tot_gen_saldo_d = _tot_num_saldo_a = _tot_numr_saldo_a = ZERO;
|
||||||
|
_tot_let_saldo_a = _tot_gen_saldo_a = _totale_parziale = ZERO;
|
||||||
|
_totale_parziale_raf = _tot_parz_sld = _tot_parz_sld_d = ZERO;
|
||||||
|
_tot_parz_sld_a = _tot_parz_prg_d = _tot_parz_prg_a = ZERO;
|
||||||
|
_tot_parz_mov_d = _tot_parz_mov_a = ZERO;
|
||||||
|
|
||||||
|
_datai = _data_ini_ese;
|
||||||
|
_datairaf = _data_ini_raf;
|
||||||
|
TString data1 = _data_ini_ese.string();
|
||||||
|
TString data2 = _data_ini_raf.string();
|
||||||
|
|
||||||
|
// Se si tratta di stampa intera struttura allora passo al sort anche tutte
|
||||||
|
// le classi presenti sulla tabella IV dir. CEE, altrimenti passo solamente
|
||||||
|
// le classi associate ai conti/sottoconti del Piano dei conti.
|
||||||
|
|
||||||
|
_items_sort = 0;
|
||||||
|
|
||||||
|
init_sort();
|
||||||
|
if (_intera_struttura)
|
||||||
|
crea_sort_tabella();
|
||||||
|
if (_tipo_bilancio == 1)
|
||||||
|
crea_sort_piano_conti_scalare();
|
||||||
|
else if (_tipo_bilancio == 2)
|
||||||
|
crea_sort_piano_conti_verifica();
|
||||||
|
_sort->endsort();
|
||||||
|
|
||||||
|
|
||||||
|
crea_intestazione();
|
||||||
|
delete _bil;
|
||||||
|
delete _prog;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
return FALSE;
|
||||||
_cont_let = 0;
|
|
||||||
_cont_numr = 0;
|
|
||||||
_cont_num = 0;
|
|
||||||
_cont_gcs = 0;
|
|
||||||
_reset_righe_stampa = TRUE;
|
|
||||||
|
|
||||||
//17/11/1995
|
|
||||||
if (_tipo_bilancio == 1)
|
|
||||||
set_real_picture("#.###.###.###.###");
|
|
||||||
else set_real_picture("###.###.###.###");
|
|
||||||
//fine
|
|
||||||
|
|
||||||
// if (_stampamov)
|
|
||||||
// set_print_zero(FALSE);
|
|
||||||
// else
|
|
||||||
set_print_zero(TRUE);
|
|
||||||
|
|
||||||
_totale_attivita_gia_stampato = FALSE;
|
|
||||||
_totale_passivita_gia_stampato = FALSE;
|
|
||||||
_statopatr_no_stamp = TRUE;
|
|
||||||
_diffprod_fatto = TRUE;
|
|
||||||
_risimp_fatto = TRUE;
|
|
||||||
_sbilancio_ordine = FALSE;
|
|
||||||
_sbilancio_patr_gia_stampato = FALSE;
|
|
||||||
_attivo_o_passivo = FALSE;
|
|
||||||
|
|
||||||
_sez_stamp = ' ';
|
|
||||||
_let_stamp = ' ';
|
|
||||||
_numr_stamp = "";
|
|
||||||
_num_stamp = "";
|
|
||||||
_sez_tot = ' ';
|
|
||||||
_let_tot = ' ';
|
|
||||||
_numr_tot = "";
|
|
||||||
_num_tot = "";
|
|
||||||
|
|
||||||
_sale = _salerafr = _totale_ordine = _totale_economico = ZERO;
|
|
||||||
_totale_ordine_raf = _totale_economico_raf = _totale_numero = ZERO;
|
|
||||||
_totale_numr = _totale_lettera = _totale_sezione = ZERO;
|
|
||||||
_totale_patrimoniale = _totale_attivita = _totale_passivita = ZERO;
|
|
||||||
_totale_num_raf = _totale_numr_raf = _totale_let_raf = ZERO;
|
|
||||||
_totale_sez_raf = _totale_patrim_raf = _totale_attiv_raf = ZERO;
|
|
||||||
_totale_passiv_raf = _totale_ordine_attivo = _totale_ordine_passivo = ZERO;
|
|
||||||
_totale_ordine_attivo_raf = _totale_ordine_passivo_raf = ZERO;
|
|
||||||
_mov_periodo_dare = _mov_periodo_avere = _prg_prec_dare = ZERO;
|
|
||||||
_prg_prec_avere = _saldo_ini_dare = _saldo_ini_avere = ZERO;
|
|
||||||
_sld_prg_dare = _sld_prg_avere = _mov_dare = _mov_avere = ZERO;
|
|
||||||
_tot_num_saldo = _tot_numr_saldo = _tot_let_saldo = _tot_gen_saldo = ZERO;
|
|
||||||
_tot_num_prg_d = _tot_numr_prg_d = _tot_let_prg_d = _tot_gen_prg_d = ZERO;
|
|
||||||
_tot_num_prg_a = _tot_numr_prg_a = _tot_let_prg_a = _tot_gen_prg_a = ZERO;
|
|
||||||
_tot_num_mov_d = _tot_numr_mov_d = _tot_let_mov_d = _tot_gen_mov_d = ZERO;
|
|
||||||
_tot_num_mov_a = _tot_numr_mov_a = _tot_let_mov_a = _tot_gen_mov_a = ZERO;
|
|
||||||
_tot_num_saldo_d = _tot_numr_saldo_d = _tot_let_saldo_d = ZERO;
|
|
||||||
_tot_gen_saldo_d = _tot_num_saldo_a = _tot_numr_saldo_a = ZERO;
|
|
||||||
_tot_let_saldo_a = _tot_gen_saldo_a = _totale_parziale = ZERO;
|
|
||||||
_totale_parziale_raf = _tot_parz_sld = _tot_parz_sld_d = ZERO;
|
|
||||||
_tot_parz_sld_a = _tot_parz_prg_d = _tot_parz_prg_a = ZERO;
|
|
||||||
_tot_parz_mov_d = _tot_parz_mov_a = ZERO;
|
|
||||||
|
|
||||||
_datai = _data_ini_ese;
|
|
||||||
_datairaf = _data_ini_raf;
|
|
||||||
TString data1 = _data_ini_ese.string();
|
|
||||||
TString data2 = _data_ini_raf.string();
|
|
||||||
|
|
||||||
// Se si tratta di stampa intera struttura allora passo al sort anche tutte
|
|
||||||
// le classi presenti sulla tabella IV dir. CEE, altrimenti passo solamente
|
|
||||||
// le classi associate ai conti/sottoconti del Piano dei conti.
|
|
||||||
|
|
||||||
_items_sort = 0;
|
|
||||||
|
|
||||||
init_sort();
|
|
||||||
if (_intera_struttura)
|
|
||||||
crea_sort_tabella();
|
|
||||||
if (_tipo_bilancio == 1)
|
|
||||||
crea_sort_piano_conti_scalare();
|
|
||||||
else if (_tipo_bilancio == 2)
|
|
||||||
crea_sort_piano_conti_verifica();
|
|
||||||
_sort->endsort();
|
|
||||||
|
|
||||||
|
|
||||||
crea_intestazione();
|
|
||||||
delete _bil;
|
|
||||||
delete _prog;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG1600_application::stampa_totali()
|
void CG1600_application::stampa_totali()
|
||||||
@ -5435,9 +5277,7 @@ bool CG1600_application::user_create()
|
|||||||
_descr = new TParagraph_string("",40);
|
_descr = new TParagraph_string("",40);
|
||||||
_d = new TParagraph_string("",33);
|
_d = new TParagraph_string("",33);
|
||||||
_tabivd = new TTable (TAB_IVD);
|
_tabivd = new TTable (TAB_IVD);
|
||||||
_tabesc = new TTable (TAB_ESC);
|
|
||||||
|
|
||||||
_anni_es = new Anni_es();
|
|
||||||
_sld = new TSaldo();
|
_sld = new TSaldo();
|
||||||
|
|
||||||
_msk = new TMask("cg1600a");
|
_msk = new TMask("cg1600a");
|
||||||
@ -5450,7 +5290,6 @@ bool CG1600_application::user_destroy()
|
|||||||
delete _msk;
|
delete _msk;
|
||||||
|
|
||||||
delete _tabivd;
|
delete _tabivd;
|
||||||
delete _tabesc;
|
|
||||||
delete _nditte;
|
delete _nditte;
|
||||||
delete _comuni;
|
delete _comuni;
|
||||||
delete _unloc;
|
delete _unloc;
|
||||||
@ -5461,7 +5300,6 @@ bool CG1600_application::user_destroy()
|
|||||||
delete _caus;
|
delete _caus;
|
||||||
delete _descr;
|
delete _descr;
|
||||||
delete _d;
|
delete _d;
|
||||||
delete _anni_es;
|
|
||||||
delete _sld;
|
delete _sld;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <rcausali.h>
|
#include <rcausali.h>
|
||||||
|
|
||||||
#include "conto.h"
|
|
||||||
#include "cg1.h"
|
#include "cg1.h"
|
||||||
#include "cg1700.h"
|
#include "cg1700.h"
|
||||||
|
#include "cglib01.h"
|
||||||
|
|
||||||
enum descr {causale, conto};
|
enum descr {causale, conto};
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ bool CG1700_application::preprocess_page(int file,int count)
|
|||||||
rcau_conto = current_cursor()->file(LF_RCAUSALI).get_int(RCA_CONTO);
|
rcau_conto = current_cursor()->file(LF_RCAUSALI).get_int(RCA_CONTO);
|
||||||
rcau_sottoconto = current_cursor()->file(LF_RCAUSALI).get_long(RCA_SOTTOCONTO);
|
rcau_sottoconto = current_cursor()->file(LF_RCAUSALI).get_long(RCA_SOTTOCONTO);
|
||||||
rcau_tipocf = current_cursor()->file(LF_RCAUSALI).get_char(RCA_TIPOCF);
|
rcau_tipocf = current_cursor()->file(LF_RCAUSALI).get_char(RCA_TIPOCF);
|
||||||
TConto tc (rcau_gruppo,rcau_conto,rcau_sottoconto,rcau_tipocf);
|
TBill tc (rcau_gruppo,rcau_conto,rcau_sottoconto,rcau_tipocf);
|
||||||
//rcau_tipocf = tc.tipo();
|
//rcau_tipocf = tc.tipo();
|
||||||
rcau_descr = tc.descrizione();
|
rcau_descr = tc.descrizione();
|
||||||
*_descr_conto = (const char*) rcau_descr;
|
*_descr_conto = (const char*) rcau_descr;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CG2103_H
|
#ifndef __CGLIB01_H
|
||||||
class TRegistro;
|
class TRegistro;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
#include "saldacon.h"
|
#include "saldacon.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CGLIB_H
|
#ifndef __CGLIB02_H
|
||||||
#include "cglib.h"
|
#include "cglib02.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __CG2101_H
|
#ifndef __CG2101_H
|
||||||
|
280
cg/cg2103.cpp
280
cg/cg2103.cpp
@ -8,286 +8,6 @@
|
|||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <rcausali.h>
|
#include <rcausali.h>
|
||||||
|
|
||||||
const char* iva2name(TipoIVA iva)
|
|
||||||
{
|
|
||||||
const char* i;
|
|
||||||
switch(iva)
|
|
||||||
{
|
|
||||||
case nessuna_iva:
|
|
||||||
i = "Nessuna IVA"; break;
|
|
||||||
case iva_acquisti:
|
|
||||||
i = "IVA Acquisti"; break;
|
|
||||||
case iva_vendite:
|
|
||||||
i = "IVA Vendite"; break;
|
|
||||||
case iva_generica:
|
|
||||||
i = "IVA Generica"; break;
|
|
||||||
default:
|
|
||||||
i = "IVA ERRATA!"; break;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// Registro
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
TRegistro::TRegistro(const char* cod, int year) : _rec(LF_TAB), _att(LF_ATTIV)
|
|
||||||
{
|
|
||||||
read(cod, year);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TRegistro::read(const char* cod, int year)
|
|
||||||
{
|
|
||||||
if (year <= 0)
|
|
||||||
{
|
|
||||||
const TDate oggi(TODAY);
|
|
||||||
year = oggi.year();
|
|
||||||
}
|
|
||||||
|
|
||||||
int err = ~NOERR;
|
|
||||||
|
|
||||||
TTable reg("REG");
|
|
||||||
reg.setkey(1);
|
|
||||||
if (cod && *cod > ' ')
|
|
||||||
{
|
|
||||||
TString16 chiave; chiave.format("%04d%s", year, cod);
|
|
||||||
reg.put("CODTAB", chiave);
|
|
||||||
err = reg.read();
|
|
||||||
}
|
|
||||||
_rec = reg.curr();
|
|
||||||
|
|
||||||
if (err != NOERR)
|
|
||||||
_rec.zero();
|
|
||||||
read_att();
|
|
||||||
|
|
||||||
return err == NOERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TRegistro::reread()
|
|
||||||
{
|
|
||||||
if (ok())
|
|
||||||
{
|
|
||||||
const TString16 n(name());
|
|
||||||
const int y = year();
|
|
||||||
return read(n, y);
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TRegistro::year() const
|
|
||||||
{
|
|
||||||
TString16 anno(_rec.get("CODTAB"));
|
|
||||||
anno.cut(4);
|
|
||||||
return atoi(anno);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const TString& TRegistro::name() const
|
|
||||||
{
|
|
||||||
return _rec.get("CODTAB").mid(4);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TRegistro& TRegistro::operator =(const TRegistro& r)
|
|
||||||
{
|
|
||||||
_rec = r._rec;
|
|
||||||
_att = r._att;
|
|
||||||
_prorata = r._prorata;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int TRegistro::tipo() const
|
|
||||||
{
|
|
||||||
const int t = _rec.get_int("I0");
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TRegistro::corrispettivi() const
|
|
||||||
{
|
|
||||||
const bool c = _rec.get_bool("B0");
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TipoIVA TRegistro::iva() const
|
|
||||||
{
|
|
||||||
TipoIVA i = (TipoIVA)tipo();
|
|
||||||
switch (i)
|
|
||||||
{
|
|
||||||
case nessuna_iva:
|
|
||||||
case iva_vendite:
|
|
||||||
case iva_acquisti:
|
|
||||||
break;
|
|
||||||
case libro_giornale:
|
|
||||||
i = nessuna_iva;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
error_box("Il registro '%s' non e' un registro IVA o contabile: tipo %d",
|
|
||||||
(const char*)name(), i);
|
|
||||||
i = nessuna_iva;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TRegistro::read_att()
|
|
||||||
{
|
|
||||||
if (!_att.empty())
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
TLocalisamfile attiv(LF_ATTIV);
|
|
||||||
attiv.setkey(1);
|
|
||||||
attiv.put("CODDITTA", prefix().get_codditta());
|
|
||||||
attiv.put("CODATT", attivita());
|
|
||||||
const int err = attiv.read();
|
|
||||||
_att = attiv.curr();
|
|
||||||
if (err != NOERR)
|
|
||||||
_att.zero();
|
|
||||||
|
|
||||||
TString16 chiave; // Ditta - Anno - Attivita' - Tipo Attivita' (fissata a 1)
|
|
||||||
chiave.format("%05ld", prefix().get_codditta());
|
|
||||||
chiave << year(); // non fare << year() << attivita()
|
|
||||||
chiave << attivita() << "1";
|
|
||||||
|
|
||||||
TTable pla("%PLA");
|
|
||||||
attiv.setkey(1);
|
|
||||||
pla.put("CODTAB", chiave);
|
|
||||||
if (pla.read() == NOERR)
|
|
||||||
{
|
|
||||||
_prorata = pla.get_real("R8");
|
|
||||||
_att.put("TIPOATT", pla.get("S7")); // Aggiorna tipo attivita'
|
|
||||||
}
|
|
||||||
else
|
|
||||||
_prorata = 0.0;
|
|
||||||
|
|
||||||
return err == NOERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TRegistro::agenzia_viaggi()
|
|
||||||
{
|
|
||||||
bool av = FALSE;
|
|
||||||
if (iva() == iva_vendite)
|
|
||||||
av = _att.get_bool("REG74TER");
|
|
||||||
return av;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TString& TRegistro::tipo_attivita()
|
|
||||||
{
|
|
||||||
return _att.get("TIPOATT");
|
|
||||||
}
|
|
||||||
|
|
||||||
const real& TRegistro::prorata()
|
|
||||||
{
|
|
||||||
return _prorata;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TRegistro::set_prorata(const real& pro)
|
|
||||||
{
|
|
||||||
_prorata = pro;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Certified 99%
|
|
||||||
bool TRegistro::update(long protiva, const TDate& datareg)
|
|
||||||
{
|
|
||||||
bool updated = TRUE;
|
|
||||||
|
|
||||||
if (protiva > _rec.get_long("I5"))
|
|
||||||
{
|
|
||||||
_rec.put("I5", protiva);
|
|
||||||
updated = FALSE;
|
|
||||||
}
|
|
||||||
if (datareg > _rec.get_date("D2"))
|
|
||||||
{
|
|
||||||
_rec.put("D2", datareg);
|
|
||||||
updated = FALSE;
|
|
||||||
}
|
|
||||||
if (!updated)
|
|
||||||
{
|
|
||||||
TTable reg("REG");
|
|
||||||
updated = reg.rewrite(_rec) == NOERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return updated;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// Libro giornale
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// Legge il libro giornale dell'anno specificato
|
|
||||||
bool TLibro_giornale::read(int y)
|
|
||||||
{
|
|
||||||
bool found = FALSE;
|
|
||||||
|
|
||||||
if (y <= 0)
|
|
||||||
{
|
|
||||||
const TDate oggi(TODAY);
|
|
||||||
y = oggi.year();
|
|
||||||
}
|
|
||||||
|
|
||||||
TString16 anno; anno.format("%04d", y);
|
|
||||||
TTable reg("REG");
|
|
||||||
reg.setkey(1);
|
|
||||||
reg.put("CODTAB", anno); // Cerca il primo registro dell'anno
|
|
||||||
|
|
||||||
for (int err = reg.read(_isgteq); err == NOERR; err = reg.next())
|
|
||||||
{
|
|
||||||
if (reg.get("CODTAB").compare(anno, 4) != 0)
|
|
||||||
break; // Sono arrivato all'anno dopo
|
|
||||||
|
|
||||||
if (reg.get_int("I0") == libro_giornale)
|
|
||||||
{
|
|
||||||
found = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) reg.zero(); // Memorizza record (anche vuoto)
|
|
||||||
_rec = reg.curr();
|
|
||||||
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
TLibro_giornale::TLibro_giornale(int y)
|
|
||||||
{
|
|
||||||
read(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// Codice IVA
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
TCodiceIVA::TCodiceIVA(const char* cod) : TRectype(LF_TABCOM)
|
|
||||||
{
|
|
||||||
read(cod);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TCodiceIVA::read(const char* cod)
|
|
||||||
{
|
|
||||||
int err = ~NOERR;
|
|
||||||
if (cod && *cod)
|
|
||||||
{
|
|
||||||
TTable iva("%IVA");
|
|
||||||
iva.put("CODTAB", cod);
|
|
||||||
err = iva.read();
|
|
||||||
TRectype::operator=(iva.curr());
|
|
||||||
}
|
|
||||||
if (err != NOERR)
|
|
||||||
zero();
|
|
||||||
return err == NOERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
real TCodiceIVA::scorpora(real& imponibile) const
|
|
||||||
{
|
|
||||||
const real percent = percentuale();
|
|
||||||
real imposta = abs(imponibile) * percent / (percent + 100.0); imposta.ceil();
|
|
||||||
if (imponibile.sign() < 0) imposta = -imposta;
|
|
||||||
imponibile -= imposta;
|
|
||||||
return imposta;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Causale
|
// Causale
|
||||||
|
98
cg/cg2103.h
98
cg/cg2103.h
@ -1,103 +1,11 @@
|
|||||||
#ifndef __CG2103_H
|
#ifndef __CG2103_H
|
||||||
#define __CG2103_H
|
#define __CG2103_H
|
||||||
|
|
||||||
#ifndef __ISAM_H
|
// Registri ed esercizi
|
||||||
#include <isam.h>
|
#ifndef __CGLIB01_H
|
||||||
#endif
|
#include "cglib01.h"
|
||||||
|
|
||||||
#ifndef __CONTO_H
|
|
||||||
#include "conto.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum TipoIVA
|
|
||||||
{
|
|
||||||
iva_errata = -1,
|
|
||||||
nessuna_iva = 0,
|
|
||||||
iva_vendite = 1,
|
|
||||||
iva_acquisti = 2,
|
|
||||||
libro_giornale = 5,
|
|
||||||
iva_generica = 9
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TipoConto
|
|
||||||
{
|
|
||||||
spr = 'G', // spese e rimborsi
|
|
||||||
aba = 'A', // abbuoni attivi
|
|
||||||
abp = 'P', // abbuoni passivi
|
|
||||||
rpf = 'R', // ritenute professionali
|
|
||||||
asp = 'L', // altre spese
|
|
||||||
dfc = 'C', // differenza cambio
|
|
||||||
tot = 'Z'
|
|
||||||
};
|
|
||||||
|
|
||||||
const char* iva2name(TipoIVA i);
|
|
||||||
|
|
||||||
class TRegistro : public TObject
|
|
||||||
{
|
|
||||||
bool read_att();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
TRectype _rec, _att;
|
|
||||||
real _prorata;
|
|
||||||
|
|
||||||
public:
|
|
||||||
bool read(const char* code, int year);
|
|
||||||
bool reread();
|
|
||||||
TRegistro& operator =(const TRegistro& r);
|
|
||||||
|
|
||||||
virtual bool ok() const { return !_rec.empty(); }
|
|
||||||
|
|
||||||
int tipo() const;
|
|
||||||
TipoIVA iva() const;
|
|
||||||
bool corrispettivi() const;
|
|
||||||
bool sospeso() const { return _rec.get_bool("B1");}
|
|
||||||
const TString& name() const;
|
|
||||||
int year() const;
|
|
||||||
TDate last_reg() const { return _rec.get_date("D2"); }
|
|
||||||
TDate last_print() const { return _rec.get_date("D3"); }
|
|
||||||
long mese_stampa_ultima_liq() const { return _rec.get_long("I4"); }
|
|
||||||
long protocol() const { return _rec.get_long("I5"); }
|
|
||||||
const TString& attivita() const { return _rec.get("S8"); }
|
|
||||||
|
|
||||||
bool agenzia_viaggi();
|
|
||||||
const TString& tipo_attivita();
|
|
||||||
bool attivita_mista() { const char a = tipo_attivita()[0]; return a == 'E'; }
|
|
||||||
const real& prorata();
|
|
||||||
void set_prorata(const real& pro);
|
|
||||||
bool update(long uprotiva, const TDate& lastreg);
|
|
||||||
|
|
||||||
TRegistro(const char* code = "", int year = 0);
|
|
||||||
virtual ~TRegistro() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class TLibro_giornale : public TRegistro
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
bool read(int year);
|
|
||||||
TDate global_last_print() const;
|
|
||||||
|
|
||||||
TLibro_giornale(int year = 0);
|
|
||||||
virtual ~TLibro_giornale() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class TCodiceIVA : private TRectype
|
|
||||||
{
|
|
||||||
public: // TObject
|
|
||||||
virtual bool ok() const { return !empty(); }
|
|
||||||
|
|
||||||
public:
|
|
||||||
bool read(const char* codice);
|
|
||||||
const TString& codice() const { return get("CODTAB"); }
|
|
||||||
real percentuale() const { return get_real("R0"); }
|
|
||||||
const TString& tipo() const { return get("S1"); }
|
|
||||||
|
|
||||||
real scorpora(real& imponibile) const; // Scorpora dall'imponibile l'imposta e la ritorna
|
|
||||||
|
|
||||||
TCodiceIVA(const char* codice = NULL);
|
|
||||||
virtual ~TCodiceIVA() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class TCausale : public TArray
|
class TCausale : public TArray
|
||||||
{
|
{
|
||||||
TRectype _rec;
|
TRectype _rec;
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#ifdef __EXTRA__
|
#ifdef __EXTRA__
|
||||||
#include "saldacon.h"
|
#include "saldacon.h"
|
||||||
#include "sc0100p.h"
|
#include "sc0100p.h"
|
||||||
#include "cglib.h"
|
|
||||||
#else
|
#else
|
||||||
#include "cg2100.h" // Campi maschere prima nota
|
#include "cg2100.h" // Campi maschere prima nota
|
||||||
#include "cg2102.h" // Applicazione di prima nota
|
#include "cg2102.h" // Applicazione di prima nota
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
#include "cg2200.h"
|
#include "cg2200.h"
|
||||||
#include "cg2101.h"
|
#include "cg2101.h"
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
|
#include "cglib02.h"
|
||||||
|
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
@ -21,9 +21,8 @@
|
|||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
#include "cglib03.h"
|
#include "cglib03.h"
|
||||||
#include "cg2103.h"
|
|
||||||
|
|
||||||
enum liste {
|
enum liste {
|
||||||
movimenti=1,
|
movimenti=1,
|
||||||
@ -574,7 +573,7 @@ void TListaMov_application::stampa_errori_rmov()
|
|||||||
bool g = FALSE;
|
bool g = FALSE;
|
||||||
char t;
|
char t;
|
||||||
|
|
||||||
TConto tc (gruppo,conto,sottoconto);
|
TBill tc (gruppo,conto,sottoconto);
|
||||||
|
|
||||||
_nr++;
|
_nr++;
|
||||||
|
|
||||||
@ -657,7 +656,7 @@ void TListaMov_application::stampa_errori_contropartita(int gruppo, int conto, l
|
|||||||
{
|
{
|
||||||
bool g = FALSE;
|
bool g = FALSE;
|
||||||
|
|
||||||
TConto tc;
|
TBill tc;
|
||||||
TRectype pc (_pcon->curr());
|
TRectype pc (_pcon->curr());
|
||||||
tc.set(gruppo,0,0l);
|
tc.set(gruppo,0,0l);
|
||||||
if (!tc.read(pc))
|
if (!tc.read(pc))
|
||||||
@ -1675,7 +1674,7 @@ bool TListaMov_application::segnala_errori_primariga()
|
|||||||
//controlli sulla contropartita
|
//controlli sulla contropartita
|
||||||
bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto, char t)
|
bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto, char t)
|
||||||
{
|
{
|
||||||
TConto tc;
|
TBill tc;
|
||||||
TRectype pc (_pcon->curr());
|
TRectype pc (_pcon->curr());
|
||||||
tc.set(gruppo,0,0l);
|
tc.set(gruppo,0,0l);
|
||||||
if (!tc.read(pc))
|
if (!tc.read(pc))
|
||||||
@ -1756,7 +1755,7 @@ bool TListaMov_application::segnala_errori_ogniriga()
|
|||||||
if (sez == 'A')
|
if (sez == 'A')
|
||||||
avere += importo;
|
avere += importo;
|
||||||
|
|
||||||
TConto tc (gruppo,conto,sottoconto);
|
TBill tc (gruppo,conto,sottoconto);
|
||||||
|
|
||||||
if (gruppoc != 0 || contoc != 0 || sottocontoc != 0l)
|
if (gruppoc != 0 || contoc != 0 || sottocontoc != 0l)
|
||||||
if (contropartita(gruppoc, contoc, sottocontoc, tipoc))
|
if (contropartita(gruppoc, contoc, sottocontoc, tipoc))
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
#include "cg3.h"
|
#include "cg3.h"
|
||||||
#include "cg3200.h"
|
#include "cg3200.h"
|
||||||
#include "cglib.h"
|
#include "cglib02.h"
|
||||||
#include "cglib04.h"
|
|
||||||
#include "cglib03.h"
|
#include "cglib03.h"
|
||||||
|
|
||||||
class TMastrini_application : public TPrintapp
|
class TMastrini_application : public TPrintapp
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
|
#include <recarray.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
@ -21,9 +22,7 @@
|
|||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <occas.h>
|
#include <occas.h>
|
||||||
|
|
||||||
#include "conto.h"
|
#include "cglib01.h"
|
||||||
#include "cglib.h"
|
|
||||||
#include "cglib04.h"
|
|
||||||
#include "cglib03.h"
|
#include "cglib03.h"
|
||||||
#include "cg2103.h"
|
#include "cg2103.h"
|
||||||
#include "cg3400a.h"
|
#include "cg3400a.h"
|
||||||
@ -49,8 +48,6 @@ HIDDEN const int AVERE198 = 174;
|
|||||||
const int SEZA132 = 108; // prima era 111
|
const int SEZA132 = 108; // prima era 111
|
||||||
const int TOTAVERE132 = 110; // prima era 112
|
const int TOTAVERE132 = 110; // prima era 112
|
||||||
|
|
||||||
HIDDEN TString256 tmp;
|
|
||||||
|
|
||||||
HIDDEN enum descr { causale, conto, operazione };
|
HIDDEN enum descr { causale, conto, operazione };
|
||||||
|
|
||||||
class TContoOccas : public TBill
|
class TContoOccas : public TBill
|
||||||
@ -142,6 +139,7 @@ private:
|
|||||||
real _importo;
|
real _importo;
|
||||||
char _sezione;
|
char _sezione;
|
||||||
int _pagine_contate; // cnt pag. stampate.
|
int _pagine_contate; // cnt pag. stampate.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TRigaiva_array _iva_array;
|
TRigaiva_array _iva_array;
|
||||||
|
|
||||||
@ -169,13 +167,14 @@ public:
|
|||||||
TString80 _ragsoc, _paiva, _comunefis, _viafis;
|
TString80 _ragsoc, _paiva, _comunefis, _viafis;
|
||||||
TString16 _provfis, _cap, _occfpi;
|
TString16 _provfis, _cap, _occfpi;
|
||||||
TString80 _cofi;
|
TString80 _cofi;
|
||||||
// TString16 _caus;
|
|
||||||
|
|
||||||
TLocalisamfile * _com, *_clifo,*_pconti,*_nditte,*_anag, *_causali;
|
TLocalisamfile * _com, *_clifo,*_pconti,*_nditte,*_anag;
|
||||||
|
|
||||||
TLocalisamfile* _attiv; // da togliere in futuro (?)
|
TLocalisamfile* _attiv; // da togliere in futuro (?)
|
||||||
TTable *_tabreg, *_tabval, *_tabes, *_tabiva;
|
TTable *_tabreg, *_tabval, *_tabes, *_tabiva;
|
||||||
|
|
||||||
|
TDecoder* _causali; // Guy: saggia aggiunta
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void preprocess_header();
|
virtual void preprocess_header();
|
||||||
virtual void preprocess_footer();
|
virtual void preprocess_footer();
|
||||||
@ -298,14 +297,7 @@ TRectype& TStampa_giornale::look_com (const char * cod)
|
|||||||
|
|
||||||
const char* TStampa_giornale::get_descr_caus (const char * codcaus)
|
const char* TStampa_giornale::get_descr_caus (const char * codcaus)
|
||||||
{
|
{
|
||||||
TLocalisamfile& caus = *_causali;
|
return _causali->decode(codcaus);
|
||||||
|
|
||||||
caus.zero();
|
|
||||||
caus.put (CAU_CODCAUS, codcaus);
|
|
||||||
if (caus.read() != NOERR) caus.zero();
|
|
||||||
|
|
||||||
tmp = caus.get(CAU_DESCR);
|
|
||||||
return tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TStampa_giornale::get_dati_ditta ()
|
void TStampa_giornale::get_dati_ditta ()
|
||||||
@ -371,8 +363,8 @@ bool TStampa_giornale::user_create()
|
|||||||
_com = new TLocalisamfile(LF_COMUNI);
|
_com = new TLocalisamfile(LF_COMUNI);
|
||||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
_clifo = new TLocalisamfile(LF_CLIFO);
|
||||||
_pconti = new TLocalisamfile(LF_PCON);
|
_pconti = new TLocalisamfile(LF_PCON);
|
||||||
_causali = new TLocalisamfile(LF_CAUSALI);
|
|
||||||
_attiv = new TLocalisamfile(LF_ATTIV); // da togliere
|
_attiv = new TLocalisamfile(LF_ATTIV); // da togliere
|
||||||
|
_causali = new TDecoder(LF_CAUSALI, "DESCR");
|
||||||
|
|
||||||
_rel = new TRelation (LF_MOV);
|
_rel = new TRelation (LF_MOV);
|
||||||
_rel->add (LF_RMOV, "NUMREG=NUMREG");
|
_rel->add (LF_RMOV, "NUMREG=NUMREG");
|
||||||
@ -398,9 +390,10 @@ bool TStampa_giornale::user_destroy()
|
|||||||
delete _RecPartoDa;
|
delete _RecPartoDa;
|
||||||
delete _RecArrivoA;
|
delete _RecArrivoA;
|
||||||
|
|
||||||
delete _com; delete _clifo; delete _causali; delete _pconti;
|
delete _com; delete _clifo; delete _pconti;
|
||||||
delete _nditte; delete _anag;
|
delete _nditte; delete _anag;
|
||||||
delete _tabreg; delete _tabes; delete _tabval; delete _tabiva;
|
delete _tabreg; delete _tabes; delete _tabval; delete _tabiva;
|
||||||
|
delete _causali;
|
||||||
|
|
||||||
delete _attiv; // da togliere in futuro
|
delete _attiv; // da togliere in futuro
|
||||||
|
|
||||||
@ -417,18 +410,12 @@ void TStampa_giornale::aggiorna_mov()
|
|||||||
const TRectype da(*_RecPartoDa);
|
const TRectype da(*_RecPartoDa);
|
||||||
const TRectype a(*_RecArrivoA);
|
const TRectype a(*_RecArrivoA);
|
||||||
_cur->setregion(da, a);
|
_cur->setregion(da, a);
|
||||||
(*_cur) = 0L;
|
|
||||||
|
|
||||||
TProgind prnd (_cur->items(), "Aggiornamento movimenti ...", FALSE, TRUE);
|
const long items = _cur->items();
|
||||||
|
TProgind prnd (items, "Aggiornamento movimenti ...", FALSE, TRUE);
|
||||||
|
|
||||||
// for (mov.read(_isgteq, _lock); mov.curr() < *_RecArrivoA && !mov.eof(); mov.next(_lock))
|
for ((*_cur) = 0L; _cur->pos() < items; ++(*_cur))
|
||||||
|
|
||||||
for ( ; _cur->pos() < _cur->items(); ++(*_cur))
|
|
||||||
{
|
{
|
||||||
#ifdef DBG
|
|
||||||
long numreg = _cur->file(LF_MOV).get_long("NUMREG");
|
|
||||||
TString datareg(_cur->file(LF_MOV).get("DATAREG"));
|
|
||||||
#endif
|
|
||||||
const bool gia_stampato = _cur->file(LF_MOV).get_bool(MOV_STAMPATO);
|
const bool gia_stampato = _cur->file(LF_MOV).get_bool(MOV_STAMPATO);
|
||||||
if (!gia_stampato)
|
if (!gia_stampato)
|
||||||
{
|
{
|
||||||
@ -437,10 +424,8 @@ void TStampa_giornale::aggiorna_mov()
|
|||||||
mov.rewrite();
|
mov.rewrite();
|
||||||
nprog++;
|
nprog++;
|
||||||
}
|
}
|
||||||
// else mov.reread(_unlock);
|
|
||||||
prnd.addstatus(1);
|
prnd.addstatus(1);
|
||||||
}
|
}
|
||||||
// mov.reread(_unlock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva)
|
int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva)
|
||||||
@ -1122,8 +1107,8 @@ void TStampa_giornale::set_rows (int file, int counter)
|
|||||||
|
|
||||||
if (caus.not_empty())
|
if (caus.not_empty())
|
||||||
{
|
{
|
||||||
TString80 desc_caus(get_descr_caus(caus));
|
const char* desc_caus = get_descr_caus(caus);
|
||||||
set_row(r+1, "@36gCausale %3s %-50s", (const char*) caus, (const char*) desc_caus);
|
set_row(r+1, "@36gCausale %3s %-50s", (const char*) caus, desc_caus);
|
||||||
if (_reg.not_empty())
|
if (_reg.not_empty())
|
||||||
set_row(r+1, " (R.IVA @b%3s@r Prot. @b%ld@r) ", (const char*)_reg,protiva);
|
set_row(r+1, " (R.IVA @b%3s@r Prot. @b%ld@r) ", (const char*)_reg,protiva);
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,9 @@
|
|||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <anagr.h>
|
#include <anagr.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
|
||||||
#include "cg3.h"
|
#include "cg3.h"
|
||||||
#include "cg3500.h"
|
#include "cg3500.h"
|
||||||
|
#include "cglib02.h"
|
||||||
|
|
||||||
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
typedef enum {stampagruppo, stampaconto, stampasottoconto, fine} tipo;
|
||||||
|
|
||||||
|
@ -12,15 +12,15 @@
|
|||||||
#include <varmask.h>
|
#include <varmask.h>
|
||||||
|
|
||||||
#include "cg3.h"
|
#include "cg3.h"
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
|
|
||||||
#include "cg3600.h"
|
#include "cg3600.h"
|
||||||
|
//#include "conto.h"
|
||||||
|
|
||||||
#include "causali.h"
|
#include <causali.h>
|
||||||
#include "mov.h"
|
#include <mov.h>
|
||||||
#include "pconti.h"
|
#include <pconti.h>
|
||||||
#include "rmov.h"
|
#include <rmov.h>
|
||||||
#include "saldi.h"
|
#include <saldi.h>
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TList
|
// TList
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib02.h"
|
||||||
|
|
||||||
struct therec {
|
struct therec {
|
||||||
char DATAREG[9];
|
char DATAREG[9];
|
||||||
|
@ -763,7 +763,7 @@ real TLiquidazione_app::versamenti_IVA(int month, const char* types, bool intr)
|
|||||||
|
|
||||||
void TLiquidazione_app::round_mille_lire(real& d)
|
void TLiquidazione_app::round_mille_lire(real& d)
|
||||||
{
|
{
|
||||||
if (d % 500.0 == ZERO) d -= 1.0;
|
if (d % real(500.0) == ZERO) d -= 1.0;
|
||||||
d.round(ROUND_MILLELIRE);
|
d.round(ROUND_MILLELIRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
#include "cg4400.h"
|
#include "cg4400.h"
|
||||||
#include "cg4400a.h"
|
#include "cg4400a.h"
|
||||||
#include "cg4400b.h"
|
#include "cg4400b.h"
|
||||||
|
#include "cglib01.h"
|
||||||
static TString256 TMP;
|
|
||||||
|
|
||||||
inline CG4400_application& app() { return (CG4400_application&)main_app(); }
|
inline CG4400_application& app() { return (CG4400_application&)main_app(); }
|
||||||
|
|
||||||
@ -2325,7 +2324,7 @@ bool CG4400_application::preprocess_page(int file, int counter)
|
|||||||
int gruppo = rmoviva.get_int("GRUPPO");
|
int gruppo = rmoviva.get_int("GRUPPO");
|
||||||
int conto = rmoviva.get_int("CONTO");
|
int conto = rmoviva.get_int("CONTO");
|
||||||
long sottoc = rmoviva.get_long("SOTTOCONTO");
|
long sottoc = rmoviva.get_long("SOTTOCONTO");
|
||||||
TConto tc (gruppo,conto,sottoc);
|
TBill tc (gruppo,conto,sottoc);
|
||||||
TString80 descr = tc.descrizione();
|
TString80 descr = tc.descrizione();
|
||||||
set_row(_r, "@144g%3d %3d %6d", gruppo, conto, sottoc);
|
set_row(_r, "@144g%3d %3d %6d", gruppo, conto, sottoc);
|
||||||
set_row(_r, "@159g%-.39s", (const char*) descr);
|
set_row(_r, "@159g%-.39s", (const char*) descr);
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include "cglib03.h"
|
#include "cglib03.h"
|
||||||
#include "cglib04.h"
|
#include "cglib04.h"
|
||||||
#include "conto.h"
|
|
||||||
|
|
||||||
enum messaggio {
|
enum messaggio {
|
||||||
no_liquidazione,
|
no_liquidazione,
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
|
||||||
#include "cg4.h"
|
#include "cg4.h"
|
||||||
#include "cg4600.h"
|
#include "cg4600.h"
|
||||||
#include "cg2101.h"
|
#include "cg2101.h"
|
||||||
#include "cglib04.h"
|
#include "cglib02.h"
|
||||||
|
|
||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <clifo.h>
|
#include <clifo.h>
|
||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib02.h"
|
||||||
#include "cg5200.h"
|
#include "cg5200.h"
|
||||||
|
|
||||||
class TRiga_array : public TArray
|
class TRiga_array : public TArray
|
||||||
@ -183,8 +183,11 @@ bool TSaldibrowse_application::fai_filtro()
|
|||||||
_saldo_gruppo = _saldo_conto = _saldo_sottoc = FALSE;
|
_saldo_gruppo = _saldo_conto = _saldo_sottoc = FALSE;
|
||||||
TMask& m = curr_mask();
|
TMask& m = curr_mask();
|
||||||
tipo = m.get(F_TIPOCF)[0];
|
tipo = m.get(F_TIPOCF)[0];
|
||||||
if (_anno != 0)
|
if (_anno != 0)
|
||||||
_annop = EsePre(_anno);
|
{
|
||||||
|
TEsercizi_contabili ese;
|
||||||
|
_annop = ese.pred(_anno);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_annop = 0;
|
_annop = 0;
|
||||||
_g = m.get_int(F_GRUPPO);
|
_g = m.get_int(F_GRUPPO);
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
#include <pagsca.h>
|
#include <pagsca.h>
|
||||||
|
|
||||||
#include "cglib04.h"
|
#include "cglib04.h"
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
#include "cg2103.h"
|
#include "cglib02.h"
|
||||||
#include "saldacon.h"
|
#include "saldacon.h"
|
||||||
|
|
||||||
#include "cg6600.h"
|
#include "cg6600.h"
|
||||||
|
@ -23,8 +23,7 @@
|
|||||||
#include <scadenze.h>
|
#include <scadenze.h>
|
||||||
#include <pagsca.h>
|
#include <pagsca.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
#include "cg2103.h"
|
|
||||||
#include "cglib04.h"
|
#include "cglib04.h"
|
||||||
#include "cg6700.h"
|
#include "cg6700.h"
|
||||||
|
|
||||||
|
@ -22,9 +22,7 @@
|
|||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
|
|
||||||
#include "cglib04.h"
|
#include "cglib04.h"
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
#include "cg2103.h"
|
|
||||||
#include "conto.h"
|
|
||||||
|
|
||||||
#include "cg6800.h"
|
#include "cg6800.h"
|
||||||
#include "cg6801.h"
|
#include "cg6801.h"
|
||||||
@ -999,7 +997,7 @@ bool TVar_mov::controllo_partita(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
char tipo = app().TipoConto(gruppo,conto);
|
char tipo = app().TipoConto(gruppo,conto);
|
||||||
|
|
||||||
TConto tc (gruppo,conto,sottoc,tipo);
|
TBill tc (gruppo,conto,sottoc,tipo);
|
||||||
|
|
||||||
TString descr = tc.descrizione();
|
TString descr = tc.descrizione();
|
||||||
f.mask().set(F_DESCRPARTITA, descr);
|
f.mask().set(F_DESCRPARTITA, descr);
|
||||||
@ -1022,7 +1020,7 @@ bool TVar_mov::controllo_contropartita(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
char tipo = app().TipoConto(gruppo,conto);
|
char tipo = app().TipoConto(gruppo,conto);
|
||||||
|
|
||||||
TConto tc (gruppo,conto,sottoc,tipo);
|
TBill tc (gruppo,conto,sottoc,tipo);
|
||||||
|
|
||||||
TString descr = tc.descrizione();
|
TString descr = tc.descrizione();
|
||||||
f.mask().set(F_DESCRCPARTITA, descr);
|
f.mask().set(F_DESCRCPARTITA, descr);
|
||||||
@ -1065,7 +1063,7 @@ bool TVar_mov::codice_clifo_hnd(TMask_field& f, KEY k)
|
|||||||
if (app()._tiporeg == 2)
|
if (app()._tiporeg == 2)
|
||||||
tipo = 'F';
|
tipo = 'F';
|
||||||
|
|
||||||
TConto tc (0,0,codcf,tipo);
|
TBill tc (0,0,codcf,tipo);
|
||||||
|
|
||||||
if (tc.find())
|
if (tc.find())
|
||||||
{
|
{
|
||||||
|
250
cg/cg6804.h
250
cg/cg6804.h
@ -1,126 +1,126 @@
|
|||||||
#ifndef __CG6804_H
|
#ifndef __CG6804_H
|
||||||
#define __CG6804_H
|
#define __CG6804_H
|
||||||
|
|
||||||
#include <mask.h>
|
#include <applicat.h>
|
||||||
#include <relation.h>
|
#include <mask.h>
|
||||||
#include <tabutil.h>
|
#include <relation.h>
|
||||||
#include <utility.h>
|
#include <tabutil.h>
|
||||||
#include <config.h>
|
#include <utility.h>
|
||||||
#include <mailbox.h>
|
#include <config.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
|
|
||||||
#include <nditte.h>
|
#include <nditte.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <rmoviva.h>
|
#include <rmoviva.h>
|
||||||
#include <pconti.h>
|
#include <pconti.h>
|
||||||
#include <occas.h>
|
#include <occas.h>
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
|
|
||||||
class TVar_sc : public TApplication
|
class TVar_sc : public TApplication
|
||||||
{
|
{
|
||||||
TIsamtempfile* _tpart, *_tscad, *_tpagsca;
|
TIsamtempfile* _tpart, *_tscad, *_tpagsca;
|
||||||
TLocalisamfile* _part, *_scad, *_pagsca;
|
TLocalisamfile* _part, *_scad, *_pagsca;
|
||||||
TTable* _tab_reg;
|
TTable* _tab_reg;
|
||||||
TRectype* _rec_part,* _rec_scad,* _rec_pagsca;
|
TRectype* _rec_part,* _rec_scad,* _rec_pagsca;
|
||||||
TTransfer_file _tras_file;
|
TTransfer_file _tras_file;
|
||||||
TMask* _msk, *_mask;
|
TMask* _msk, *_mask;
|
||||||
|
|
||||||
bool _registrato,_aperti;
|
bool _registrato,_aperti;
|
||||||
TString _control_rec,_trasf,_std,_numpart,_tmcf;
|
TString _control_rec,_trasf,_std,_numpart,_tmcf;
|
||||||
long _dittaric,_sottoc;
|
long _dittaric,_sottoc;
|
||||||
int _gruppo,_conto,_anno,_nriga,_tm_caus;
|
int _gruppo,_conto,_anno,_nriga,_tm_caus;
|
||||||
char _tipocf;
|
char _tipocf;
|
||||||
bool _dd_caus,_nd_caus,_movval;
|
bool _dd_caus,_nd_caus,_movval;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual bool menu(MENU_TAG m);
|
virtual bool menu(MENU_TAG m);
|
||||||
bool main_loop();
|
bool main_loop();
|
||||||
void apri_temp_file();
|
void apri_temp_file();
|
||||||
bool esegui_controlli();
|
bool esegui_controlli();
|
||||||
bool leggi_trasfer();
|
bool leggi_trasfer();
|
||||||
bool controlli();
|
bool controlli();
|
||||||
void leggi_record_controllo();
|
void leggi_record_controllo();
|
||||||
bool video_SC();
|
bool video_SC();
|
||||||
void registra_partita(TMask& m);
|
void registra_partita(TMask& m);
|
||||||
void registra_scadenze(TMask& m);
|
void registra_scadenze(TMask& m);
|
||||||
void registra_pagamenti(TMask& m);
|
void registra_pagamenti(TMask& m);
|
||||||
void setta_campi_maschera(TMask& m);
|
void setta_campi_maschera(TMask& m);
|
||||||
void setta_parametri_record(const TString& sigla,const TString& flag);
|
void setta_parametri_record(const TString& sigla,const TString& flag);
|
||||||
char TipoConto (int g, int c);
|
char TipoConto (int g, int c);
|
||||||
void ricerca_localita(TString& com, TString& den, TString& cap, TString& prov);
|
void ricerca_localita(TString& com, TString& den, TString& cap, TString& prov);
|
||||||
|
|
||||||
static bool a_notify(TSheet_field& s, int r, KEY k);
|
static bool a_notify(TSheet_field& s, int r, KEY k);
|
||||||
|
|
||||||
// HANDLER sulla riga di partita
|
// HANDLER sulla riga di partita
|
||||||
static bool tipocf_handler (TMask_field& f, KEY k);
|
static bool tipocf_handler (TMask_field& f, KEY k);
|
||||||
static bool codcf_handler (TMask_field& f, KEY k);
|
static bool codcf_handler (TMask_field& f, KEY k);
|
||||||
static bool rifpart_handler (TMask_field& f, KEY k);
|
static bool rifpart_handler (TMask_field& f, KEY k);
|
||||||
static bool datareg_handler (TMask_field& f, KEY k);
|
static bool datareg_handler (TMask_field& f, KEY k);
|
||||||
static bool codcaus_handler (TMask_field& f, KEY k);
|
static bool codcaus_handler (TMask_field& f, KEY k);
|
||||||
static bool datadoc_handler (TMask_field& f, KEY k);
|
static bool datadoc_handler (TMask_field& f, KEY k);
|
||||||
static bool numdoc_handler (TMask_field& f, KEY k);
|
static bool numdoc_handler (TMask_field& f, KEY k);
|
||||||
static bool contocl_handler (TMask_field& f, KEY k);
|
static bool contocl_handler (TMask_field& f, KEY k);
|
||||||
static bool tipomov_handler (TMask_field& f, KEY k);
|
static bool tipomov_handler (TMask_field& f, KEY k);
|
||||||
static bool sezione_handler (TMask_field& f, KEY k);
|
static bool sezione_handler (TMask_field& f, KEY k);
|
||||||
static bool tipopag_handler (TMask_field& f, KEY k);
|
static bool tipopag_handler (TMask_field& f, KEY k);
|
||||||
static bool datapag_handler (TMask_field& f, KEY k);
|
static bool datapag_handler (TMask_field& f, KEY k);
|
||||||
static bool codval_handler (TMask_field& f, KEY k);
|
static bool codval_handler (TMask_field& f, KEY k);
|
||||||
static bool datacam_handler (TMask_field& f, KEY k);
|
static bool datacam_handler (TMask_field& f, KEY k);
|
||||||
static bool cambio_handler (TMask_field& f, KEY k);
|
static bool cambio_handler (TMask_field& f, KEY k);
|
||||||
static bool gestione_handler (TMask_field& f, KEY k);
|
static bool gestione_handler (TMask_field& f, KEY k);
|
||||||
static bool registra_dati_comuni(TMask_field& f, KEY k);
|
static bool registra_dati_comuni(TMask_field& f, KEY k);
|
||||||
static bool elimina_partita (TMask_field& f, KEY k);
|
static bool elimina_partita (TMask_field& f, KEY k);
|
||||||
|
|
||||||
// HANDLER sulla riga di scadenza
|
// HANDLER sulla riga di scadenza
|
||||||
static bool nrata_handler (TMask_field& f, KEY k);
|
static bool nrata_handler (TMask_field& f, KEY k);
|
||||||
static bool codpag_handler (TMask_field& f, KEY k);
|
static bool codpag_handler (TMask_field& f, KEY k);
|
||||||
static bool tpscad_handler (TMask_field& f, KEY k);
|
static bool tpscad_handler (TMask_field& f, KEY k);
|
||||||
static bool ultclass_handler (TMask_field& f, KEY k);
|
static bool ultclass_handler (TMask_field& f, KEY k);
|
||||||
static bool datascad_handler (TMask_field& f, KEY k);
|
static bool datascad_handler (TMask_field& f, KEY k);
|
||||||
static bool banca_handler (TMask_field& f, KEY k);
|
static bool banca_handler (TMask_field& f, KEY k);
|
||||||
static bool codag_handler (TMask_field& f, KEY k);
|
static bool codag_handler (TMask_field& f, KEY k);
|
||||||
static bool datasoll_handler (TMask_field& f, KEY k);
|
static bool datasoll_handler (TMask_field& f, KEY k);
|
||||||
static bool importo_handler (TMask_field& f, KEY k);
|
static bool importo_handler (TMask_field& f, KEY k);
|
||||||
static bool impval_handler (TMask_field& f, KEY k);
|
static bool impval_handler (TMask_field& f, KEY k);
|
||||||
static bool elimina_scadenza (TMask_field& f, KEY k);
|
static bool elimina_scadenza (TMask_field& f, KEY k);
|
||||||
|
|
||||||
// HANDLER sulla riga di pagamento
|
// HANDLER sulla riga di pagamento
|
||||||
static bool rifpartita_handler (TMask_field& f, KEY k);
|
static bool rifpartita_handler (TMask_field& f, KEY k);
|
||||||
static bool accsal_handler (TMask_field& f, KEY k);
|
static bool accsal_handler (TMask_field& f, KEY k);
|
||||||
static bool passat_handler (TMask_field& f, KEY k);
|
static bool passat_handler (TMask_field& f, KEY k);
|
||||||
static bool impvalp_handler (TMask_field& f, KEY k);
|
static bool impvalp_handler (TMask_field& f, KEY k);
|
||||||
static bool abbuoni_handler (TMask_field& f, KEY k);
|
static bool abbuoni_handler (TMask_field& f, KEY k);
|
||||||
static bool contropartita_handler(TMask_field& f, KEY k);
|
static bool contropartita_handler(TMask_field& f, KEY k);
|
||||||
static bool elimina_pagamenti (TMask_field& f, KEY k);
|
static bool elimina_pagamenti (TMask_field& f, KEY k);
|
||||||
static bool sezione_abb_handler (TMask_field& f, KEY k);
|
static bool sezione_abb_handler (TMask_field& f, KEY k);
|
||||||
static bool sezione_dc_handler (TMask_field& f, KEY k);
|
static bool sezione_dc_handler (TMask_field& f, KEY k);
|
||||||
static bool diffcambio_handler (TMask_field& f, KEY k);
|
static bool diffcambio_handler (TMask_field& f, KEY k);
|
||||||
static bool ritenute_handler (TMask_field& f, KEY k);
|
static bool ritenute_handler (TMask_field& f, KEY k);
|
||||||
|
|
||||||
bool descr_conto(const TString&,int,int,long,TString&);
|
bool descr_conto(const TString&,int,int,long,TString&);
|
||||||
bool descr_caus (const TString&,TString&);
|
bool descr_caus (const TString&,TString&);
|
||||||
bool descr_contocl(int,int,TString&);
|
bool descr_contocl(int,int,TString&);
|
||||||
bool tipo_contocl(int,int,TString&);
|
bool tipo_contocl(int,int,TString&);
|
||||||
bool codvaluta (const TString& codval);
|
bool codvaluta (const TString& codval);
|
||||||
void setta_mask_scad(char t,int g,int c,long s,int anno,const TString& np,int nr,TMask& m);
|
void setta_mask_scad(char t,int g,int c,long s,int anno,const TString& np,int nr,TMask& m);
|
||||||
void setta_mask_pagsca(char t,int g,int c,long s,int anno,const TString& np,int nr,TMask& m);
|
void setta_mask_pagsca(char t,int g,int c,long s,int anno,const TString& np,int nr,TMask& m);
|
||||||
char sezione(char tipo,int g,int c,long s,int anno,const TString& npart,int nriga,TString& codval,TMask& m);
|
char sezione(char tipo,int g,int c,long s,int anno,const TString& npart,int nriga,TString& codval,TMask& m);
|
||||||
int tipo_movimento(char tipo,int g,int c,long s,int anno,const TString& npart,int nriga,TMask& m);
|
int tipo_movimento(char tipo,int g,int c,long s,int anno,const TString& npart,int nriga,TMask& m);
|
||||||
void descr_condpag(const TString& codpag,int tipopag,const TString& ultclass,TString& d_condpag);
|
void descr_condpag(const TString& codpag,int tipopag,const TString& ultclass,TString& d_condpag);
|
||||||
bool record_partite(char tipo,int g,int c,long s,int anno,TString& npart,int nrigp);
|
bool record_partite(char tipo,int g,int c,long s,int anno,TString& npart,int nrigp);
|
||||||
bool record_scadenze(char tipo,int g,int c,long s,int anno,TString& npart,int nrigp,int nrata);
|
bool record_scadenze(char tipo,int g,int c,long s,int anno,TString& npart,int nrigp,int nrata);
|
||||||
void sgancia_pagamenti(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata);
|
void sgancia_pagamenti(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata);
|
||||||
bool cancella_partita(TMask_field& f);
|
bool cancella_partita(TMask_field& f);
|
||||||
bool cancella_scadenza(TMask_field& f);
|
bool cancella_scadenza(TMask_field& f);
|
||||||
bool cancella_pagamenti(TMask_field& f);
|
bool cancella_pagamenti(TMask_field& f);
|
||||||
bool controlla_abbuoni_diffcam(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata);
|
bool controlla_abbuoni_diffcam(char tipo,int g,int c,long s,int anno,TString& npart,int nriga,int nrata);
|
||||||
|
|
||||||
TVar_sc();
|
TVar_sc();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__CG6804_H
|
#endif //__CG6804_H
|
@ -1,39 +1,41 @@
|
|||||||
#include "cg6905.h"
|
#include <prefix.h>
|
||||||
|
|
||||||
bool TCanc_file_invio::create()
|
#include "cg6905.h"
|
||||||
{
|
|
||||||
TApplication::create();
|
bool TCanc_file_invio::create()
|
||||||
|
{
|
||||||
dispatch_e_menu (BAR_ITEM(1));
|
TApplication::create();
|
||||||
|
|
||||||
return TRUE;
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
}
|
|
||||||
|
return TRUE;
|
||||||
bool TCanc_file_invio::destroy()
|
}
|
||||||
{
|
|
||||||
return TApplication::destroy();
|
bool TCanc_file_invio::destroy()
|
||||||
}
|
{
|
||||||
|
return TApplication::destroy();
|
||||||
bool TCanc_file_invio::set()
|
}
|
||||||
{
|
|
||||||
TString marker;
|
bool TCanc_file_invio::set()
|
||||||
|
{
|
||||||
_tras_file.remove_all(FALSE);
|
TString marker;
|
||||||
|
|
||||||
marker = firm2dir(0);
|
_tras_file.remove_all(FALSE);
|
||||||
marker << "\\marker";
|
|
||||||
|
marker = firm2dir(0);
|
||||||
fremove(marker);
|
marker << "\\marker";
|
||||||
|
|
||||||
message_box("Eliminazione file di lavoro dell' invio terminata");
|
fremove(marker);
|
||||||
|
|
||||||
return FALSE;
|
message_box("Eliminazione file di lavoro dell' invio terminata");
|
||||||
}
|
|
||||||
|
return FALSE;
|
||||||
bool TCanc_file_invio::menu(MENU_TAG m)
|
}
|
||||||
{
|
|
||||||
if (m == BAR_ITEM(1))
|
bool TCanc_file_invio::menu(MENU_TAG m)
|
||||||
return set();
|
{
|
||||||
|
if (m == BAR_ITEM(1))
|
||||||
return FALSE;
|
return set();
|
||||||
}
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
226
cg/cglib.h
226
cg/cglib.h
@ -1,226 +0,0 @@
|
|||||||
#ifndef __CGLIB_H
|
|
||||||
#define __CGLIB_H
|
|
||||||
|
|
||||||
#ifndef __RECARRAY_H
|
|
||||||
#include <recarray.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CONTO_H
|
|
||||||
#include "conto.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CG2103_H
|
|
||||||
#include "cg2103.h" // per TCausale
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class TCaus : public TCausale
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
TRectype _rec;
|
|
||||||
|
|
||||||
public:
|
|
||||||
bool chiusura() const;
|
|
||||||
bool apertura() const;
|
|
||||||
virtual bool read(const char* cod);
|
|
||||||
|
|
||||||
TCaus(const char* cod);
|
|
||||||
~TCaus() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// TSaldi_list
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class TSaldi_list : public TAssoc_array
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TSaldi_list (int g, int c, int aec, int aep=0);
|
|
||||||
TRectype* saldi() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum tipobil { DataLimite=1, UltimaImmissione };
|
|
||||||
enum tiposal { normale, apertura, chiusura };
|
|
||||||
|
|
||||||
const int EsePre(const int EseCorr);
|
|
||||||
|
|
||||||
class TSaldo
|
|
||||||
{
|
|
||||||
TLocalisamfile _saldi;
|
|
||||||
|
|
||||||
real _saldo, _saldo_iniziale, _saldoiniziale; // oh my GOSH
|
|
||||||
real _prg_dare, _prg_avere;
|
|
||||||
int _indbil;
|
|
||||||
int _annoes;
|
|
||||||
TDate _inizioEs, _fineEs;
|
|
||||||
TString16 _codcaus;
|
|
||||||
TDate _datareg;
|
|
||||||
TDate _datacomp;
|
|
||||||
TString _provv;
|
|
||||||
|
|
||||||
bool _movimentato;
|
|
||||||
bool _significativo;
|
|
||||||
bool _rec_presente_ec;
|
|
||||||
bool _rec_presente_ep;
|
|
||||||
bool _prec;
|
|
||||||
|
|
||||||
TDecoder _causali_apertura;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void InFinEs(int);
|
|
||||||
bool leggi_mov(long numreg); // Leggi testata
|
|
||||||
real calcola_saldo_iniziale(int g, int c, long s, int indbil);
|
|
||||||
bool prg_saldo(int, TConto&, real&, real&, bool);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
bool movimentato() const { return _movimentato; }
|
|
||||||
bool significativo() const { return _significativo; }
|
|
||||||
bool esiste_saldo() const { return _rec_presente_ec || _rec_presente_ep; }
|
|
||||||
bool esiste_saldo_ep() const { return _rec_presente_ep; }
|
|
||||||
|
|
||||||
int annoes () const { return _annoes; }
|
|
||||||
void set_annoes (int anno) { _annoes = anno; }
|
|
||||||
|
|
||||||
bool causale_mov(long, const TDate&, const TDate&, TString&);
|
|
||||||
const char* causale_chiusura_es();
|
|
||||||
const char* causale_apertura_es();
|
|
||||||
|
|
||||||
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil,int prov,bool saldo_chiusura = TRUE);
|
|
||||||
bool ultima_immissione_verifica(int anno,int g,int c,long s,int indbil,int prov);
|
|
||||||
bool data_limite_bilancio(int,int,int,long,const TDate&,const TDate&,int,int);
|
|
||||||
|
|
||||||
bool ricerca_progr_prec(int, int, int, long);
|
|
||||||
|
|
||||||
real saldofin_esprec(int,int,int,long,bool saldo_chiusura = FALSE,bool mov_prec = FALSE);
|
|
||||||
bool prg_attuali(int i,TConto& c, real& p1, real& p2)
|
|
||||||
{ return prg_saldo(i, c, p1, p2, FALSE); }
|
|
||||||
bool prg_mov_eliminati(int i, TConto& c, real& p1, real& p2)
|
|
||||||
{ return prg_saldo(i, c, p1, p2, TRUE); }
|
|
||||||
|
|
||||||
const real& saldo() const { return _saldo;}
|
|
||||||
const real& saldoini() const { return _saldo_iniziale;}
|
|
||||||
const real& saldoinisusaldi() const { return _saldoiniziale;}
|
|
||||||
const real& prgdare() const { return _prg_dare;}
|
|
||||||
const real& prgavere() const { return _prg_avere;}
|
|
||||||
const bool flagprec() { return _prec; }
|
|
||||||
|
|
||||||
// bool prg_attuali(int i,TConto& c, int d, real& p1, real& p2);
|
|
||||||
// bool prg_mov_eliminati(int i,TConto& c,int d, real& p1, real& p2);
|
|
||||||
|
|
||||||
TSaldo();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TTab_conti : public TAssoc_array
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void aggiorna_conto(const TBill& tc, int anno_es, const TImporto& importo,
|
|
||||||
tiposal movap, bool provv, bool somma, bool movimentato, bool scaricato);
|
|
||||||
|
|
||||||
TConto* add(const TBill& c, int anno, bool provv = FALSE);
|
|
||||||
TConto* find(const TBill& c, int anno, bool provv = FALSE);
|
|
||||||
void remove(const TBill& c, int anno, bool provv = FALSE);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class TSaldo_agg : public TObject
|
|
||||||
{
|
|
||||||
TTab_conti _tab_conti;
|
|
||||||
tiposal _movap; // se e' mov. d'apertura (aggiorno SALDO e FLAGSALINI in saldi)
|
|
||||||
bool _provv;
|
|
||||||
int _anno_es; // anno esercizio
|
|
||||||
TDate _data_ulmov; // data ultimo movimento
|
|
||||||
long _num_ulmov; // numero ultimo movimento
|
|
||||||
TRectype* _rec; // record corrente sui saldi
|
|
||||||
bool _movimentato; // di default e' FALSE; viene usato a TRUE solo quando voglio
|
|
||||||
// che un conto sia movimentato sui saldi anche se progressivi
|
|
||||||
// e saldo iniziale non sono significativi. Usato dalla Chiusura/Apertura conti
|
|
||||||
public:
|
|
||||||
void clear_saldi(int year);
|
|
||||||
void registra();
|
|
||||||
void aggiorna (const TBill& tc, const TImporto& importo, bool somma=TRUE, bool scaricato = FALSE);
|
|
||||||
void aggiorna (int gruppo, int conto, long sottoconto,
|
|
||||||
const real& importo, char sezione, bool somma=TRUE, bool scaricato = FALSE);
|
|
||||||
|
|
||||||
TConto* find(const TBill& c, int anno) { return _tab_conti.find(c, anno); }
|
|
||||||
|
|
||||||
void set_anno_es(int anno) { _anno_es = anno; }
|
|
||||||
int anno_es() const { return _anno_es; }
|
|
||||||
|
|
||||||
void set_tipo_saldo (tiposal movap) { _movap = movap; }
|
|
||||||
tiposal tipo_saldo() const { return _movap; }
|
|
||||||
|
|
||||||
void set_movprovv (bool p) { _provv = p; }
|
|
||||||
bool movprovv() const { return _provv; }
|
|
||||||
|
|
||||||
void set_movimentato (bool movimentato) { _movimentato = movimentato; }
|
|
||||||
bool movimentato() const { return _movimentato; }
|
|
||||||
|
|
||||||
void set_data_ulmov (const TDate& data) { _data_ulmov = data; }
|
|
||||||
const TDate& data_ulmov() const { return _data_ulmov; }
|
|
||||||
|
|
||||||
void set_num_ulmov (long num) { _num_ulmov = num; }
|
|
||||||
long num_ulmov() const { return _num_ulmov; }
|
|
||||||
|
|
||||||
void reset(); // pulisce l'array dei conti
|
|
||||||
int items() const { return _tab_conti.items();}
|
|
||||||
|
|
||||||
TSaldo_agg();
|
|
||||||
virtual ~TSaldo_agg() { }
|
|
||||||
};
|
|
||||||
|
|
||||||
class TEsercizio : public TSortable
|
|
||||||
{
|
|
||||||
int _codice;
|
|
||||||
TDate _inizio, _fine, _scarico, _chiusura, _chiusura_mag;
|
|
||||||
|
|
||||||
protected: // TSortable
|
|
||||||
int compare(const TSortable& s) const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
int codice() const { return _codice; }
|
|
||||||
const TDate& inizio() const { return _inizio; }
|
|
||||||
const TDate& fine() const { return _fine; }
|
|
||||||
const TDate& scarico() const { return _scarico; }
|
|
||||||
const TDate& chiusura() const { return _chiusura; }
|
|
||||||
const TDate& chiusura_mag() const { return _chiusura_mag; }
|
|
||||||
|
|
||||||
TEsercizio(const TRectype& rec);
|
|
||||||
virtual ~TEsercizio() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class TEsercizi_contabili : public TObject
|
|
||||||
{
|
|
||||||
static TArray _esercizi;
|
|
||||||
static long _firm;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
static void check();
|
|
||||||
|
|
||||||
const TEsercizio& esc(int i) const
|
|
||||||
{ return (const TEsercizio&)_esercizi[i]; }
|
|
||||||
|
|
||||||
int date2index(const TDate& d) const;
|
|
||||||
int esc2index(int codice) const;
|
|
||||||
int items() const { return _esercizi.items(); }
|
|
||||||
|
|
||||||
public:
|
|
||||||
static void update();
|
|
||||||
|
|
||||||
const TEsercizio& esercizio(int codice) const;
|
|
||||||
const TEsercizio& operator [](int codice) const { return esercizio(codice); }
|
|
||||||
|
|
||||||
int date2esc(const TDate& date) const;
|
|
||||||
int pred(int codice) const;
|
|
||||||
int next(int codice) const;
|
|
||||||
int first() const;
|
|
||||||
int last() const;
|
|
||||||
bool exist(int codice) const;
|
|
||||||
|
|
||||||
TEsercizi_contabili();
|
|
||||||
virtual ~TEsercizi_contabili() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
1225
cg/cglib01.cpp
1225
cg/cglib01.cpp
File diff suppressed because it is too large
Load Diff
222
cg/cglib01.h
Executable file
222
cg/cglib01.h
Executable file
@ -0,0 +1,222 @@
|
|||||||
|
#ifndef __CGLIB01_H
|
||||||
|
#define __CGLIB01_H
|
||||||
|
|
||||||
|
#ifndef __ISAM_H
|
||||||
|
#include <isam.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Gestione esercizi contabili, registri e libro giornale
|
||||||
|
|
||||||
|
class TEsercizio : public TSortable
|
||||||
|
{
|
||||||
|
int _codice;
|
||||||
|
TDate _inizio, _fine, _scarico, _chiusura, _chiusura_mag;
|
||||||
|
|
||||||
|
protected: // TSortable
|
||||||
|
int compare(const TSortable& s) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
int codice() const { return _codice; }
|
||||||
|
const TDate& inizio() const { return _inizio; }
|
||||||
|
const TDate& fine() const { return _fine; }
|
||||||
|
const TDate& scarico() const { return _scarico; }
|
||||||
|
const TDate& chiusura() const { return _chiusura; }
|
||||||
|
const TDate& chiusura_mag() const { return _chiusura_mag; }
|
||||||
|
|
||||||
|
TEsercizio(const TRectype& rec);
|
||||||
|
virtual ~TEsercizio() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class TEsercizi_contabili : public TObject
|
||||||
|
{
|
||||||
|
static TArray _esercizi;
|
||||||
|
static long _firm;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static void check();
|
||||||
|
|
||||||
|
const TEsercizio& esc(int i) const
|
||||||
|
{ return (const TEsercizio&)_esercizi[i]; }
|
||||||
|
|
||||||
|
int date2index(const TDate& d) const;
|
||||||
|
int esc2index(int codice) const;
|
||||||
|
int items() const { return _esercizi.items(); }
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void update();
|
||||||
|
|
||||||
|
const TEsercizio& esercizio(int codice) const;
|
||||||
|
const TEsercizio& operator [](int codice) const { return esercizio(codice); }
|
||||||
|
|
||||||
|
int date2esc(const TDate& date) const;
|
||||||
|
int pred(int codice) const;
|
||||||
|
int next(int codice) const;
|
||||||
|
int first() const;
|
||||||
|
int last() const;
|
||||||
|
bool exist(int codice) const;
|
||||||
|
|
||||||
|
TEsercizi_contabili();
|
||||||
|
virtual ~TEsercizi_contabili() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
enum TipoIVA
|
||||||
|
{
|
||||||
|
iva_errata = -1,
|
||||||
|
nessuna_iva = 0,
|
||||||
|
iva_vendite = 1,
|
||||||
|
iva_acquisti = 2,
|
||||||
|
libro_giornale = 5,
|
||||||
|
iva_generica = 9
|
||||||
|
};
|
||||||
|
|
||||||
|
const char* iva2name(TipoIVA i);
|
||||||
|
|
||||||
|
class TRegistro : public TObject
|
||||||
|
{
|
||||||
|
bool read_att();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
TRectype _rec, _att;
|
||||||
|
real _prorata;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool read(const char* code, int year);
|
||||||
|
bool reread();
|
||||||
|
TRegistro& operator =(const TRegistro& r);
|
||||||
|
|
||||||
|
virtual bool ok() const { return !_rec.empty(); }
|
||||||
|
|
||||||
|
int tipo() const;
|
||||||
|
TipoIVA iva() const;
|
||||||
|
bool corrispettivi() const;
|
||||||
|
bool sospeso() const { return _rec.get_bool("B1");}
|
||||||
|
const TString& name() const;
|
||||||
|
int year() const;
|
||||||
|
TDate last_reg() const { return _rec.get_date("D2"); }
|
||||||
|
TDate last_print() const { return _rec.get_date("D3"); }
|
||||||
|
long mese_stampa_ultima_liq() const { return _rec.get_long("I4"); }
|
||||||
|
long protocol() const { return _rec.get_long("I5"); }
|
||||||
|
const TString& attivita() const { return _rec.get("S8"); }
|
||||||
|
|
||||||
|
bool agenzia_viaggi();
|
||||||
|
const TString& tipo_attivita();
|
||||||
|
bool attivita_mista() { const char a = tipo_attivita()[0]; return a == 'E'; }
|
||||||
|
const real& prorata();
|
||||||
|
void set_prorata(const real& pro);
|
||||||
|
bool update(long uprotiva, const TDate& lastreg);
|
||||||
|
|
||||||
|
TRegistro(const char* code = "", int year = 0);
|
||||||
|
virtual ~TRegistro() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class TLibro_giornale : public TRegistro
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool read(int year);
|
||||||
|
TDate global_last_print() const;
|
||||||
|
|
||||||
|
TLibro_giornale(int year = 0);
|
||||||
|
virtual ~TLibro_giornale() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class TCodiceIVA : private TRectype
|
||||||
|
{
|
||||||
|
public: // TObject
|
||||||
|
virtual bool ok() const { return !empty(); }
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool read(const char* codice);
|
||||||
|
const TString& codice() const { return get("CODTAB"); }
|
||||||
|
real percentuale() const { return get_real("R0"); }
|
||||||
|
const TString& tipo() const { return get("S1"); }
|
||||||
|
|
||||||
|
real scorpora(real& imponibile) const; // Scorpora dall'imponibile l'imposta e la ritorna
|
||||||
|
|
||||||
|
TCodiceIVA(const char* codice = NULL);
|
||||||
|
virtual ~TCodiceIVA() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef __MASK_H
|
||||||
|
class TMask;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class TBill : public TSortable
|
||||||
|
{
|
||||||
|
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
||||||
|
int _gruppo, _conto;
|
||||||
|
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
||||||
|
TString* _descrizione; // Vuota fino alla chiamata di describe
|
||||||
|
int _tipo_cr; // Tipo costo/ricavo
|
||||||
|
bool _sospeso;
|
||||||
|
char _sezione;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual int compare(const TSortable& s) const;
|
||||||
|
virtual const char* class_name() const { return "Conto"; }
|
||||||
|
|
||||||
|
void set_description(const char* d);
|
||||||
|
const TBill& copy(const TBill& b);
|
||||||
|
const char* field_name(int n, bool contro) const;
|
||||||
|
|
||||||
|
public: // TObject
|
||||||
|
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
|
||||||
|
|
||||||
|
public:
|
||||||
|
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
|
||||||
|
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(NULL),
|
||||||
|
_sezione(' '), _sospeso(FALSE)
|
||||||
|
{ set(g,c,s,t,d,r);}
|
||||||
|
|
||||||
|
TBill(TToken_string& tgcsd, int from, int mode = 0)
|
||||||
|
: _descrizione(NULL)
|
||||||
|
{ get(tgcsd, from, mode); }
|
||||||
|
|
||||||
|
TBill(const TRectype& rec, bool contro = FALSE)
|
||||||
|
: _descrizione(NULL)
|
||||||
|
{ get(rec, contro); }
|
||||||
|
|
||||||
|
TBill(const TBill& b)
|
||||||
|
: _descrizione(NULL)
|
||||||
|
{ copy(b); }
|
||||||
|
|
||||||
|
virtual ~TBill();
|
||||||
|
|
||||||
|
const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ',
|
||||||
|
const char* d = NULL, int r = -1);
|
||||||
|
|
||||||
|
const TBill& get(TToken_string& ts, int from, int mode = 0);
|
||||||
|
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
|
||||||
|
const TBill& operator=(const TBill& b) { return copy(b); }
|
||||||
|
|
||||||
|
bool empty() const { return _gruppo==0 && _conto==0 && _sottoconto == 0; }
|
||||||
|
|
||||||
|
char tipo() const { return _tipo; }
|
||||||
|
int gruppo() const { return _gruppo; }
|
||||||
|
int conto() const { return _conto; }
|
||||||
|
long sottoconto() const { return _sottoconto; }
|
||||||
|
long codclifo() const { return _sottoconto; }
|
||||||
|
long& codclifo() { return _sottoconto; }
|
||||||
|
|
||||||
|
bool find();
|
||||||
|
const TString& descrizione() const;
|
||||||
|
int tipo_cr() const;
|
||||||
|
void tipo_cr(int tcr) { _tipo_cr = tcr; }
|
||||||
|
|
||||||
|
int tipo_att();
|
||||||
|
bool read(TRectype& r);
|
||||||
|
bool sospeso() const { return _sospeso; } // _sospeso e' letto nella read()
|
||||||
|
char sezione() const { return _sezione; }
|
||||||
|
|
||||||
|
void put(TRectype& r, bool contro = FALSE) const;
|
||||||
|
bool get(const TRectype& r, bool contro = FALSE);
|
||||||
|
|
||||||
|
void set(TMask& m, short g, short c, short s, short t = 0, short d = 0) const;
|
||||||
|
void get(const TMask& m, short g, short c, short s, short t = 0, short d = 0);
|
||||||
|
|
||||||
|
const char* string(int mode = 0) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
641
cg/cglib02.cpp
641
cg/cglib02.cpp
@ -7,14 +7,527 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <prefix.h>
|
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
#include <xvtility.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib01.h"
|
||||||
|
#include "cglib02.h"
|
||||||
|
|
||||||
|
#include <causali.h>
|
||||||
|
#include <mov.h>
|
||||||
|
#include <rmov.h>
|
||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TSaldi_list
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//
|
||||||
|
// Cerca l'esercizio precedente di EseCorr
|
||||||
|
// Se EseCorr e' gia' il primo ritorna 0
|
||||||
|
//
|
||||||
|
HIDDEN int EsePre(const int EseCorr)
|
||||||
|
{
|
||||||
|
TEsercizi_contabili esc;
|
||||||
|
return esc.pred(EseCorr);
|
||||||
|
}
|
||||||
|
|
||||||
|
// aep e' l'esercizio precedente
|
||||||
|
TSaldi_list::TSaldi_list(int gr, int co, int aec, int aep_par)
|
||||||
|
{
|
||||||
|
TLocalisamfile cf(LF_SALDI);
|
||||||
|
bool force;
|
||||||
|
TString16 key;
|
||||||
|
int aep = aep_par;
|
||||||
|
|
||||||
|
destroy();
|
||||||
|
cf.zero();
|
||||||
|
|
||||||
|
// Se non passo l'anno precedente lo devo comunque calcolare
|
||||||
|
if (aep_par == 0)
|
||||||
|
aep = EsePre(aec);
|
||||||
|
|
||||||
|
cf.setkey(2);
|
||||||
|
cf.put(SLD_GRUPPO,gr);
|
||||||
|
cf.put(SLD_CONTO,co);
|
||||||
|
|
||||||
|
for (cf.read(_isgteq);!cf.eof();cf.next())
|
||||||
|
{
|
||||||
|
if (!cf.get_bool(SLD_FLSCA))
|
||||||
|
{
|
||||||
|
const int ae = cf.get_int(SLD_ANNOES);
|
||||||
|
const int g = cf.get_int(SLD_GRUPPO);
|
||||||
|
const int c = cf.get_int(SLD_CONTO);
|
||||||
|
const long s = cf.get_long(SLD_SOTTOCONTO);
|
||||||
|
|
||||||
|
if (g != gr || c != co) break;
|
||||||
|
if (ae != aec && ae != aep) continue;
|
||||||
|
|
||||||
|
TRectype r(cf.curr());
|
||||||
|
key.format("%3d%3d%6ld", g, c, s);
|
||||||
|
|
||||||
|
// Se avevo chiesto anche l'es. prec. puo' darsi che l'abbia gia' trovato
|
||||||
|
force = !aep_par;
|
||||||
|
add((const char*) key, r, force);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TRectype* TSaldi_list::saldi() const
|
||||||
|
{
|
||||||
|
TObject* o = ((TAssoc_array*)this)->get();
|
||||||
|
return (TRectype*)o;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TSaldo
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
TSaldo::TSaldo() : _saldi(LF_SALDI), _saldoiniziale(ZERO), _saldo_iniziale(ZERO),
|
||||||
|
_prg_dare(ZERO), _prg_avere(ZERO), _saldo(ZERO), _annoes(0),
|
||||||
|
_indbil(0), _prec(FALSE), _movimentato(FALSE), _significativo(FALSE),
|
||||||
|
_rec_presente_ec(FALSE), _rec_presente_ep(FALSE),
|
||||||
|
_causali_apertura(LF_CAUSALI, CAU_MOVAP)
|
||||||
|
|
||||||
|
{}
|
||||||
|
|
||||||
|
real TSaldo::saldofin_esprec(int annoes, int g, int c, long s, bool saldo_chiusura, bool mov_prec)
|
||||||
|
{
|
||||||
|
const int annoesprec = EsePre(annoes);
|
||||||
|
_significativo = FALSE;
|
||||||
|
|
||||||
|
if (!ricerca_progr_prec(annoesprec, g, c, s)) // non ci sono esercizi prima del primo
|
||||||
|
return ZERO;
|
||||||
|
|
||||||
|
const char flag = _saldi.get(SLD_FLAGSALINI)[0];
|
||||||
|
const real saldo = _saldi.get_real(SLD_SALDO);
|
||||||
|
const real pdare = _saldi.get_real(SLD_PDARE);
|
||||||
|
const real pavere = _saldi.get_real(SLD_PAVERE);
|
||||||
|
const real pdarepro = _saldi.get_real(SLD_PDAREPRO);
|
||||||
|
const real paverepro = _saldi.get_real(SLD_PAVEREPRO);
|
||||||
|
const char flagsf = _saldi.get_char(SLD_FLAGSALFIN);
|
||||||
|
const real saldosf = _saldi.get_real(SLD_SALDOFIN);
|
||||||
|
|
||||||
|
real tot = pdare-pavere;
|
||||||
|
|
||||||
|
if (flag == 'D') tot += saldo;
|
||||||
|
else tot -= saldo;
|
||||||
|
|
||||||
|
if (saldo_chiusura) // W96SALDI del 18-07-96
|
||||||
|
{ // Ho aggiunto il flag saldo_chiusura con valore di
|
||||||
|
if (flagsf == 'D') // default a FALSE, perche' il saldo finale dell' esercizio
|
||||||
|
tot += saldosf; // precedente va considerato solamente nel calcolo dei
|
||||||
|
else // progressivi precedenti nella stampa mastrini,
|
||||||
|
tot -= saldosf; // che e' l'unico programma ad usare la funzione
|
||||||
|
} // passandogli come flag saldo_chiusura il valore TRUE.
|
||||||
|
|
||||||
|
_significativo = (tot != 0);
|
||||||
|
return tot;
|
||||||
|
}
|
||||||
|
|
||||||
|
//richiamata nel bilancio a sez.contr per data limite
|
||||||
|
//in realta' calcola il saldo finale es.prec
|
||||||
|
real TSaldo::calcola_saldo_iniziale(int g,int c,long s,int indbil)
|
||||||
|
{
|
||||||
|
real saldoini;
|
||||||
|
_significativo = TRUE;
|
||||||
|
|
||||||
|
_saldi.zero();
|
||||||
|
_saldi.put(SLD_GRUPPO,g);
|
||||||
|
_saldi.put(SLD_CONTO,c);
|
||||||
|
_saldi.put(SLD_SOTTOCONTO,s);
|
||||||
|
_saldi.put(SLD_ANNOES,_annoes);
|
||||||
|
_saldi.put(SLD_FLSCA,"");
|
||||||
|
|
||||||
|
if (_rec_presente_ec = (_saldi.read() == NOERR))
|
||||||
|
saldoini = _saldi.get_real(SLD_SALDO);
|
||||||
|
|
||||||
|
_significativo = _rec_presente_ec && saldoini != ZERO;
|
||||||
|
|
||||||
|
if (saldoini != ZERO) //non va considerato!!! Vedi appunti
|
||||||
|
_saldo_iniziale = ZERO;
|
||||||
|
|
||||||
|
if (saldoini == ZERO)
|
||||||
|
{
|
||||||
|
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||||
|
{
|
||||||
|
_prec = TRUE;
|
||||||
|
saldoini = saldofin_esprec(_annoes, g, c, s);
|
||||||
|
}
|
||||||
|
_saldo_iniziale = saldoini;
|
||||||
|
}
|
||||||
|
return _saldo_iniziale;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* TSaldo::causale_chiusura_es()
|
||||||
|
{
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
return conf.get("CoCaCh");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* TSaldo::causale_apertura_es()
|
||||||
|
{
|
||||||
|
TConfig conf(CONFIG_DITTA);
|
||||||
|
return conf.get("CoCaAp");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TSaldo::leggi_mov(long nr)
|
||||||
|
{
|
||||||
|
TLocalisamfile mov(LF_MOV);
|
||||||
|
// mov.zero();
|
||||||
|
mov.put (MOV_NUMREG, nr);
|
||||||
|
const bool ok = mov.read() == NOERR;
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
_codcaus = mov.get(MOV_CODCAUS);
|
||||||
|
_datareg = mov.get(MOV_DATAREG);
|
||||||
|
_provv = mov.get(MOV_PROVVIS); // _provv.trim();
|
||||||
|
_datacomp = mov.get(MOV_DATACOMP);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
NFCHECK("Testata assente: %ld", nr);
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
//per bilancio scalare (ovvero a sezioni contrapposte) per data limite
|
||||||
|
bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDate& data_inf,
|
||||||
|
const TDate& data_sup, int indbil, int stp_prov)
|
||||||
|
{
|
||||||
|
TLocalisamfile rmov(LF_RMOV);
|
||||||
|
|
||||||
|
_saldo_iniziale = ZERO;
|
||||||
|
_saldo = ZERO;
|
||||||
|
_movimentato = FALSE;
|
||||||
|
_rec_presente_ep = FALSE;
|
||||||
|
_rec_presente_ec = FALSE;
|
||||||
|
_prec = FALSE;
|
||||||
|
|
||||||
|
rmov.setkey(2);
|
||||||
|
rmov.zero();
|
||||||
|
rmov.put(RMV_GRUPPO,g);
|
||||||
|
rmov.put(RMV_CONTO,c);
|
||||||
|
rmov.put(RMV_SOTTOCONTO,s);
|
||||||
|
|
||||||
|
// Anche se non movimentato vado a vedere il saldo
|
||||||
|
if (stp_prov != 3)
|
||||||
|
_saldo = calcola_saldo_iniziale(g,c,s,indbil);
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
long num_rec = 0;
|
||||||
|
const clock_t clock_start = clock();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (rmov.read(_isgteq); !rmov.eof(); rmov.next())
|
||||||
|
{
|
||||||
|
const int gruppo = rmov.get_int(RMV_GRUPPO);
|
||||||
|
const int conto = rmov.get_int(RMV_CONTO);
|
||||||
|
const long sottoconto = rmov.get_long(RMV_SOTTOCONTO);
|
||||||
|
if (gruppo != g || conto != c || sottoconto != s)
|
||||||
|
break;
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
num_rec++;
|
||||||
|
if ((num_rec & 0x7F) == 0)
|
||||||
|
{
|
||||||
|
const double sec = (clock() - clock_start) / CLOCKS_PER_SEC;
|
||||||
|
if (sec > 0.0)
|
||||||
|
{
|
||||||
|
TString80 msg;
|
||||||
|
msg.format("%ld records at %ld rec/sec", num_rec, long(num_rec/sec));
|
||||||
|
xvt_statbar_set(msg);
|
||||||
|
do_events();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const long num_reg = rmov.get_long(RMV_NUMREG);
|
||||||
|
TDate data_mov;
|
||||||
|
|
||||||
|
// Leggo la testata
|
||||||
|
leggi_mov(num_reg);
|
||||||
|
|
||||||
|
if (bilancio == DataLimite)
|
||||||
|
data_mov = _datacomp;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_annoes == 0)
|
||||||
|
data_mov = _datareg;
|
||||||
|
else
|
||||||
|
data_mov = _datacomp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_mov < data_inf || data_mov > data_sup)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// "Se la causale del movimento e' di chiusura,
|
||||||
|
// o di apertura il movimento non va considerato"
|
||||||
|
if (_codcaus.not_empty())
|
||||||
|
{
|
||||||
|
const TString& movap = _causali_apertura.decode(_codcaus);
|
||||||
|
if (movap == "C")
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//bilancio normale (non comprende i provvisori) ?
|
||||||
|
if (stp_prov == 1 && _provv.not_empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//bilancio dei soli provvisori ?
|
||||||
|
if (stp_prov == 3 && _provv.empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const char sezione = rmov.get_char(RMV_SEZIONE);
|
||||||
|
const real importo = rmov.get(RMV_IMPORTO);
|
||||||
|
|
||||||
|
// I mov. di puro riferimento (= con importo = 0) vanno scartati
|
||||||
|
if (importo == ZERO)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_movimentato = TRUE;
|
||||||
|
|
||||||
|
if (sezione == 'D')
|
||||||
|
_saldo += importo;
|
||||||
|
else
|
||||||
|
_saldo -= importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
xvt_statbar_refresh();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return _movimentato;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//per bilancio di verifica all'ultima immissione
|
||||||
|
bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil,int stp_prov)
|
||||||
|
{
|
||||||
|
//Si considerano i saldi e non piu' i movimenti
|
||||||
|
char sezione,sezsf;
|
||||||
|
int gruppo, conto, annoe;
|
||||||
|
long sottoconto;
|
||||||
|
real pdarepro, paverepro,saldofin;
|
||||||
|
bool esito = FALSE;
|
||||||
|
|
||||||
|
_saldo_iniziale = ZERO;
|
||||||
|
_saldoiniziale = ZERO;
|
||||||
|
_prg_dare = ZERO;
|
||||||
|
_prg_avere = ZERO;
|
||||||
|
_saldo = ZERO;
|
||||||
|
saldofin = ZERO;
|
||||||
|
|
||||||
|
_saldi.zero();
|
||||||
|
_saldi.put(SLD_ANNOES,annoes);
|
||||||
|
_saldi.put(SLD_GRUPPO,g);
|
||||||
|
_saldi.put(SLD_CONTO,c);
|
||||||
|
_saldi.put(SLD_SOTTOCONTO,s);
|
||||||
|
_saldi.put(SLD_FLSCA, "");
|
||||||
|
|
||||||
|
if (_saldi.read() == NOERR)
|
||||||
|
{
|
||||||
|
annoe = _saldi.get_int(SLD_ANNOES);
|
||||||
|
gruppo = _saldi.get_int(SLD_GRUPPO);
|
||||||
|
conto = _saldi.get_int(SLD_CONTO);
|
||||||
|
sottoconto = _saldi.get_long(SLD_SOTTOCONTO);
|
||||||
|
_saldo_iniziale = _saldi.get_real(SLD_SALDO);
|
||||||
|
_prg_dare = _saldi.get_real(SLD_PDARE);
|
||||||
|
_prg_avere = _saldi.get_real(SLD_PAVERE);
|
||||||
|
pdarepro = _saldi.get_real(SLD_PDAREPRO);
|
||||||
|
paverepro = _saldi.get_real(SLD_PAVEREPRO);
|
||||||
|
sezione = _saldi.get_char(SLD_FLAGSALINI);
|
||||||
|
sezsf = _saldi.get_char(SLD_FLAGSALFIN); // W96SALDI del 19-06-96 modifica richiesta
|
||||||
|
saldofin = _saldi.get_real(SLD_SALDOFIN); // da PATRIZIA
|
||||||
|
|
||||||
|
if (stp_prov == 1) //bilancio normale (senza provvisori)
|
||||||
|
if (_saldo_iniziale == ZERO && _prg_dare == ZERO && _prg_avere == ZERO)
|
||||||
|
return esito;
|
||||||
|
// if (stp_prov == 0 && paverepro == ZERO)
|
||||||
|
if (stp_prov == 3 && paverepro == ZERO && pdarepro == ZERO) // Modifica del 24-09-96 errore MI0890.
|
||||||
|
{
|
||||||
|
_saldo = _prg_dare = _prg_avere = ZERO; // N.B. Non e' detto che funzioni sempre!!!!!!
|
||||||
|
return esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
||||||
|
|
||||||
|
if (sezsf == 'A') saldofin = -saldofin; // W96SALDI del 19-06-96
|
||||||
|
|
||||||
|
_saldoiniziale = _saldo_iniziale; //saldo iniziale presente sul record saldi
|
||||||
|
//non comprensivo del saldo finale es.precedente
|
||||||
|
|
||||||
|
if (stp_prov != 3)
|
||||||
|
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||||
|
if (_saldo_iniziale == ZERO)
|
||||||
|
_saldo_iniziale += saldofin_esprec(annoes,gruppo,conto,sottoconto);
|
||||||
|
|
||||||
|
esito = TRUE;
|
||||||
|
|
||||||
|
switch (stp_prov)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
_saldo = _saldo_iniziale + _prg_dare - _prg_avere + saldofin; // W96SALDI del 19-06-96
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_saldo = _saldo_iniziale + _prg_dare - _prg_avere + pdarepro - paverepro + saldofin; // W96SALDI del 19-06-96
|
||||||
|
if (pdarepro != ZERO) // Modifica del 24-09-96 errore MI0890: nel caso in cui i progressivi
|
||||||
|
_prg_dare = pdarepro; // pdarepro o paverepro sono compilati sono in presenza di un movimento
|
||||||
|
if (paverepro != ZERO) // provvisorio, dunque li trasferisco nei progressivi che poi uso nel
|
||||||
|
_prg_avere = paverepro; // CG1500 per la stampa.
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
_saldo = pdarepro - paverepro;
|
||||||
|
_prg_dare = pdarepro; // Idem come sopra.
|
||||||
|
_prg_avere = paverepro; // N.B. Non e' detto che funzioni sempre!!!!!!
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
//per bilancio a sezioni contrapposte all'ultima immissione
|
||||||
|
// W96SALDI in questa funzione e' stato aggiunto il parametro saldo_chiusura che di default
|
||||||
|
// e' TRUE. A cosa serve ? Serve per includere nel calcolo del saldo all' ultima immissione
|
||||||
|
// anche il saldo finale compilato nei movimenti di chiusura (se non venisse considerato i conti
|
||||||
|
// risulterebbero aperti); siccome alcuni programmi (esempio il bilancio IV dir. CEE) non ne
|
||||||
|
// devono tenere conto, si e' data la possibilita' di usare la funzione passandogli il parametro a FALSE.
|
||||||
|
// Modifica del 09-07-96
|
||||||
|
bool TSaldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil,int stp_prov,bool saldo_chiusura)
|
||||||
|
{
|
||||||
|
//Si considerano i saldi e non piu' i movimenti
|
||||||
|
char sezione;
|
||||||
|
int gruppo, conto, annoe;
|
||||||
|
long sottoconto;
|
||||||
|
real pdarepro, paverepro;
|
||||||
|
real saldofinale;
|
||||||
|
char flagsf;
|
||||||
|
bool esito = FALSE;
|
||||||
|
|
||||||
|
_saldo_iniziale = ZERO;
|
||||||
|
_prg_dare = ZERO;
|
||||||
|
_prg_avere = ZERO;
|
||||||
|
_saldo = ZERO;
|
||||||
|
_rec_presente_ec = FALSE;
|
||||||
|
_rec_presente_ep = FALSE;
|
||||||
|
_prec = FALSE;
|
||||||
|
|
||||||
|
_saldi.zero();
|
||||||
|
_saldi.put(SLD_ANNOES,annoes);
|
||||||
|
_saldi.put(SLD_GRUPPO,g);
|
||||||
|
_saldi.put(SLD_CONTO,c);
|
||||||
|
_saldi.put(SLD_SOTTOCONTO,s);
|
||||||
|
_saldi.put(SLD_FLSCA, "");
|
||||||
|
|
||||||
|
if (_saldi.read() == NOERR)
|
||||||
|
{
|
||||||
|
annoe = _saldi.get_int(SLD_ANNOES);
|
||||||
|
gruppo = _saldi.get_int(SLD_GRUPPO);
|
||||||
|
conto = _saldi.get_int(SLD_CONTO);
|
||||||
|
sottoconto = _saldi.get_long(SLD_SOTTOCONTO);
|
||||||
|
_saldo_iniziale = _saldi.get_real(SLD_SALDO);
|
||||||
|
_prg_dare = _saldi.get_real(SLD_PDARE);
|
||||||
|
_prg_avere = _saldi.get_real(SLD_PAVERE);
|
||||||
|
pdarepro = _saldi.get_real(SLD_PDAREPRO);
|
||||||
|
paverepro = _saldi.get_real(SLD_PAVEREPRO);
|
||||||
|
sezione = _saldi.get_char(SLD_FLAGSALINI);
|
||||||
|
flagsf = _saldi.get_char(SLD_FLAGSALFIN);
|
||||||
|
saldofinale = _saldi.get_real(SLD_SALDOFIN);
|
||||||
|
|
||||||
|
if (stp_prov == 1) //bilancio normale (senza provvisori)
|
||||||
|
esito = (_saldo_iniziale != ZERO || _prg_dare != ZERO || _prg_avere != ZERO);
|
||||||
|
|
||||||
|
if (stp_prov == 2) //bilancio globale (con provvisori)
|
||||||
|
esito = (_saldo_iniziale != ZERO || _prg_dare != ZERO || _prg_avere != ZERO
|
||||||
|
|| pdarepro != ZERO || paverepro != ZERO);
|
||||||
|
|
||||||
|
if (stp_prov == 3) //bilancio dei soli mov. provvisori
|
||||||
|
esito = (pdarepro != ZERO || paverepro != ZERO);
|
||||||
|
|
||||||
|
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
||||||
|
|
||||||
|
if (saldo_chiusura) // W96SALDI modifica inserita per il discorso di inclusione oppure
|
||||||
|
if (flagsf == 'A') // no del saldo di chiusura inserita il 09-07-96
|
||||||
|
saldofinale = -saldofinale;
|
||||||
|
|
||||||
|
_rec_presente_ec = esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stp_prov != 3)
|
||||||
|
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||||
|
if (_saldo_iniziale == ZERO)
|
||||||
|
{
|
||||||
|
_prec = TRUE;
|
||||||
|
_saldo_iniziale += saldofin_esprec(annoes,g,c,s);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stp_prov == 1)
|
||||||
|
_saldo = _saldo_iniziale + _prg_dare - _prg_avere;
|
||||||
|
|
||||||
|
if (stp_prov == 2)
|
||||||
|
_saldo = _saldo_iniziale + _prg_dare - _prg_avere + pdarepro - paverepro;
|
||||||
|
|
||||||
|
if (stp_prov == 3)
|
||||||
|
_saldo = pdarepro - paverepro;
|
||||||
|
|
||||||
|
if (saldo_chiusura) // W96SALDI modifica inserita per il discorso di inclusione oppure
|
||||||
|
_saldo += saldofinale; // no del saldo di chiusura inserita il 09-07-96
|
||||||
|
|
||||||
|
return esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TSaldo::ricerca_progr_prec (int annoesprec, int g, int c, long s)
|
||||||
|
{
|
||||||
|
if (annoesprec == 0)
|
||||||
|
_rec_presente_ep = FALSE;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const int oldkey = _saldi.getkey();
|
||||||
|
_saldi.setkey(1);
|
||||||
|
_saldi.zero();
|
||||||
|
_saldi.put(SLD_ANNOES,annoesprec);
|
||||||
|
_saldi.put(SLD_GRUPPO,g);
|
||||||
|
_saldi.put(SLD_CONTO,c);
|
||||||
|
_saldi.put(SLD_SOTTOCONTO,s);
|
||||||
|
_saldi.put(SLD_FLSCA, "");
|
||||||
|
_rec_presente_ep = _saldi.read() == NOERR;
|
||||||
|
_saldi.setkey(oldkey);
|
||||||
|
}
|
||||||
|
return _rec_presente_ep;
|
||||||
|
}
|
||||||
|
|
||||||
|
//calcolo dei progressivi attuali (normali o eliminati)
|
||||||
|
bool TSaldo::prg_saldo(int annoes, TConto& conto, real& prgdare, real& prgavere, bool scar)
|
||||||
|
{
|
||||||
|
_saldi.zero();
|
||||||
|
_saldi.put(SLD_GRUPPO,conto.gruppo());
|
||||||
|
_saldi.put(SLD_CONTO,conto.conto());
|
||||||
|
_saldi.put(SLD_SOTTOCONTO,conto.sottoconto());
|
||||||
|
_saldi.put(SLD_ANNOES,annoes);
|
||||||
|
_saldi.put(SLD_FLSCA, scar);
|
||||||
|
|
||||||
|
bool ok = _saldi.read() == NOERR;
|
||||||
|
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
const char flagsalini = _saldi.get_char(SLD_FLAGSALINI);
|
||||||
|
const real saldoini = _saldi.get_real(SLD_SALDO);
|
||||||
|
prgdare = _saldi.get_real(SLD_PDARE);
|
||||||
|
prgavere = _saldi.get_real(SLD_PAVERE);
|
||||||
|
|
||||||
|
if (flagsalini == 'D')
|
||||||
|
prgdare += saldoini ;
|
||||||
|
else
|
||||||
|
prgavere += saldoini;
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// TContoExt
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TContoExt : public TConto
|
class TContoExt : public TConto
|
||||||
{
|
{
|
||||||
bool _scaricato;
|
bool _scaricato;
|
||||||
@ -314,125 +827,3 @@ void TSaldo_agg::registra()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
// Gestione Tabella esercizi
|
|
||||||
///////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
TArray TEsercizi_contabili::_esercizi;
|
|
||||||
long TEsercizi_contabili::_firm = 0;
|
|
||||||
|
|
||||||
TEsercizio::TEsercizio(const TRectype& rec)
|
|
||||||
{
|
|
||||||
_codice = rec.get_int("CODTAB");
|
|
||||||
_inizio = rec.get("D0");
|
|
||||||
_fine = rec.get("D1");
|
|
||||||
_scarico = rec.get("D2");
|
|
||||||
_chiusura = rec.get("D3");
|
|
||||||
_chiusura_mag = rec.get("D4");
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizio::compare(const TSortable& s) const
|
|
||||||
{
|
|
||||||
const TEsercizio& e = (const TEsercizio&)s;
|
|
||||||
int c = 0;
|
|
||||||
if (_inizio != e._inizio)
|
|
||||||
c = _inizio > e._inizio ? +1 : -1;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEsercizi_contabili::TEsercizi_contabili()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void TEsercizi_contabili::update()
|
|
||||||
{
|
|
||||||
_firm = prefix().get_codditta();
|
|
||||||
|
|
||||||
_esercizi.destroy();
|
|
||||||
TTable tab_esc("ESC");
|
|
||||||
for (int err = tab_esc.first(); err == NOERR; err = tab_esc.next())
|
|
||||||
{
|
|
||||||
TEsercizio* e = new TEsercizio(tab_esc.curr());
|
|
||||||
_esercizi.add(e);
|
|
||||||
}
|
|
||||||
_esercizi.sort();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TEsercizi_contabili::check()
|
|
||||||
{
|
|
||||||
if (_firm != prefix().get_codditta())
|
|
||||||
{
|
|
||||||
#ifdef DBG
|
|
||||||
if (_firm != 0)
|
|
||||||
error_box("Questo programma carinissimo usa gli esercizi,\n"
|
|
||||||
"purtroppo non tiene conto del cambio ditta!");
|
|
||||||
#endif
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::date2index(const TDate& d) const
|
|
||||||
{
|
|
||||||
check();
|
|
||||||
for (int i = items()-1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
const TEsercizio& e = esc(i);
|
|
||||||
if (d >= e.inizio() && d <= e.fine())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::esc2index(int codice) const
|
|
||||||
{
|
|
||||||
check();
|
|
||||||
for (int i = items()-1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
const TEsercizio& e = esc(i);
|
|
||||||
if (codice == e.codice())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::date2esc(const TDate& d) const
|
|
||||||
{
|
|
||||||
const int i = date2index(d);
|
|
||||||
return i >= 0 ? esc(i).codice() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::first() const
|
|
||||||
{
|
|
||||||
check();
|
|
||||||
return items() ? esc(0).codice() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::last() const
|
|
||||||
{
|
|
||||||
check();
|
|
||||||
return items() ? esc(items()-1).codice() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::pred(int codice) const
|
|
||||||
{
|
|
||||||
const int i = esc2index(codice);
|
|
||||||
return i > 0 ? esc(i-1).codice() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TEsercizi_contabili::next(int anno) const
|
|
||||||
{
|
|
||||||
const int i = esc2index(anno);
|
|
||||||
return i < items()-1 ? esc(i+1).codice() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TEsercizi_contabili::exist(int codice) const
|
|
||||||
{
|
|
||||||
const int i = esc2index(codice);
|
|
||||||
return i >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TEsercizio& TEsercizi_contabili::esercizio(int codice) const
|
|
||||||
{
|
|
||||||
const int i = esc2index(codice);
|
|
||||||
return esc(i);
|
|
||||||
}
|
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
// cglib04.cpp
|
// cglib04.cpp
|
||||||
|
|
||||||
#include <utility.h>
|
|
||||||
#include <progind.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <extcdecl.h>
|
|
||||||
|
|
||||||
#include "cglib.h"
|
#include <codeb.h>
|
||||||
|
|
||||||
|
#include <extcdecl.h>
|
||||||
|
#include <prefix.h>
|
||||||
|
#include <progind.h>
|
||||||
|
#include <scanner.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
|
#include "cglib01.h"
|
||||||
#include "cglib04.h"
|
#include "cglib04.h"
|
||||||
|
|
||||||
const int size = 256; //Lunghezza del record del TRASFER
|
const int size = 256; //Lunghezza del record del TRASFER
|
||||||
@ -359,10 +364,9 @@ bool TTransfer_file::open(const char* path, bool create)
|
|||||||
|
|
||||||
const char* TTransfer_file::path(long codditta)
|
const char* TTransfer_file::path(long codditta)
|
||||||
{
|
{
|
||||||
if (codditta)
|
if (codditta == 0)
|
||||||
return firm2dir(codditta);
|
codditta = prefix().get_codditta();
|
||||||
else
|
return firm2dir(codditta);
|
||||||
return main_app().get_firm_dir();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTransfer_file::remove_all(bool file_ditta)
|
void TTransfer_file::remove_all(bool file_ditta)
|
||||||
@ -371,8 +375,9 @@ void TTransfer_file::remove_all(bool file_ditta)
|
|||||||
TString dir,trasfer;
|
TString dir,trasfer;
|
||||||
|
|
||||||
if (file_ditta)
|
if (file_ditta)
|
||||||
{
|
{
|
||||||
dir << main_app().get_firm_dir();
|
const long ditta = prefix().get_codditta();
|
||||||
|
dir << firm2dir(ditta);
|
||||||
trasfer = dir;
|
trasfer = dir;
|
||||||
dir << HEADER;
|
dir << HEADER;
|
||||||
trasfer << "\\trasfer";
|
trasfer << "\\trasfer";
|
||||||
@ -395,7 +400,10 @@ void TTransfer_file::remove_all(bool file_ditta)
|
|||||||
close();
|
close();
|
||||||
dir = "";
|
dir = "";
|
||||||
if (file_ditta)
|
if (file_ditta)
|
||||||
dir << main_app().get_firm_dir();
|
{
|
||||||
|
const long ditta = prefix().get_codditta();
|
||||||
|
dir << firm2dir(ditta);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
dir << firm2dir(0);
|
dir << firm2dir(0);
|
||||||
|
|
||||||
@ -1740,7 +1748,9 @@ int TTransfer_file::trasfer_data_mov(TIsamtempfile& file, TRectype& dep)
|
|||||||
int TTransfer_file::cerca_annoes(long numreg,TString& tipodoc)
|
int TTransfer_file::cerca_annoes(long numreg,TString& tipodoc)
|
||||||
{
|
{
|
||||||
TString80 tmpmov = "%";
|
TString80 tmpmov = "%";
|
||||||
tmpmov << main_app().get_firm_dir();
|
|
||||||
|
const long ditta = prefix().get_codditta();
|
||||||
|
tmpmov << firm2dir(ditta);
|
||||||
tmpmov << "\\" << TEMP_MOV;
|
tmpmov << "\\" << TEMP_MOV;
|
||||||
TIsamtempfile tmov (LF_MOV, tmpmov, 0);
|
TIsamtempfile tmov (LF_MOV, tmpmov, 0);
|
||||||
|
|
||||||
@ -3036,7 +3046,9 @@ bool TTransfer_file::ordina_trasfer(const char* orig)
|
|||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
TString80 tmptab = "%";
|
TString80 tmptab = "%";
|
||||||
tmptab << main_app().get_firm_dir();
|
|
||||||
|
const long ditta = prefix().get_codditta();
|
||||||
|
tmptab << firm2dir(ditta);
|
||||||
tmptab << "\\" << TEMP_TAB;
|
tmptab << "\\" << TEMP_TAB;
|
||||||
_ttab = new TIsamtempfile(LF_TAB, tmptab, TRUE);
|
_ttab = new TIsamtempfile(LF_TAB, tmptab, TRUE);
|
||||||
|
|
||||||
@ -3163,7 +3175,9 @@ bool TTransfer_file::fcopytemp(const char* orig, const char* dest)
|
|||||||
nrec_moviva = atol(nrec.mid(pos*6,6));
|
nrec_moviva = atol(nrec.mid(pos*6,6));
|
||||||
|
|
||||||
TString80 tmpocc = "%";
|
TString80 tmpocc = "%";
|
||||||
tmpocc << main_app().get_firm_dir();
|
|
||||||
|
const long ditta = prefix().get_codditta();
|
||||||
|
tmpocc << firm2dir(ditta);
|
||||||
tmpocc << "\\" << TEMP_OCC;
|
tmpocc << "\\" << TEMP_OCC;
|
||||||
_toccas = new TIsamtempfile(LF_OCCAS, tmpocc, TRUE);
|
_toccas = new TIsamtempfile(LF_OCCAS, tmpocc, TRUE);
|
||||||
}
|
}
|
||||||
@ -3565,7 +3579,9 @@ bool TTransfer_file::fcopytemp_PC(const char* orig, const char* dest)
|
|||||||
_deprmov = new TRectype (LF_RMOV);
|
_deprmov = new TRectype (LF_RMOV);
|
||||||
|
|
||||||
TString80 tmpocc = "%";
|
TString80 tmpocc = "%";
|
||||||
tmpocc << main_app().get_firm_dir();
|
|
||||||
|
const long ditta = prefix().get_codditta();
|
||||||
|
tmpocc << firm2dir(ditta);
|
||||||
tmpocc << "\\" << TEMP_OCC;
|
tmpocc << "\\" << TEMP_OCC;
|
||||||
_toccas = new TIsamtempfile(LF_OCCAS, tmpocc, TRUE);
|
_toccas = new TIsamtempfile(LF_OCCAS, tmpocc, TRUE);
|
||||||
_depoccas = new TRectype (LF_OCCAS);
|
_depoccas = new TRectype (LF_OCCAS);
|
||||||
|
20
cg/cglib04.h
20
cg/cglib04.h
@ -3,19 +3,13 @@
|
|||||||
#ifndef __CGLIB04_H
|
#ifndef __CGLIB04_H
|
||||||
#define __CGLIB04_H
|
#define __CGLIB04_H
|
||||||
|
|
||||||
#include <applicat.h>
|
#ifndef __ISAM_H
|
||||||
#include <config.h>
|
|
||||||
#include <prefix.h>
|
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <stdio.h>
|
#endif
|
||||||
#include <array.h>
|
|
||||||
#include <assoc.h>
|
#ifndef __PROGIND_H
|
||||||
#include <strings.h>
|
#include <progind.h>
|
||||||
#include <scanner.h>
|
#endif
|
||||||
#include <tabutil.h>
|
|
||||||
#include <progind.h>
|
|
||||||
#include <isam.h>
|
|
||||||
#include <codeb.h>
|
|
||||||
|
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
@ -30,8 +24,6 @@
|
|||||||
#include <scadenze.h>
|
#include <scadenze.h>
|
||||||
#include <pagsca.h>
|
#include <pagsca.h>
|
||||||
|
|
||||||
#include "cg2103.h"
|
|
||||||
|
|
||||||
#define TEMP_CAUS "tcaus"
|
#define TEMP_CAUS "tcaus"
|
||||||
#define TEMP_RCAUS "trcaus"
|
#define TEMP_RCAUS "trcaus"
|
||||||
#define TEMP_CLIFO "tclifo"
|
#define TEMP_CLIFO "tclifo"
|
||||||
|
361
cg/conto.cpp
361
cg/conto.cpp
@ -1,361 +0,0 @@
|
|||||||
#include <ctype.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <isam.h>
|
|
||||||
#include <mask.h>
|
|
||||||
#include <utility.h>
|
|
||||||
|
|
||||||
#include "conto.h"
|
|
||||||
|
|
||||||
TBill::~TBill()
|
|
||||||
{
|
|
||||||
if (_descrizione)
|
|
||||||
delete _descrizione;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TBill::set_description(const char* d)
|
|
||||||
{
|
|
||||||
if (_descrizione || (d && *d))
|
|
||||||
{
|
|
||||||
if (_descrizione)
|
|
||||||
*_descrizione = d;
|
|
||||||
else
|
|
||||||
_descrizione = new TString(d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Certified 90%
|
|
||||||
const TBill& TBill::get(TToken_string& s, int from, int mode)
|
|
||||||
{
|
|
||||||
const char* first = s.get(from);
|
|
||||||
if (mode & 0x1)
|
|
||||||
{
|
|
||||||
_tipo = first ? toupper(*first) : ' ';
|
|
||||||
first = s.get();
|
|
||||||
} else _tipo = ' ';
|
|
||||||
|
|
||||||
#ifdef DBG
|
|
||||||
if (strchr(" CF", _tipo) == NULL)
|
|
||||||
{
|
|
||||||
error_box("Tipo conto errato: '%c'", _tipo);
|
|
||||||
_tipo = ' ';
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_gruppo = first ? atoi(first) : 0;
|
|
||||||
_conto = s.get_int();
|
|
||||||
_sottoconto = s.get_long();
|
|
||||||
if (mode & 0x2)
|
|
||||||
set_description(s.get());
|
|
||||||
|
|
||||||
_tipo_cr = -1;
|
|
||||||
_sezione = ' ';
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TBill& TBill::copy(const TBill& bill)
|
|
||||||
{
|
|
||||||
_tipo = bill._tipo;
|
|
||||||
_gruppo = bill._gruppo;
|
|
||||||
_conto = bill._conto;
|
|
||||||
_sottoconto = bill._sottoconto;
|
|
||||||
set_description(bill.descrizione());
|
|
||||||
_tipo_cr = bill._tipo_cr;
|
|
||||||
_sospeso = bill._sospeso;
|
|
||||||
_sezione = bill._sezione;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Certified 100%
|
|
||||||
const TBill& TBill::set(int g, int c, long s, char t, const char* d, int r)
|
|
||||||
{
|
|
||||||
_tipo = (t > ' ') ? toupper(t) : ' ';
|
|
||||||
_gruppo = g;
|
|
||||||
_conto = c;
|
|
||||||
_sottoconto = s;
|
|
||||||
set_description(d);
|
|
||||||
_tipo_cr = r;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TBill& TBill::add_to(TToken_string& ts, int from, int mode)
|
|
||||||
{
|
|
||||||
if (mode & 0x4)
|
|
||||||
{
|
|
||||||
const int cr = tipo_cr();
|
|
||||||
if (cr > 0) ts.add(cr, from++); else ts.add(" ", from++);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode & 0x1)
|
|
||||||
ts.add(_tipo, from++);
|
|
||||||
|
|
||||||
if (_gruppo > 0) ts.add(_gruppo, from++); else ts.add(" ", from++);
|
|
||||||
if (_conto > 0) ts.add(_conto, from++); else ts.add(" ", from++);
|
|
||||||
if (_sottoconto > 0L) ts.add(_sottoconto, from++); else ts.add(" ", from++);
|
|
||||||
|
|
||||||
if (mode & 0x2)
|
|
||||||
ts.add(descrizione(), from++);
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const char* TBill::field_name(int n, bool contro) const
|
|
||||||
{
|
|
||||||
CHECKD(n >= 0 && n <= 3, "Invalid bill field", n);
|
|
||||||
|
|
||||||
const char* f;
|
|
||||||
if (contro)
|
|
||||||
{
|
|
||||||
switch(n)
|
|
||||||
{
|
|
||||||
case 0: f = "GRUPPOC"; break;
|
|
||||||
case 1: f = "CONTOC"; break;
|
|
||||||
case 2: f = "SOTTOCONTC"; break;
|
|
||||||
default:f = "TIPOCC"; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch(n)
|
|
||||||
{
|
|
||||||
case 0: f = "GRUPPO"; break;
|
|
||||||
case 1: f = "CONTO"; break;
|
|
||||||
case 2: f = "SOTTOCONTO"; break;
|
|
||||||
default:f = "TIPOC"; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TBill::put(TRectype& r, bool c) const
|
|
||||||
{
|
|
||||||
r.put(field_name(0, c), gruppo());
|
|
||||||
r.put(field_name(1, c), conto());
|
|
||||||
r.put(field_name(2, c), sottoconto());
|
|
||||||
r.put(field_name(3, c), tipo());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TBill::get(const TRectype& r, bool c)
|
|
||||||
{
|
|
||||||
set(r.get_int(field_name(0, c)),
|
|
||||||
r.get_int(field_name(1, c)),
|
|
||||||
r.get_long(field_name(2, c)),
|
|
||||||
r.get_char(field_name(3, c)));
|
|
||||||
|
|
||||||
set_description(NULL);
|
|
||||||
_tipo_cr = -1;
|
|
||||||
_sezione = ' ';
|
|
||||||
|
|
||||||
if (r.num() == LF_RMOVIVA)
|
|
||||||
tipo_cr(r.get_int("TIPOCR"));
|
|
||||||
|
|
||||||
return ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TBill::set(TMask& m, short g, short c, short s, short t, short d) const
|
|
||||||
{
|
|
||||||
m.set(g, gruppo());
|
|
||||||
m.set(c, conto());
|
|
||||||
m.set(s, sottoconto());
|
|
||||||
if (t)
|
|
||||||
{
|
|
||||||
char typ[2] = { tipo(), '\0' };
|
|
||||||
m.set(t, typ);
|
|
||||||
}
|
|
||||||
if (d)
|
|
||||||
m.set(d, descrizione());
|
|
||||||
}
|
|
||||||
|
|
||||||
void TBill::get(const TMask& m, short g, short c, short s, short t, short d)
|
|
||||||
{
|
|
||||||
const int gr = m.get_int(g);
|
|
||||||
const int co = m.get_int(c);
|
|
||||||
const long so = m.get_long(s);
|
|
||||||
char ti = ' ';
|
|
||||||
if (t)
|
|
||||||
ti = m.get(t)[0];
|
|
||||||
TString80 de;
|
|
||||||
if (d)
|
|
||||||
de = m.get(d);
|
|
||||||
set(gr, co, so, ti, de);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Certified 100%
|
|
||||||
bool TBill::ok() const
|
|
||||||
{
|
|
||||||
return _gruppo != 0 && _conto != 0 && _sottoconto != 0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Certified 99%
|
|
||||||
int TBill::compare(const TSortable& s) const
|
|
||||||
{
|
|
||||||
CHECK(class_name()==s.class_name(), "Can't compare TBill with TObject");
|
|
||||||
const TBill& c = (const TBill&)s;
|
|
||||||
|
|
||||||
int res = _gruppo - c._gruppo;
|
|
||||||
if (res) return res;
|
|
||||||
|
|
||||||
res = _conto - c._conto;
|
|
||||||
if (res) return res;
|
|
||||||
|
|
||||||
const long lres = _sottoconto - c._sottoconto;
|
|
||||||
if (lres < 0L) res = -1; else
|
|
||||||
if (lres > 0L) res = +1;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Certified 95%
|
|
||||||
bool TBill::find()
|
|
||||||
{
|
|
||||||
bool ok = FALSE;
|
|
||||||
|
|
||||||
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
|
|
||||||
{
|
|
||||||
TRectype pcon(LF_PCON);
|
|
||||||
ok = read(pcon);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L)
|
|
||||||
{
|
|
||||||
TLocalisamfile clifo(LF_CLIFO);
|
|
||||||
clifo.setkey(1);
|
|
||||||
clifo.put("TIPOCF", _tipo);
|
|
||||||
clifo.put("CODCF", _sottoconto);
|
|
||||||
ok = clifo.read() == NOERR;
|
|
||||||
if (ok)
|
|
||||||
{
|
|
||||||
set_description(clifo.get("RAGSOC"));
|
|
||||||
if (_tipo_cr < 0)
|
|
||||||
{
|
|
||||||
_tipo_cr = 0;
|
|
||||||
_sezione = ' ';
|
|
||||||
}
|
|
||||||
_sospeso = clifo.get_bool("SOSPESO");
|
|
||||||
|
|
||||||
const char tipoa = clifo.get_char("TIPOAPER");
|
|
||||||
if (tipoa == 'F') // Se persona fisica allora aggiusta la ragione sociale
|
|
||||||
{
|
|
||||||
TString nome(descrizione().mid(30));
|
|
||||||
if (nome.not_empty())
|
|
||||||
{
|
|
||||||
_descrizione->cut(30);
|
|
||||||
_descrizione->trim(); nome.trim();
|
|
||||||
*_descrizione << ' ' << nome;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (_gruppo == 0 || _conto == 0)
|
|
||||||
{
|
|
||||||
_gruppo = clifo.get_int("GRUPPO");
|
|
||||||
_conto = clifo.get_int("CONTO");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TBill::read(TRectype &r)
|
|
||||||
{
|
|
||||||
TLocalisamfile pcon(LF_PCON);
|
|
||||||
pcon.put("GRUPPO", _gruppo);
|
|
||||||
pcon.put("CONTO", _conto);
|
|
||||||
pcon.put("SOTTOCONTO", _sottoconto);
|
|
||||||
|
|
||||||
const int err = pcon.read();
|
|
||||||
if (err == NOERR)
|
|
||||||
{
|
|
||||||
r = pcon.curr();
|
|
||||||
_tipo_cr = r.get_int("TIPOSPRIC");
|
|
||||||
_sezione = r.get_char("SEZSALDI");
|
|
||||||
set_description(r.get("DESCR"));
|
|
||||||
_sospeso = r.get_bool("SOSPESO");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
r.zero();
|
|
||||||
|
|
||||||
return err == NOERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TBill::tipo_att()
|
|
||||||
{
|
|
||||||
int tipo_att = 1;
|
|
||||||
if (tipo() <= ' ' && ok())
|
|
||||||
{
|
|
||||||
TBill bill(gruppo(), conto());
|
|
||||||
TRectype rec(LF_PCON); bill.read(rec);
|
|
||||||
const TIndbil ib = (TIndbil)rec.get_int("INDBIL");
|
|
||||||
if (ib == ib_passivita || ib == ib_ricavi)
|
|
||||||
{
|
|
||||||
read(rec);
|
|
||||||
const int ricser = rec.get_int("RICSER"); // 0 = Altre attivita 1 = Servizi
|
|
||||||
tipo_att = (ricser == 1) ? 1 : 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tipo_att;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Certified 99%
|
|
||||||
const TString& TBill::descrizione() const
|
|
||||||
{
|
|
||||||
TBill& myself = (TBill&)*this;
|
|
||||||
// Se il conto e valido (c'e' almeno il gruppo) cerca la sua descrizione su file
|
|
||||||
if ((_descrizione == NULL || _descrizione->blank()) && gruppo() != 0)
|
|
||||||
{
|
|
||||||
if (!myself.find())
|
|
||||||
myself.set_description("Sconosciuto");
|
|
||||||
}
|
|
||||||
if (_descrizione == NULL)
|
|
||||||
myself._descrizione = new TString;
|
|
||||||
|
|
||||||
return *_descrizione;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TBill::tipo_cr() const
|
|
||||||
{
|
|
||||||
if (_tipo_cr < 0)
|
|
||||||
{
|
|
||||||
TBill& myself = (TBill&)*this;
|
|
||||||
myself.find();
|
|
||||||
}
|
|
||||||
return _tipo_cr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Certified 99% (uses __tmp_string)
|
|
||||||
const char* TBill::string(int mode) const
|
|
||||||
{
|
|
||||||
TFixed_string s(&__tmp_string[256], 80);
|
|
||||||
s.cut(0);
|
|
||||||
|
|
||||||
if (mode & 0x4)
|
|
||||||
{
|
|
||||||
const int cr = tipo_cr();
|
|
||||||
if (cr > 0) s << cr << '|';
|
|
||||||
else s << " |";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode & 0x1)
|
|
||||||
s << _tipo << '|';
|
|
||||||
|
|
||||||
if (_gruppo > 0) s << _gruppo << '|';
|
|
||||||
else s << " |";
|
|
||||||
|
|
||||||
if (_conto > 0) s << _conto << '|';
|
|
||||||
else s << " |";
|
|
||||||
|
|
||||||
if (_sottoconto > 0L) s << _sottoconto;
|
|
||||||
else s << ' ';
|
|
||||||
|
|
||||||
if (mode & 0x2)
|
|
||||||
s << '|' << descrizione();
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
133
cg/conto.h
133
cg/conto.h
@ -1,133 +0,0 @@
|
|||||||
#ifndef __CONTO_H
|
|
||||||
#define __CONTO_H
|
|
||||||
|
|
||||||
#ifndef __REAL_H
|
|
||||||
#include <real.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ISAM_H
|
|
||||||
class TRectype;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __MASK_H
|
|
||||||
class TMask;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
class TBill : public TSortable
|
|
||||||
{
|
|
||||||
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
|
|
||||||
int _gruppo, _conto;
|
|
||||||
long _sottoconto; // Sottoconto, codice cliente o fornitore
|
|
||||||
TString* _descrizione; // Vuota fino alla chiamata di describe
|
|
||||||
int _tipo_cr; // Tipo costo/ricavo
|
|
||||||
bool _sospeso;
|
|
||||||
char _sezione;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual int compare(const TSortable& s) const;
|
|
||||||
virtual const char* class_name() const { return "Conto"; }
|
|
||||||
|
|
||||||
void set_description(const char* d);
|
|
||||||
const TBill& copy(const TBill& b);
|
|
||||||
const char* field_name(int n, bool contro) const;
|
|
||||||
|
|
||||||
public: // TObject
|
|
||||||
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
|
|
||||||
|
|
||||||
public:
|
|
||||||
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
|
|
||||||
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(NULL),
|
|
||||||
_sezione(' '), _sospeso(FALSE)
|
|
||||||
{ set(g,c,s,t,d,r);}
|
|
||||||
|
|
||||||
TBill(TToken_string& tgcsd, int from, int mode = 0)
|
|
||||||
: _descrizione(NULL)
|
|
||||||
{ get(tgcsd, from, mode); }
|
|
||||||
|
|
||||||
TBill(const TRectype& rec, bool contro = FALSE)
|
|
||||||
: _descrizione(NULL)
|
|
||||||
{ get(rec, contro); }
|
|
||||||
|
|
||||||
TBill(const TBill& b)
|
|
||||||
: _descrizione(NULL)
|
|
||||||
{ copy(b); }
|
|
||||||
|
|
||||||
virtual ~TBill();
|
|
||||||
|
|
||||||
const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ',
|
|
||||||
const char* d = NULL, int r = -1);
|
|
||||||
|
|
||||||
const TBill& get(TToken_string& ts, int from, int mode = 0);
|
|
||||||
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
|
|
||||||
const TBill& operator=(const TBill& b) { return copy(b); }
|
|
||||||
|
|
||||||
bool empty() const { return _gruppo==0 && _conto==0 && _sottoconto == 0; }
|
|
||||||
|
|
||||||
char tipo() const { return _tipo; }
|
|
||||||
int gruppo() const { return _gruppo; }
|
|
||||||
int conto() const { return _conto; }
|
|
||||||
long sottoconto() const { return _sottoconto; }
|
|
||||||
long codclifo() const { return _sottoconto; }
|
|
||||||
long& codclifo() { return _sottoconto; }
|
|
||||||
|
|
||||||
bool find();
|
|
||||||
const TString& descrizione() const;
|
|
||||||
int tipo_cr() const;
|
|
||||||
void tipo_cr(int tcr) { _tipo_cr = tcr; }
|
|
||||||
|
|
||||||
int tipo_att();
|
|
||||||
bool read(TRectype& r);
|
|
||||||
bool sospeso() const { return _sospeso; } // _sospeso e' letto nella read()
|
|
||||||
char sezione() const { return _sezione; }
|
|
||||||
|
|
||||||
void put(TRectype& r, bool contro = FALSE) const;
|
|
||||||
bool get(const TRectype& r, bool contro = FALSE);
|
|
||||||
|
|
||||||
void set(TMask& m, short g, short c, short s, short t = 0, short d = 0) const;
|
|
||||||
void get(const TMask& m, short g, short c, short s, short t = 0, short d = 0);
|
|
||||||
|
|
||||||
const char* string(int mode = 0) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
|
|
||||||
|
|
||||||
class TConto : public TBill
|
|
||||||
{
|
|
||||||
real _dare, _avere, _darepro, _averepro, _saldofin, _saldo;
|
|
||||||
TImporto _saldo_finale;
|
|
||||||
|
|
||||||
public:
|
|
||||||
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
|
|
||||||
: TBill(g, c, s, t, d) {}
|
|
||||||
TConto (TToken_string& tgcsd, int from, int mode = 0)
|
|
||||||
: TBill(tgcsd, from, mode) {}
|
|
||||||
|
|
||||||
real& dare() { return _dare; }
|
|
||||||
const real& dare() const { return _dare; }
|
|
||||||
|
|
||||||
real& avere() { return _avere; }
|
|
||||||
const real& avere() const { return _avere; }
|
|
||||||
|
|
||||||
real& darepro() { return _darepro; }
|
|
||||||
const real& darepro() const { return _darepro; }
|
|
||||||
|
|
||||||
real& averepro() { return _averepro; }
|
|
||||||
const real& averepro() const { return _averepro; }
|
|
||||||
|
|
||||||
real& saldo() { return _saldo; }
|
|
||||||
const real& saldo() const { return _saldo; }
|
|
||||||
|
|
||||||
real& saldofin() { return _saldofin; }
|
|
||||||
const real& saldofin() const { return _saldofin; }
|
|
||||||
|
|
||||||
TImporto& saldo_finale() { return _saldo_finale; }
|
|
||||||
const TImporto& saldo_finale() const { return _saldo_finale; }
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -5,12 +5,8 @@
|
|||||||
#include <recarray.h>
|
#include <recarray.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __MASK_H
|
#ifndef __CGLIB01_H
|
||||||
class TMask;
|
#include "cglib01.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __CONTO_H
|
|
||||||
#include "conto.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __PARTITE_H
|
#ifndef __PARTITE_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user