Modifiche da Parma a causali mastrini list amovimenti e giornale
git-svn-id: svn://10.65.10.50/trunk@256 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
adb2327962
commit
7472971f9d
302
cg/cg0500.cpp
302
cg/cg0500.cpp
@ -13,7 +13,7 @@
|
|||||||
#include <rcausali.h>
|
#include <rcausali.h>
|
||||||
|
|
||||||
#include "cglib.h"
|
#include "cglib.h"
|
||||||
#include "cg0501.h"
|
#include "cg2103.h"
|
||||||
#include "cg0500.h"
|
#include "cg0500.h"
|
||||||
|
|
||||||
#define SS_TIPOCF 102
|
#define SS_TIPOCF 102
|
||||||
@ -171,6 +171,7 @@ typedef enum { acquisto, vendita, incasso_pagamento,
|
|||||||
// 1 vendite senza corrisp
|
// 1 vendite senza corrisp
|
||||||
// 2 vendite con corrisp
|
// 2 vendite con corrisp
|
||||||
// 3 acquisti
|
// 3 acquisti
|
||||||
|
// 4 sia acquisti che vendite
|
||||||
|
|
||||||
friend bool filtra_reg(const TRelation * r);
|
friend bool filtra_reg(const TRelation * r);
|
||||||
|
|
||||||
@ -181,6 +182,7 @@ typedef enum { acquisto, vendita, incasso_pagamento,
|
|||||||
static bool conto_hndl (TMask_field& f, KEY k);
|
static bool conto_hndl (TMask_field& f, KEY k);
|
||||||
static bool sottoconto_hndl (TMask_field& f, KEY k);
|
static bool sottoconto_hndl (TMask_field& f, KEY k);
|
||||||
static bool codcausim_hndl (TMask_field& f, KEY k);
|
static bool codcausim_hndl (TMask_field& f, KEY k);
|
||||||
|
static bool m770_hndl (TMask_field& f, KEY k);
|
||||||
static bool leggi_riga (int r, KEY k);
|
static bool leggi_riga (int r, KEY k);
|
||||||
|
|
||||||
TRelation * _rel;
|
TRelation * _rel;
|
||||||
@ -218,6 +220,7 @@ protected:
|
|||||||
// int cancella(long items);
|
// int cancella(long items);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool _forcedCopy;
|
||||||
TRighe_rcaus _righe_rcaus; // Array delle descrizioni delle righe
|
TRighe_rcaus _righe_rcaus; // Array delle descrizioni delle righe
|
||||||
tipo_descr _tipo_des; // Il tipo di causale corrente
|
tipo_descr _tipo_des; // Il tipo di causale corrente
|
||||||
int _riga; // Riga corrente dello sheet (set_notify)
|
int _riga; // Riga corrente dello sheet (set_notify)
|
||||||
@ -295,12 +298,27 @@ bool filtra_reg(const TRelation * r)
|
|||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Handler della maschera principale
|
// Handler della maschera principale
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
/************
|
||||||
|
se m770==6 le descrizioni devono essere
|
||||||
|
1. conto
|
||||||
|
2. cassa/banca
|
||||||
|
3. erario
|
||||||
|
************/
|
||||||
|
bool CG0500_application::m770_hndl (TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
const int m770 = m.get_int(F_M_770);
|
||||||
|
if (m770 == 6) app()->fill_sheet(m);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
bool CG0500_application::tipodoc_hndl (TMask_field& f, KEY k)
|
bool CG0500_application::tipodoc_hndl (TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
// if (k == K_TAB && f.focusdirty())
|
|
||||||
// Testo K_TAB perche' il controllo deve scattare anche all'inizio
|
// Testo K_TAB perche' il controllo deve scattare anche all'inizio
|
||||||
// per vedere, per es., se il registro scritto nella causale
|
// per vedere, per es., se il registro scritto nella causale esiste ancora
|
||||||
// esiste ancora
|
|
||||||
if (k == K_TAB)
|
if (k == K_TAB)
|
||||||
{
|
{
|
||||||
const TString16 val(f.get());
|
const TString16 val(f.get());
|
||||||
@ -308,14 +326,46 @@ bool CG0500_application::tipodoc_hndl (TMask_field& f, KEY k)
|
|||||||
|
|
||||||
if (val.not_empty() && val != "IN" && val != "PG" && val != "AN")
|
if (val.not_empty() && val != "IN" && val != "PG" && val != "AN")
|
||||||
{
|
{
|
||||||
if (salda_conto())
|
// if (f.to_check(k)) {
|
||||||
{
|
|
||||||
f.mask().hide(F_TIPO_MOV_2);
|
f.mask().hide(F_TIPO_MOV_2);
|
||||||
f.mask().show(F_TIPO_MOV_1);
|
if (salda_conto()) f.mask().show(F_TIPO_MOV_1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
f.mask().enable(F_COD_REG);
|
f.mask().enable(F_COD_REG);
|
||||||
field_reg.check_type(CHECK_REQUIRED);
|
field_reg.check_type(CHECK_REQUIRED);
|
||||||
|
|
||||||
|
TipoIVA i = nessuna_iva;
|
||||||
|
TTable tabtpd("%TPD");
|
||||||
|
tabtpd.put("CODTAB", val);
|
||||||
|
|
||||||
|
if (tabtpd.read() == NOERR)
|
||||||
|
{
|
||||||
|
i = (TipoIVA)tabtpd.get_int("I0"); // IVA acquisti, vendite, generica
|
||||||
|
bool corrisp = tabtpd.get_bool("B0");
|
||||||
|
|
||||||
|
if (i == 1) // vendite
|
||||||
|
{
|
||||||
|
if (corrisp) { // vendite con corrispettivi
|
||||||
|
app()->_filtro = 2;
|
||||||
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
|
}
|
||||||
|
else { // vendite senza corrispettivi
|
||||||
|
app()->_filtro = 1;
|
||||||
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if ( i == 2 ) // acquisti
|
||||||
|
{
|
||||||
|
app()->_filtro = 3;
|
||||||
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
|
} else
|
||||||
|
if ( i == 9 ) // sia acquisti che vendite
|
||||||
|
{
|
||||||
|
app()->_filtro = 4;
|
||||||
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**************************************************************
|
||||||
// Cambio il filtro sui registri: con tipo=1
|
// Cambio il filtro sui registri: con tipo=1
|
||||||
if (val == "FV" || val == "FF" || val == "FS") {
|
if (val == "FV" || val == "FF" || val == "FS") {
|
||||||
app()->_filtro = 1;
|
app()->_filtro = 1;
|
||||||
@ -338,6 +388,21 @@ bool CG0500_application::tipodoc_hndl (TMask_field& f, KEY k)
|
|||||||
app()->_filtro = 3;
|
app()->_filtro = 3;
|
||||||
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
field_reg.browse()->cursor()->set_filterfunction(filtra_reg);
|
||||||
}
|
}
|
||||||
|
**************************************************************/
|
||||||
|
|
||||||
|
}
|
||||||
|
else // TIPODOC vuoto || IN || PG || AN
|
||||||
|
{
|
||||||
|
// Devo poter rivedere tutti i registri se ho cancellato il campo TIPODOC
|
||||||
|
field_reg.check_type(CHECK_NORMAL);
|
||||||
|
f.mask().set(F_COD_REG,"");
|
||||||
|
f.mask().disable(F_COD_REG);
|
||||||
|
|
||||||
|
// if (f.to_check(k)) {
|
||||||
|
f.mask().hide(F_TIPO_MOV_1);
|
||||||
|
if (salda_conto()) f.mask().show(F_TIPO_MOV_2);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
// Ma davvero esiste il registro ?
|
// Ma davvero esiste il registro ?
|
||||||
TString16 codreg=f.mask().get(F_COD_REG);
|
TString16 codreg=f.mask().get(F_COD_REG);
|
||||||
@ -348,23 +413,10 @@ bool CG0500_application::tipodoc_hndl (TMask_field& f, KEY k)
|
|||||||
return f.warning_box("Non esiste il registro %s per l'anno %d",
|
return f.warning_box("Non esiste il registro %s per l'anno %d",
|
||||||
(const char *)codreg, anno_iva());
|
(const char *)codreg, anno_iva());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else // TIPODOC vuoto || IN || PG || AN
|
|
||||||
{
|
|
||||||
// Devo poter rivedere tutti i registri se ho cancellato il campo TIPODOC
|
|
||||||
field_reg.check_type(CHECK_NORMAL);
|
|
||||||
|
|
||||||
f.mask().set(F_COD_REG,"");
|
app()->MostraCampi(f);
|
||||||
f.mask().disable(F_COD_REG);
|
if (f.focusdirty())
|
||||||
if (salda_conto()) {
|
|
||||||
f.mask().hide(F_TIPO_MOV_1);
|
|
||||||
f.mask().show(F_TIPO_MOV_2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (f.focusdirty()) {
|
|
||||||
app()->fill_sheet(f.mask());
|
app()->fill_sheet(f.mask());
|
||||||
app()->MostraCampi(f); // show-hide di diversi campi pilotati da codreg
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -373,7 +425,7 @@ bool CG0500_application::tipomov_hndl (TMask_field& f, KEY k)
|
|||||||
{
|
{
|
||||||
if (k == K_SPACE) {
|
if (k == K_SPACE) {
|
||||||
app()->MostraCampi(f);
|
app()->MostraCampi(f);
|
||||||
app()->fill_sheet(f.mask());
|
if (f.focusdirty()) app()->fill_sheet(f.mask());
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -402,59 +454,88 @@ bool CG0500_application::codcausim_hndl (TMask_field& f, KEY k)
|
|||||||
|
|
||||||
bool CG0500_application::MostraCampi(TMask_field& f)
|
bool CG0500_application::MostraCampi(TMask_field& f)
|
||||||
{
|
{
|
||||||
const int tpm = f.mask().get_int(F_TIPO_MOV);
|
TMask& m = f.mask();
|
||||||
TString16 codreg = f.mask().get(F_COD_REG);
|
const int tpm = m.get_int(F_TIPO_MOV);
|
||||||
|
TString16 codreg = m.get(F_COD_REG);
|
||||||
if (codreg.empty())
|
if (codreg.empty())
|
||||||
{
|
{
|
||||||
|
m.hide(F_AUTO_FAT);
|
||||||
|
m.hide(F_ALLEGAT);
|
||||||
|
m.hide(F_FAT_RITARDO);
|
||||||
|
m.hide(F_OP_INTRACOM);
|
||||||
|
m.hide(F_VALINTRA);
|
||||||
|
if (salda_conto()) m.hide(F_COD_CAUS_IM);
|
||||||
|
|
||||||
switch (tpm) {
|
switch (tpm) {
|
||||||
case 0:
|
case 0:
|
||||||
f.mask().show(F_OP_FINE_ANNO);
|
m.show(F_OP_FINE_ANNO);
|
||||||
f.mask().hide(F_MOV_VALU);
|
m.show(F_COLL_CESP);
|
||||||
f.mask().hide(F_MOV_SEZ);
|
m.show(F_M_770);
|
||||||
|
m.hide(F_MOV_VALU);
|
||||||
|
m.hide(F_MOV_SEZ);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
f.mask().hide(F_OP_FINE_ANNO);
|
if (gestione_valuta()) m.show(F_MOV_VALU);
|
||||||
f.mask().show(F_MOV_VALU);
|
if (salda_conto()) m.show(F_MOV_SEZ);
|
||||||
f.mask().show(F_MOV_SEZ);
|
m.show(F_M_770);
|
||||||
f.mask().hide(F_COLL_CESP);
|
m.hide(F_OP_FINE_ANNO);
|
||||||
|
m.hide(F_COLL_CESP);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
f.mask().show(F_COLL_CESP);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // codreg non vuoto
|
else { // codreg non vuoto
|
||||||
f.mask().hide(F_OP_FINE_ANNO);
|
m.hide(F_OP_FINE_ANNO);
|
||||||
f.mask().hide(F_MOV_SEZ);
|
m.hide(F_MOV_SEZ);
|
||||||
if (gestione_valuta())
|
if (gestione_valuta()) m.show(F_MOV_VALU);
|
||||||
f.mask().show(F_MOV_VALU);
|
if (!salda_conto()) m.show(F_COD_CAUS_IM);
|
||||||
|
m.show(F_AUTO_FAT);
|
||||||
|
m.show(F_ALLEGAT);
|
||||||
|
m.show(F_FAT_RITARDO);
|
||||||
|
m.show(F_COLL_CESP);
|
||||||
|
m.show(F_OP_INTRACOM);
|
||||||
|
m.show(F_VALINTRA);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0500_application::cod_reg_hndl (TMask_field& f, KEY k)
|
bool CG0500_application::cod_reg_hndl (TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
// if (k == K_TAB && f.focusdirty())
|
if (k == K_TAB) {
|
||||||
if (k == K_TAB)
|
|
||||||
{
|
|
||||||
app()->MostraCampi(f);
|
app()->MostraCampi(f);
|
||||||
if (f.focusdirty()) app()->fill_sheet(f.mask());
|
if (f.focusdirty()) app()->fill_sheet(f.mask());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// controllo di consistenza tra codice (tipo) registro e tipo documento
|
// controllo di consistenza tra codice (tipo) registro e tipo documento
|
||||||
// if (k == K_ENTER && f.dirty())
|
|
||||||
if (k == K_ENTER)
|
if (k == K_ENTER)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
// bool ok = TRUE;
|
||||||
|
|
||||||
const TString16 tpd = f.mask().get(F_TIPO_DOC);
|
const TString16 tpd = f.mask().get(F_TIPO_DOC);
|
||||||
const int tipo = f.mask().get_int(F_TIPO_REG);
|
|
||||||
const bool corrisp = f.mask().get_bool(F_CORRISP);
|
|
||||||
const TString16 codreg = f.mask().get(F_COD_REG);
|
const TString16 codreg = f.mask().get(F_COD_REG);
|
||||||
|
|
||||||
|
if (tpd.not_empty())
|
||||||
|
{
|
||||||
|
TipoIVA i = nessuna_iva;
|
||||||
|
TRegistro grog(codreg, anno_iva());
|
||||||
|
TTable tabtpd("%TPD");
|
||||||
|
tabtpd.put("CODTAB", tpd);
|
||||||
|
if (tabtpd.read() == NOERR)
|
||||||
|
{
|
||||||
|
i = (TipoIVA)tabtpd.get_int("I0"); // IVA acquisti, vendite, generica
|
||||||
|
const TipoIVA ri = grog.iva();
|
||||||
|
if (i == iva_generica) i = ri;
|
||||||
|
if (i != ri) {
|
||||||
|
return f.warning_box("Tipo documento incompatibile con tipo registro");
|
||||||
|
i = iva_errata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
if (tpd.not_empty() && tpd != "AN" && tpd != "PG" && tpd != "IN")
|
if (tpd.not_empty() && tpd != "AN" && tpd != "PG" && tpd != "IN")
|
||||||
{
|
{
|
||||||
if (codreg.empty())
|
if (codreg.empty())
|
||||||
@ -487,10 +568,12 @@ bool CG0500_application::cod_reg_hndl (TMask_field& f, KEY k)
|
|||||||
if (tipo != 2) ok = FALSE;
|
if (tipo != 2) ok = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return f.warning_box("Il registro (tipo %d) non e' compatibile con il tipo di documento (%s)",
|
return f.warning_box("Il registro (tipo %d) non e' compatibile con il tipo di documento (%s)",
|
||||||
tipo, (const char*)tpd);
|
tipo, (const char*)tpd);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -677,23 +760,40 @@ void TRighe_rcaus::CausaleIncassoPagamento()
|
|||||||
|
|
||||||
void CG0500_application::compilaarray(const TString& tpd, int tpm, int tpr, int m770)
|
void CG0500_application::compilaarray(const TString& tpd, int tpm, int tpr, int m770)
|
||||||
{
|
{
|
||||||
|
_forcedCopy = FALSE;
|
||||||
if (tpd.empty() || tpd == "IN" || tpd == "AN" || tpd == "PG")
|
if (tpd.empty() || tpd == "IN" || tpd == "AN" || tpd == "PG")
|
||||||
{
|
{
|
||||||
if ( tpm == 3 || tpm == 5 || tpm == 6 )
|
if (salda_conto())
|
||||||
|
{
|
||||||
|
switch (tpm) {
|
||||||
|
case 3:
|
||||||
|
case 5:
|
||||||
|
case 6:
|
||||||
_righe_rcaus.CausaleIncassoPagamento();
|
_righe_rcaus.CausaleIncassoPagamento();
|
||||||
else
|
break;
|
||||||
{
|
case 0:
|
||||||
if ( !salda_conto() || tpm == 0 )
|
|
||||||
if (m770 == 6)
|
if (m770 == 6)
|
||||||
{
|
|
||||||
_righe_rcaus.CausaleRitenutaOccas();
|
_righe_rcaus.CausaleRitenutaOccas();
|
||||||
return;
|
else {
|
||||||
|
_forcedCopy = TRUE;
|
||||||
|
_righe_rcaus.ClearDescr();
|
||||||
|
_righe_rcaus.CaricaRigheLibere();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_forcedCopy = TRUE;
|
||||||
|
_righe_rcaus.ClearDescr();
|
||||||
|
_righe_rcaus.CaricaRigheLibere();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // NO saldaconto
|
||||||
|
_forcedCopy = TRUE;
|
||||||
_righe_rcaus.ClearDescr();
|
_righe_rcaus.ClearDescr();
|
||||||
_righe_rcaus.CaricaRigheLibere();
|
_righe_rcaus.CaricaRigheLibere();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else // C'e' il tipodoc.
|
||||||
{
|
{
|
||||||
if (tpr == 1)
|
if (tpr == 1)
|
||||||
_righe_rcaus.CausaleVendite();
|
_righe_rcaus.CausaleVendite();
|
||||||
@ -702,6 +802,7 @@ void CG0500_application::compilaarray(const TString& tpd, int tpm, int tpr, int
|
|||||||
_righe_rcaus.CausaleAcquisti();
|
_righe_rcaus.CausaleAcquisti();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_forcedCopy = TRUE;
|
||||||
_righe_rcaus.ClearDescr();
|
_righe_rcaus.ClearDescr();
|
||||||
_righe_rcaus.CaricaRigheLibere();
|
_righe_rcaus.CaricaRigheLibere();
|
||||||
}
|
}
|
||||||
@ -781,20 +882,28 @@ void CG0500_application::array2sheet()
|
|||||||
char _dfi [30];
|
char _dfi [30];
|
||||||
TFixed_string dfi(_dfi,30);
|
TFixed_string dfi(_dfi,30);
|
||||||
_items = _righe_rcaus.items();
|
_items = _righe_rcaus.items();
|
||||||
// ss().reset();
|
bool update = FALSE;
|
||||||
|
|
||||||
for (int i = 0; i < _items; i++)
|
for (int i = 0; i < _items; i++)
|
||||||
{
|
{
|
||||||
TToken_string & riga = ss().row(i);
|
TToken_string& riga = ss().row(i);
|
||||||
TToken_string * r = (TToken_string*)_righe_rcaus.objptr(i);
|
TToken_string* r = (TToken_string*)_righe_rcaus.objptr(i);
|
||||||
if (r != NULL)
|
|
||||||
{
|
|
||||||
dfi = r->get(0);
|
dfi = r->get(0);
|
||||||
|
// Ricopio la descrizione solo se non vuota
|
||||||
|
if (_forcedCopy) {
|
||||||
|
update = TRUE;
|
||||||
|
riga.add(dfi,0);
|
||||||
|
} else
|
||||||
|
if (!r->empty_items())
|
||||||
|
{
|
||||||
|
if (dfi.not_empty()) {
|
||||||
|
update = TRUE;
|
||||||
riga.add(dfi,0);
|
riga.add(dfi,0);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
riga.cut(0);
|
|
||||||
}
|
}
|
||||||
ss().force_update();
|
}
|
||||||
|
if (update) ss().force_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
||||||
@ -803,15 +912,19 @@ bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
|||||||
TString16 tpd, codreg;
|
TString16 tpd, codreg;
|
||||||
int tpm, m770, tpr;
|
int tpm, m770, tpr;
|
||||||
|
|
||||||
if (m.mode() == MODE_MOD && !fromHandler)
|
// if (m.mode() == MODE_MOD && !fromHandler)
|
||||||
{
|
if (fromHandler) {
|
||||||
|
codreg = m.field(F_COD_REG).get();
|
||||||
|
tpd = m.field(F_TIPO_DOC).get();
|
||||||
|
tpm = m.get_int(F_TIPO_MOV);
|
||||||
|
m770 = m.get_int(F_M_770);
|
||||||
|
} else if (m.mode() == MODE_MOD) {
|
||||||
codreg = caus.get("REG");
|
codreg = caus.get("REG");
|
||||||
tpd = caus.get("TIPODOC");
|
tpd = caus.get("TIPODOC");
|
||||||
tpm = caus.get_int("TIPOMOV");
|
tpm = caus.get_int("TIPOMOV");
|
||||||
m770 = caus.get_int("M770");
|
m770 = caus.get_int("M770");
|
||||||
}
|
}
|
||||||
else
|
else { // sono in inserimento e prima di entrare negli handler
|
||||||
{
|
|
||||||
codreg = m.field(F_COD_REG).get();
|
codreg = m.field(F_COD_REG).get();
|
||||||
tpd = m.field(F_TIPO_DOC).get();
|
tpd = m.field(F_TIPO_DOC).get();
|
||||||
tpm = m.get_int(F_TIPO_MOV);
|
tpm = m.get_int(F_TIPO_MOV);
|
||||||
@ -820,8 +933,7 @@ bool CG0500_application::descr2array(TMask& m, bool fromHandler)
|
|||||||
|
|
||||||
if (fromHandler)
|
if (fromHandler)
|
||||||
tpr = m.get_int(F_TIPO_REG);
|
tpr = m.get_int(F_TIPO_REG);
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
TString16 chiave; chiave << anno_iva() << codreg;
|
TString16 chiave; chiave << anno_iva() << codreg;
|
||||||
TTable reg("REG");
|
TTable reg("REG");
|
||||||
reg.put("CODTAB", chiave);
|
reg.put("CODTAB", chiave);
|
||||||
@ -894,7 +1006,6 @@ int CG0500_application::re_write(const TMask& m,bool rewrite)
|
|||||||
desc = riga.get();
|
desc = riga.get();
|
||||||
coddesc = riga.get();
|
coddesc = riga.get();
|
||||||
|
|
||||||
// NB spostato TIPOCF da terzultimo a secondo
|
|
||||||
if (g > 0 || c > 0 || s > 0L)
|
if (g > 0 || c > 0 || s > 0L)
|
||||||
{
|
{
|
||||||
rcaus->zero();
|
rcaus->zero();
|
||||||
@ -923,7 +1034,6 @@ int CG0500_application::re_write(const TMask& m,bool rewrite)
|
|||||||
if (rewrite)
|
if (rewrite)
|
||||||
{
|
{
|
||||||
togli_dal_file(cau); // Elimina dal file le righe rimaste nel bitarray
|
togli_dal_file(cau); // Elimina dal file le righe rimaste nel bitarray
|
||||||
// return _rel->rewrite();
|
|
||||||
return caus->rewrite();
|
return caus->rewrite();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -931,24 +1041,6 @@ int CG0500_application::re_write(const TMask& m,bool rewrite)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
int CG0500_application::cancella(long items)
|
|
||||||
{
|
|
||||||
TLocalisamfile * rcaus = _rel->lfile(LF_RCAUSALI);
|
|
||||||
const TString codcaus = _rel->lfile()->get(RCA_CODCAUS);
|
|
||||||
for (int i = 1; i <= items; i++)
|
|
||||||
{
|
|
||||||
rcaus->zero();
|
|
||||||
rcaus->put(RCA_CODCAUS, codcaus);
|
|
||||||
rcaus->put(RCA_NRIGA, i);
|
|
||||||
if (rcaus->read(_isequal, _lock) == NOERR)
|
|
||||||
rcaus->remove();
|
|
||||||
}
|
|
||||||
return rcaus->status();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
bool CG0500_application::remove()
|
bool CG0500_application::remove()
|
||||||
{
|
{
|
||||||
const bool ok = TRelation_application::remove();
|
const bool ok = TRelation_application::remove();
|
||||||
@ -988,41 +1080,10 @@ void CG0500_application::init_modify_mode(TMask& m)
|
|||||||
|
|
||||||
void CG0500_application::init_mask(TMask& m)
|
void CG0500_application::init_mask(TMask& m)
|
||||||
{
|
{
|
||||||
const TString tpd(m.get(F_TIPO_DOC));
|
|
||||||
const TString tpm(m.get(F_TIPO_MOV));
|
|
||||||
|
|
||||||
// F_TIPO_MOV e', nella maschera, un campo nascosto.
|
|
||||||
// Sono visibili nella maschera F_TIPO_MOV_1 oppure F_TIPO_MOV2,
|
|
||||||
// a seconda che F_TIPO_DOC sia compilato oppure no.
|
|
||||||
// All'inizio viene fatto l'output del campo TIPOMOV del file nel campo
|
|
||||||
// nascosto F_TIPO_MOV.
|
|
||||||
// Qui il contenuto di F_TIPO_MOV viene mandato a F_TIPO_MOV_1
|
|
||||||
// oppure F_TIPO_MOV_2.
|
|
||||||
if (tpd.empty() || tpd == "IN" || tpd == "AN" || tpd == "PG")
|
|
||||||
{
|
|
||||||
m.hide(F_TIPO_MOV_1);
|
|
||||||
m.set(F_TIPO_MOV_2, tpm);
|
|
||||||
m.show(F_TIPO_MOV_2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m.hide(F_TIPO_MOV_2);
|
|
||||||
m.set(F_TIPO_MOV_1, tpm);
|
|
||||||
m.show(F_TIPO_MOV_1);
|
|
||||||
}
|
|
||||||
// 27/06/94 Setto il campo nascosto F_ANNOES all'anno di liq. Iva
|
// 27/06/94 Setto il campo nascosto F_ANNOES all'anno di liq. Iva
|
||||||
// preso dai par.ditta
|
// preso dai par.ditta
|
||||||
const int anno = anno_iva();
|
const int anno = anno_iva();
|
||||||
m.set(F_ANNOES, anno);
|
m.set(F_ANNOES, anno);
|
||||||
|
|
||||||
// Setto il tipo reg e il flag corrisp nei campi nascosti della maschera
|
|
||||||
// perche non mi fa l'output su di essi quando carica i dati dal file
|
|
||||||
/*
|
|
||||||
TRegistro reg(codreg, anno);
|
|
||||||
const int tipo = reg.tipo();
|
|
||||||
m.set(F_TIPO_REG, tipo);
|
|
||||||
m.set(F_CORRISP, reg.corrisp());
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1050,10 +1111,13 @@ bool CG0500_application::user_create()
|
|||||||
_msk->hide (F_MOV_VALU);
|
_msk->hide (F_MOV_VALU);
|
||||||
|
|
||||||
_msk->set_handler(F_TIPO_DOC, tipodoc_hndl);
|
_msk->set_handler(F_TIPO_DOC, tipodoc_hndl);
|
||||||
|
if (salda_conto()) {
|
||||||
_msk->set_handler(F_TIPO_MOV_1, tipomov_hndl);
|
_msk->set_handler(F_TIPO_MOV_1, tipomov_hndl);
|
||||||
_msk->set_handler(F_TIPO_MOV_2, tipomov_hndl);
|
_msk->set_handler(F_TIPO_MOV_2, tipomov_hndl);
|
||||||
|
}
|
||||||
_msk->set_handler(F_COD_REG, cod_reg_hndl);
|
_msk->set_handler(F_COD_REG, cod_reg_hndl);
|
||||||
_msk->set_handler(F_COD_CAUS_IM, codcausim_hndl);
|
_msk->set_handler(F_COD_CAUS_IM, codcausim_hndl);
|
||||||
|
_msk->set_handler(F_M_770, m770_hndl);
|
||||||
|
|
||||||
TSheet_field& cs = ss();
|
TSheet_field& cs = ss();
|
||||||
cs.set_notify(leggi_riga);
|
cs.set_notify(leggi_riga);
|
||||||
@ -1064,6 +1128,8 @@ bool CG0500_application::user_create()
|
|||||||
cs.sheet_mask().set_handler(305, sottoconto_hndl);
|
cs.sheet_mask().set_handler(305, sottoconto_hndl);
|
||||||
cs.sheet_mask().set_handler(104, conto_hndl);
|
cs.sheet_mask().set_handler(104, conto_hndl);
|
||||||
|
|
||||||
|
_forcedCopy = FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,10 +14,13 @@ BEGIN
|
|||||||
PROMPT 33 1 "C/F "
|
PROMPT 33 1 "C/F "
|
||||||
ITEM " |Conto"
|
ITEM " |Conto"
|
||||||
MESSAGE SHOW,105|HIDE,205|HIDE,305
|
MESSAGE SHOW,105|HIDE,205|HIDE,305
|
||||||
|
MESSAGE SHOW,107|HIDE,207|HIDE,307
|
||||||
ITEM "C|Cliente"
|
ITEM "C|Cliente"
|
||||||
MESSAGE SHOW,205|HIDE,105|HIDE,305
|
MESSAGE SHOW,205|HIDE,105|HIDE,305
|
||||||
|
MESSAGE SHOW,207|HIDE,107|HIDE,307
|
||||||
ITEM "F|Fornitore"
|
ITEM "F|Fornitore"
|
||||||
MESSAGE SHOW,305|HIDE,105|HIDE,205
|
MESSAGE SHOW,305|HIDE,105|HIDE,205
|
||||||
|
MESSAGE SHOW,307|HIDE,107|HIDE,207
|
||||||
FLAGS "DG"
|
FLAGS "DG"
|
||||||
GROUP 1
|
GROUP 1
|
||||||
// FLAGS "U"
|
// FLAGS "U"
|
||||||
@ -104,6 +107,7 @@ BEGIN
|
|||||||
OUTPUT 107 RAGSOC
|
OUTPUT 107 RAGSOC
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
|
MESSAGE CLEAR,105
|
||||||
MESSAGE COPY,105
|
MESSAGE COPY,105
|
||||||
ADD RUN CG0 -1
|
ADD RUN CG0 -1
|
||||||
GROUP 1
|
GROUP 1
|
||||||
@ -126,6 +130,7 @@ BEGIN
|
|||||||
OUTPUT 107 RAGSOC
|
OUTPUT 107 RAGSOC
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
|
MESSAGE CLEAR,105
|
||||||
MESSAGE COPY,105
|
MESSAGE COPY,105
|
||||||
ADD RUN CG0 -1
|
ADD RUN CG0 -1
|
||||||
GROUP 1
|
GROUP 1
|
||||||
@ -145,16 +150,40 @@ END
|
|||||||
STRING 107 50
|
STRING 107 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Descrizione "
|
PROMPT 1 5 "Descrizione "
|
||||||
USE LF_PCON KEY 2
|
|
||||||
FIELD LF_RCAUSALI->DESC
|
FIELD LF_RCAUSALI->DESC
|
||||||
|
USE LF_PCON KEY 2
|
||||||
|
INPUT DESCR 107
|
||||||
|
DISPLAY "Descrizione@50" DESCR
|
||||||
|
DISPLAY "Gruppo" GRUPPO
|
||||||
|
DISPLAY "Conto" CONTO
|
||||||
|
DISPLAY "Sottoconto" SOTTOCONTO
|
||||||
|
OUTPUT 103 GRUPPO
|
||||||
|
OUTPUT 104 CONTO
|
||||||
|
OUTPUT 105 SOTTOCONTO
|
||||||
|
OUTPUT 107 DESCR
|
||||||
|
// MESSAGE COPY, 207
|
||||||
|
// MESSAGE COPY, 307
|
||||||
|
ADD RUN CG0 -0
|
||||||
GROUP 1
|
GROUP 1
|
||||||
END
|
END
|
||||||
|
|
||||||
// Descrizione CLIENTE
|
// Descrizione CLIENTE
|
||||||
STRING 207 50
|
STRING 207 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Descrizione "
|
PROMPT 1 5 "Rag.sociale "
|
||||||
FIELD LF_RCAUSALI->DESC
|
FIELD LF_RCAUSALI->DESC
|
||||||
|
USE LF_CLIFO KEY 2 SELECT (TIPOCF=="C")
|
||||||
|
INPUT TIPOCF "C"
|
||||||
|
INPUT CODCF 205
|
||||||
|
DISPLAY "Tipo C/F" TIPOCF
|
||||||
|
DISPLAY "Ragione sociale@50" RAGSOC
|
||||||
|
DISPLAY "Gruppo" GRUPPO
|
||||||
|
DISPLAY "Conto" CONTO
|
||||||
|
DISPLAY "Sottoconto" CODCF
|
||||||
|
OUTPUT 205 CODCF
|
||||||
|
OUTPUT 207 RAGSOC
|
||||||
|
MESSAGE CLEAR,107
|
||||||
|
MESSAGE COPY,107
|
||||||
GROUP 1
|
GROUP 1
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
@ -162,8 +191,20 @@ END
|
|||||||
// Descrizione FORNITORE
|
// Descrizione FORNITORE
|
||||||
STRING 307 50
|
STRING 307 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 5 "Descrizione "
|
PROMPT 1 5 "Rag.sociale "
|
||||||
FIELD LF_RCAUSALI->DESC
|
FIELD LF_RCAUSALI->DESC
|
||||||
|
USE LF_CLIFO KEY 2 SELECT (TIPOCF=="F")
|
||||||
|
INPUT TIPOCF "F"
|
||||||
|
INPUT CODCF 305
|
||||||
|
DISPLAY "Tipo C/F" TIPOCF
|
||||||
|
DISPLAY "Ragione sociale@50" RAGSOC
|
||||||
|
DISPLAY "Gruppo" GRUPPO
|
||||||
|
DISPLAY "Conto" CONTO
|
||||||
|
DISPLAY "Sottoconto" CODCF
|
||||||
|
OUTPUT 305 CODCF
|
||||||
|
OUTPUT 307 RAGSOC
|
||||||
|
MESSAGE CLEAR,107
|
||||||
|
MESSAGE COPY,107
|
||||||
GROUP 1
|
GROUP 1
|
||||||
FLAGS "H"
|
FLAGS "H"
|
||||||
END
|
END
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "cg3.h"
|
#include "cg3.h"
|
||||||
#include "cg3100.h"
|
#include "cg3100.h"
|
||||||
#include "cg3401.h"
|
#include "cglib03.h"
|
||||||
|
|
||||||
//const MAXSTR = 128;
|
//const MAXSTR = 128;
|
||||||
//static char __tmp [MAXSTR];
|
//static char __tmp [MAXSTR];
|
||||||
@ -67,7 +67,7 @@ class CG3100_application : public TPrintapp
|
|||||||
TString _capcf, _codval, _simbolo, _statocf, _comcf, _tipo_fin;
|
TString _capcf, _codval, _simbolo, _statocf, _comcf, _tipo_fin;
|
||||||
long _documenti, _codice_ini, _codice_fin, _numero_reg,_codcf;
|
long _documenti, _codice_ini, _codice_fin, _numero_reg,_codcf;
|
||||||
long _numreg, _numreg_fin, _numreg_ini, _codalleg, _numeroregp,_codclifosucc;
|
long _numreg, _numreg_fin, _numreg_ini, _codalleg, _numeroregp,_codclifosucc;
|
||||||
long _codcf_prec;
|
long _codcf_prec, _numr;
|
||||||
int _anno, _annoes;
|
int _anno, _annoes;
|
||||||
real _totdocumenti, _totdoc, _totimponibile, _totimposta, _importo;
|
real _totdocumenti, _totdoc, _totimponibile, _totimposta, _importo;
|
||||||
real _op_esenti, _op_non_imp, _impo, _impos;
|
real _op_esenti, _op_non_imp, _impo, _impos;
|
||||||
@ -861,13 +861,13 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
{
|
{
|
||||||
int anno = cur->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
int anno = cur->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||||
TString codreg = cur->curr(LF_MOV).get(MOV_REG);
|
TString codreg = cur->curr(LF_MOV).get(MOV_REG);
|
||||||
|
_numr = current_cursor()->curr(LF_MOV).get_long(MOV_NUMREG);
|
||||||
_tipo_elenco = current_cursor()->curr(LF_MOV).get(MOV_TIPO);
|
_tipo_elenco = current_cursor()->curr(LF_MOV).get(MOV_TIPO);
|
||||||
_codcf = current_cursor()->curr(LF_MOV).get_long(MOV_CODCF);
|
_codcf = current_cursor()->curr(LF_MOV).get_long(MOV_CODCF);
|
||||||
int tiporeg = CodiceRegistro (codreg, anno);
|
int tiporeg = CodiceRegistro (codreg, anno);
|
||||||
TString attreg = AttivitaRegistro (codreg, anno);
|
TString attreg = AttivitaRegistro (codreg, anno);
|
||||||
|
|
||||||
if ((tiporeg == 1)||(tiporeg == 2))//se si tratta di un movimento iva
|
if (tiporeg == 1 || tiporeg == 2)//se si tratta di un movimento iva
|
||||||
{
|
{
|
||||||
_tipoatt = TipoAttivita(attreg, get_firm());
|
_tipoatt = TipoAttivita(attreg, get_firm());
|
||||||
_tipo_elenco = cur->curr(LF_MOV).get(MOV_TIPO);
|
_tipo_elenco = cur->curr(LF_MOV).get(MOV_TIPO);
|
||||||
@ -876,10 +876,14 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
_tipodoc = cur->curr(LF_MOV).get(MOV_TIPODOC);
|
_tipodoc = cur->curr(LF_MOV).get(MOV_TIPODOC);
|
||||||
_codval = cur->curr(LF_MOV).get(MOV_CODVAL);
|
_codval = cur->curr(LF_MOV).get(MOV_CODVAL);
|
||||||
_totdoc = cur->curr(LF_MOV).get_real(MOV_TOTDOC);
|
_totdoc = cur->curr(LF_MOV).get_real(MOV_TOTDOC);
|
||||||
|
/*
|
||||||
if ((_tipo_elenco != _tipo_clifo_precedente) &&
|
if ((_tipo_elenco != _tipo_clifo_precedente) &&
|
||||||
(_tipo_clifo_precedente != "") && _salto_pagina)
|
(_tipo_clifo_precedente != "") && _salto_pagina)
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
|
*/
|
||||||
|
if ((_tipo_elenco != _tipo_clifo_prec) &&
|
||||||
|
(_tipo_clifo_prec != "") && _salto_pagina)
|
||||||
|
printer().formfeed();
|
||||||
|
|
||||||
TLocalisamfile* file = cur->file(LF_MOV);
|
TLocalisamfile* file = cur->file(LF_MOV);
|
||||||
TRectype da (file->curr());
|
TRectype da (file->curr());
|
||||||
@ -915,11 +919,14 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
stampa_intestazione();
|
stampa_intestazione();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ((_tipo_clifo_prec != _tipo_elenco)&&(_codcf_prec != _codcf))
|
if (_tipo_clifo_prec == _tipo_elenco && _codcf_prec == _codcf)
|
||||||
|
_settata_prima_riga = FALSE;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
stampa_intestazione();
|
stampa_intestazione();
|
||||||
_tipo_clifo_prec = _tipo_elenco;
|
_tipo_clifo_prec = _tipo_elenco;
|
||||||
_codcf_prec = _codcf;
|
_codcf_prec = _codcf;
|
||||||
|
_settata_prima_riga = FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -941,11 +948,9 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
_simbolo = SimboloValuta(_codval);
|
_simbolo = SimboloValuta(_codval);
|
||||||
_allegb = CausAlleg(_codcaus);
|
_allegb = CausAlleg(_codcaus);
|
||||||
_descr_doc = DescrDoc(_tipodoc);
|
_descr_doc = DescrDoc(_tipodoc);
|
||||||
|
//_totdocumenti += _totdoc;
|
||||||
_totdocumenti += _totdoc;
|
|
||||||
//_ricser = current_cursor()->curr(LF_RMOVIVA).get_int(RMI_RICSER);
|
//_ricser = current_cursor()->curr(LF_RMOVIVA).get_int(RMI_RICSER);
|
||||||
_intracom = current_cursor()->curr(LF_RMOVIVA).get_bool(RMI_INTRA);
|
_intracom = current_cursor()->curr(LF_RMOVIVA).get_bool(RMI_INTRA);
|
||||||
//long numeroreg = cur->curr(LF_RMOVIVA).get_long(RMI_NUMREG);
|
|
||||||
|
|
||||||
if ((_codval != "LIT") && _intracom)
|
if ((_codval != "LIT") && _intracom)
|
||||||
{
|
{
|
||||||
@ -996,7 +1001,6 @@ bool CG3100_application::preprocess_page(int file,int counter)
|
|||||||
incrementa_totali();
|
incrementa_totali();
|
||||||
_settata_prima_riga = TRUE;
|
_settata_prima_riga = TRUE;
|
||||||
++_documenti;
|
++_documenti;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (_settata_prima_riga)
|
else if (_settata_prima_riga)
|
||||||
{
|
{
|
||||||
@ -1075,6 +1079,8 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
case fatture:
|
case fatture:
|
||||||
if (file == LF_MOV)
|
if (file == LF_MOV)
|
||||||
{
|
{
|
||||||
|
long numreg;
|
||||||
|
_totdocumenti += _totdoc;
|
||||||
TRecnotype pos, items;
|
TRecnotype pos, items;
|
||||||
bool FINITO = FALSE;
|
bool FINITO = FALSE;
|
||||||
TLocalisamfile* mov;
|
TLocalisamfile* mov;
|
||||||
@ -1091,6 +1097,7 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
{
|
{
|
||||||
cur->save_status();
|
cur->save_status();
|
||||||
++(*cur);
|
++(*cur);
|
||||||
|
long numrsucc = cur->file(LF_MOV)->get_long(MOV_NUMREG);
|
||||||
_tipoelsucc = cur->file(LF_MOV)->get(MOV_TIPO);
|
_tipoelsucc = cur->file(LF_MOV)->get(MOV_TIPO);
|
||||||
_codclifosucc = cur->file(LF_MOV)->get_long(MOV_CODCF);
|
_codclifosucc = cur->file(LF_MOV)->get_long(MOV_CODCF);
|
||||||
--(*cur);
|
--(*cur);
|
||||||
@ -1112,17 +1119,19 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
set_row(3, "@75g%r", &_totimposta);
|
set_row(3, "@75g%r", &_totimposta);
|
||||||
set_row(3, "@94g%r", &_op_esenti);
|
set_row(3, "@94g%r", &_op_esenti);
|
||||||
set_row(3, "@112g%r", &_op_non_imp);
|
set_row(3, "@112g%r", &_op_non_imp);
|
||||||
_tipo_clifo_precedente = _tipo_elenco;
|
//_tipo_clifo_precedente = _tipo_elenco;
|
||||||
_totimposta = 0;
|
_totimposta = 0;
|
||||||
_totimponibile = 0;
|
_totimponibile = 0;
|
||||||
_op_esenti = 0;
|
_op_esenti = 0;
|
||||||
_op_non_imp = 0;
|
_op_non_imp = 0;
|
||||||
_documenti = 0;
|
_documenti = 0;
|
||||||
_tipo_clifo_prec = "";
|
_totdocumenti = 0;
|
||||||
_codcf_prec = 0l;
|
//_tipo_clifo_prec = "";
|
||||||
|
//_codcf_prec = 0l;
|
||||||
return REPEAT_PAGE;
|
return REPEAT_PAGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
else if (file == LF_RMOVIVA)
|
else if (file == LF_RMOVIVA)
|
||||||
{
|
{
|
||||||
long numrec;
|
long numrec;
|
||||||
@ -1132,17 +1141,16 @@ print_action CG3100_application::postprocess_page(int file,int count)
|
|||||||
|
|
||||||
TRecnotype recno = rmoviva->recno();
|
TRecnotype recno = rmoviva->recno();
|
||||||
rmoviva->next();
|
rmoviva->next();
|
||||||
//if (rmoviva->bad()) rmoviva->zero();
|
|
||||||
numrec = rmoviva->get_long(RMI_NUMREG);
|
numrec = rmoviva->get_long(RMI_NUMREG);
|
||||||
rmoviva->readat(recno);
|
rmoviva->readat(recno);
|
||||||
|
|
||||||
if (_numreg != numrec)
|
if ( (_numreg != numrec) && (
|
||||||
_settata_prima_riga = FALSE;
|
_settata_prima_riga = FALSE;
|
||||||
else
|
else
|
||||||
_settata_prima_riga = TRUE;
|
_settata_prima_riga = TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case movimenti_sezionale:
|
case movimenti_sezionale:
|
||||||
@ -1483,6 +1491,7 @@ bool CG3100_application::set_print(int m)
|
|||||||
|
|
||||||
reset_files();
|
reset_files();
|
||||||
TLocalisamfile* fl;
|
TLocalisamfile* fl;
|
||||||
|
//_curr1->set_filterfunction (0);
|
||||||
_curr1->set_filterfunction (filter_func);
|
_curr1->set_filterfunction (filter_func);
|
||||||
_curr2->set_filterfunction (filter_func);
|
_curr2->set_filterfunction (filter_func);
|
||||||
_curr3->set_filterfunction (filter_func_fatture);
|
_curr3->set_filterfunction (filter_func_fatture);
|
||||||
@ -1552,7 +1561,7 @@ bool CG3100_application::set_print(int m)
|
|||||||
fl = current_cursor()->file(LF_MOV);
|
fl = current_cursor()->file(LF_MOV);
|
||||||
TString tipo = msk.get(F_TIPOELENCO);
|
TString tipo = msk.get(F_TIPOELENCO);
|
||||||
bool movprov = msk.get_bool(F_STAMPAMOVP);
|
bool movprov = msk.get_bool(F_STAMPAMOVP);
|
||||||
if ((tipo=="C")||(tipo=="F"))
|
if (tipo=="C" || tipo=="F")
|
||||||
{
|
{
|
||||||
_codice_ini = atol(msk.get(F_CODICEINI));
|
_codice_ini = atol(msk.get(F_CODICEINI));
|
||||||
_codice_fin = atol(msk.get(F_CODICEFIN));
|
_codice_fin = atol(msk.get(F_CODICEFIN));
|
||||||
@ -1622,8 +1631,10 @@ void CG3100_application::user_create()
|
|||||||
|
|
||||||
_relmov1->add(LF_RMOV, "NUMREG=NUMREG",1);
|
_relmov1->add(LF_RMOV, "NUMREG=NUMREG",1);
|
||||||
_relmov1->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
_relmov1->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
||||||
|
|
||||||
_relmov2->add(LF_RMOV, "NUMREG=NUMREG",1);
|
_relmov2->add(LF_RMOV, "NUMREG=NUMREG",1);
|
||||||
_relmov2->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
_relmov2->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
||||||
|
|
||||||
_relmov3->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
_relmov3->add(LF_RMOVIVA, "NUMREG=NUMREG",1);
|
||||||
_relmov3->add(LF_RMOV, "NUMREG=NUMREG",1);
|
_relmov3->add(LF_RMOV, "NUMREG=NUMREG",1);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "cg3100.h"
|
#include "cg3100.h"
|
||||||
|
|
||||||
PAGE "Stampa Lista Movimenti" -1 -1 76 20
|
PAGE "" -1 -1 76 20
|
||||||
|
|
||||||
NUMBER F_CODDITTA 5
|
NUMBER F_CODDITTA 5
|
||||||
BEGIN
|
BEGIN
|
||||||
|
203
cg/cg3200.cpp
203
cg/cg3200.cpp
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
#include "cg3.h"
|
#include "cg3.h"
|
||||||
#include "cg3200.h"
|
#include "cg3200.h"
|
||||||
#include "cg3401.h"
|
|
||||||
#include "cglib.h"
|
#include "cglib.h"
|
||||||
|
#include "cglib03.h"
|
||||||
|
|
||||||
const MAXSTR = 128;
|
const MAXSTR = 128;
|
||||||
static char __tmp [MAXSTR];
|
static char __tmp [MAXSTR];
|
||||||
@ -65,7 +65,7 @@ class CG3200_application : public TPrintapp
|
|||||||
|
|
||||||
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
|
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
|
||||||
|
|
||||||
int _annomsk,_annoesmsk,_annomsksucc,_tipocf;
|
int _annomsk,_annoesmsk,_annomsksucc,_tipocf,_anno_ghost;
|
||||||
long _sottoc,_numreg,_annoes,_numgio,_protiva;
|
long _sottoc,_numreg,_annoes,_numgio,_protiva;
|
||||||
bool _stampa_progressivi_si,_competenza,_inizio_stampa,_puoi_stampare;
|
bool _stampa_progressivi_si,_competenza,_inizio_stampa,_puoi_stampare;
|
||||||
char _ricerca;
|
char _ricerca;
|
||||||
@ -164,7 +164,7 @@ bool CG3200_application::almeno_un_record()
|
|||||||
bool trovato=FALSE;
|
bool trovato=FALSE;
|
||||||
long record,sottoc;
|
long record,sottoc;
|
||||||
int gruppo,conto;
|
int gruppo,conto;
|
||||||
TDate datareg;
|
TDate datareg, datacomp;
|
||||||
TLocalisamfile* rmov;
|
TLocalisamfile* rmov;
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
rmov = current_cursor()->file(LF_RMOV);
|
||||||
@ -176,7 +176,7 @@ bool CG3200_application::almeno_un_record()
|
|||||||
rmov->put(RMV_GRUPPO,_gruppo);
|
rmov->put(RMV_GRUPPO,_gruppo);
|
||||||
rmov->put(RMV_CONTO,_conto);
|
rmov->put(RMV_CONTO,_conto);
|
||||||
rmov->put(RMV_SOTTOCONTO,_sottoc);
|
rmov->put(RMV_SOTTOCONTO,_sottoc);
|
||||||
for (rmov->read(); ;rmov->next())
|
for (rmov->read(); !rmov->eof() ;rmov->next())
|
||||||
{
|
{
|
||||||
int annoes = rmov->get_int (RMV_ANNOES);
|
int annoes = rmov->get_int (RMV_ANNOES);
|
||||||
long numreg = rmov->get_long(RMV_NUMREG);
|
long numreg = rmov->get_long(RMV_NUMREG);
|
||||||
@ -187,7 +187,7 @@ bool CG3200_application::almeno_un_record()
|
|||||||
_mov->read();
|
_mov->read();
|
||||||
if (_mov->bad())
|
if (_mov->bad())
|
||||||
_mov->zero();
|
_mov->zero();
|
||||||
TDate datacomp = (_mov->curr().get(MOV_DATACOMP));
|
datacomp = (_mov->curr().get(MOV_DATACOMP));
|
||||||
|
|
||||||
if (_annomsk == 0)
|
if (_annomsk == 0)
|
||||||
datareg = rmov->get_date(RMV_DATAREG);
|
datareg = rmov->get_date(RMV_DATAREG);
|
||||||
@ -290,7 +290,7 @@ bool CG3200_application::data_fine(TMask_field& f, KEY k)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
date2esc(data_ini);
|
app()->_anno_ghost = date2esc(data_ini);
|
||||||
|
|
||||||
if (data < app()->_inizioEs || data > app()->_fineEs)
|
if (data < app()->_inizioEs || data > app()->_fineEs)
|
||||||
{
|
{
|
||||||
@ -329,7 +329,7 @@ void CG3200_application::saldi_zero()
|
|||||||
while (!rmov->eof())
|
while (!rmov->eof())
|
||||||
{
|
{
|
||||||
rmov->read();
|
rmov->read();
|
||||||
// char sezione = *(_rmov->curr().get(RMV_SEZIONE));
|
// char sezione = *(_rmov->curr().get(RMV_SEZIONE));
|
||||||
TString sezione = rmov->curr().get(RMV_SEZIONE);
|
TString sezione = rmov->curr().get(RMV_SEZIONE);
|
||||||
real importo = rmov->curr().get_real(RMV_IMPORTO);
|
real importo = rmov->curr().get_real(RMV_IMPORTO);
|
||||||
int gruppo = atoi(rmov->get(RMV_GRUPPO));
|
int gruppo = atoi(rmov->get(RMV_GRUPPO));
|
||||||
@ -361,12 +361,6 @@ void CG3200_application::fai_stampa132()
|
|||||||
set_row (1,"@30g#7t", &_numdoc);
|
set_row (1,"@30g#7t", &_numdoc);
|
||||||
set_row (1,"@38g#3t", &_codcaus);
|
set_row (1,"@38g#3t", &_codcaus);
|
||||||
|
|
||||||
// _sezione = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
|
||||||
// if (_sezione == "D")
|
|
||||||
// set_row (1,"@85g#t", &_importo_str);
|
|
||||||
// else if (_sezione == "A")
|
|
||||||
// set_row (1,"@101g#t", &_importo_str);
|
|
||||||
|
|
||||||
set_row (1,"@117g#3t", &_gruppocontr);
|
set_row (1,"@117g#3t", &_gruppocontr);
|
||||||
set_row (1,"@120g#3t", &_contocontr);
|
set_row (1,"@120g#3t", &_contocontr);
|
||||||
set_row (1,"@123g#6t", &_sottocontocontr);
|
set_row (1,"@123g#6t", &_sottocontocontr);
|
||||||
@ -390,13 +384,7 @@ void CG3200_application::fai_stampa198()
|
|||||||
set_row (1,"@30g#7t", &_numdoc);
|
set_row (1,"@30g#7t", &_numdoc);
|
||||||
set_row (1,"@38g#3t", &_codcaus);
|
set_row (1,"@38g#3t", &_codcaus);
|
||||||
|
|
||||||
_sezione = current_cursor()->curr(LF_RMOV).get(RMV_SEZIONE);
|
// Stampa saldo movimenti
|
||||||
if (_sezione == "D")
|
|
||||||
set_row (1,"@102g#t", &_importo_str);
|
|
||||||
else if (_sezione == "A")
|
|
||||||
set_row (1,"@119g#t", &_importo_str);
|
|
||||||
|
|
||||||
// Stampa saldo movimenti
|
|
||||||
|
|
||||||
set_row (1,"@153g#t", &_saldo_movimenti_str);
|
set_row (1,"@153g#t", &_saldo_movimenti_str);
|
||||||
|
|
||||||
@ -410,7 +398,7 @@ void CG3200_application::fai_stampa198()
|
|||||||
_dataregrmov = current_cursor()->curr(LF_RMOV).get_date(RMV_DATAREG);
|
_dataregrmov = current_cursor()->curr(LF_RMOV).get_date(RMV_DATAREG);
|
||||||
dataregrmovstring=_dataregrmov.string();
|
dataregrmovstring=_dataregrmov.string();
|
||||||
|
|
||||||
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
//Gestire la stampa di saldo_progressivi nella postprocess_page di RMOV
|
||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
rmov = current_cursor()->file(LF_RMOV);
|
||||||
rec = rmov->recno();
|
rec = rmov->recno();
|
||||||
@ -450,7 +438,7 @@ void CG3200_application::stampa_totali132()
|
|||||||
set_row (5,"@32gTOTALI PROGRESSIVI AL@55g%s",(const char*)_ultima_data_reg.string());
|
set_row (5,"@32gTOTALI PROGRESSIVI AL@55g%s",(const char*)_ultima_data_reg.string());
|
||||||
set_row (5,"@69g%15.0r", &_saldo_progre_al);
|
set_row (5,"@69g%15.0r", &_saldo_progre_al);
|
||||||
set_row (5,"@85g%15.0r", &_totprogre_dare_al);
|
set_row (5,"@85g%15.0r", &_totprogre_dare_al);
|
||||||
set_row (5,"@101g%r", &_totprogre_avere_al);
|
set_row (5,"@101g%15.0r", &_totprogre_avere_al);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,7 +478,7 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
|||||||
switch (file)
|
switch (file)
|
||||||
{
|
{
|
||||||
case LF_PCON:
|
case LF_PCON:
|
||||||
// Usati in crea_intestazione()
|
// Usati in crea_intestazione()
|
||||||
_gruppo = atoi(current_cursor()->curr(LF_PCON).get(PCN_GRUPPO));
|
_gruppo = atoi(current_cursor()->curr(LF_PCON).get(PCN_GRUPPO));
|
||||||
_conto = atoi(current_cursor()->curr(LF_PCON).get(PCN_CONTO));
|
_conto = atoi(current_cursor()->curr(LF_PCON).get(PCN_CONTO));
|
||||||
_sottoc = atol(current_cursor()->curr(LF_PCON).get(PCN_SOTTOCONTO));
|
_sottoc = atol(current_cursor()->curr(LF_PCON).get(PCN_SOTTOCONTO));
|
||||||
@ -652,23 +640,31 @@ bool CG3200_application::preprocess_pconti(int file, int counter)
|
|||||||
{
|
{
|
||||||
_totale_periodo_dare += _importo;
|
_totale_periodo_dare += _importo;
|
||||||
_riporto_parziale_dare += _importo;
|
_riporto_parziale_dare += _importo;
|
||||||
if (_numcarat == 2)
|
|
||||||
|
if (_numcarat == 1) // Stampa 132 caratteri
|
||||||
|
set_row (1,"@85g%s", (const char*) _importo_str);
|
||||||
|
else
|
||||||
|
if (_numcarat == 2) // Stampa 198 caratteri
|
||||||
{
|
{
|
||||||
_saldo_progressivi += _importo;
|
_saldo_progressivi += _importo;
|
||||||
_saldo_movimenti += _importo;
|
_saldo_movimenti += _importo;
|
||||||
|
set_row (1,"@102g%s", (const char*) _importo_str);
|
||||||
}
|
}
|
||||||
set_row (1,"@85g%s", (const char*) _importo_str);
|
|
||||||
}
|
}
|
||||||
else if (_sezione == "A")
|
else if (_sezione == "A")
|
||||||
{
|
{
|
||||||
_totale_periodo_avere += _importo;
|
_totale_periodo_avere += _importo;
|
||||||
_riporto_parziale_avere += _importo;
|
_riporto_parziale_avere += _importo;
|
||||||
if (_numcarat == 2)
|
|
||||||
|
if (_numcarat == 1) // Stampa 132 caratteri
|
||||||
|
set_row (1,"@101g%s", (const char*) _importo_str);
|
||||||
|
else
|
||||||
|
if (_numcarat == 2) // Stampa 198 caratteri
|
||||||
{
|
{
|
||||||
_saldo_progressivi -= _importo;
|
_saldo_progressivi -= _importo;
|
||||||
_saldo_movimenti -= _importo;
|
_saldo_movimenti -= _importo;
|
||||||
|
set_row (1,"@119g%s", (const char*) _importo_str);
|
||||||
}
|
}
|
||||||
set_row (1,"@101g%s", (const char*) _importo_str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_saldo_progressivi_str=_saldo_progressivi.string("###############");
|
_saldo_progressivi_str=_saldo_progressivi.string("###############");
|
||||||
@ -706,7 +702,7 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
|||||||
switch (file)
|
switch (file)
|
||||||
{
|
{
|
||||||
case LF_CLIFO:
|
case LF_CLIFO:
|
||||||
// Usati in crea_intestazione()
|
// Usati in crea_intestazione()
|
||||||
_gruppo = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_GRUPPO));
|
_gruppo = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_GRUPPO));
|
||||||
_conto = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_CONTO));
|
_conto = atoi(current_cursor()->curr(LF_CLIFO).get(CLI_CONTO));
|
||||||
_sottoc = atol(current_cursor()->curr(LF_CLIFO).get(CLI_CODCF));
|
_sottoc = atol(current_cursor()->curr(LF_CLIFO).get(CLI_CODCF));
|
||||||
@ -869,22 +865,33 @@ bool CG3200_application::preprocess_clifo(int file, int counter)
|
|||||||
{
|
{
|
||||||
_totale_periodo_dare += _importo;
|
_totale_periodo_dare += _importo;
|
||||||
_riporto_parziale_dare += _importo;
|
_riporto_parziale_dare += _importo;
|
||||||
if (_numcarat == 2)
|
|
||||||
|
if (_numcarat == 1) // Stampa 132 caratteri
|
||||||
|
set_row (1,"@85g%s", (const char*) _importo_str);
|
||||||
|
else
|
||||||
|
if (_numcarat == 2) // Stampa 198 caratteri
|
||||||
{
|
{
|
||||||
_saldo_progressivi += _importo;
|
_saldo_progressivi += _importo;
|
||||||
_saldo_movimenti += _importo;
|
_saldo_movimenti += _importo;
|
||||||
|
set_row (1,"@102g%s", (const char*) _importo_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_sezione == "A")
|
else if (_sezione == "A")
|
||||||
{
|
{
|
||||||
_totale_periodo_avere += _importo;
|
_totale_periodo_avere += _importo;
|
||||||
_riporto_parziale_avere += _importo;
|
_riporto_parziale_avere += _importo;
|
||||||
if (_numcarat == 2)
|
|
||||||
|
if (_numcarat == 1) // Stampa 132 caratteri
|
||||||
|
set_row (1,"@101g%s", (const char*) _importo_str);
|
||||||
|
else
|
||||||
|
if (_numcarat == 2) // Stampa 198 caratteri
|
||||||
{
|
{
|
||||||
_saldo_progressivi -= _importo;
|
_saldo_progressivi -= _importo;
|
||||||
_saldo_movimenti -= _importo;
|
_saldo_movimenti -= _importo;
|
||||||
|
set_row (1,"@119g%s", (const char*) _importo_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_saldo_progressivi_str=_saldo_progressivi.string("###############");
|
_saldo_progressivi_str=_saldo_progressivi.string("###############");
|
||||||
_saldo_movimenti_str=_saldo_movimenti.string("###############");
|
_saldo_movimenti_str=_saldo_movimenti.string("###############");
|
||||||
if (_numcarat == 2)
|
if (_numcarat == 2)
|
||||||
@ -1130,7 +1137,7 @@ void CG3200_application::descrizione_causale()
|
|||||||
void CG3200_application::documenti_iva()
|
void CG3200_application::documenti_iva()
|
||||||
{
|
{
|
||||||
TString dep;
|
TString dep;
|
||||||
// _tipodoc = _mov->curr().get(MOV_TIPODOC);
|
// _tipodoc = _mov->curr().get(MOV_TIPODOC);
|
||||||
|
|
||||||
_tabtpd->curr().zero();
|
_tabtpd->curr().zero();
|
||||||
dep << format ("%2s",(const char*) _tipodoc);
|
dep << format ("%2s",(const char*) _tipodoc);
|
||||||
@ -1173,30 +1180,8 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
if (tasto == K_ENTER)
|
if (tasto == K_ENTER)
|
||||||
{
|
{
|
||||||
// _data_ini = (_msk->get(F_DATAINI));
|
|
||||||
// _data_fine = (_msk->get(F_DATAFINE));
|
|
||||||
|
|
||||||
_annomsk = atoi(_msk->get(F_ANNO));
|
_annomsk = atoi(_msk->get(F_ANNO));
|
||||||
|
|
||||||
/*****
|
|
||||||
if (_annomsk == 0)
|
|
||||||
if (_data_fine == botime) //Se data_fine e' vuota
|
|
||||||
_data_fine = eotime;
|
|
||||||
|
|
||||||
if (_annomsk != 0)
|
|
||||||
{
|
|
||||||
_annoesmsk = _annomsk - 1;
|
|
||||||
data_fine_esercizio();
|
|
||||||
if (_data_ini == botime)
|
|
||||||
_data_ini = _data_inizioese;
|
|
||||||
if (_data_fine == botime)
|
|
||||||
_data_fine = _data_finese;
|
|
||||||
}
|
|
||||||
|
|
||||||
data1 = _data_ini.string();
|
|
||||||
data2 = _data_fine.string();
|
|
||||||
|
|
||||||
*****/
|
|
||||||
_stampaprogre = (bool)(_msk->get(F_STAMPAPROGRE) == "X");
|
_stampaprogre = (bool)(_msk->get(F_STAMPAPROGRE) == "X");
|
||||||
_stampatotiva = (bool)(_msk->get(F_STAMPATOTIVA) == "X");
|
_stampatotiva = (bool)(_msk->get(F_STAMPATOTIVA) == "X");
|
||||||
_stampanum = atoi(_msk->get(F_STAMPANUM));
|
_stampanum = atoi(_msk->get(F_STAMPANUM));
|
||||||
@ -1216,7 +1201,7 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
ricerca_dati_ditta();
|
ricerca_dati_ditta();
|
||||||
|
|
||||||
// Scelta del formato e del numero di mastrini per pagina 1 o 2
|
// Scelta del formato e del numero di mastrini per pagina 1 o 2
|
||||||
|
|
||||||
if (nummast == 1)
|
if (nummast == 1)
|
||||||
crt = formato;
|
crt = formato;
|
||||||
@ -1225,7 +1210,7 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
printer().formlen(crt);
|
printer().formlen(crt);
|
||||||
|
|
||||||
//Crea il cursore su gruppo, conto e sottoconto del file RMOV
|
//Crea il cursore su gruppo, conto e sottoconto del file RMOV
|
||||||
if (_ricerca == 'P')
|
if (_ricerca == 'P')
|
||||||
{
|
{
|
||||||
reset_files(); //resetta l'albero di stampa
|
reset_files(); //resetta l'albero di stampa
|
||||||
@ -1284,19 +1269,6 @@ bool CG3200_application::set_print(int)
|
|||||||
if (_stampatotiva)
|
if (_stampatotiva)
|
||||||
_b.destroy();
|
_b.destroy();
|
||||||
|
|
||||||
/******
|
|
||||||
if (_competenza)
|
|
||||||
if (_data_fine == _data_finese)
|
|
||||||
{
|
|
||||||
TDate datafinesucc = _data_fine;
|
|
||||||
datafinesucc.addyear(1);
|
|
||||||
data_fine_esercizio_succ();
|
|
||||||
if (datafinesucc == _data_finesesucc)
|
|
||||||
_data_fine = datafinesucc;
|
|
||||||
}
|
|
||||||
|
|
||||||
*********/
|
|
||||||
|
|
||||||
switch (_tipostampa)
|
switch (_tipostampa)
|
||||||
{
|
{
|
||||||
case 1: _totale_saldo = 1;
|
case 1: _totale_saldo = 1;
|
||||||
@ -1317,7 +1289,7 @@ bool CG3200_application::set_print(int)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1367,7 +1339,7 @@ void CG3200_application::ricerca_dati_ditta()
|
|||||||
long app;
|
long app;
|
||||||
|
|
||||||
_nditte->setkey(1);
|
_nditte->setkey(1);
|
||||||
// _codice_ditta << get_firm();
|
// _codice_ditta << get_firm();
|
||||||
_nditte->curr().zero();
|
_nditte->curr().zero();
|
||||||
_nditte->curr().put(NDT_CODDITTA,_codice_ditta);
|
_nditte->curr().put(NDT_CODDITTA,_codice_ditta);
|
||||||
_nditte->read();
|
_nditte->read();
|
||||||
@ -1451,8 +1423,8 @@ void CG3200_application::crea_intestazione()
|
|||||||
{
|
{
|
||||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||||
set_header (6, (const char *) sep);
|
set_header (6, (const char *) sep);
|
||||||
set_header (7,"Operazione@19gDocumento@117gContro@130gAn");
|
set_header (7,"Operazione@19gDocumento@117gContro");
|
||||||
set_header (8,"Data@11gnumero@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita@130gCo");
|
set_header (8,"Data@11gnumero@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita");
|
||||||
sep.fill('-');
|
sep.fill('-');
|
||||||
set_header (9, (const char *) sep);
|
set_header (9, (const char *) sep);
|
||||||
}
|
}
|
||||||
@ -1460,8 +1432,8 @@ void CG3200_application::crea_intestazione()
|
|||||||
{
|
{
|
||||||
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
||||||
set_header (6,"@1g%s", (const char *) sep1);
|
set_header (6,"@1g%s", (const char *) sep1);
|
||||||
set_header (7,"Operazione@19gData@30gNumero@172gContro@183gA@185gReg@193gNumero");
|
set_header (7,"Operazione@19gData@30gNumero@172gContro@185gReg@193gNumero");
|
||||||
set_header (8,"Data@11gnumero@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@183gC@185gIva@189gProtocollo");
|
set_header (8,"Data@11gnumero@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@185gIva@189gProtocollo");
|
||||||
sep1.fill('-');
|
sep1.fill('-');
|
||||||
set_header (9,"@1g%s", (const char *) sep1);
|
set_header (9,"@1g%s", (const char *) sep1);
|
||||||
}
|
}
|
||||||
@ -1509,7 +1481,7 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
{
|
{
|
||||||
long record,sottoc,annoes;
|
long record,sottoc,annoes;
|
||||||
int gruppo,conto;
|
int gruppo,conto;
|
||||||
TDate datareg;
|
TDate datareg, datacomp;
|
||||||
TLocalisamfile* rmov;
|
TLocalisamfile* rmov;
|
||||||
char sezione;
|
char sezione;
|
||||||
real importo;
|
real importo;
|
||||||
@ -1517,14 +1489,12 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
|
|
||||||
rmov = current_cursor()->file(LF_RMOV);
|
rmov = current_cursor()->file(LF_RMOV);
|
||||||
|
|
||||||
// if (current_cursor()->is_first_match(LF_RMOV))
|
|
||||||
// {
|
|
||||||
record = rmov->recno();
|
record = rmov->recno();
|
||||||
rmov->zero();
|
rmov->zero();
|
||||||
rmov->put(RMV_GRUPPO, _gruppo);
|
rmov->put(RMV_GRUPPO, _gruppo);
|
||||||
rmov->put(RMV_CONTO, _conto);
|
rmov->put(RMV_CONTO, _conto);
|
||||||
rmov->put(RMV_SOTTOCONTO, _sottoc);
|
rmov->put(RMV_SOTTOCONTO, _sottoc);
|
||||||
for (rmov->read(); ;rmov->next())
|
for (rmov->read();!rmov->eof() ;rmov->next())
|
||||||
{
|
{
|
||||||
annoes = rmov->get_int (RMV_ANNOES);
|
annoes = rmov->get_int (RMV_ANNOES);
|
||||||
datareg = rmov->get_date(RMV_DATAREG);
|
datareg = rmov->get_date(RMV_DATAREG);
|
||||||
@ -1538,7 +1508,7 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
_mov->read();
|
_mov->read();
|
||||||
if (_mov->bad())
|
if (_mov->bad())
|
||||||
_mov->zero();
|
_mov->zero();
|
||||||
TDate datacomp = (_mov->curr().get(MOV_DATACOMP));
|
datacomp = (_mov->curr().get(MOV_DATACOMP));
|
||||||
|
|
||||||
if (_annomsk == 0)
|
if (_annomsk == 0)
|
||||||
{
|
{
|
||||||
@ -1558,7 +1528,7 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
gruppo = rmov->get_int(RMV_GRUPPO);
|
gruppo = rmov->get_int(RMV_GRUPPO);
|
||||||
conto = rmov->get_int(RMV_CONTO);
|
conto = rmov->get_int(RMV_CONTO);
|
||||||
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
sottoc = rmov->get_long(RMV_SOTTOCONTO);
|
||||||
if ((gruppo != _gruppo)&&(conto != _conto)&&(sottoc != _sottoc))
|
if ((gruppo != _gruppo)||(conto != _conto)||(sottoc != _sottoc))
|
||||||
break;
|
break;
|
||||||
else if (((annoes==_annomsk)||(_annomsk == 0))&&(datareg >= data)&&(datareg < _data_ini)) //Legge movimenti con data < data iniziale
|
else if (((annoes==_annomsk)||(_annomsk == 0))&&(datareg >= data)&&(datareg < _data_ini)) //Legge movimenti con data < data iniziale
|
||||||
if (sezione == 'D')
|
if (sezione == 'D')
|
||||||
@ -1567,7 +1537,6 @@ void CG3200_application::calcola_progressivi_al()
|
|||||||
_totale_prima_avere += importo;
|
_totale_prima_avere += importo;
|
||||||
}
|
}
|
||||||
rmov->readat(record);
|
rmov->readat(record);
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CG3200_application::calcola_progressivi()
|
void CG3200_application::calcola_progressivi()
|
||||||
@ -1580,6 +1549,15 @@ void CG3200_application::calcola_progressivi()
|
|||||||
int indbil;
|
int indbil;
|
||||||
char salini;
|
char salini;
|
||||||
TRectype record(saldi.curr());
|
TRectype record(saldi.curr());
|
||||||
|
int anno_corrente, anno_precedente;
|
||||||
|
|
||||||
|
if (_annomsk != 0)
|
||||||
|
anno_corrente = _annomsk;
|
||||||
|
else
|
||||||
|
if (_annomsk == 0)
|
||||||
|
anno_corrente = _anno_ghost;
|
||||||
|
|
||||||
|
anno_precedente = anno_corrente - 1;
|
||||||
|
|
||||||
saldo = 0.00;
|
saldo = 0.00;
|
||||||
pdarep = 0.00;
|
pdarep = 0.00;
|
||||||
@ -1588,8 +1566,9 @@ void CG3200_application::calcola_progressivi()
|
|||||||
paveresca = 0.00;
|
paveresca = 0.00;
|
||||||
pdarescap = 0.00;
|
pdarescap = 0.00;
|
||||||
paverescap = 0.00;
|
paverescap = 0.00;
|
||||||
// Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto
|
|
||||||
// uguali a quelli di rmov per il calcolo dei progressivi precedenti
|
// Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto
|
||||||
|
// uguali a quelli di rmov per il calcolo dei progressivi precedenti
|
||||||
|
|
||||||
record.zero();
|
record.zero();
|
||||||
record.put(SLD_GRUPPO, _gruppo);
|
record.put(SLD_GRUPPO, _gruppo);
|
||||||
@ -1627,33 +1606,38 @@ void CG3200_application::calcola_progressivi()
|
|||||||
{
|
{
|
||||||
int annoes_saldi = saldi.curr().get_int(SLD_ANNOES);
|
int annoes_saldi = saldi.curr().get_int(SLD_ANNOES);
|
||||||
|
|
||||||
//Calcola i progressivi dell'esercizio attuale
|
//Calcola i progressivi dell'esercizio attuale
|
||||||
|
|
||||||
if (annoes_saldi == _annomsk)
|
if (annoes_saldi == anno_corrente)
|
||||||
{
|
{
|
||||||
pdaresca = saldi.curr().get_real(SLD_PDARESCA);
|
pdaresca = saldi.curr().get_real(SLD_PDARESCA);
|
||||||
paveresca = saldi.curr().get_real(SLD_PAVERESCA);
|
paveresca = saldi.curr().get_real(SLD_PAVERESCA);
|
||||||
|
progdare_attuale = saldi.curr().get_real(SLD_PDARE);
|
||||||
|
progavere_attuale = saldi.curr().get_real(SLD_PAVERE);
|
||||||
saldo = saldi.curr().get_real(SLD_SALDO);
|
saldo = saldi.curr().get_real(SLD_SALDO);
|
||||||
salini = saldi.curr().get(SLD_FLAGSALINI)[0];
|
salini = saldi.curr().get(SLD_FLAGSALINI)[0];
|
||||||
|
_ultima_data_reg = saldi.curr().get_date(SLD_DATAULMOV);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Calcola i progressivi dell'esercizio precedente
|
//Calcola i progressivi dell'esercizio precedente
|
||||||
|
|
||||||
if (_annomsk != 0)
|
if (annoes_saldi == anno_precedente)
|
||||||
{
|
|
||||||
if (annoes_saldi == _annoesmsk)
|
|
||||||
{
|
{
|
||||||
pdarescap = saldi.curr().get_real(SLD_PDARESCA);
|
pdarescap = saldi.curr().get_real(SLD_PDARESCA);
|
||||||
pdarep = saldi.curr().get_real(SLD_PDARE);
|
pdarep = saldi.curr().get_real(SLD_PDARE);
|
||||||
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
|
||||||
paverep = saldi.curr().get_real(SLD_PAVERE);
|
paverep = saldi.curr().get_real(SLD_PAVERE);
|
||||||
|
}
|
||||||
|
|
||||||
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
|
||||||
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere
|
||||||
// i progressivi dell'esercizio precedente devo a questo punto sommare i
|
// i progressivi dell'esercizio precedente devo a questo punto sommare i
|
||||||
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
// progressivi dell'esercizio e i progressivi di quelli scaricati, tenendo
|
||||||
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
// conto del flag salini per sapere se il saldo e' dare oppure avere.
|
||||||
|
|
||||||
|
|
||||||
|
if (_annomsk != 0 && anno_corrente == annoes_saldi)
|
||||||
|
{
|
||||||
if (saldo != 0)
|
if (saldo != 0)
|
||||||
{
|
{
|
||||||
if (salini == 'D')
|
if (salini == 'D')
|
||||||
@ -1672,12 +1656,12 @@ void CG3200_application::calcola_progressivi()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
|
||||||
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
|
||||||
|
|
||||||
if ((indbil == 1) || (indbil == 2) || (indbil == 5))
|
if ((indbil == 1) || (indbil == 2) || (indbil == 5))
|
||||||
{
|
{
|
||||||
saldo = _sld.saldofin_esprec(_annomsk,_gruppo,_conto,_sottoc);
|
saldo = _sld.saldofin_esprec(anno_corrente,_gruppo,_conto,_sottoc);
|
||||||
|
|
||||||
if (saldo.sign() > 0)
|
if (saldo.sign() > 0)
|
||||||
{
|
{
|
||||||
@ -1695,18 +1679,17 @@ void CG3200_application::calcola_progressivi()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//Calcolo dei progressivi precedenti: somma di tutti quei movimenti di rmov
|
//Calcolo dei progressivi precedenti: somma di tutti quei movimenti di rmov
|
||||||
//che hanno la data di registrazione inferiore alla data di inizio stampa,
|
//che hanno la data di registrazione inferiore alla data di inizio stampa,
|
||||||
//dei progressivi dell'anno esercizio precedente, e dei progressivi dei
|
//dei progressivi dell'anno esercizio precedente, e dei progressivi dei
|
||||||
//movimenti scaricati dell'esercizio attuale.
|
//movimenti scaricati dell'esercizio attuale.
|
||||||
|
|
||||||
// calcola_progressivi_al();
|
// calcola_progressivi_al();
|
||||||
|
|
||||||
// _progredare = pdaresca + progredare_eseprec + _totale_prima_dare;
|
// _progredare = pdaresca + progredare_eseprec + _totale_prima_dare;
|
||||||
// _progreavere = paveresca + progreavere_eseprec + _totale_prima_avere;
|
// _progreavere = paveresca + progreavere_eseprec + _totale_prima_avere;
|
||||||
// _saldo_progre_prec = _progredare - _progreavere;
|
// _saldo_progre_prec = _progredare - _progreavere;
|
||||||
} // FOR
|
} // FOR
|
||||||
|
|
||||||
calcola_progressivi_al();
|
calcola_progressivi_al();
|
||||||
@ -1732,12 +1715,12 @@ void CG3200_application::calcola_progressivi()
|
|||||||
string = _progreavere.string("###############");
|
string = _progreavere.string("###############");
|
||||||
set_header (10,"@119g%15s",(const char*) string);
|
set_header (10,"@119g%15s",(const char*) string);
|
||||||
}
|
}
|
||||||
//Calcolo dei progressivi al <ultima data registrazione>
|
//Calcolo dei progressivi al <ultima data registrazione>
|
||||||
|
|
||||||
|
|
||||||
//Se sulla maschera e' stato selezionato il controllo competenza esercizio
|
//Se sulla maschera e' stato selezionato il controllo competenza esercizio
|
||||||
//Sommo i progressivi dell'esercizio precedente e quelli dell'esercizio attuale
|
//Sommo i progressivi dell'esercizio precedente e quelli dell'esercizio attuale
|
||||||
//altrimenti solo quelli dell'esercizio attuale
|
//altrimenti solo quelli dell'esercizio attuale
|
||||||
|
|
||||||
if (_annomsk != 0)
|
if (_annomsk != 0)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "cg3200.h"
|
#include "cg3200.h"
|
||||||
|
|
||||||
PAGE "Stampa Clienti e Fornitori" -1 -1 78 20
|
PAGE "" -1 -1 78 20
|
||||||
|
|
||||||
|
|
||||||
NUMBER F_CODDITTA 5
|
NUMBER F_CODDITTA 5
|
||||||
@ -45,7 +45,7 @@ END
|
|||||||
NUMBER F_ANNO 4
|
NUMBER F_ANNO 4
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 47 1 "Anno esercizio "
|
PROMPT 47 1 "Anno esercizio "
|
||||||
HELP "Inserire un anno esercizio presente nella tabella oppure nulla: in questo caso non e' possibile fare il controllo competenza esercizio"
|
HELP "Inserire un anno esercizio presente nella tabella oppure niente: in quest'ultimo caso non e' possibile fare il controllo competenza esercizio"
|
||||||
USE ESC
|
USE ESC
|
||||||
INPUT CODTAB F_ANNO
|
INPUT CODTAB F_ANNO
|
||||||
DISPLAY "Anno Esercizio" CODTAB
|
DISPLAY "Anno Esercizio" CODTAB
|
||||||
|
120
cg/cg3400.cpp
120
cg/cg3400.cpp
@ -51,7 +51,8 @@ public:
|
|||||||
TCursor * _cur;
|
TCursor * _cur;
|
||||||
TRectype * _RecPartoDa, *_RecArrivoA;
|
TRectype * _RecPartoDa, *_RecArrivoA;
|
||||||
|
|
||||||
TString _reg_cod, _reg_anno, _reg_descr;
|
int _ae; // anno esercizio di ALLA_DATA
|
||||||
|
TString _reg_cod, _reg_descr;
|
||||||
TDate _data_da, _data_a, _last_data;
|
TDate _data_da, _data_a, _last_data;
|
||||||
real _tot_dare, _tot_avere; // valori di partenza
|
real _tot_dare, _tot_avere; // valori di partenza
|
||||||
real _tot_dare_progr, _tot_avere_progr; // progressivi
|
real _tot_dare_progr, _tot_avere_progr; // progressivi
|
||||||
@ -74,11 +75,12 @@ public:
|
|||||||
bool _gia_settata_riga_mov; // per la stampa no iva
|
bool _gia_settata_riga_mov; // per la stampa no iva
|
||||||
TString _viacf, _civcf, _comcf, _capcf, _statocf; // dati C/F
|
TString _viacf, _civcf, _comcf, _capcf, _statocf; // dati C/F
|
||||||
TString _ragsoc, _paiva, _comunefis, _provfis, _viafis; // dati ditta
|
TString _ragsoc, _paiva, _comunefis, _provfis, _viafis; // dati ditta
|
||||||
TString _cofi, _cap, _anno_es;
|
TString _cofi, _cap;
|
||||||
TLocalisamfile * _com, *_clifo,*_pconti,*_nditte,*_anag, *_caus;
|
TLocalisamfile * _com, *_clifo,*_pconti,*_nditte,*_anag, *_caus;
|
||||||
TTable *_tabreg, *_tabval, *_tabes;
|
TTable *_tabreg, *_tabval, *_tabes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
int _annoEsMov;
|
||||||
bool _stampa_definitiva;
|
bool _stampa_definitiva;
|
||||||
TDate _inizioEs, _fineEs; // date inizio e fine esercizio
|
TDate _inizioEs, _fineEs; // date inizio e fine esercizio
|
||||||
TString256 _riporto; // riga di stampa per i riporti
|
TString256 _riporto; // riga di stampa per i riporti
|
||||||
@ -110,7 +112,7 @@ public:
|
|||||||
int set_header_132();
|
int set_header_132();
|
||||||
int set_header_198();
|
int set_header_198();
|
||||||
|
|
||||||
bool leggi_tabreg(const char *, const char *);
|
bool leggi_tabreg(const char * codreg, int annoes);
|
||||||
void aggiorna_tabreg(int, int);
|
void aggiorna_tabreg(int, int);
|
||||||
void aggiorna_mov();
|
void aggiorna_mov();
|
||||||
void scrivi_numgio(long);
|
void scrivi_numgio(long);
|
||||||
@ -122,7 +124,7 @@ public:
|
|||||||
const char * SimboloValuta (const char * cod);
|
const char * SimboloValuta (const char * cod);
|
||||||
const char * get_descr_caus (const char * codcaus);
|
const char * get_descr_caus (const char * codcaus);
|
||||||
|
|
||||||
CG3400_application() : _reg_cod(3), _reg_anno(4), _tot_dare_progr(0.00),
|
CG3400_application() : _reg_cod(3), _tot_dare_progr(0.00),
|
||||||
_tot_avere_progr (0.00), _data_da(""), _data_a("") {};
|
_tot_avere_progr (0.00), _data_da(""), _data_a("") {};
|
||||||
virtual ~CG3400_application() {};
|
virtual ~CG3400_application() {};
|
||||||
};
|
};
|
||||||
@ -431,8 +433,9 @@ void CG3400_application::stampa_totali_giorno(TDate data, bool ff)
|
|||||||
else
|
else
|
||||||
set_row (2, ""); // Lascio una riga vuota dopo il totale
|
set_row (2, ""); // Lascio una riga vuota dopo il totale
|
||||||
|
|
||||||
if (ff) set_auto_ff (TRUE);
|
if (ff) printer().formfeed();
|
||||||
else set_auto_ff (FALSE);
|
// if (ff) set_auto_ff (TRUE);
|
||||||
|
// else set_auto_ff (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@ -449,21 +452,21 @@ void CG3400_application::set_page_132 (int file, int counter)
|
|||||||
if (_libro_giornale_iva_unico)
|
if (_libro_giornale_iva_unico)
|
||||||
{
|
{
|
||||||
if (_stampa_definitiva)
|
if (_stampa_definitiva)
|
||||||
set_row(r,"Registrazione n. #-7ld del @d documento n. @7s del @d @56g@s Anno di competenza %s",
|
set_row(r,"Registrazione n. #-7ld del @d documento n. @7s del @d @56g@s Anno di competenza %04d",
|
||||||
&_nprog_mov,
|
&_nprog_mov,
|
||||||
FLD(LF_MOV, MOV_DATAREG),
|
FLD(LF_MOV, MOV_DATAREG),
|
||||||
FLD(LF_MOV, MOV_NUMDOC),
|
FLD(LF_MOV, MOV_NUMDOC),
|
||||||
FLD(LF_MOV, MOV_DATADOC),
|
FLD(LF_MOV, MOV_DATADOC),
|
||||||
FLD(LF_MOV, MOV_DESCR),
|
FLD(LF_MOV, MOV_DESCR),
|
||||||
(const char *)_reg_anno);
|
_ae);
|
||||||
else
|
else
|
||||||
set_row(r,"Registrazione n. @7,lpn del @d documento n. @7s del @d @56g@s Anno di competenza %s",
|
set_row(r,"Registrazione n. @7,lpn del @d documento n. @7s del @d @56g@s Anno di competenza %04d",
|
||||||
FLD(LF_MOV, MOV_NUMREG, "#######"),
|
FLD(LF_MOV, MOV_NUMREG, "#######"),
|
||||||
FLD(LF_MOV, MOV_DATAREG),
|
FLD(LF_MOV, MOV_DATAREG),
|
||||||
FLD(LF_MOV, MOV_NUMDOC),
|
FLD(LF_MOV, MOV_NUMDOC),
|
||||||
FLD(LF_MOV, MOV_DATADOC),
|
FLD(LF_MOV, MOV_DATADOC),
|
||||||
FLD(LF_MOV, MOV_DESCR),
|
FLD(LF_MOV, MOV_DESCR),
|
||||||
(const char *)_reg_anno);
|
_ae);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -857,7 +860,7 @@ print_action CG3400_application::postprocess_page(int file, int counter)
|
|||||||
int r=0;
|
int r=0;
|
||||||
bool nuovo_mese = FALSE;
|
bool nuovo_mese = FALSE;
|
||||||
|
|
||||||
set_auto_ff (FALSE);
|
// set_auto_ff (FALSE);
|
||||||
if (counter)
|
if (counter)
|
||||||
{
|
{
|
||||||
if (nuovo_mese)
|
if (nuovo_mese)
|
||||||
@ -901,7 +904,7 @@ print_action CG3400_application::postprocess_page(int file, int counter)
|
|||||||
|
|
||||||
case LF_RMOVIVA:
|
case LF_RMOVIVA:
|
||||||
default:
|
default:
|
||||||
set_auto_ff(FALSE); // ff gia' fatto prima
|
// set_auto_ff(FALSE); // ff gia' fatto prima
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return NEXT_PAGE;
|
return NEXT_PAGE;
|
||||||
@ -930,11 +933,11 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
switch (file)
|
switch (file)
|
||||||
{
|
{
|
||||||
case LF_MOV:
|
case LF_MOV:
|
||||||
|
|
||||||
_num_rig=0;
|
_num_rig=0;
|
||||||
_iva_array.destroy();
|
_iva_array.destroy();
|
||||||
|
|
||||||
if (!current_cursor()->is_first_match(LF_RMOV))
|
if (!current_cursor()->is_first_match(LF_RMOV)) return FALSE;
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
gia_stampato = current_cursor()->file(LF_MOV)->get_bool(MOV_STAMPATO);
|
gia_stampato = current_cursor()->file(LF_MOV)->get_bool(MOV_STAMPATO);
|
||||||
if (gia_stampato)
|
if (gia_stampato)
|
||||||
@ -943,16 +946,18 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
else
|
else
|
||||||
set_row (1, "@131g*"); // stampo un * se mov. gia stampato
|
set_row (1, "@131g*"); // stampo un * se mov. gia stampato
|
||||||
|
|
||||||
if (_libro_giornale_iva_unico)
|
if (_libro_giornale_iva_unico) _nprog_mov++;
|
||||||
_nprog_mov++;
|
|
||||||
|
|
||||||
_data_corr = _cur->file(LF_MOV)->get_date(MOV_DATAREG);
|
_data_corr = _cur->file(LF_MOV)->get_date(MOV_DATAREG);
|
||||||
_mese_corr = _data_corr.month();
|
_mese_corr = _data_corr.month();
|
||||||
_anno_es = _cur->file(LF_MOV)->get(MOV_ANNOES);
|
_annoEsMov = _cur->file(LF_MOV)->get_int(MOV_ANNOES);
|
||||||
caus = _cur->file(LF_MOV)->get(MOV_CODCAUS);
|
caus = _cur->file(LF_MOV)->get(MOV_CODCAUS);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LF_RMOV:
|
case LF_RMOV:
|
||||||
set_auto_ff(FALSE);
|
|
||||||
|
// set_auto_ff(FALSE);
|
||||||
_num_rig++;
|
_num_rig++;
|
||||||
reset_print();
|
reset_print();
|
||||||
set_rows(file, counter);
|
set_rows(file, counter);
|
||||||
@ -978,9 +983,11 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
*_descr_operazione = (const char *)rmv_descr;
|
*_descr_operazione = (const char *)rmv_descr;
|
||||||
_descr_operazione->set_width(198);
|
_descr_operazione->set_width(198);
|
||||||
}
|
}
|
||||||
|
|
||||||
setta_righe_descr(_descr_operazione, operazione);
|
setta_righe_descr(_descr_operazione, operazione);
|
||||||
if (!_libro_giornale_iva_unico)
|
|
||||||
_nprog_mov++;
|
if (!_libro_giornale_iva_unico) _nprog_mov++;
|
||||||
|
|
||||||
g = current_cursor()->curr(LF_RMOV).get_int(RMV_GRUPPO);
|
g = current_cursor()->curr(LF_RMOV).get_int(RMV_GRUPPO);
|
||||||
c = current_cursor()->curr(LF_RMOV).get_int(RMV_CONTO);
|
c = current_cursor()->curr(LF_RMOV).get_int(RMV_CONTO);
|
||||||
s = current_cursor()->curr(LF_RMOV).get_long(RMV_SOTTOCONTO);
|
s = current_cursor()->curr(LF_RMOV).get_long(RMV_SOTTOCONTO);
|
||||||
@ -1021,6 +1028,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
setta_righe_indirizzo();
|
setta_righe_indirizzo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sezione = _cur->file(LF_RMOV)->get (RMV_SEZIONE);
|
sezione = _cur->file(LF_RMOV)->get (RMV_SEZIONE);
|
||||||
importo = _cur->file(LF_RMOV)->get_real (RMV_IMPORTO);
|
importo = _cur->file(LF_RMOV)->get_real (RMV_IMPORTO);
|
||||||
|
|
||||||
@ -1028,7 +1036,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
if (sezione == "D")
|
if (sezione == "D")
|
||||||
{
|
{
|
||||||
_tot_dare_progr += importo; // prog. generali
|
_tot_dare_progr += importo; // prog. generali
|
||||||
if (_anno_es != _reg_anno)
|
if (_annoEsMov != _ae)
|
||||||
_tot_dare_ac += importo; // prog. anno precedente
|
_tot_dare_ac += importo; // prog. anno precedente
|
||||||
else
|
else
|
||||||
_tot_dare_gg += importo; // prog. giornalieri
|
_tot_dare_gg += importo; // prog. giornalieri
|
||||||
@ -1041,7 +1049,7 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_tot_avere_progr += importo;
|
_tot_avere_progr += importo;
|
||||||
if (_anno_es != _reg_anno)
|
if (_annoEsMov != _ae)
|
||||||
_tot_avere_ac += importo;
|
_tot_avere_ac += importo;
|
||||||
else
|
else
|
||||||
_tot_avere_gg += importo;
|
_tot_avere_gg += importo;
|
||||||
@ -1050,17 +1058,21 @@ bool CG3400_application::preprocess_page(int file, int counter)
|
|||||||
else
|
else
|
||||||
set_row (1, "@164g%r", &importo);
|
set_row (1, "@164g%r", &importo);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LF_RMOVIVA:
|
case LF_RMOVIVA:
|
||||||
set_auto_ff(FALSE);
|
|
||||||
|
// set_auto_ff(FALSE);
|
||||||
if (_libro_giornale_iva_unico)
|
if (_libro_giornale_iva_unico)
|
||||||
{
|
{
|
||||||
calcola_iva ();
|
calcola_iva ();
|
||||||
setta_righe_valuta();
|
setta_righe_valuta();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
set_auto_ff(FALSE);
|
// set_auto_ff(FALSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1193,13 +1205,6 @@ void CG3400_application::setta_righe_indirizzo()
|
|||||||
_civcf = occ->get (OCC_CIV);
|
_civcf = occ->get (OCC_CIV);
|
||||||
_capcf = occ->get (OCC_CAP);
|
_capcf = occ->get (OCC_CAP);
|
||||||
_comcf = occ->get (OCC_COM);
|
_comcf = occ->get (OCC_COM);
|
||||||
|
|
||||||
/******
|
|
||||||
_viacf = cur->file(LF_MOV)->get (MOV_OCINDIR);
|
|
||||||
_civcf = cur->file(LF_MOV)->get (MOV_OCCIV);
|
|
||||||
_capcf = cur->file(LF_MOV)->get (MOV_OCCAP);
|
|
||||||
_comcf = cur->file(LF_MOV)->get (MOV_OCCOM);
|
|
||||||
********/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRectype dep = look_com (_comcf, _com);
|
TRectype dep = look_com (_comcf, _com);
|
||||||
@ -1226,8 +1231,7 @@ void CG3400_application::aggiorna_tabreg(int partito_da, int stampate)
|
|||||||
{
|
{
|
||||||
TString16 codtab;
|
TString16 codtab;
|
||||||
|
|
||||||
codtab.format ("%4s%-3s", (const char*) _reg_anno,
|
codtab.format ("%04d%-3s", _ae, (const char*) _reg_cod);
|
||||||
(const char*) _reg_cod);
|
|
||||||
|
|
||||||
_tabreg->zero();
|
_tabreg->zero();
|
||||||
_tabreg->put("CODTAB", codtab);
|
_tabreg->put("CODTAB", codtab);
|
||||||
@ -1246,11 +1250,11 @@ void CG3400_application::aggiorna_tabreg(int partito_da, int stampate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CG3400_application::leggi_tabreg(const char * reg_cod,
|
bool CG3400_application::leggi_tabreg(const char * reg_cod,
|
||||||
const char * reg_anno)
|
int reg_anno)
|
||||||
{
|
{
|
||||||
TString16 codtab;
|
TString16 codtab;
|
||||||
|
|
||||||
codtab.format ("%4s%-3s", reg_anno, reg_cod);
|
codtab.format ("%04d%-3s", reg_anno, reg_cod);
|
||||||
|
|
||||||
_tabreg->zero();
|
_tabreg->zero();
|
||||||
_tabreg->put("CODTAB", codtab);
|
_tabreg->put("CODTAB", codtab);
|
||||||
@ -1305,10 +1309,12 @@ bool CG3400_application::mask_a_data (TMask_field& f, KEY k)
|
|||||||
const TDate data_a(f.get());
|
const TDate data_a(f.get());
|
||||||
const TString16 codreg(m.get(CODREG));
|
const TString16 codreg(m.get(CODREG));
|
||||||
const int ae = date2esc(data_a); // Anno esercizio
|
const int ae = date2esc(data_a); // Anno esercizio
|
||||||
|
const bool definitiva = m.get_bool(STAMPA_DEF);
|
||||||
if (ae == 0)
|
if (ae == 0)
|
||||||
return f.error_box("La data specificata non appartiene a nessun esercizio");
|
return f.error_box("La data specificata non appartiene a nessun esercizio");
|
||||||
|
|
||||||
TRegistro reg(codreg, ae);
|
TRegistro reg(codreg, ae);
|
||||||
|
|
||||||
if (!reg.ok())
|
if (!reg.ok())
|
||||||
return f.warning_box("Non trovo il registro %s per l'esercizio %d",
|
return f.warning_box("Non trovo il registro %s per l'esercizio %d",
|
||||||
(const char *) codreg, ae);
|
(const char *) codreg, ae);
|
||||||
@ -1316,14 +1322,16 @@ bool CG3400_application::mask_a_data (TMask_field& f, KEY k)
|
|||||||
return f.warning_box("Il registro %s non e' di tipo libro giornale",
|
return f.warning_box("Il registro %s non e' di tipo libro giornale",
|
||||||
(const char *) codreg);
|
(const char *) codreg);
|
||||||
|
|
||||||
if (!app()->_stampa_definitiva)
|
if (definitiva)
|
||||||
{
|
{
|
||||||
const TDate data_da(m.get(DATA_DA));
|
const TDate data_da(m.get(DATA_DA));
|
||||||
const TString16 ie(app()->_inizioEs.string());
|
|
||||||
const TString16 fe(app()->_fineEs.string());
|
// se la stampa e' di prova DALLA_DATA e' obbligatoria
|
||||||
|
if (!data_da.ok())
|
||||||
|
return f.warning_box("Manca la data di partenza");
|
||||||
|
|
||||||
if (data_da < app()->_inizioEs || data_a > app()->_fineEs);
|
if (data_da < app()->_inizioEs || data_a > app()->_fineEs);
|
||||||
return f.warning_box("Le date devono essere comprese tra %s e %s",
|
return f.warning_box("Le date specificate non appartengono allo stesso esercizio");
|
||||||
(const char*)ie, (const char*)fe);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1341,27 +1349,25 @@ bool CG3400_application::mask_a_data (TMask_field& f, KEY k)
|
|||||||
//
|
//
|
||||||
bool CG3400_application::mask_a_cod_reg (TMask_field& f, KEY k)
|
bool CG3400_application::mask_a_cod_reg (TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
TString reg_cod(""),reg_anno("");
|
|
||||||
|
|
||||||
if (k == K_TAB)
|
if (k == K_TAB)
|
||||||
{
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
CG3400_application * a = (CG3400_application*) MainApp();
|
CG3400_application * a = (CG3400_application*) MainApp();
|
||||||
|
const bool definitiva = m.get_bool(STAMPA_DEF);
|
||||||
|
|
||||||
reg_cod = f.mask().field(CODREG).get();
|
TString16 reg_cod(f.get());
|
||||||
reg_anno = f.mask().field(ANNO_ESER).get();
|
|
||||||
|
|
||||||
a->leggi_tabreg(reg_cod, reg_anno);
|
a->leggi_tabreg(reg_cod, a->_ae);
|
||||||
|
|
||||||
TString pag(8), stok(8);
|
TString pag(8), stok(8);
|
||||||
pag << (a->_pagine_stampate+1);
|
pag << (a->_pagine_stampate+1);
|
||||||
stok << a->_stampa_ok;
|
stok << a->_stampa_ok;
|
||||||
|
|
||||||
|
if (definitiva)
|
||||||
if (a->_stampa_ok == -1) // stampa precedente andata bene
|
if (a->_stampa_ok == -1) // stampa precedente andata bene
|
||||||
f.mask().field(PAGINA_DA).set(pag);
|
m.field(PAGINA_DA).set(pag);
|
||||||
else
|
else
|
||||||
f.mask().field(PAGINA_DA).set(stok);
|
m.field(PAGINA_DA).set(stok);
|
||||||
|
|
||||||
f.mask().field(DATA_DA).set (a->_last_data.string());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1404,7 +1410,6 @@ bool CG3400_application::set_print(int)
|
|||||||
if (tasto == K_ENTER)
|
if (tasto == K_ENTER)
|
||||||
{
|
{
|
||||||
_reg_cod = ma.get(CODREG);
|
_reg_cod = ma.get(CODREG);
|
||||||
_reg_anno = ma.get(ANNO_ESER);
|
|
||||||
_stampa_definitiva = (bool) (ma.get(STAMPA_DEF) == "X");
|
_stampa_definitiva = (bool) (ma.get(STAMPA_DEF) == "X");
|
||||||
_data_da = ma.get(DATA_DA);
|
_data_da = ma.get(DATA_DA);
|
||||||
_data_a = ma.get(DATA_A);
|
_data_a = ma.get(DATA_A);
|
||||||
@ -1412,6 +1417,11 @@ bool CG3400_application::set_print(int)
|
|||||||
_stampa_width = (int)ma.get_long(STAMPA_WIDTH);
|
_stampa_width = (int)ma.get_long(STAMPA_WIDTH);
|
||||||
_stampa_len = (int)ma.get_long(STAMPA_LEN);
|
_stampa_len = (int)ma.get_long(STAMPA_LEN);
|
||||||
|
|
||||||
|
// Se stampa definita DALLA_DATA e' l'ultima data di stampa del
|
||||||
|
// registro, se indicata, oppure la data di inizio esercizio
|
||||||
|
if (_stampa_definitiva)
|
||||||
|
if (!_last_data.ok()) _data_da = _inizioEs;
|
||||||
|
|
||||||
if (_stampa_len) printer().formlen(_stampa_len);
|
if (_stampa_len) printer().formlen(_stampa_len);
|
||||||
if (_stampa_width == 1) _stampa_width = 132;
|
if (_stampa_width == 1) _stampa_width = 132;
|
||||||
else _stampa_width = 198;
|
else _stampa_width = 198;
|
||||||
@ -1426,14 +1436,14 @@ bool CG3400_application::set_print(int)
|
|||||||
|
|
||||||
_cur->setregion(da, a);
|
_cur->setregion(da, a);
|
||||||
|
|
||||||
|
if (_stampa_definitiva)
|
||||||
|
{
|
||||||
mb.set (PROGR_DARE, _tot_dare.string());
|
mb.set (PROGR_DARE, _tot_dare.string());
|
||||||
mb.set (N_RIGA_STAMPATO, _nprog_da);
|
mb.set (N_RIGA_STAMPATO, _nprog_da);
|
||||||
mb.set (ULTIMA_DATA, _last_data.string());
|
mb.set (ULTIMA_DATA, _last_data.string());
|
||||||
tasto = mb.run();
|
tasto = mb.run();
|
||||||
if (tasto == K_ENTER)
|
return (tasto == K_ENTER);
|
||||||
return TRUE;
|
}
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -2,24 +2,24 @@
|
|||||||
|
|
||||||
PAGE "" -1 -1 70 15
|
PAGE "" -1 -1 70 15
|
||||||
|
|
||||||
STRING REG_COD 3
|
STRING CODREG 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Codice registro "
|
PROMPT 1 1 "Codice registro "
|
||||||
FLAGS "U"
|
|
||||||
USE REG SELECT (I0 = 5) || (I0 = 4)
|
USE REG SELECT (I0 = 5) || (I0 = 4)
|
||||||
INPUT CODTAB[1,4] ANNO_ESER
|
INPUT CODTAB[1,4] ANNO_ESER
|
||||||
INPUT CODTAB[5,7] REG_COD
|
INPUT CODTAB[5,7] CODREG
|
||||||
DISPLAY "Anno" CODTAB[1,4]
|
DISPLAY "Anno" CODTAB[1,4]
|
||||||
DISPLAY "Codice" CODTAB[5,7]
|
DISPLAY "Codice" CODTAB[5,7]
|
||||||
DISPLAY "Descrizione@50" S0
|
DISPLAY "Descrizione@50" S0
|
||||||
DISPLAY "Tipo" I0
|
DISPLAY "Tipo" I0
|
||||||
OUTPUT ANNO_ESER CODTAB[1,4]
|
// OUTPUT ANNO_ESER CODTAB[1,4]
|
||||||
OUTPUT REG_COD CODTAB[5,7]
|
OUTPUT CODREG CODTAB[5,7]
|
||||||
OUTPUT REG_DESC S0
|
OUTPUT REG_DESC S0
|
||||||
OUTPUT PAGINA_DA I1
|
OUTPUT PAGINA_DA I1
|
||||||
// OUTPUT DATA_DA D0
|
// OUTPUT DATA_DA D0
|
||||||
OUTPUT DATA_A D1
|
// OUTPUT DATA_A D1
|
||||||
CHECKTYPE NORMAL
|
// CHECKTYPE NORMAL
|
||||||
|
FLAGS "R"
|
||||||
END
|
END
|
||||||
|
|
||||||
NUMBER ANNO_ESER 4
|
NUMBER ANNO_ESER 4
|
||||||
@ -32,8 +32,8 @@ BEGIN
|
|||||||
DISPLAY "Data fine " D1
|
DISPLAY "Data fine " D1
|
||||||
DISPLAY "Data scarico" D2
|
DISPLAY "Data scarico" D2
|
||||||
OUTPUT ANNO_ESER CODTAB
|
OUTPUT ANNO_ESER CODTAB
|
||||||
CHECKTYPE REQUIRED
|
// CHECKTYPE REQUIRED
|
||||||
FLAGS "H"
|
FLAGS "HRZ"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING REG_DESC 50
|
STRING REG_DESC 50
|
||||||
@ -92,7 +92,7 @@ END
|
|||||||
BOOLEAN STAMPA_DEF
|
BOOLEAN STAMPA_DEF
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 34 10 "Stampa definitiva"
|
PROMPT 34 10 "Stampa definitiva"
|
||||||
MESSAGE TRUE DISABLE,DATA_DA
|
MESSAGE TRUE DISABLE,DATA_DA | CLEAR, DATA_DA
|
||||||
MESSAGE FALSE ENABLE,DATA_DA
|
MESSAGE FALSE ENABLE,DATA_DA
|
||||||
END
|
END
|
||||||
|
|
||||||
|
32
cg/cglib.h
32
cg/cglib.h
@ -28,20 +28,38 @@ public:
|
|||||||
TRectype& clifo(int i)const { return(TRectype&)this->operator[](i); }
|
TRectype& clifo(int i)const { return(TRectype&)this->operator[](i); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef enum {scalare = 1, verifica} bilancio;
|
||||||
|
|
||||||
class Saldo
|
class Saldo
|
||||||
{
|
{
|
||||||
real _saldo, _saldo_iniziale, _prg_dare, _prg_avere;
|
real _saldo, _saldo_iniziale, _prg_dare, _prg_avere;
|
||||||
int _indbil;
|
int _indbil;
|
||||||
TLocalisamfile * _saldi, *_rmov, *_clifo, *_mov;
|
|
||||||
TRectype* _rec;
|
TRectype* _rec;
|
||||||
|
bilancio _bilancio;
|
||||||
|
int _annoes;
|
||||||
|
TDate _inizioEs, _fineEs;
|
||||||
|
TString16 _codcaus;
|
||||||
|
TDate _datareg;
|
||||||
|
TDate _datacomp;
|
||||||
|
char _provv;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void InFinEs(int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
int annoes () const { return _annoes; }
|
||||||
|
bilancio bil () const { return _bilancio; }
|
||||||
|
void set_annoes (int anno) { _annoes = anno; }
|
||||||
|
void set_bil (bilancio bil) { _bilancio = bil; }
|
||||||
|
void leggi_mov(long);
|
||||||
bool causale_mov(long, const TDate&, const TDate&, TString&);
|
bool causale_mov(long, const TDate&, const TDate&, TString&);
|
||||||
const char* causale_chiusura_es();
|
const char* causale_chiusura_es();
|
||||||
const char* causale_apertura_es();
|
const char* causale_apertura_es();
|
||||||
bool calcola_data_limite(int,int,int,long,const TDate&,const TDate&,int,bool,
|
bool calcola_data_limite(int,int,int,long,const TDate&,const TDate&,int,bool,
|
||||||
const TDate&,const TDate&,const TDate&,bool);
|
const TDate&,const TDate&,const TDate&,bool);
|
||||||
bool calcola_ultima_immissione(int, int, int, int, long, int);
|
bool calcola_ultima_immissione(int, int, int, int, long, int);
|
||||||
|
real ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil);
|
||||||
|
real data_limite_bilancio(int,int,long,const TDate&,const TDate&,int,bool);
|
||||||
real calcola_saldo_iniziale(int, int, int, long, int);
|
real calcola_saldo_iniziale(int, int, int, long, int);
|
||||||
bool calcola_clifo(int, int, int, int, int);
|
bool calcola_clifo(int, int, int, int, int);
|
||||||
TRectype& ricerca_progr_prec(int, int, int, long);
|
TRectype& ricerca_progr_prec(int, int, int, long);
|
||||||
@ -79,7 +97,7 @@ class TSaldo_agg : public TObject
|
|||||||
int _anno_es; // anno esercizio
|
int _anno_es; // anno esercizio
|
||||||
TDate _data_ulmov; // data ultimo movimento
|
TDate _data_ulmov; // data ultimo movimento
|
||||||
long _num_ulmov; // numero ultimo movimento
|
long _num_ulmov; // numero ultimo movimento
|
||||||
|
TRectype * _rec; // record corrente sui saldi
|
||||||
TConto& tconti() { return *(TConto*)_tab_conti.get(); }
|
TConto& tconti() { return *(TConto*)_tab_conti.get(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -91,19 +109,19 @@ public:
|
|||||||
char sezione, bool somma=TRUE);
|
char sezione, bool somma=TRUE);
|
||||||
|
|
||||||
void set_anno_es(int anno) { _anno_es = anno; }
|
void set_anno_es(int anno) { _anno_es = anno; }
|
||||||
int anno_es() const { return _anno_es; }
|
int anno_es() { return _anno_es; }
|
||||||
|
|
||||||
void set_movap (bool movap) { _movap = movap; }
|
void set_movap (bool movap) { _movap = movap; }
|
||||||
bool movap() const { return _movap; }
|
bool movap() { return _movap; }
|
||||||
|
|
||||||
void set_movprovv (bool p) { _provv = p; }
|
void set_movprovv (bool p) { _provv = p; }
|
||||||
bool movprovv() { return _provv; }
|
bool movprovv() { return _provv; }
|
||||||
|
|
||||||
void set_data_ulmov (const TDate& data) { _data_ulmov = data; }
|
void set_data_ulmov (TDate& data) { _data_ulmov = data; }
|
||||||
const TDate& data_ulmov() const { return _data_ulmov; }
|
TDate& data_ulmov() { return _data_ulmov; }
|
||||||
|
|
||||||
void set_num_ulmov (long num) { _num_ulmov = num; }
|
void set_num_ulmov (long num) { _num_ulmov = num; }
|
||||||
long num_ulmov() const { return _num_ulmov; }
|
long num_ulmov() { return _num_ulmov; }
|
||||||
|
|
||||||
void reset(); // pulisce l'array dei conti
|
void reset(); // pulisce l'array dei conti
|
||||||
TSaldo_agg();
|
TSaldo_agg();
|
||||||
|
218
cg/cglib01.cpp
218
cg/cglib01.cpp
@ -45,29 +45,19 @@ Saldo::Saldo()
|
|||||||
_prg_dare = ZERO;
|
_prg_dare = ZERO;
|
||||||
_prg_avere = ZERO;
|
_prg_avere = ZERO;
|
||||||
_saldo = ZERO;
|
_saldo = ZERO;
|
||||||
|
_annoes = 0;
|
||||||
_indbil = 0;
|
_indbil = 0;
|
||||||
_saldi = new TLocalisamfile(LF_SALDI);
|
|
||||||
_mov = new TLocalisamfile(LF_MOV);
|
|
||||||
_rmov = new TLocalisamfile(LF_RMOV);
|
|
||||||
_clifo = new TLocalisamfile(LF_CLIFO);
|
|
||||||
_rec = new TRectype(LF_SALDI);
|
_rec = new TRectype(LF_SALDI);
|
||||||
}
|
}
|
||||||
|
|
||||||
Saldo::~Saldo()
|
Saldo::~Saldo()
|
||||||
{
|
{
|
||||||
delete _saldi;
|
|
||||||
delete _mov;
|
|
||||||
delete _rmov;
|
|
||||||
delete _clifo;
|
|
||||||
delete _rec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
real Saldo::saldofin_esprec(int annoes, int g, int c, long s)
|
real Saldo::saldofin_esprec(int annoes, int g, int c, long s)
|
||||||
{
|
{
|
||||||
real saldo,pdare,pavere,pdaresca,paveresca;
|
real saldo,pdare,pavere,pdaresca,paveresca;
|
||||||
char flag;
|
char flag;
|
||||||
TLocalisamfile& saldi = *_saldi;
|
|
||||||
TRecnotype numrec = saldi.recno();
|
|
||||||
TRectype app = ricerca_progr_prec(annoes-1, g, c, s);
|
TRectype app = ricerca_progr_prec(annoes-1, g, c, s);
|
||||||
|
|
||||||
flag = app.get(SLD_FLAGSALINI)[0];
|
flag = app.get(SLD_FLAGSALINI)[0];
|
||||||
@ -77,8 +67,6 @@ real Saldo::saldofin_esprec(int annoes, int g, int c, long s)
|
|||||||
pdaresca = app.get_real(SLD_PDARESCA);
|
pdaresca = app.get_real(SLD_PDARESCA);
|
||||||
paveresca = app.get_real(SLD_PAVERESCA);
|
paveresca = app.get_real(SLD_PAVERESCA);
|
||||||
|
|
||||||
saldi.readat(numrec);
|
|
||||||
|
|
||||||
if (flag == 'D')
|
if (flag == 'D')
|
||||||
return saldo+pdaresca-paveresca+pdare-pavere;
|
return saldo+pdaresca-paveresca+pdare-pavere;
|
||||||
else
|
else
|
||||||
@ -89,7 +77,7 @@ real Saldo::calcola_saldo_iniziale(int annoes,int g,int c,long s,int indbil)
|
|||||||
{
|
{
|
||||||
real saldoini, pdaresca, paveresca;
|
real saldoini, pdaresca, paveresca;
|
||||||
char flag;
|
char flag;
|
||||||
TLocalisamfile& saldi = *_saldi;
|
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||||
|
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
saldi.put(SLD_GRUPPO,g);
|
saldi.put(SLD_GRUPPO,g);
|
||||||
@ -101,16 +89,15 @@ real Saldo::calcola_saldo_iniziale(int annoes,int g,int c,long s,int indbil)
|
|||||||
|
|
||||||
saldi.read();
|
saldi.read();
|
||||||
|
|
||||||
if (saldi.bad())
|
if (saldi.bad()) saldi.zero();
|
||||||
saldi.zero();
|
|
||||||
|
|
||||||
flag = saldi.get(SLD_FLAGSALINI)[0];
|
flag = saldi.get(SLD_FLAGSALINI)[0];
|
||||||
saldoini = saldi.get_real(SLD_SALDO);
|
saldoini = saldi.get_real(SLD_SALDO);
|
||||||
pdaresca = saldi.get_real(SLD_PDARESCA);
|
pdaresca = saldi.get_real(SLD_PDARESCA);
|
||||||
paveresca = saldi.get_real(SLD_PAVERESCA);
|
paveresca = saldi.get_real(SLD_PAVERESCA);
|
||||||
|
|
||||||
if (saldoini == 0.00) //e il conto e' patrimoniale o d'ordine
|
if (saldoini == ZERO) //e il conto e' patrimoniale o d'ordine
|
||||||
if ( (indbil == 1)||(indbil == 2)||(indbil == 5) )
|
if ( indbil == 1 || indbil == 2 || indbil == 5 )
|
||||||
saldoini = saldofin_esprec(annoes, g, c, s);
|
saldoini = saldofin_esprec(annoes, g, c, s);
|
||||||
|
|
||||||
if (flag == 'D')
|
if (flag == 'D')
|
||||||
@ -119,9 +106,8 @@ real Saldo::calcola_saldo_iniziale(int annoes,int g,int c,long s,int indbil)
|
|||||||
return pdaresca-saldoini-paveresca;
|
return pdaresca-saldoini-paveresca;
|
||||||
}
|
}
|
||||||
|
|
||||||
// La funzione seguente calcola il saldo per data limite o all'ultima immissione es.in /
|
/*
|
||||||
// corso o precedente, a seconda del valore dei suoi parametri al momento della chiamata
|
bool Saldo::calcola(int annoes, int annoesprec,int g, int c, long s,
|
||||||
bool Saldo::calcola(int annoes, int annoesprec, int g, int c, long s,
|
|
||||||
const TDate& data_inf, const TDate& data_sup,
|
const TDate& data_inf, const TDate& data_sup,
|
||||||
int indbil, bool controllo_competenza, const TDate& inizio_es,
|
int indbil, bool controllo_competenza, const TDate& inizio_es,
|
||||||
const TDate& fine_es, const TDate& fine_es_prec,bool stp_prov)
|
const TDate& fine_es, const TDate& fine_es_prec,bool stp_prov)
|
||||||
@ -133,11 +119,12 @@ bool Saldo::calcola(int annoes, int annoesprec, int g, int c, long s,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!calcola_ultima_immissione(annoes, annoesprec, g, c, s, indbil))
|
if (!calcola_ultima_immissione(annoes,annoesprec, g, c, s, indbil))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
const char* Saldo::causale_chiusura_es()
|
const char* Saldo::causale_chiusura_es()
|
||||||
{
|
{
|
||||||
@ -155,37 +142,29 @@ const char* Saldo::causale_apertura_es()
|
|||||||
return __tmp;
|
return __tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Saldo::causale_mov(long nr, const TDate& inizio_es, const TDate& data_sup, TString& provv)
|
void Saldo::leggi_mov(long nr)
|
||||||
{
|
{
|
||||||
TString codcaus;
|
TLocalisamfile mov(LF_MOV, FALSE);
|
||||||
TDate datareg;
|
|
||||||
TLocalisamfile& mov = *_mov;
|
|
||||||
|
|
||||||
mov.zero();
|
mov.zero();
|
||||||
mov.put (MOV_NUMREG,nr);
|
mov.put (MOV_NUMREG,nr);
|
||||||
|
|
||||||
if (mov.read() == NOERR)
|
if (mov.read() == NOERR)
|
||||||
{
|
{
|
||||||
codcaus = mov.get(MOV_CODCAUS);
|
_codcaus = mov.get(MOV_CODCAUS);
|
||||||
datareg = mov.get_date(MOV_DATAREG);
|
_datareg = mov.get_date(MOV_DATAREG);
|
||||||
provv = mov.get(MOV_PROVVIS);
|
_provv = mov.get_char(MOV_PROVVIS);
|
||||||
if (codcaus == causale_chiusura_es())
|
_datacomp = mov.get_date(MOV_DATACOMP);
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
if (codcaus == causale_apertura_es())
|
|
||||||
if ( (datareg < inizio_es) || (datareg > data_sup) )
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Saldo::calcola_data_limite(int annoes, int g, int c, long s, const TDate& data_inf, const TDate& data_sup, int indbil, bool controllo_competenza, const TDate& inizio_es, const TDate& fine_es, const TDate& fine_es_prec,bool stp_prov)
|
bool Saldo::calcola_data_limite(int annoes, int g, int c, long s, const TDate& data_inf, const TDate& data_sup, int indbil, bool controllo_competenza, const TDate& inizio_es, const TDate& fine_es, const TDate& fine_es_prec,bool stp_prov)
|
||||||
{
|
{
|
||||||
TString sezione, gcs_corr, gcs_prec="", provv = "";
|
TString sezione, gcs_corr, gcs_prec="", provv = "";
|
||||||
real importo, dep = 0.00;
|
real importo, dep = ZERO;
|
||||||
int gruppo, conto, annoe;
|
int gruppo, conto, annoe;
|
||||||
long sottoconto, num_reg;
|
long sottoconto, num_reg;
|
||||||
TLocalisamfile& rmov = *_rmov;
|
TLocalisamfile rmov(LF_RMOV, FALSE);
|
||||||
|
|
||||||
TDate data_rmv;
|
TDate data_rmv;
|
||||||
bool esito = FALSE;
|
bool esito = FALSE;
|
||||||
@ -212,8 +191,8 @@ bool Saldo::calcola_data_limite(int annoes, int g, int c, long s, const TDate& d
|
|||||||
num_reg = rmov.get_long(RMV_NUMREG);
|
num_reg = rmov.get_long(RMV_NUMREG);
|
||||||
|
|
||||||
//se la causale del movimento e' uguale a quella di chiusura, il movimento non va considerato
|
//se la causale del movimento e' uguale a quella di chiusura, il movimento non va considerato
|
||||||
if (causale_mov(num_reg,inizio_es,data_sup,provv))
|
//if (causale_mov(num_reg,inizio_es,data_sup,provv))
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
if ((!stp_prov) && (provv.trim().not_empty())) //se non e' richiesta stampa
|
if ((!stp_prov) && (provv.trim().not_empty())) //se non e' richiesta stampa
|
||||||
continue; //mov. provvisori li scarto
|
continue; //mov. provvisori li scarto
|
||||||
@ -258,6 +237,97 @@ bool Saldo::calcola_data_limite(int annoes, int g, int c, long s, const TDate& d
|
|||||||
return esito;
|
return esito;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
void Saldo::InFinEs(int ae)
|
||||||
|
{
|
||||||
|
TTable TabEs ("ESC");
|
||||||
|
TString16 codtab;
|
||||||
|
|
||||||
|
TabEs.zero();
|
||||||
|
|
||||||
|
codtab.format ("%04d", ae);
|
||||||
|
TabEs.put ("CODTAB", codtab);
|
||||||
|
TabEs.read();
|
||||||
|
if (TabEs.good())
|
||||||
|
{
|
||||||
|
_inizioEs = TabEs.get_date ("D0");
|
||||||
|
_fineEs = TabEs.get_date ("D1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
real Saldo::data_limite_bilancio(int g, int c, long s, const TDate& data_inf,
|
||||||
|
const TDate& data_sup, int indbil, bool stp_prov)
|
||||||
|
{
|
||||||
|
TString16 gcs_corr, gcs_prec;
|
||||||
|
real importo, dep = ZERO;
|
||||||
|
int gruppo, conto, annoe;
|
||||||
|
long sottoconto, num_reg;
|
||||||
|
TDate data_mov;
|
||||||
|
char sezione;
|
||||||
|
TLocalisamfile rmov(LF_RMOV, FALSE);
|
||||||
|
|
||||||
|
rmov.setkey(2);
|
||||||
|
rmov.zero();
|
||||||
|
rmov.put(RMV_GRUPPO,g);
|
||||||
|
rmov.put(RMV_CONTO,c);
|
||||||
|
rmov.put(RMV_SOTTOCONTO,s);
|
||||||
|
TRectype rec(rmov.curr());
|
||||||
|
|
||||||
|
rmov.read(_isgteq);
|
||||||
|
for ( ; !rmov.eof(); rmov.next())
|
||||||
|
{
|
||||||
|
if (rmov.curr() != rec) break;
|
||||||
|
|
||||||
|
annoe = rmov.get_int(RMV_ANNOES);
|
||||||
|
gruppo = rmov.get_int(RMV_GRUPPO);
|
||||||
|
conto = rmov.get_int(RMV_CONTO);
|
||||||
|
sottoconto = rmov.get_long(RMV_SOTTOCONTO);
|
||||||
|
num_reg = rmov.get_long(RMV_NUMREG);
|
||||||
|
|
||||||
|
leggi_mov(num_reg);
|
||||||
|
|
||||||
|
if (_bilancio == scalare)
|
||||||
|
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' uguale a quella di chiusura,
|
||||||
|
// il movimento non va considerato
|
||||||
|
|
||||||
|
if (_codcaus == causale_chiusura_es()) continue;
|
||||||
|
|
||||||
|
if (!stp_prov && _provv != ' ') //se non e' richiesta stampa
|
||||||
|
continue; //mov. provvisori li scarto
|
||||||
|
|
||||||
|
gcs_corr = format ("%3d%3d%6ld", gruppo, conto, sottoconto);
|
||||||
|
|
||||||
|
if (gcs_corr != gcs_prec)
|
||||||
|
{
|
||||||
|
gcs_prec = gcs_corr;
|
||||||
|
dep += calcola_saldo_iniziale(_annoes,gruppo,conto,sottoconto,indbil);
|
||||||
|
}
|
||||||
|
|
||||||
|
sezione = rmov.get_char(RMV_SEZIONE);
|
||||||
|
importo = rmov.get_real(RMV_IMPORTO);
|
||||||
|
|
||||||
|
if (importo == ZERO)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (sezione == 'D') dep += importo;
|
||||||
|
else dep -= importo;
|
||||||
|
|
||||||
|
}
|
||||||
|
_saldo = dep;
|
||||||
|
return _saldo;
|
||||||
|
}
|
||||||
|
|
||||||
bool Saldo::calcola_ultima_immissione(int annoes, int annoesprec, int g, int c,
|
bool Saldo::calcola_ultima_immissione(int annoes, int annoesprec, int g, int c,
|
||||||
long s, int indbil)
|
long s, int indbil)
|
||||||
{
|
{
|
||||||
@ -265,7 +335,7 @@ long s, int indbil)
|
|||||||
char sezione;
|
char sezione;
|
||||||
int gruppo, conto, annoe;
|
int gruppo, conto, annoe;
|
||||||
long sottoconto;
|
long sottoconto;
|
||||||
TLocalisamfile& saldi = *_saldi;
|
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||||
bool esito = TRUE;
|
bool esito = TRUE;
|
||||||
|
|
||||||
_saldo_iniziale = ZERO;
|
_saldo_iniziale = ZERO;
|
||||||
@ -326,22 +396,70 @@ long s, int indbil)
|
|||||||
return esito;
|
return esito;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRectype& Saldo::ricerca_progr_prec (int annoesprec, int g, int c, long s)
|
real Saldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil)
|
||||||
{
|
{
|
||||||
TLocalisamfile& saldi = *_saldi;
|
//Si considerano i saldi e non piu' i movimenti
|
||||||
|
char sezione;
|
||||||
|
int gruppo, conto, annoe;
|
||||||
|
long sottoconto;
|
||||||
|
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||||
|
|
||||||
|
_saldo_iniziale = ZERO;
|
||||||
|
_prg_dare = ZERO;
|
||||||
|
_prg_avere = ZERO;
|
||||||
|
_saldo = ZERO;
|
||||||
|
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
// static TRectype rec(saldi.curr());
|
|
||||||
|
saldi.put(SLD_ANNOES,annoes);
|
||||||
|
saldi.put(SLD_GRUPPO,g);
|
||||||
|
saldi.put(SLD_CONTO,c);
|
||||||
|
saldi.put(SLD_SOTTOCONTO,s);
|
||||||
|
|
||||||
|
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);
|
||||||
|
sezione = saldi.get_char(SLD_FLAGSALINI);
|
||||||
|
|
||||||
|
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
||||||
|
|
||||||
|
// if (indbil == 3 || indbil == 4)
|
||||||
|
// return esito;
|
||||||
|
|
||||||
|
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||||
|
if (_saldo_iniziale == ZERO)
|
||||||
|
_saldo_iniziale += saldofin_esprec(annoes,gruppo,conto,sottoconto);
|
||||||
|
|
||||||
|
// i tre valori precedenti vengono utilizzati per la stampa bilancio
|
||||||
|
// di verifica
|
||||||
|
_saldo = _saldo_iniziale + _prg_dare - _prg_avere;
|
||||||
|
}
|
||||||
|
return _saldo;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRectype& Saldo::ricerca_progr_prec (int annoesprec, int g, int c, long s)
|
||||||
|
{
|
||||||
|
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||||
|
// TRectype rec(LF_SALDI);
|
||||||
|
|
||||||
|
saldi.setkey(1);
|
||||||
|
saldi.zero();
|
||||||
|
|
||||||
if (annoesprec != 0) saldi.put(SLD_ANNOES,annoesprec);
|
if (annoesprec != 0) saldi.put(SLD_ANNOES,annoesprec);
|
||||||
if (g != 0) saldi.put(SLD_GRUPPO,g);
|
if (g != 0) saldi.put(SLD_GRUPPO,g);
|
||||||
if (c != 0) saldi.put(SLD_CONTO,c);
|
if (c != 0) saldi.put(SLD_CONTO,c);
|
||||||
if (s != 0) saldi.put(SLD_SOTTOCONTO,s);
|
if (s != 0) saldi.put(SLD_SOTTOCONTO,s);
|
||||||
|
|
||||||
saldi.read();
|
if (saldi.read() != NOERR) saldi.zero();
|
||||||
if (saldi.bad()) saldi.zero();
|
|
||||||
|
|
||||||
*_rec = saldi.curr();
|
*_rec = saldi.curr();
|
||||||
|
|
||||||
return *_rec;
|
return *_rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,7 +471,7 @@ bool Saldo::prg_attuali(int annoes,TConto& conto,int indbil,real& prgdare,real&
|
|||||||
int g = conto.gruppo();
|
int g = conto.gruppo();
|
||||||
int c = conto.conto();
|
int c = conto.conto();
|
||||||
long s = conto.sottoconto();
|
long s = conto.sottoconto();
|
||||||
TLocalisamfile& saldi = *_saldi;
|
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||||
|
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
saldi.put(SLD_GRUPPO,g);
|
saldi.put(SLD_GRUPPO,g);
|
||||||
@ -398,7 +516,7 @@ bool Saldo::prg_mov_eliminati(int annoes,TConto& conto,int indbil,real& prgdare,
|
|||||||
{
|
{
|
||||||
real saldoini, pdaresca, paveresca;
|
real saldoini, pdaresca, paveresca;
|
||||||
char flagsalini;
|
char flagsalini;
|
||||||
TLocalisamfile& saldi = *_saldi;
|
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||||
|
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
saldi.put(SLD_GRUPPO,conto.gruppo());
|
saldi.put(SLD_GRUPPO,conto.gruppo());
|
||||||
@ -414,10 +532,10 @@ bool Saldo::prg_mov_eliminati(int annoes,TConto& conto,int indbil,real& prgdare,
|
|||||||
saldoini = saldi.get_real(SLD_SALDO);
|
saldoini = saldi.get_real(SLD_SALDO);
|
||||||
|
|
||||||
if ( (indbil == 1) || (indbil == 2) || (indbil == 5) )
|
if ( (indbil == 1) || (indbil == 2) || (indbil == 5) )
|
||||||
if (saldoini == 0)
|
if (saldoini == ZERO)
|
||||||
{
|
{
|
||||||
saldoini = saldofin_esprec(annoes,conto.gruppo(),conto.conto(),conto.sottoconto());
|
saldoini = saldofin_esprec(annoes,conto.gruppo(),conto.conto(),conto.sottoconto());
|
||||||
if (saldoini > 0.00)
|
if (saldoini > ZERO)
|
||||||
flagsalini = 'D';
|
flagsalini = 'D';
|
||||||
else flagsalini = 'A';
|
else flagsalini = 'A';
|
||||||
}
|
}
|
||||||
|
15
cg/makefile
15
cg/makefile
@ -41,10 +41,9 @@ $(O)/cg0300.o: cg0300.cpp $(I15) $(I31) $(I53) cg0300.h cg0.h
|
|||||||
$(O)/cg0400.o: cg0400.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0400.h cg0.h
|
$(O)/cg0400.o: cg0400.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0400.h cg0.h
|
||||||
|
|
||||||
$(O)/cg0500.o: cg0500.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h
|
$(O)/cg0500.o: cg0500.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h
|
||||||
$(O)/cg0501.o: cg0501.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I43) cg0500.h cg0501.h
|
|
||||||
|
|
||||||
$(EP)cg0: $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0201.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg0501.o $(O)/conto.o $(LIBD1) $(EP)cg0.frl
|
$(EP)cg0: $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0201.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg2103.o $(O)/conto.o $(LIBD1) $(EP)cg0.frl
|
||||||
$(LINK) $(LFLAGSD1) $@ $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0201.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg0501.o $(O)/conto.o
|
$(LINK) $(LFLAGSD1) $@ $(O)/cg0.o $(O)/cg0100.o $(O)/cg0200.o $(O)/cg0201.o $(O)/cg0300.o $(O)/cg0400.o $(O)/cg0500.o $(O)/cg2103.o $(O)/conto.o
|
||||||
|
|
||||||
$(EP)cg0.frl: cg0.url $(U1)
|
$(EP)cg0.frl: cg0.url $(U1)
|
||||||
$(RCOMP) cg0 -l $(EP)cg0
|
$(RCOMP) cg0 -l $(EP)cg0
|
||||||
@ -101,11 +100,11 @@ $(O)/cg3300.o: cg3300.cpp cg3300.h $(I6) $(I10) $(I24) $(I27) $(I33)
|
|||||||
|
|
||||||
$(O)/cg3301.o: cg3301.cpp cg3300.h $(I6) $(I10) $(I24) $(I27) $(I33)
|
$(O)/cg3301.o: cg3301.cpp cg3300.h $(I6) $(I10) $(I24) $(I27) $(I33)
|
||||||
|
|
||||||
(O)/cg3100.o: cg3401.h cg3100.cpp $(I6) $(I10) $(I24) $(I27) $(I33)
|
(O)/cg3100.o: cglib03.h cg3100.cpp $(I6) $(I10) $(I24) $(I27) $(I33)
|
||||||
|
|
||||||
$(O)/cg3200.o: cg3401.h cg3200.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I47) $(I48)
|
$(O)/cg3200.o: cglib03.h cg3200.cpp $(I6) $(I10) $(I24) $(I27) $(I33) $(I47) $(I48)
|
||||||
|
|
||||||
$(O)/cg3400.o: cg3401.h cg3400.cpp $(I6) $(I10) $(I24) $(I27) $(I33)
|
$(O)/cg3400.o: cglib03.h cg3400.cpp $(I6) $(I10) $(I24) $(I27) $(I33)
|
||||||
|
|
||||||
$(O)/cg3500.o: cg3500.cpp cg3500.h $(I6) $(I10) $(I24) $(I27) $(I33)
|
$(O)/cg3500.o: cg3500.cpp cg3500.h $(I6) $(I10) $(I24) $(I27) $(I33)
|
||||||
|
|
||||||
@ -115,8 +114,8 @@ $(O)/cglib03.o: cglib03.cpp $(I24) $(I31) $(I33) $(I40) $(I42) $(I51) cglib.h
|
|||||||
|
|
||||||
$(O)/conto.o: conto.cpp conto.h
|
$(O)/conto.o: conto.cpp conto.h
|
||||||
|
|
||||||
$(EP)cg3: $(O)/cg3.o $(LIBD1) $(O)/cg3300.o $(O)/cg3301.o $(O)/cg3200.o $(O)/cg3100.o $(O)/cg3400.o $(O)/cg3500.o $(O)/conto.o $(O)/cglib01.o $(O)/cglib03.o $(EP)cg3.frl
|
$(EP)cg3: $(O)/cg3.o $(LIBD1) $(O)/cg3300.o $(O)/cg3301.o $(O)/cg3200.o $(O)/cg3100.o $(O)/cg3400.o $(O)/cg3500.o $(O)/cg2103.o $(O)/conto.o $(O)/cglib01.o $(O)/cglib03.o $(EP)cg3.frl
|
||||||
$(LINK) $(LFLAGSD1) $@ $(O)/cg3.o $(O)/cg3300.o $(O)/cg3301.o $(O)/cg3200.o $(O)/cg3100.o $(O)/cg3400.o $(O)/cg3500.o $(O)/conto.o $(O)/cglib01.o $(O)/cglib03.o
|
$(LINK) $(LFLAGSD1) $@ $(O)/cg3.o $(O)/cg3300.o $(O)/cg3301.o $(O)/cg3200.o $(O)/cg3100.o $(O)/cg3400.o $(O)/cg3500.o $(O)/conto.o $(O)/cglib01.o $(O)/cglib03.o $(O)/cg2103.o
|
||||||
|
|
||||||
$(EP)cg3.frl: cg3.url $(U1)
|
$(EP)cg3.frl: cg3.url $(U1)
|
||||||
$(RCOMP) cg3 -l $(EP)cg3
|
$(RCOMP) cg3 -l $(EP)cg3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user