cg3500.cpp Corretta stampa totale generale = 0
cg4600.cpp Aggiorna data ultima operazione nei saldi di apertura cg5200.cpp Aggiustati handlers dichiarati con friend git-svn-id: svn://10.65.10.50/trunk@4051 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e20c432136
commit
41c47ce3ae
@ -767,30 +767,30 @@ void CG3500_application::setta_riga_gruppo()
|
||||
|
||||
void CG3500_application::setta_riga_totale()
|
||||
{
|
||||
int r;
|
||||
|
||||
_saldo_tot = _prg_dare_tot - _prg_avere_tot;
|
||||
if (_scelta == 1) r = 8;
|
||||
else r = 6;
|
||||
|
||||
const int r = _scelta == 1 ? 8 : 6;
|
||||
|
||||
//17/11/1995
|
||||
TString pdt(_prg_dare_tot.string("#.###.###.###.###"));
|
||||
TString pat(_prg_avere_tot.string("#.###.###.###.###"));
|
||||
//set_row(r,"**** TOTALE GENERALE @57g%r@77g%r",&_prg_dare_tot,&_prg_avere_tot);
|
||||
set_row(r,"**** TOTALE GENERALE @55g%s@75g%s",(const char*)pdt,(const char*)pat);
|
||||
set_row(r, "**** TOTALE GENERALE @55g%s@75g%s",
|
||||
(const char*)pdt, (const char*)pat);
|
||||
|
||||
// Guy: 10/01/97 errore MI6125
|
||||
if (_saldo_tot != 0.0)
|
||||
{
|
||||
int go = 95;
|
||||
if (_saldo_tot < 0.0)
|
||||
{
|
||||
_saldo_tot = -_saldo_tot;
|
||||
go += 20;
|
||||
}
|
||||
|
||||
if (_saldo_tot > 0.00)
|
||||
{
|
||||
//set_row(r,"@97g%r",&_saldo_tot);
|
||||
TString st(_saldo_tot.string("#.###.###.###.###"));
|
||||
set_row(r,"@95g%s",(const char*)st);
|
||||
}
|
||||
else
|
||||
{
|
||||
_saldo_tot = _saldo_tot * (-1.00);
|
||||
TString st(_saldo_tot.string("#.###.###.###.###"));
|
||||
//set_row(r,"@117g%r",&_saldo_tot);
|
||||
set_row(r,"@115g%s",(const char*)st);
|
||||
}
|
||||
TString st(24);
|
||||
st << '@' << go << 'g' << _saldo_tot.string("#.###.###.###.###");
|
||||
set_row(r, (const char*)st);
|
||||
}
|
||||
}
|
||||
|
||||
TDate CG3500_application::UltimaData(int g, int c, long s)
|
||||
|
@ -1,13 +1,13 @@
|
||||
// Chiusura/Apertura Conti
|
||||
|
||||
#include <config.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <config.h>
|
||||
#include <urldefid.h>
|
||||
#include <progind.h>
|
||||
|
||||
#include "cglib.h"
|
||||
#include "cg4.h"
|
||||
@ -20,19 +20,16 @@
|
||||
#include <saldi.h>
|
||||
#include <rmov.h>
|
||||
|
||||
bool mask_datac (TMask_field&, KEY);
|
||||
bool mask_dataap (TMask_field&, KEY);
|
||||
bool mask_distinti (TMask_field&, KEY);
|
||||
bool attivo_passivo (TMask_field&, KEY);
|
||||
bool costi_ricavi (TMask_field&, KEY);
|
||||
|
||||
#define MAX 98
|
||||
|
||||
class CG4600_application : public TApplication
|
||||
class TApertura_chiusura : public TApplication
|
||||
{
|
||||
friend bool mask_datac (TMask_field&, KEY);
|
||||
friend bool mask_dataap (TMask_field&, KEY);
|
||||
friend bool mask_distinti (TMask_field&, KEY);
|
||||
static bool mask_datac (TMask_field&, KEY);
|
||||
static bool mask_dataap (TMask_field&, KEY);
|
||||
static bool mask_distinti (TMask_field&, KEY);
|
||||
static bool attivo_passivo(TMask_field&, KEY);
|
||||
static bool costi_ricavi (TMask_field&, KEY);
|
||||
|
||||
TTable* _reg;
|
||||
TRelation* _rel;
|
||||
@ -67,7 +64,7 @@ public:
|
||||
void apri_passivita();
|
||||
void apri_conti_ordine();
|
||||
void rmov_proper (int, long, TDate&, TRectype&, TConto&, real&, bool);
|
||||
void ultima_registrazione();
|
||||
long ultima_registrazione();
|
||||
void compila_testata(int anno,TDate& datareg,TString& codcaus,TDate& datacomp);
|
||||
void chiusura_conto_economico();
|
||||
void chiusura_conto_patrimoniale();
|
||||
@ -76,10 +73,10 @@ public:
|
||||
// bool epilogo_conti();
|
||||
void data_competenza(int anno,TDate& datacomp);
|
||||
|
||||
CG4600_application() {}
|
||||
TApertura_chiusura() {}
|
||||
};
|
||||
|
||||
CG4600_application& app() { return (CG4600_application&) main_app(); }
|
||||
TApertura_chiusura& app() { return (TApertura_chiusura&) main_app(); }
|
||||
|
||||
HIDDEN bool abilita_anni(TMask& m, KEY k)
|
||||
{
|
||||
@ -108,7 +105,8 @@ HIDDEN bool anni_contigui (int annoch, int annoap)
|
||||
inizio = esc.get_date("D0");
|
||||
if (anno == annoch)
|
||||
fine = esc.get_date("D1");
|
||||
if (inizio != botime && fine != botime) break;
|
||||
if (inizio != botime && fine != botime)
|
||||
break;
|
||||
}
|
||||
--inizio;
|
||||
if (inizio != fine)
|
||||
@ -135,7 +133,7 @@ HIDDEN TRectype& cerca_esercizio(int anno,TMask_field& f)
|
||||
return TabEs.curr();
|
||||
}
|
||||
|
||||
bool mask_datac (TMask_field& f, KEY k)
|
||||
bool TApertura_chiusura::mask_datac (TMask_field& f, KEY k)
|
||||
{
|
||||
TTable TabReg("REG");
|
||||
TString annos (4);
|
||||
@ -213,9 +211,11 @@ bool mask_datac (TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool mask_dataap (TMask_field& f, KEY k)
|
||||
bool TApertura_chiusura::mask_dataap (TMask_field& f, KEY k)
|
||||
{
|
||||
TTable TabEs ("ESC");
|
||||
// TTable TabEs ("ESC");
|
||||
TEsercizi_contabili esc;
|
||||
|
||||
TTable TabReg("REG");
|
||||
int anno = 0;
|
||||
TString annos (4);
|
||||
@ -228,7 +228,7 @@ bool mask_dataap (TMask_field& f, KEY k)
|
||||
if ( k == K_TAB && f.focusdirty() )
|
||||
{
|
||||
TDate data = f.mask().get_date(F_DATAAP);
|
||||
int anno = date2esc(data);
|
||||
int anno = esc.date2esc(data);
|
||||
|
||||
if (anno != 0)
|
||||
f.mask().set(F_ANNO, anno); // Esercizio di apertura
|
||||
@ -237,7 +237,7 @@ bool mask_dataap (TMask_field& f, KEY k)
|
||||
TDate inizio = TabEsch.get_date("D0");
|
||||
|
||||
--inizio;
|
||||
anno = date2esc(inizio);
|
||||
anno = esc.date2esc(inizio);
|
||||
|
||||
if (anno != 0)
|
||||
{
|
||||
@ -332,7 +332,7 @@ bool mask_dataap (TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool mask_distinti (TMask_field& f, KEY k)
|
||||
bool TApertura_chiusura::mask_distinti (TMask_field& f, KEY k)
|
||||
{
|
||||
int idg,idc,ids,idg1,idc1,ids1;
|
||||
|
||||
@ -378,7 +378,7 @@ bool mask_distinti (TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool attivo_passivo (TMask_field& f, KEY k)
|
||||
bool TApertura_chiusura::attivo_passivo (TMask_field& f, KEY k)
|
||||
{
|
||||
TLocalisamfile pcon (LF_PCON);
|
||||
|
||||
@ -409,7 +409,7 @@ bool attivo_passivo (TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool costi_ricavi (TMask_field& f, KEY k)
|
||||
bool TApertura_chiusura::costi_ricavi (TMask_field& f, KEY k)
|
||||
{
|
||||
TLocalisamfile pcon (LF_PCON);
|
||||
|
||||
@ -440,7 +440,7 @@ bool costi_ricavi (TMask_field& f, KEY k)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CG4600_application::create()
|
||||
bool TApertura_chiusura::create()
|
||||
{
|
||||
TApplication::create();
|
||||
|
||||
@ -464,7 +464,7 @@ bool CG4600_application::create()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CG4600_application::destroy()
|
||||
bool TApertura_chiusura::destroy()
|
||||
{
|
||||
delete _saldi;
|
||||
delete _sale;
|
||||
@ -480,7 +480,7 @@ bool CG4600_application::destroy()
|
||||
return TApplication::destroy();
|
||||
}
|
||||
|
||||
void CG4600_application::ultima_registrazione()
|
||||
long TApertura_chiusura::ultima_registrazione()
|
||||
{
|
||||
long numregmov;
|
||||
|
||||
@ -488,10 +488,10 @@ void CG4600_application::ultima_registrazione()
|
||||
_mov->last(); //dell'ultimo record di mov, e lo
|
||||
numregmov = _mov->get_long(MOV_NUMREG); //incremento di uno per ottenere
|
||||
_numreg = numregmov + 1; //un numero di registrazione
|
||||
//sicuramente non esistente.
|
||||
return _numreg; //sicuramente non esistente.
|
||||
}
|
||||
|
||||
void CG4600_application::data_competenza(int anno, TDate& datacomp)
|
||||
void TApertura_chiusura::data_competenza(int anno, TDate& datacomp)
|
||||
{
|
||||
TString16 dep (format("%04d", anno));
|
||||
|
||||
@ -501,7 +501,7 @@ void CG4600_application::data_competenza(int anno, TDate& datacomp)
|
||||
datacomp = _esc->get_date("D1");
|
||||
}
|
||||
|
||||
bool CG4600_application::set()
|
||||
bool TApertura_chiusura::set()
|
||||
{
|
||||
TTable TabEs ("ESC");
|
||||
TMask m ("cg4600a");
|
||||
@ -652,6 +652,10 @@ bool CG4600_application::set()
|
||||
_sld->set_tipo_saldo(chiusura);
|
||||
_sld->set_movimentato(TRUE);
|
||||
|
||||
// Guy: 10-01-97 errore MI6077
|
||||
if (_sld->data_ulmov() < _dataregch)
|
||||
_sld->set_data_ulmov(_dataregch);
|
||||
|
||||
// _pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
|
||||
costi ();
|
||||
|
||||
@ -692,6 +696,11 @@ bool CG4600_application::set()
|
||||
_sld->set_anno_es(_annoesap);
|
||||
_sld->set_tipo_saldo(apertura);
|
||||
_sld->set_movimentato(TRUE);
|
||||
|
||||
// Guy: 10-01-97 errore MI6077
|
||||
if (_sld->data_ulmov() < _dataregap)
|
||||
_sld->set_data_ulmov(_dataregap);
|
||||
|
||||
// _pn->destroy_rows(_numreg); //Azzero l'oggetto pn.
|
||||
*_cur = 0l;
|
||||
|
||||
@ -720,7 +729,7 @@ bool CG4600_application::set()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CG4600_application::compila_testata(int annoes,TDate& datareg,TString& codcaus,TDate& datacomp)
|
||||
void TApertura_chiusura::compila_testata(int annoes,TDate& datareg,TString& codcaus,TDate& datacomp)
|
||||
{
|
||||
_pn->lfile().zero();
|
||||
_pn->lfile().put(MOV_ANNOES, annoes); //Viene generato un movimento
|
||||
@ -730,7 +739,7 @@ void CG4600_application::compila_testata(int annoes,TDate& datareg,TString& codc
|
||||
_pn->lfile().put(MOV_DATACOMP, datacomp);
|
||||
}
|
||||
|
||||
void CG4600_application::rmov_proper(int anno,long numrig,TDate& datareg,TRectype& rmov,
|
||||
void TApertura_chiusura::rmov_proper(int anno,long numrig,TDate& datareg,TRectype& rmov,
|
||||
TConto& tc,real& tot_saldo,bool sezione_opposta)
|
||||
{
|
||||
char sez_rmov = ' ';
|
||||
@ -774,7 +783,7 @@ void CG4600_application::rmov_proper(int anno,long numrig,TDate& datareg,TRectyp
|
||||
rmov.put(RMV_IMPORTO, totale);
|
||||
}
|
||||
|
||||
void CG4600_application::costi()
|
||||
void TApertura_chiusura::costi()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -928,7 +937,7 @@ void CG4600_application::costi()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::ricavi()
|
||||
void TApertura_chiusura::ricavi()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -1081,7 +1090,7 @@ void CG4600_application::ricavi()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::chiusura_conto_economico()
|
||||
void TApertura_chiusura::chiusura_conto_economico()
|
||||
{
|
||||
_capitale_netto = _totale_saldo; //Mi serve per fare la riapertura del capitae netto
|
||||
|
||||
@ -1173,7 +1182,7 @@ void CG4600_application::chiusura_conto_economico()
|
||||
}
|
||||
}
|
||||
|
||||
void CG4600_application::chiudi_attivita()
|
||||
void TApertura_chiusura::chiudi_attivita()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -1327,7 +1336,7 @@ void CG4600_application::chiudi_attivita()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::chiudi_passivita()
|
||||
void TApertura_chiusura::chiudi_passivita()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -1480,7 +1489,7 @@ void CG4600_application::chiudi_passivita()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::chiudi_conti_ordine()
|
||||
void TApertura_chiusura::chiudi_conti_ordine()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -1631,7 +1640,7 @@ void CG4600_application::chiudi_conti_ordine()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::chiusura_conto_patrimoniale()
|
||||
void TApertura_chiusura::chiusura_conto_patrimoniale()
|
||||
{
|
||||
int j;
|
||||
long numrig;
|
||||
@ -1682,7 +1691,7 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
void CG4600_application::apri_attivita()
|
||||
void TApertura_chiusura::apri_attivita()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -1829,7 +1838,7 @@ void CG4600_application::apri_attivita()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::apri_passivita()
|
||||
void TApertura_chiusura::apri_passivita()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -1976,7 +1985,7 @@ void CG4600_application::apri_passivita()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::apri_conti_ordine()
|
||||
void TApertura_chiusura::apri_conti_ordine()
|
||||
{
|
||||
bool compila_mov = TRUE;
|
||||
long s;
|
||||
@ -2123,7 +2132,7 @@ void CG4600_application::apri_conti_ordine()
|
||||
} // for pcon
|
||||
}
|
||||
|
||||
void CG4600_application::apertura_capitale_netto()
|
||||
void TApertura_chiusura::apertura_capitale_netto()
|
||||
{
|
||||
int numrig;
|
||||
|
||||
@ -2172,7 +2181,7 @@ void CG4600_application::apertura_capitale_netto()
|
||||
}
|
||||
}
|
||||
|
||||
bool CG4600_application::menu(MENU_TAG m)
|
||||
bool TApertura_chiusura::menu(MENU_TAG m)
|
||||
{
|
||||
if (m == BAR_ITEM(1))
|
||||
return set();
|
||||
@ -2181,7 +2190,7 @@ bool CG4600_application::menu(MENU_TAG m)
|
||||
|
||||
int cg4600 (int argc, char* argv[])
|
||||
{
|
||||
CG4600_application main_app;
|
||||
TApertura_chiusura main_app;
|
||||
main_app.run(argc, argv, "Apertura/Chiusura Conti");
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <brwapp.h>
|
||||
#include <msksheet.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <saldi.h>
|
||||
#include <clifo.h>
|
||||
@ -231,15 +231,18 @@ bool TSaldibrowse_application::anno_handler(TMask_field& f, KEY key)
|
||||
{
|
||||
if (key == K_TAB && f.focusdirty())
|
||||
{
|
||||
TString cod(f.get());
|
||||
app()._anno = atoi(cod);
|
||||
app()._esc->zero();
|
||||
app()._esc->put("CODTAB",cod);
|
||||
if (cod.not_empty() && app()._esc->read() != NOERR)
|
||||
const int anno = atoi(f.get());
|
||||
if (anno > 0)
|
||||
{
|
||||
f.error_box("Esercizio %s non presente.",(const char*) cod);
|
||||
return FALSE;
|
||||
}
|
||||
app()._esc->put("CODTAB", anno);
|
||||
if (app()._esc->read() != NOERR)
|
||||
{
|
||||
f.error_box("Esercizio %d non presente.", anno);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
app()._anno = anno;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
#include <applicat.h>
|
||||
#include <isam.h>
|
||||
#include <mask.h>
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <mov.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include "cg5.h"
|
||||
#include "cg5400.h"
|
||||
|
@ -164,8 +164,10 @@ public:
|
||||
long num_ulmov() const { return _num_ulmov; }
|
||||
|
||||
void reset(); // pulisce l'array dei conti
|
||||
TSaldo_agg();
|
||||
int items() const { return _tab_conti.items();}
|
||||
|
||||
TSaldo_agg();
|
||||
virtual ~TSaldo_agg() { }
|
||||
};
|
||||
|
||||
class TEsercizio : public TSortable
|
||||
|
Loading…
x
Reference in New Issue
Block a user