Patch level : XX.218
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione AGA patch 218 sul main trunk git-svn-id: svn://10.65.10.50/trunk@10087 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ba237a9d91
commit
3a17a5a00e
13
ba/ba0.cpp
13
ba/ba0.cpp
@ -1634,13 +1634,12 @@ bool TMenu_application::create()
|
||||
|
||||
#ifdef _DEMO_
|
||||
{
|
||||
TMask w("Attenzione", 1, 78, 14);
|
||||
w.add_static(DLG_NULL, 0 ,"@bAttenzione" , 35 , 1);
|
||||
w.add_static(DLG_NULL, 0 ,"@bQuesto programma e' in versione dimostrativa." , 1 , 3);
|
||||
w.add_static(DLG_NULL, 0 ,"@bNon si possono memorizzare date posteriori al 1992" , 1 , 5);
|
||||
w.add_static(DLG_NULL, 0 ,"@bcon mese successivo a Marzo." , 1 , 7);
|
||||
w.add_static(DLG_NULL, 0 ,"@bIl programma funziona per due ore ogni giorno." , 1 , 9);
|
||||
w.add_static(DLG_NULL, 0 ,"@bIl numero di registrazioni e' stato limitato a circa 1000." , 1 , 11);
|
||||
TMask w("ATTENZIONE", 1, 68, 12);
|
||||
w.add_static(DLG_NULL, 0 ,"@bATTENZIONE" , 30 , 1);
|
||||
w.add_static(DLG_NULL, 0 ,"Questo programma è in versione dimostrativa." , 1 , 3);
|
||||
w.add_static(DLG_NULL, 0 ,"Non si possono memorizzare date con mese successivo a Marzo." , 1 , 5);
|
||||
w.add_static(DLG_NULL, 0 ,"Il programma funziona circa per due ore ogni giorno." , 1 , 7);
|
||||
w.add_static(DLG_NULL, 0 ,"Il numero di registrazioni è stato limitato ad un migliaio." , 1 , 9);
|
||||
w.add_button(DLG_OK, 0, "", -11, -1, 10, 2);
|
||||
w.run();
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ void TColumnizer_win::recalc_layout(int dx, int dy)
|
||||
long maxy = _rows.items() - rows()/2 + 1;
|
||||
long maxx = dx;
|
||||
if (maxx <= 0)
|
||||
maxx = _column.get_long(_column.items()-1) + 70;
|
||||
maxx = _column.get_long(_column.items()-1) + 384;
|
||||
maxx -= columns()/2 + NUM_WIDTH;
|
||||
if (maxx < 0) maxx = 0;
|
||||
if (maxy < 0) maxy = 0;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include <tabapp.h>
|
||||
|
||||
#include "../cg/cglib03.h"
|
||||
|
||||
#include "batbreg.h"
|
||||
#include "batbcam.h"
|
||||
#include "batbdel.h"
|
||||
@ -171,8 +172,10 @@ void TGeneric_table_app::init_modify_mode(TMask& m)
|
||||
{
|
||||
m.disable(-3); // Disabilita scelta decimali e contro-euro
|
||||
} else
|
||||
if (n == TAB_VERSAMENTI)
|
||||
if (n == TAB_VERSAMENTI)
|
||||
{
|
||||
load_rec_in_disabled_fields(m);
|
||||
}
|
||||
}
|
||||
|
||||
void TGeneric_table_app::init_query_mode(TMask& m)
|
||||
@ -272,7 +275,8 @@ HIDDEN bool ditta_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (f.to_check(k))
|
||||
{
|
||||
TFirm firm(atol(f.get()));
|
||||
const long ditta = atol(f.get());
|
||||
TFirm firm(ditta);
|
||||
f.mask().set(F_CODVAL, firm.codice_valuta());
|
||||
}
|
||||
return TRUE;
|
||||
@ -366,12 +370,15 @@ HIDDEN bool impdel_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
const TMask& m = f.mask();
|
||||
|
||||
if (f.to_check(k))
|
||||
{
|
||||
real r(f.get());
|
||||
TCurrency cur(r, f.mask().get(F_CODVAL));
|
||||
const int ndec = cur.decimals();
|
||||
r.round(ndec == 0 ? -3 : ndec);
|
||||
if (!m.query_mode() && f.to_check(k))
|
||||
{
|
||||
const int anno = m.get_int(F_ANNODEL);
|
||||
const int tipo_del = m.get_int(F_TIPODEL);
|
||||
const long ditta = m.get_long(F_DITTA);
|
||||
TIva_round ir; ir.set_default_iva_mode(anno, tipo_del == 2, ditta);
|
||||
|
||||
real r = f.get();
|
||||
ir.round(r);
|
||||
f.set(r.string());
|
||||
}
|
||||
|
||||
@ -412,6 +419,7 @@ HIDDEN bool mese_handler(TMask_field& f, KEY k)
|
||||
const int mese = m.get_int(F_MESEDEL);
|
||||
const long firm = m.get_long(F_DITTA);
|
||||
const int anno = m.get_int(F_ANNODEL);
|
||||
|
||||
if (app().frequenza_versamenti(firm, anno) == 'T')
|
||||
{
|
||||
TLocalisamfile nditte(LF_NDITTE);
|
||||
|
||||
11
ba/baeur.cpp
11
ba/baeur.cpp
@ -432,7 +432,15 @@ int main(int argc, char** argv)
|
||||
{
|
||||
TApplication::check_parameters(argc, argv);
|
||||
|
||||
int a = argc > 1 ? argv[1][1]-'0' : 0;
|
||||
int a = 0;
|
||||
if (argc > 1)
|
||||
{
|
||||
a = toupper(argv[1][1]);
|
||||
if (isdigit(a))
|
||||
a -= '0';
|
||||
else
|
||||
a -= 'A'-10;
|
||||
}
|
||||
switch (a)
|
||||
{
|
||||
case 1: baeur01(argc, argv); break; // Conversione ditte
|
||||
@ -444,6 +452,7 @@ int main(int argc, char** argv)
|
||||
case 7: baeur07(argc, argv); break;
|
||||
case 8: baeur08(argc, argv); break;
|
||||
case 9: baeur09(argc, argv); break; // Ricalcolo saldi Lire/Euro
|
||||
case 10: baeur0A(argc, argv); break; // Copia movimenti contabili da Euro a Lire
|
||||
default: baeur00(argc, argv); break; // Creazioe area dati euro
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -71,8 +71,8 @@ protected:
|
||||
void update_saldo(const TRectype& mov, const TRectype& rmov, TLocalisamfile& saldi);
|
||||
|
||||
public:
|
||||
void add(int g, int c, long s, char sez, const real& imp);
|
||||
void add(const TBill& bill, const TImporto& imp);
|
||||
bool add(int g, int c, long s, char sez, const real& imp);
|
||||
bool add(const TBill& bill, const TImporto& imp);
|
||||
TImporto save(const TDate& datareg, const TString& caus, const TString& desc,
|
||||
const TBill& contro, bool adeuro, bool convert, bool invert);
|
||||
TImporto calc_bil(bool convert, bool invert); // Sommatoria delle righe
|
||||
@ -107,5 +107,6 @@ int baeur06(int argc, char* argv[]);
|
||||
int baeur07(int argc, char* argv[]);
|
||||
int baeur08(int argc, char* argv[]);
|
||||
int baeur09(int argc, char* argv[]);
|
||||
int baeur0A(int argc, char* argv[]);
|
||||
|
||||
#endif
|
||||
|
||||
@ -727,7 +727,7 @@ void TEuro01_app::convert_saldi(const TDate& adozione, const TBill& arrotino)
|
||||
convert_file(LF_SALDI, NULL, NULL, NULL, saldi_handler, &sld);
|
||||
|
||||
TImporto& saldo = sld._sld;
|
||||
saldo.valore().round(-2);
|
||||
saldo.valore().round(2);
|
||||
if (!saldo.is_zero())
|
||||
{
|
||||
TLocalisamfile saldi_lire(LF_SALDI); // Open trc
|
||||
|
||||
@ -29,24 +29,33 @@ inline TEuro02_app& app() { return (TEuro02_app&)main_app(); }
|
||||
// Gestione movimenti di apertura e chiusura
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
void TCG_mov::add(int g, int c, long s, char sez, const real& imp)
|
||||
{
|
||||
TCG_rmov* rmov = new TCG_rmov;
|
||||
rmov->_gruppo = g;
|
||||
rmov->_conto = c;
|
||||
rmov->_sottoconto = s;
|
||||
rmov->_importo.set(sez, imp);
|
||||
TArray::add(rmov);
|
||||
bool TCG_mov::add(int g, int c, long s, char sez, const real& imp)
|
||||
{
|
||||
bool ok = s > 0;
|
||||
if (ok)
|
||||
{
|
||||
TCG_rmov* rmov = new TCG_rmov;
|
||||
rmov->_gruppo = g;
|
||||
rmov->_conto = c;
|
||||
rmov->_sottoconto = s;
|
||||
rmov->_importo.set(sez, imp);
|
||||
TArray::add(rmov);
|
||||
}
|
||||
#ifdef DBG
|
||||
else
|
||||
error_box("Conto non valido: %d %d %ld", g, c, s);
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TCG_mov::add(const TBill& bill, const TImporto& imp)
|
||||
bool TCG_mov::add(const TBill& bill, const TImporto& imp)
|
||||
{
|
||||
int g = bill.gruppo();
|
||||
int c = bill.conto();
|
||||
long s = bill.sottoconto();
|
||||
char sez = imp.sezione();
|
||||
real val = imp.valore();
|
||||
add(g, c, s, sez, val);
|
||||
return add(g, c, s, sez, val);
|
||||
}
|
||||
|
||||
void TCG_mov::crea_testata(TLocalisamfile& mov, const TString& caus,
|
||||
@ -153,9 +162,9 @@ TImporto TCG_mov::save(const TDate& datareg, const TString& caus, const TString&
|
||||
TProgind pi(items(), desc, FALSE, TRUE);
|
||||
|
||||
// Apro comunque i file in lire per avere i tracciati
|
||||
TLocalisamfile lmov(LF_MOV, adeuro);
|
||||
TLocalisamfile lrmov(LF_RMOV, adeuro);
|
||||
TLocalisamfile lsaldi(LF_SALDI, adeuro);
|
||||
TLocalisamfile lmov(LF_MOV);
|
||||
TLocalisamfile lrmov(LF_RMOV);
|
||||
TLocalisamfile lsaldi(LF_SALDI);
|
||||
TLocalisamfile *pmov, *prmov, *psaldi;
|
||||
|
||||
// Apro quelli in euro se necessario
|
||||
@ -211,7 +220,7 @@ TImporto TCG_mov::save(const TDate& datareg, const TString& caus, const TString&
|
||||
|
||||
TBill conto(riga._gruppo, riga._conto, riga._sottoconto);
|
||||
if (!conto.find())
|
||||
error_box("Nella riga %d movimento %ld sarebbe utile anche il conto %d %d %ld",
|
||||
error_box("Nella riga %d del movimento %ld sarebbe utile anche il conto %d %d %ld",
|
||||
written, mov.get_long(MOV_NUMREG), riga._gruppo, riga._conto, riga._sottoconto);
|
||||
conto.put(rmov.curr(), FALSE);
|
||||
contro.put(rmov.curr(), TRUE);
|
||||
@ -449,7 +458,7 @@ void TEuro02_app::main_loop()
|
||||
goto_lire(f);
|
||||
if (f <= 0L)
|
||||
set_firm();
|
||||
|
||||
|
||||
TEuro20_mask msk;
|
||||
msk.on_firm_change(); // Preimposta data adozione euro ed altro
|
||||
|
||||
|
||||
@ -391,6 +391,7 @@ void TEuro03_app::main_loop()
|
||||
data._proper.get(msk, F30_PROPER_G, F30_PROPER_C, F30_PROPER_S);
|
||||
data._bilape.get(msk, F30_BILAPE_G, F30_BILAPE_C, F30_BILAPE_S);
|
||||
data._utipat.get(msk, F30_UTIPAT_G, F30_UTIPAT_C, F30_UTIPAT_S);
|
||||
data._perpat.get(msk, F30_PERPAT_G, F30_PERPAT_C, F30_PERPAT_S);
|
||||
data._utieco.get(msk, F30_UTIECO_G, F30_UTIECO_C, F30_UTIECO_S);
|
||||
data._pereco.get(msk, F30_PERECO_G, F30_PERECO_C, F30_PERECO_S);
|
||||
data._difarr.get(msk, F30_DIFARR_G, F30_DIFARR_C, F30_DIFARR_S);
|
||||
|
||||
@ -182,7 +182,7 @@ static bool rdoc_handler(TRectype& rec, void* jolly)
|
||||
key << "|" << rec.get(RDOC_ANNO);
|
||||
key << "|" << rec.get(RDOC_CODNUM);
|
||||
key << "|" << rec.get(RDOC_NDOC);
|
||||
TRectype & doc = (TRectype &) cache().get(LF_DOC, key);
|
||||
TRectype doc((TRectype &) cache().get(LF_DOC, key));
|
||||
bool ok = doc_handler(doc, jolly);
|
||||
|
||||
if (doc.get(DOC_MOVMAG).empty())
|
||||
|
||||
@ -23,14 +23,12 @@ public:
|
||||
};
|
||||
|
||||
bool TArticolo_euro::adjust_storico(const int anno)
|
||||
|
||||
{
|
||||
bool updated = FALSE;
|
||||
TAssoc_array values;
|
||||
TString16 annoes; annoes << anno;
|
||||
TRecord_array & s = storico(annoes);
|
||||
const int sto_items = s.rows();
|
||||
|
||||
for (int i = 1; i <= sto_items; i++)
|
||||
{
|
||||
TRectype & rec = s[i];
|
||||
@ -47,16 +45,15 @@ bool TArticolo_euro::adjust_storico(const int anno)
|
||||
*tot += val;
|
||||
}
|
||||
|
||||
TRecord_array & m = mag(annoes);
|
||||
TRecord_array& m = mag(annoes);
|
||||
const int mag_items = m.rows();
|
||||
|
||||
for (i = 1; i <= mag_items; i++)
|
||||
{
|
||||
TRectype & rec = m[i];
|
||||
TString16 codmag(rec.get(MAG_CODMAG));
|
||||
const real val = rec.get_real(MAG_VALRIM);
|
||||
real * tot = (real *)values.objptr(codmag);
|
||||
|
||||
|
||||
if (tot == NULL)
|
||||
{
|
||||
tot = new real;
|
||||
@ -72,7 +69,7 @@ bool TArticolo_euro::adjust_storico(const int anno)
|
||||
real val = rec.get_real(MAG_VALRIM);
|
||||
real * corr = (real *)values.objptr(codmag);
|
||||
|
||||
if (corr != NULL & *corr != ZERO)
|
||||
if (corr != NULL && *corr != ZERO)
|
||||
{
|
||||
corr->round(TCurrency::get_firm_dec(FALSE));
|
||||
val += *corr;
|
||||
@ -135,8 +132,7 @@ void TEuro06_app::update_stomag()
|
||||
for (c = 0L; c.pos() < items; ++c)
|
||||
{
|
||||
pi.addstatus(1);
|
||||
TArticolo_euro & curr_art = (TArticolo_euro &) c.curr();
|
||||
|
||||
TArticolo_euro& curr_art = (TArticolo_euro &) c.curr();
|
||||
for (int codes = e.first(); codes > 0; codes = e.next(codes))
|
||||
{
|
||||
if (curr_art.adjust_storico(codes))
|
||||
|
||||
535
ba/baeur0a.cpp
Executable file
535
ba/baeur0a.cpp
Executable file
@ -0,0 +1,535 @@
|
||||
#include <automask.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <viswin.h>
|
||||
#include <browfile.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include "baeur.h"
|
||||
#include "baeura0.h"
|
||||
|
||||
#include "../cg/cg2103.h"
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "mov.h"
|
||||
#include "partite.h"
|
||||
#include "rmov.h"
|
||||
#include "rmoviva.h"
|
||||
#include "saldi.h"
|
||||
#include "scadenze.h"
|
||||
|
||||
class TPirogano_mask : public TAutomask
|
||||
{
|
||||
TViswin* _log_win;
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
void convert_movs(long fr, long to);
|
||||
TViswin& log_win() { return *_log_win; }
|
||||
|
||||
TPirogano_mask();
|
||||
};
|
||||
|
||||
bool TPirogano_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch (o.dlg())
|
||||
{
|
||||
case DLG_PRINT:
|
||||
if (e == fe_button)
|
||||
{
|
||||
_log_win->text().print();
|
||||
return FALSE; // Don't close
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TPirogano_mask::TPirogano_mask() : TAutomask("baeura0")
|
||||
{
|
||||
TBrowsefile_field& bf = (TBrowsefile_field&)field(F_LOG);
|
||||
_log_win = &bf.vis_win();
|
||||
}
|
||||
|
||||
class TPirogano_app : public TEuro_app
|
||||
{
|
||||
TPirogano_mask* _msk;
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
void log_msg(TString& str);
|
||||
void log_war(TString& str);
|
||||
void log_err(TString& str);
|
||||
|
||||
void scadenze_handler(TRectype& rec, const TRectype& part, real& totrate);
|
||||
void convert_scad(const TRectype& part);
|
||||
bool partite_handler(TRectype& rec);
|
||||
void convert_part(long num_reg);
|
||||
|
||||
void update_saldo(const TRectype& rmov, int segno);
|
||||
void save_row(TEuroisamfile& rmov);
|
||||
void convert_rmovs(long num_reg, long num_rege);
|
||||
void convert_movs(long fr, long to);
|
||||
};
|
||||
|
||||
void TPirogano_app::log_msg(TString& str)
|
||||
{
|
||||
str.insert("- ");
|
||||
_msk->log_win().add_line(str);
|
||||
}
|
||||
|
||||
void TPirogano_app::log_war(TString& str)
|
||||
{
|
||||
str.insert("$[b,w]! ");
|
||||
_msk->log_win().add_line(str);
|
||||
}
|
||||
|
||||
void TPirogano_app::log_err(TString& str)
|
||||
{
|
||||
str.insert("$[r,w]* ");
|
||||
_msk->log_win().add_line(str);
|
||||
}
|
||||
|
||||
void TPirogano_app::update_saldo(const TRectype& rmov, int segno)
|
||||
{
|
||||
// File saldi in euro
|
||||
TEuroisamfile saldi(LF_SALDI, TRUE);
|
||||
TRectype& curr = saldi.curr();
|
||||
|
||||
TBill zio; zio.get(rmov);
|
||||
curr.zero();
|
||||
curr.put(SLD_ANNOES, rmov.get(RMV_ANNOES));
|
||||
curr.put(SLD_GRUPPO, zio.gruppo());
|
||||
curr.put(SLD_CONTO, zio.conto());
|
||||
curr.put(SLD_SOTTOCONTO, zio.sottoconto());
|
||||
curr.put(SLD_FLSCA, "");
|
||||
|
||||
const bool found = saldi.read(_isequal, _lock) == NOERR;
|
||||
if (!found)
|
||||
{
|
||||
curr.zero();
|
||||
curr.put(SLD_ANNOES, rmov.get(RMV_ANNOES));
|
||||
curr.put(SLD_GRUPPO, zio.gruppo());
|
||||
curr.put(SLD_CONTO, zio.conto());
|
||||
curr.put(SLD_SOTTOCONTO, zio.sottoconto());
|
||||
curr.put(SLD_FLSCA, "");
|
||||
}
|
||||
|
||||
const TImporto importo(rmov.get_char(RMV_SEZIONE), rmov.get_real(RMV_IMPORTO));
|
||||
const char* field = importo.sezione() == 'D' ? SLD_PDARE : SLD_PAVERE;
|
||||
real saldo = curr.get(field);
|
||||
if (segno < 0)
|
||||
saldo -= importo.valore();
|
||||
else
|
||||
saldo += importo.valore();
|
||||
curr.put(field, saldo);
|
||||
|
||||
const int err = found ? saldi.rewrite() : saldi.write();
|
||||
if (err != NOERR)
|
||||
{
|
||||
TString str;
|
||||
str << "Errore " << err << " durante l'aggiornamento dei saldi";
|
||||
log_err(str);
|
||||
}
|
||||
}
|
||||
|
||||
void TPirogano_app::save_row(TEuroisamfile& rmov)
|
||||
{
|
||||
const TRectype newrow = rmov.curr();
|
||||
TRectype oldrow(LF_RMOV);
|
||||
const bool found = rmov.read() == NOERR;
|
||||
if (found)
|
||||
oldrow = rmov.curr();
|
||||
rmov.curr() = newrow;
|
||||
const int err = found ? rmov.rewrite() : rmov.write();
|
||||
if (err != NOERR)
|
||||
{
|
||||
TString str;
|
||||
str << "Errore " << err << " durante la scrittura della riga " << rmov.get(RMV_NUMRIG);
|
||||
log_err(str);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (found)
|
||||
update_saldo(oldrow, -1);
|
||||
update_saldo(newrow, +1);
|
||||
}
|
||||
}
|
||||
|
||||
void TPirogano_app::convert_rmovs(long numreg, long numrege)
|
||||
{
|
||||
// File righe movimento in euro
|
||||
TEuroisamfile fileur(LF_RMOV, TRUE);
|
||||
TRectype& receur = fileur.curr();
|
||||
|
||||
TRelation rel(LF_RMOV);
|
||||
TRectype& curr = rel.curr();
|
||||
curr.put(MOV_NUMREG, numreg);
|
||||
TCursor cur(&rel, "", 1, &curr, &curr);
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
TImporto saldo;
|
||||
int last_rowe = 0;
|
||||
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
receur = curr;
|
||||
convert_import(receur, RMV_IMPORTO);
|
||||
saldo += TImporto(receur.get_char(RMV_SEZIONE), receur.get_real(RMV_IMPORTO));
|
||||
|
||||
last_rowe = receur.get_int(RMV_NUMRIG);
|
||||
receur.put(RMV_NUMREG, numrege);
|
||||
save_row(fileur);
|
||||
}
|
||||
|
||||
if (!saldo.is_zero())
|
||||
{
|
||||
receur.zero();
|
||||
receur.put(RMV_NUMREG, numrege);
|
||||
receur.put(RMV_NUMRIG, ++last_rowe);
|
||||
|
||||
TBill billy; load_round_bill(billy);
|
||||
billy.put(receur, FALSE);
|
||||
|
||||
saldo.swap_section();
|
||||
saldo.normalize();
|
||||
receur.put(RMV_SEZIONE, saldo.sezione());
|
||||
receur.put(RMV_IMPORTO, saldo.valore());
|
||||
|
||||
save_row(fileur);
|
||||
}
|
||||
}
|
||||
|
||||
void TPirogano_app::scadenze_handler(TRectype& rec, const TRectype& parte, real& totrate)
|
||||
{
|
||||
convert_import(rec, SCAD_IMPORTO);
|
||||
|
||||
if (!rec.get_real(SCAD_IMPORTOVAL).is_zero())
|
||||
{
|
||||
const TString& codval = parte.get(PART_CODVAL);
|
||||
if (codval.empty())
|
||||
rec.zero(SCAD_IMPORTOVAL);
|
||||
}
|
||||
|
||||
const int nrata = rec.get_int(SCAD_NRATA);
|
||||
if (nrata == 1)
|
||||
totrate = ZERO;
|
||||
totrate += rec.get_real(SCAD_IMPORTO);
|
||||
|
||||
// I problemi di arrotondamento dovrei averli solo con tante rate
|
||||
if (nrata > 1)
|
||||
{
|
||||
TLocalisamfile scad(LF_SCADENZE);
|
||||
scad.curr() = rec;
|
||||
scad.curr().put(SCAD_NRATA, nrata+1);
|
||||
if (scad.read() != NOERR) // Sono l'ultima rata
|
||||
{
|
||||
const real toteur = parte.get(PART_IMPTOTDOC);
|
||||
const real diff = toteur - totrate;
|
||||
if (diff != ZERO)
|
||||
{
|
||||
real rata = rec.get(SCAD_IMPORTO);
|
||||
rata += diff;
|
||||
rec.put(SCAD_IMPORTO, rata);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TPirogano_app::convert_scad(const TRectype& part)
|
||||
{
|
||||
// File destinazione in euro
|
||||
TEuroisamfile fileur(LF_SCADENZE, TRUE);
|
||||
TRectype& receur = fileur.curr();
|
||||
|
||||
TRelation rel(LF_SCADENZE);
|
||||
TRectype& curr = rel.curr();
|
||||
curr.put(SCAD_TIPOCF, part.get(PART_TIPOCF));
|
||||
curr.put(SCAD_GRUPPO, part.get(PART_GRUPPO));
|
||||
curr.put(SCAD_CONTO, part.get(PART_CONTO));
|
||||
curr.put(SCAD_SOTTOCONTO, part.get(PART_SOTTOCONTO));
|
||||
curr.put(SCAD_ANNO, part.get(PART_ANNO));
|
||||
curr.put(SCAD_NUMPART, part.get(PART_NUMPART));
|
||||
curr.put(SCAD_NRIGA, part.get(PART_NRIGA));
|
||||
|
||||
TCursor cur(&rel, "", 1, &curr, &curr); // Seleziona solo le rate interessate
|
||||
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
real totrate;
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
receur = curr;
|
||||
scadenze_handler(receur, part, totrate);
|
||||
int err = fileur.write();
|
||||
if (err != NOERR)
|
||||
err = fileur.rewrite();
|
||||
if (err != NOERR)
|
||||
{
|
||||
TString str;
|
||||
str << "Errore " << err << " durante la scrittura della rata " << receur.get(SCAD_NRIGA);
|
||||
log_err(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TPirogano_app::partite_handler(TRectype& rec)
|
||||
{
|
||||
if (rec.get_bool(PART_CHIUSA) || rec.get_int(PART_NRIGA) == 9999)
|
||||
return FALSE;
|
||||
|
||||
zero_import(rec, PART_NREG); // Creo solo partite extra-contabili
|
||||
convert_import(rec, "IMPTOTDOC|IMPORTO|IMPOSTA|SPESE|RITENUTE|DIFFCAM");
|
||||
|
||||
const TString16 codval = rec.get(PART_CODVAL);
|
||||
if (::is_firm_value(codval))
|
||||
{
|
||||
convert_import(rec, PART_ABBUONI);
|
||||
zero_import(rec, "CODVAL|IMPORTOVAL|DIFFCAM");
|
||||
} else
|
||||
if (::is_euro_value(codval))
|
||||
{
|
||||
zero_import(rec, "CODVAL|IMPORTOVAL|DIFFCAM");
|
||||
} else
|
||||
if (::is_true_value(codval))
|
||||
{
|
||||
const real impval = rec.get(PART_IMPORTOVAL);
|
||||
if (impval != ZERO)
|
||||
{
|
||||
const real impeur = rec.get(PART_IMPORTO);
|
||||
const real old_cambio = rec.get(PART_CAMBIO);
|
||||
real new_cambio = impval / impeur;
|
||||
new_cambio.round(5);
|
||||
if (abs(old_cambio - new_cambio) > 0.001) // Non era già contro euro
|
||||
rec.put(PART_CAMBIO, new_cambio);
|
||||
}
|
||||
}
|
||||
|
||||
if (rec.get_int(PART_TIPOMOV) > 1)
|
||||
{
|
||||
// Riempe il campo totale documento per i pagamenti (In contabilità viene lasciato vuoto)
|
||||
rec.put(PART_IMPTOTDOC, rec.get(PART_IMPORTO));
|
||||
}
|
||||
|
||||
rec.put(PART_INVIATA, "X");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TPirogano_app::convert_part(long num_reg)
|
||||
{
|
||||
// File destinazione in euro
|
||||
TEuroisamfile fileur(LF_PARTITE, TRUE);
|
||||
TRectype& receur = fileur.curr();
|
||||
|
||||
TRelation rel(LF_PARTITE);
|
||||
TRectype& curr = rel.curr();
|
||||
curr.put(PART_NREG, num_reg);
|
||||
TCursor cur(&rel, "", 2, &curr, &curr); // Seleziona solo le partite interessate
|
||||
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
TString str;
|
||||
|
||||
bool one_saved = FALSE;
|
||||
if (items > 0)
|
||||
{
|
||||
str << "Conversione della partita extracontabile " << curr.get(PART_ANNO);
|
||||
str << '/' << curr.get(PART_NUMPART);
|
||||
log_msg(str);
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
receur = curr;
|
||||
if (partite_handler(receur))
|
||||
{
|
||||
int err = fileur.write();
|
||||
if (err != NOERR)
|
||||
err = fileur.rewrite();
|
||||
if (err != NOERR)
|
||||
{
|
||||
str.cut(0) << "Errore " << err << " durante la scrittura della riga " << receur.get(PART_NRIGA);
|
||||
log_err(str);
|
||||
}
|
||||
else
|
||||
{
|
||||
convert_scad(receur);
|
||||
one_saved = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!one_saved)
|
||||
{
|
||||
str = "Non sono state rilevate scadenze aperte";
|
||||
log_war(str);
|
||||
}
|
||||
}
|
||||
|
||||
void TPirogano_app::convert_movs(long fr, long to)
|
||||
{
|
||||
_msk->log_win().destroy_lines();
|
||||
|
||||
// File destinazione in euro
|
||||
TEuroisamfile fileur(LF_MOV, TRUE);
|
||||
TRectype& receur = fileur.curr();
|
||||
|
||||
long next_rege = 1;
|
||||
if (fileur.last() == NOERR)
|
||||
next_rege = receur.get_long(MOV_NUMREG)+1;
|
||||
|
||||
TRelation rel(LF_MOV);
|
||||
TRectype& curr = rel.curr();
|
||||
|
||||
TRectype fr_mov(curr); if (fr > 0) fr_mov.put(MOV_NUMREG, fr);
|
||||
TRectype to_mov(curr); if (to > 0) to_mov.put(MOV_NUMREG, to);
|
||||
TCursor cur(&rel, "", 1, &fr_mov, &to_mov);
|
||||
|
||||
TString str;
|
||||
str << "Conversione " << rel.lfile().description() << " ...";
|
||||
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
TProgind pi(items, str, FALSE, TRUE);
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
pi.addstatus(1);
|
||||
|
||||
const long num_reg = curr.get_long(MOV_NUMREG);
|
||||
const TDate datareg = curr.get(MOV_DATAREG);
|
||||
const int yearreg = datareg.year();
|
||||
const long clifo = curr.get_long(MOV_CODCF);
|
||||
|
||||
const TString8 caus = curr.get(MOV_CODCAUS);
|
||||
TipoIVA iva = nessuna_iva;
|
||||
int tipomov = 0;
|
||||
if (caus.not_empty())
|
||||
{
|
||||
TCausale causale(caus, yearreg);
|
||||
iva = causale.iva();
|
||||
tipomov = causale.tipomov();
|
||||
}
|
||||
|
||||
bool converted = FALSE;
|
||||
if (yearreg == 2002 && iva == nessuna_iva && tipomov == 0)
|
||||
{
|
||||
receur = curr;
|
||||
convert_import(receur, MOV_TOTDOC); // Forse inutile
|
||||
|
||||
int err = 0;
|
||||
long num_rege = curr.get_long("TNUMREG");
|
||||
if (num_rege <= 0)
|
||||
{
|
||||
num_rege = next_rege++;
|
||||
curr.put("TNUMREG", num_rege);
|
||||
rel.rewrite();
|
||||
}
|
||||
receur.put(MOV_NUMREG, num_rege);
|
||||
|
||||
str.cut(0) << "Conversione del movimento " << num_reg << " -> " << num_rege;
|
||||
log_msg(str);
|
||||
|
||||
err = fileur.write();
|
||||
if (err != NOERR)
|
||||
err = fileur.rewrite();
|
||||
|
||||
if (err != NOERR)
|
||||
{
|
||||
str.cut(0) << "Errore " << err << " durante la scrittura della testata";
|
||||
log_err(str);
|
||||
}
|
||||
convert_rmovs(num_reg, num_rege);
|
||||
converted = TRUE;
|
||||
}
|
||||
if (yearreg == 2001 && iva != nessuna_iva && tipomov == 1)
|
||||
{
|
||||
str.cut(0) << "Elaborazione della partita del movimento " << num_reg;
|
||||
log_msg(str);
|
||||
convert_part(num_reg);
|
||||
converted = TRUE;
|
||||
}
|
||||
|
||||
if (!converted)
|
||||
{
|
||||
str.cut(0) << "Ignorato movimento " << num_reg << " del " << datareg;
|
||||
if (caus.not_empty()) str << " con causale " << caus;
|
||||
log_war(str);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
_msk->log_win().goto_end();
|
||||
}
|
||||
|
||||
void TPirogano_app::main_loop()
|
||||
{
|
||||
open_files(LF_TABCOM, LF_TAB, LF_MOV, LF_RMOV, LF_CAUSALI, LF_SALDI, LF_PARTITE, LF_SCADENZE, 0);
|
||||
|
||||
TFilename dati, datie;
|
||||
get_aree_dati(dati, datie);
|
||||
|
||||
_msk = new TPirogano_mask;
|
||||
TMask& m = *_msk;
|
||||
m.set(F_DATI, dati);
|
||||
m.set(F_DATIE, datie);
|
||||
|
||||
const long firm = get_firm();
|
||||
TString8 ditta;
|
||||
ditta.format("%05ldA", firm);
|
||||
TFilename inie = datie;
|
||||
inie.add(ditta);
|
||||
inie.add("prassid.ini");
|
||||
|
||||
KEY k = K_ENTER;
|
||||
while (k == K_ENTER)
|
||||
{
|
||||
if (inie.exist())
|
||||
{
|
||||
TConfig config(inie, "Euro");
|
||||
m.set(F_ADOZIONE, config.get("Adozione"));
|
||||
m.set(F_LAST_DATE, config.get("InvDate"));
|
||||
m.set(F_LAST_FROM, config.get("InvFirst"));
|
||||
m.set(F_LAST_TO, config.get("InvLast"));
|
||||
}
|
||||
else
|
||||
{
|
||||
error_box("Non esiste la ditta %ld nell'area dati in Euro %s", firm, (const char*)datie);
|
||||
m.disable(DLG_OK);
|
||||
}
|
||||
|
||||
k = m.run();
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
const long fr_mov = m.get_long(F_MOV_FROM);
|
||||
const long to_mov = m.get_long(F_MOV_TO);
|
||||
|
||||
convert_movs(fr_mov, to_mov);
|
||||
|
||||
TConfig config(inie, "Euro");
|
||||
config.set("InvDate", TDate(TODAY));
|
||||
config.set("InvFirst", fr_mov);
|
||||
config.set("InvLast", to_mov);
|
||||
}
|
||||
}
|
||||
|
||||
delete _msk;
|
||||
_msk = NULL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// main
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
int baeur0A(int argc, char* argv[])
|
||||
{
|
||||
TPirogano_app app;
|
||||
app.run(argc, argv, "Trasferimento movimenti 2002");
|
||||
return 0;
|
||||
}
|
||||
16
ba/baeura0.h
Executable file
16
ba/baeura0.h
Executable file
@ -0,0 +1,16 @@
|
||||
#define F_DITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_DATI 103
|
||||
#define F_DATIE 104
|
||||
#define F_ADOZIONE 105
|
||||
|
||||
#define F_LAST_DATE 111
|
||||
#define F_LAST_FROM 112
|
||||
#define F_LAST_TO 113
|
||||
|
||||
#define F_MOV_FROM 121
|
||||
#define F_DES_FROM 122
|
||||
#define F_MOV_TO 123
|
||||
#define F_DES_TO 124
|
||||
|
||||
#define F_LOG 130
|
||||
131
ba/baeura0.uml
Executable file
131
ba/baeura0.uml
Executable file
@ -0,0 +1,131 @@
|
||||
#include "baeura0.h"
|
||||
|
||||
TOOLBAR "" 0 -2 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -13 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -23 -11 ""
|
||||
PICTURE BMP_PRINT
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -33 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Trasferimento movimenti 2002" 0 0 80 18
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bDitta da convertire"
|
||||
END
|
||||
|
||||
NUMBER F_DITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 2 "Ditta "
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_DITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "DF"
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 50
|
||||
BEGIN
|
||||
PROMPT 21 2 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_DATI 50
|
||||
BEGIN
|
||||
PROMPT 2 3 "Area dati in Lire "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_DATIE 50
|
||||
BEGIN
|
||||
PROMPT 2 4 "Area dati in Euro "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_ADOZIONE
|
||||
BEGIN
|
||||
PROMPT 2 5 "Data adozione Euro "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 7 "@bUltimo trasferimento "
|
||||
END
|
||||
|
||||
DATE F_LAST_DATE
|
||||
BEGIN
|
||||
PROMPT 2 8 "Data "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_LAST_FROM 5
|
||||
BEGIN
|
||||
PROMPT 25 8 "Dal "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_LAST_TO 5
|
||||
BEGIN
|
||||
PROMPT 50 8 "al "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "@bProssimo trasferimento"
|
||||
END
|
||||
|
||||
DATE DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 11 "Data "
|
||||
FLAGS "AD"
|
||||
END
|
||||
|
||||
NUMBER F_MOV_FROM 5
|
||||
BEGIN
|
||||
PROMPT 25 11 "Dal "
|
||||
USE LF_MOV
|
||||
INPUT NUMREG F_MOV_FROM
|
||||
DISPLAY "Num. Lire" NUMREG
|
||||
DISPLAY "Num. Euro" TNUMREG
|
||||
DISPLAY "Registrazione" DATAREG
|
||||
DISPLAY "Causale" CODCAUS
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_MOV_FROM NUMREG
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire un movimento valido"
|
||||
ADD RUN cg2 -0
|
||||
END
|
||||
|
||||
NUMBER F_MOV_TO 5
|
||||
BEGIN
|
||||
PROMPT 50 11 "al "
|
||||
COPY USE F_MOV_FROM
|
||||
INPUT NUMREG F_MOV_TO
|
||||
COPY DISPLAY F_MOV_FROM
|
||||
OUTPUT F_MOV_TO NUMREG
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire un movimento valido"
|
||||
ADD RUN cg2 -0
|
||||
END
|
||||
|
||||
BROWSEFILE F_LOG 75 -1
|
||||
BEGIN
|
||||
PROMPT 1 12 ""
|
||||
END
|
||||
|
||||
ENDMASK
|
||||
@ -557,6 +557,8 @@ int main(int argc,char** argv)
|
||||
|
||||
if (mod == "cg")
|
||||
r=bainst07(argc,argv); // pre/post installazione contabilità generale:
|
||||
else if (mod == "ce")
|
||||
r=bainst11(argc, argv);// pre/post installazione cespiti
|
||||
else if (mod == "at")
|
||||
r=bainst17(argc, argv);// pre/post installazione avis
|
||||
else if (mod == "in")
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#define G_PREINST 1
|
||||
int bainst00(int argc, char** argv);
|
||||
int bainst07(int argc, char** argv);
|
||||
int bainst11(int argc, char** argv);
|
||||
int bainst17(int argc, char** argv);
|
||||
int bainst18(int argc, char** argv);
|
||||
int bainst31(int argc, char** argv);
|
||||
|
||||
59
ba/bainst11.cpp
Executable file
59
ba/bainst11.cpp
Executable file
@ -0,0 +1,59 @@
|
||||
#include <applicat.h>
|
||||
#include <mask.h>
|
||||
#include <config.h>
|
||||
#include <utility.h>
|
||||
#include <execp.h>
|
||||
#include <isam.h>
|
||||
|
||||
#include "bainst.h"
|
||||
#include "bainst11.h"
|
||||
|
||||
class TInstall_CE : public TSkeleton_application
|
||||
{
|
||||
protected:
|
||||
virtual void main_loop() ;
|
||||
virtual bool install_com(bool in_lire) ; // setta i dati comuni
|
||||
|
||||
public:
|
||||
virtual ~TInstall_CE () {}
|
||||
};
|
||||
|
||||
bool TInstall_CE ::install_com(bool in_lire)
|
||||
{
|
||||
const char* tab[5] = {"cac","cat","cgr","tmc","clm"};
|
||||
if (in_lire)
|
||||
tab[4] = "clm_lire";
|
||||
|
||||
TSystemisamfile tabcom(LF_TABCOM);
|
||||
TStd_filename txtfile;
|
||||
TString16 str;
|
||||
for (int i=0; i<5; i++)
|
||||
{
|
||||
str = tab[i]; str << ".txt";
|
||||
txtfile.check(FALSE, str);
|
||||
tabcom.load(txtfile);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TInstall_CE::main_loop()
|
||||
{
|
||||
TConfig ini("install.ini","ce");
|
||||
const bool primainst=ini.get("Versione").blank();
|
||||
|
||||
TMask m("bainst11.msk");
|
||||
if (primainst)
|
||||
m.set(F_LOADTAB,"X");
|
||||
if (m.run()!=K_QUIT && m.get_bool(F_LOADTAB))
|
||||
{
|
||||
bool in_lire = m.get_bool(F_LIMITI);
|
||||
install_com(in_lire);
|
||||
}
|
||||
}
|
||||
|
||||
int bainst11(int argc, char** argv)
|
||||
{
|
||||
TInstall_CE app;
|
||||
app.run(argc, argv, "Installazione Cespiti");
|
||||
return 0;
|
||||
}
|
||||
3
ba/bainst11.h
Executable file
3
ba/bainst11.h
Executable file
@ -0,0 +1,3 @@
|
||||
#include "bainsta.h"
|
||||
#define F_LOADTAB 101
|
||||
#define F_LIMITI 102
|
||||
30
ba/bainst11.uml
Executable file
30
ba/bainst11.uml
Executable file
@ -0,0 +1,30 @@
|
||||
#include "bainst11.h"
|
||||
|
||||
PAGE "Installazione CE" -1 -1 50 8
|
||||
// GROUP 1 = PRE-INSTALLATION
|
||||
// GROUP 2 = POST-INSTALLATION
|
||||
|
||||
BOOL F_LOADTAB
|
||||
BEGIN
|
||||
PROMPT 2 2 "Carica le tabelle Ministeriali"
|
||||
MESSAGE FALSE,CLEAR F_LIMITI
|
||||
MESSAGE TRUE,ENABLE F_LIMITI
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
RADIOBUTTON F_LIMITI 1 46
|
||||
BEGIN
|
||||
PROMPT 2 4 "Valuta tabella limiti"
|
||||
FLAGS "Z"
|
||||
ITEM "|EURO"
|
||||
ITEM "X|Lire"
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -11 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
11
ba/batbcms.h
Executable file
11
ba/batbcms.h
Executable file
@ -0,0 +1,11 @@
|
||||
#define F_CODICE 101
|
||||
#define F_DESCR 102
|
||||
#define F_CODCF 103
|
||||
#define F_IVA 104
|
||||
#define F_REND 105
|
||||
#define F_PUBB 106
|
||||
#define F_INIZIO 107
|
||||
#define F_FINE 108
|
||||
#define F_PROR 109
|
||||
#define F_RESP 110
|
||||
#define F_CHIUSA 111
|
||||
125
ba/batbcms.uml
Executable file
125
ba/batbcms.uml
Executable file
@ -0,0 +1,125 @@
|
||||
#include "batbcms.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
#include <toolbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Commesse" -1 -1 78 8
|
||||
|
||||
STRING F_CODICE 20
|
||||
BEGIN
|
||||
PROMPT 4 2 "Codice Commessa "
|
||||
FIELD CODTAB
|
||||
FLAGS "UZ"
|
||||
KEY 1
|
||||
USE CMS
|
||||
INPUT CODTAB F_CODICE
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_CODICE CODTAB
|
||||
OUTPUT F_DESCR S0
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 4 4 "Descrizione "
|
||||
FIELD S0
|
||||
KEY 2
|
||||
USE CMS KEY 2
|
||||
INPUT S0 F_DESCR
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
COPY OUTPUT F_CODICE
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Manca la descrizione"
|
||||
END
|
||||
|
||||
NUMBER F_CODCF 6
|
||||
BEGIN
|
||||
PROMPT 4 6 "Codice cliente "
|
||||
FIELD I0
|
||||
USE LF_CLIFO
|
||||
INPUT TIPOCF "C"
|
||||
INPUT CODCF F_CODCF
|
||||
DISPLAY "Codice@6R" CODCF
|
||||
DISPLAY "Sospeso" SOSPESO
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
DISPLAY "Codice fiscale@16" COFI
|
||||
DISPLAY "Partita IVA@11" PAIV
|
||||
OUTPUT F_CODCF CODCF
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Cliente assente"
|
||||
ADD RUN cg0 -1
|
||||
END
|
||||
|
||||
LIST F_IVA 20
|
||||
BEGIN
|
||||
PROMPT 4 8 "Regime IVA "
|
||||
FIELD S7
|
||||
HELP "Indicare il tipo di regime IVA"
|
||||
ITEM " |IVA normale"
|
||||
ITEM "NR|Non rilevante"
|
||||
ITEM "ES|Operazioni esenti"
|
||||
ITEM "NI|Non imponibili"
|
||||
ITEM "NS|Non soggetti"
|
||||
ITEM "FC|Fuori campo"
|
||||
END
|
||||
|
||||
BOOLEAN F_PUBB
|
||||
BEGIN
|
||||
PROMPT 4 10 "Pubblico"
|
||||
FIELD B0
|
||||
MESSAGE FALSE CLEAR,F_REND
|
||||
MESSAGE TRUE ENABLE,F_REND
|
||||
END
|
||||
|
||||
BOOLEAN F_REND
|
||||
BEGIN
|
||||
PROMPT 4 12 "Da rendicontare"
|
||||
FIELD B1
|
||||
END
|
||||
|
||||
DATE F_INIZIO
|
||||
BEGIN
|
||||
PROMPT 4 14 "Data inizio "
|
||||
FIELD D0
|
||||
END
|
||||
|
||||
DATE F_FINE
|
||||
BEGIN
|
||||
PROMPT 44 14 "Data fine "
|
||||
FIELD D1
|
||||
END
|
||||
|
||||
BOOLEAN F_PROR
|
||||
BEGIN
|
||||
PROMPT 4 16 "Prorogata"
|
||||
FIELD B2
|
||||
END
|
||||
|
||||
BOOLEAN F_CHIUSA
|
||||
BEGIN
|
||||
PROMPT 4 18 "Chiusa"
|
||||
FIELD B3
|
||||
END
|
||||
|
||||
STRING F_RESP 8
|
||||
BEGIN
|
||||
PROMPT 4 20 "Responsabile "
|
||||
FLAGS "U"
|
||||
USE LF_USER SELECT ISGROUP!="X"
|
||||
INPUT USERNAME F_RESP
|
||||
DISPLAY "Utente@8" USERNAME
|
||||
DISPLAY "Gruppo@8" GROUPNAME
|
||||
DISPLAY "Descrizione@50" USERDESC
|
||||
OUTPUT F_RESP USERNAME
|
||||
CHECKTYPE SEARCH
|
||||
FIELD S4
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
2
ba/batbfsc.h
Executable file
2
ba/batbfsc.h
Executable file
@ -0,0 +1,2 @@
|
||||
#define F_CODICE 101
|
||||
#define F_DESCR 102
|
||||
42
ba/batbfsc.uml
Executable file
42
ba/batbfsc.uml
Executable file
@ -0,0 +1,42 @@
|
||||
#include "batbfsc.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
#include <toolbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Fasi Commesse" -1 -1 78 8
|
||||
|
||||
STRING F_CODICE 10
|
||||
BEGIN
|
||||
PROMPT 4 2 "Codice Fase "
|
||||
FIELD CODTAB
|
||||
FLAGS "UZ"
|
||||
KEY 1
|
||||
USE FSC
|
||||
INPUT CODTAB F_CODICE
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_CODICE CODTAB
|
||||
OUTPUT F_DESCR S0
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 4 4 "Descrizione "
|
||||
FIELD S0
|
||||
KEY 2
|
||||
USE FSC KEY 2
|
||||
INPUT S0 F_DESCR
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice@10" CODTAB
|
||||
COPY OUTPUT F_CODICE
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Manca la descrizione"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
@ -1,5 +1,5 @@
|
||||
[Header]
|
||||
Version=199518
|
||||
Version=199517
|
||||
Fields=COD,3|CODTAB,25|S0,70|S1,70|S2,70|S3,70|S4,20|S5,20|S6,5|S7,5
|
||||
Fields=S8,5|S9,5|S10,5|S11,5|I0,7|I1,7|I2,7|I3,7|I4,7|I5,7
|
||||
Fields=I6,7|I7,7|I8,7|I9,7|I10,7|I11,7|I12,7|I13,7|I14,7|R0,18
|
||||
|
||||
@ -76,6 +76,8 @@ BEGIN
|
||||
ITEM "1|1 decimale"
|
||||
ITEM "2|2 decimali"
|
||||
ITEM "3|3 decimali"
|
||||
ITEM "4|4 decimali"
|
||||
ITEM "5|5 decimali"
|
||||
FIELD I1
|
||||
NUM_EXPR #THIS_FIELD>=#VAL_DECIMALS
|
||||
WARNING "Si devono specificare almeno tanti decimali quanti quelli degli importi"
|
||||
|
||||
@ -3,7 +3,7 @@ Caption = "Amministrazione"
|
||||
Picture = <cg00.bmp>
|
||||
Module = 0
|
||||
Item_01 = "Contabilita' generale", <cgprassi.men>
|
||||
Item_02 = "Gestione cespiti", "cesp -t /cPRAWIN.INI", ""
|
||||
Item_02 = "Gestione cespiti", <ceprassi.men>
|
||||
Item_03 = "Gestione percipienti", <77prassi.men>
|
||||
Item_04 = "Contabilita analitica", <procomm.men>
|
||||
Item_05 = "Bilanci e Analisi", <abprassi.men>
|
||||
|
||||
2116
ce/cac.txt
Executable file
2116
ce/cac.txt
Executable file
File diff suppressed because it is too large
Load Diff
192
ce/cat.txt
Executable file
192
ce/cat.txt
Executable file
@ -0,0 +1,192 @@
|
||||
[Header]
|
||||
Version=199517
|
||||
Fields=COD,3|CODTAB,25|S0,70|S1,70|S2,70|S3,70|S4,20|S5,20|S6,5|S7,5
|
||||
Fields=S8,5|S9,5|S10,5|S11,5|I0,7|I1,7|I2,7|I3,7|I4,7|I5,7
|
||||
Fields=I6,7|I7,7|I8,7|I9,7|I10,7|I11,7|I12,7|I13,7|I14,7|R0,18
|
||||
Fields=R1,18|R2,18|R3,18|R4,18|R5,18|R6,18|R7,18|R8,18|R9,18|R10,18
|
||||
Fields=R11,18|R12,18|R13,18|R14,18|R15,18|R16,18|R17,18|R18,18|R19,18|D0,10
|
||||
Fields=D1,10|D2,10|D3,10|D4,10|B0,1|B1,1|B2,1|B3,1|B4,1|B5,1
|
||||
Fields=B6,1|B7,1|B8,1|B9,1|FPC,1
|
||||
|
||||
[Data]
|
||||
CAT|01 1|Affittuari di Fondi Rustici, Condotti a Mezzadria|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|01 2|Industrie Agrarie Diverse,all'infuori della Cat.degli Affit.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|01 3|Industrie Agrarie da Proprietari di Fondi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|01 4|Aziende di Utilizzazione del Bosco(abbattimento e carboniz.)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|01 5|Esercizio di Macchine Agricole per c/terzi (incluso noleggi)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|02 1|Armentizia,Allev. Cavalli,Malghe,Monta Taurina-Equina,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|03 1|Industria della Pesca,compresa quella di Spugne e diCorallo|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|03 2|Allevamento di Pesci e Molluschi in Acque Marine e Interne|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 1|Miniere di Minerali di Ferro e di Minerali Metallif.non Ferr|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 2|Miniere di Zolfo|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 3|Miniere di Combustibili Fossili|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 4|Miniere di Combustibili Liquidi e Gassosi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 5|Cave di Marmo e Aff.,Pietre da Costruzione,Calcari,Marne,ecc|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 6|Cave di Sabbia, Ghiaia e Pietrisco|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|04 7|Miniere Salgemma,Sorgenti Salate Naturali,Produz.Sale Marino|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 1|Brillatura Riso,Pilatura e altre Lavoraz.Cereali e Legumi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 2|Molitura di Cereali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 3|Panificazione,Produzione di Biscotti e di Pasticcerie|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 4|Pastificazione|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 5/a|Lavorazione Cacao,Produz.Cioccolata,Torrefaz.Caffè e Surrog.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 5/b|Produzione di Gelati|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 6|Produzione e Raffinazione dello Zucchero|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 7|Lavorazione e Conservazione delle Carni|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 8|Lavorazione e Conservazione Prodotti Alimentari della Pesca|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|05 9|Conservazione e Trasformazione Frutta,Ortaggi,Funghi,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0510|Lavorazione e Conservazione Latte (Caseifici,lav.burro,ecc.)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0511|Produz. Olio d'Oliva/Semi,x Spremitura,Olii Vegetali,c/Solv.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0512|Raffinazione degli Olii Vegetali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0513|Industria dei Vini,Mosti Concentrati ed Aceti|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0514|Distillerie di Alcole|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0515|Produzione di Liquori e Affini|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0516|Produzione di Malto,Birra ed Estratti di Malto|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0517|Produzione di Bevande Analcoliche Gassate e non|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0518|Fabbricazione Ghiaccio ed Esercizio Frigoriferi c/terzi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 1|Prime Lavorazioni del Legno (segherie)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 2|Laboratori Falegnameria,Carpenteria in Legno. Fabbr. Oggetti|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 3|Costruzione e Riparazione di Veicoli in Legno|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 4|Cantieri Navali per Costruz.,Riparaz.,Demoliz. Navi in Legno|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 5|Fabbricaz.Mobili/Arredam.in Legno.Lucidatura,Laccatura|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 6|Preparaz. Crine Vegetal.,Trebbia,ecc.Lavoraz. Canne Palustri|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 7|Lavorazione del Sughero|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 8|Industr.Produz.Compensati,Pannelli in Legno o con Sost.Miste|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|06 9|Industrie Produz. di Pannelli di Legno Sfibrato e Affini|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 1/a|Siderurgia in Genere|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 1/b|Metallurgia dei Metalli non Ferrosi (piombo alluminio ecc.)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 1/c|Fonderie II Fusione|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 1/d|Industria Metallurgica del Magnesio|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 2|Fabbriche di Macchine Industr.ed Agric. e di Utensil.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 3|Costruzione di Pompe,Compress. Ventilat. ecc|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 4|Costruzioni di Mobili, Arredi metallici, Casseforti, ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 5|Costruzione Appar.Igienico-Sanitari e termici-uso domestico|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 6|Fabbricazione di Serrature Comuni e di Minuterie, ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 7|Fabbricaz.di Scatol.Fustame Metall.e Prod.Affini di Lam.Sott|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 8|Fabb. di Stoviglie,Vasell. Accessori Casalinghi, ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|07 9|Fabbricaz. Coltell.,Armi Bianche ed Attr. x Arti e Mestieri|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0710|Fabb.Strum.ed Appar.x Chirurgia,Medicina,Odontotec.e Ortoped|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0711|Fabbricazione di Armi da Fuoco e Materiale Bellico in Genere|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0712|Fabbricazione di bilance, orologeria ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0713|Fabbricazione di Giocattoli di Metallo|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0714|Fabbricazione Medaglie,Argenterie,Oreficerie,Gioiellerie,ecc|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0715|Costr.e Montatura Biciclette,Fabbr.Parti,Ricambi e Accessori|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0716/a|Costruz.e Montat.di Motov.e Fabbr.di Parti di Motov.e Access|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0716/b|Costruzione e Montaggio Motori per Aviazione|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0717|Costruz.di Autov.ed Autotel.Fabbr.di Parti di Ric. e Access.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0718|Costruz.Carrozz.per Auto,per Motov.Costruz. di Rimorchi ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0719|Costruzione di Materiale Rotabile Ferroviario e Filoviario|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0720|Costruzione e Riparazione di Aeromobili|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0721|Cantieri Navali per Costruzioni,Riparazioni e Demolizioni|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0722|Costruzione Macchine,Apparecchi e Strumenti Elettrici, ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0723|Officine per Fucinatura,Stampatura,Imbutitura,Saldatura,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0724|Officine da Ramaio,Lattoniere,Stagnino,Fabbro Ferraio,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0725|Officine Meccaniche Riparazione Auto,Motoveicoli,Bici,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0726|Officine Inst. e Riparaz. Imp.,Macchinari ed Appar. Elettr.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0727|Impr.Specializzate,non Costruttrici x Installaz.Imp.Termici|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0728|Lavorazione Artistica dei Metalli non Preziosi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0729|Fabbricazione e Riparazione Strumenti ed Apparecchi Musicali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 1|Macinaz./Lavag.Minerali Non Metallif.,Lavoraz.marmo e pietra|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 2|Lavoraz. Pietre Dure e Preziose per Gioiellerie e Uso Indus.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 3|Lavorazione Artistica dei Marmi e delle Pietre|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 4/a|Fabbricazione di Calce e Gesso|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 4/b|Fabbricazione di Cemento|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 5/a|Fabbricazione di Laterizi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 5/b|Fabbricazione di Oggetti in Gres e Materiali Refrattari|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 5/c|Fabbricazione di Abrasivi Granulari,Rigidi e Flessibili|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 6|Industria della Ceramica|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 7|Fabbricazione Manufatti di Cemento/Gesso/Stucco|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|08 8|Fabbricaz.e Lavoraz.del Vetro(escl.Lavoraz.Lenti x Occhiali)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 1/a|Produzione di Acido Solforico,Cloro,Soda Elettrolitica,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 1/b|Produz.Ammoniaca Sintetica,Acido Nitrico,Nitrato Calcio,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 2|Raffinerie Petrolio,Produzione e Distribuzione Benzina,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 3/a|Produzione Derivati Distillaz. Carbon Fossile,Escl.Offic.Gas|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 3/b|Produz. Elettrodi x Forni Elettrici x Fabbr. Acciaio e Anodi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 4|Produz. Carburanti Artific. Liquidi,compresa Prod. Alcole|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 5|Produzione di Gas Compressi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 6|Produzione di Esplosivi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 7|Idrogenazione Olii/Grassi Vegetali ed Animali e Lav. Grassi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 8|Produz. Saponi,Glicerine,Profumerie,Essenze,Aromi,Candele...|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|09 9|Produzioni Farmaceutiche,Chimico-Farmaceutiche ed Affini|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0910/a|Produz. Colori Organici e Sintetici e Relativi Prod. Interm.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0910/b|Produz. Estratti Concianti,Vernici,Pitture,Inchiostri,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0911/a|Produzione di Cellulosa (compresa quella per la carta)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0911/b|Produz. del Trasparente di Cellulosa,Fibre Tessili Artif.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0912|Produz. Mat. Plastiche e Resine Sintetiche.Prod.Ind.Petrol.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0913|Produz. Materiali Sensibili per Fotografia e Cinematografia|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0914|Raffinerie di Zolfo|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|10 1/a|Fabbricaz. e Lavoraz. Carta e Cartone-Fabbr.Carte da Parato|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|10 1/b|Fabbricaz.Manufatti Carta e Cartone Compr. Produz. Imballag.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|11 1|Concia,Tintura delle Pelli. Produz. di Succedanei e Imitaz.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|11 2|Fabbricaz.Art.Cuoio,Pelle e Succed.,esclusi Guanti e Calzat.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 1|Produz. ed Allevam. del Seme Bachi.Essicaz. di Bozzoli|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 2|Filatura (trattura) della Seta|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 3|Tessitura della Seta e delle Fibre Tessili Artificiali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 4|Produzione di Fibre Rigenerate|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 5/a|Lavorazione del Cotone Puro o Misto con Altre Fibre|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 5/b|Lavorazione dei Cascami di Seta, Puri o Misti ad Altre Fibre|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 5/c|Lavorazione delle Fibre Sintetiche|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 6|Lavorazione della Lana Pura o Mista con Altre Fibre|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 7|Lavorazione Lino,Canapa,Juta,Ramiè e Simili,Puri o Misti|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 8|Fabbricazione Cordami,Spaghi,Reti da Pesca e da Caccia|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 9|Fabbricazione Passamanerie,Tulli,Merletti,Nastri,Tess.Elast.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1210|Tintura,Candeggio,Stampatura,Mercerizzazione,Rifinitura,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1211|Lavoraz. Setole,Crine Animale,Pelo,Penne,Piume,Capok e Sim.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1212|Fabbricazione Tappeti da Terra(escl. quelli di cocco e sim.)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 1|Industria del Cappello|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 2|Laboratori di Modisteria|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 3|Laboratori per la Confezione di Vestiario|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 4|Laboratori per la Confezione di Pellicce|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 5|Laboratori per la Confezione di Biancheria|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 6|Laboratori Fabbricazione Maglieria,Guanti in Maglia e Calze|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 7|Calzaturifici|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 8|Laboratori di Confezione e Riparazione di Calzature|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|13 9|Laboratori Fabbricaz. Guanti Pelle,Stoffa o Tessuto Maglia|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1310|Laboratori per Confezioni Varie e Accessori del Vestiario|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1311|Fabbricazione e Lavorazione Oggetti di Ornamento|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1312|Laboratori di Materassaio e Tapezziere,per Confez. Vele,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1313|Fabbricaz. Giocattoli in Genere (esclusi in metallo e gomma)|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|14 1/a|Produzione di Manufatti di Gomma|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|14 1/b|Produzione di Cavi Elettrici|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|14 1/c|Lavorazione di Materie Plastiche|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|14 1/d|Produzione di Dischi Fonografici,Incisioni,Edizione e Stampa|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|14 2|Laboratori di Vulcanizzazione degli Oggetti di Gomma|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|15 1|Tipografie, Litografie ed Affini|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|15 2|Legatorie|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|15 3|Editori di Libri e Giornali ed Agenzie di Stampa|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|16 1|Imprese di Costruzioni Edilizie,Lavori di Terra ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|16 1/a|Imprese di Costruz.Edilizie,Lavori di Terra e Opere Stradali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|16 1/b|Imprese Costruzioni Reti di Trasporto e Distr.Elettr.e Telef|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|16 1/c|Edilizia Prefabbricata|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 1/a|Produzione e Distribuzione di Energia Idroelettrica|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 1/b|Produzione e Distribuzione di Energia Termoelettrica|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 2/a|Produzione e Distribuzione di Gas Illuminante|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 2/b|Produzione e Distribuzione di Gas Naturale|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 3|Distribuzione di Acqua Potabile e non Potabile|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 4/a|Stabilimenti Balneari Marini|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|17 4/b|Stabilimenti Termali, Idrotermali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 1|Trasporti Aerei|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 2|Trasporti Marittimi|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 3|Trasporti Lacuali,Fluviali e Lagunari|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 4|Ferrovie,Compresi Binari Raccordo c/terzi,Eser. Vagoni Letto|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 5|Tramvie Interurb.,Urbane, Metropolitane, Filovie, Funivie|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 6|Autoservizi per Viaggiatori,Urbani,Extraurbani e di Linea.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 7|Servizi Trasp. Persone c/vetture-Autovett. da Piazza/Rimessa|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 8|Servizi di Trasporto Merci su Vie Ordinarie|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|18 9|Imprese di Trasporti e Pompe Funebri|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1810/a|Servizi Telegrafici,Telefonici,Telecomunicaz. Tramite Satell|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1810/b|Servizi Radiotelegrafonici,Radiofonici,Televisivi e Telecom.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1811|Impianti per le telecomunicazioni a Mezzo Satelliti|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|1812|Autostrade,Strade e Superstrade in Concessione|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|19 1|Alberghi-Ristoranti-Bar e Attività Affini|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|20 1|Teatri,cinematografi,sale ballo e simili,campi sportivi,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|20 2|Compagnie/Agenzie Teatrali.Produz.,doppiaggio,sviluppo films|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|20 3|Teatri,Cinematografi,Sale Ballo e Simili,Campi Sportivi,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|20 4|Compagnie ed Agenzie Teatrali,Produzione,Doppiaggio,Svilup.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|21 1|Ospedali,Cliniche,Sanatori,Case Cura ed Ist. Similari Priv.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|22 1|Serv. Igienici e Estetica Persona.Alb. Diurni,Barbieri,ecc.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|22 2|Imprese di Smaltimento Rifiuti|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|22 3|Lavanderie,Stiratorie,Smacchiatorie,Tintorie e Servizi Aff.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|99 1|Fiere e Rassegne|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|99 2|Altre Attività|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|0519|Imbottigliamento di Acque Minerali Naturali|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
CAT|12 7/b|Fabbricazione di tessuti a maglia|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||
|
||||
@ -23,6 +23,7 @@ class TQuery_mask : public TAutomask
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
void on_search_event(TOperable_field& o);
|
||||
virtual void on_firm_change();
|
||||
|
||||
int calcola_stato_attivita();
|
||||
bool cespite_ok() const;
|
||||
@ -207,6 +208,12 @@ bool TQuery_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TQuery_mask::on_firm_change()
|
||||
{
|
||||
TAutomask::on_firm_change();
|
||||
ditta_cespiti().init_mask(*this);
|
||||
}
|
||||
|
||||
TQuery_mask::TQuery_mask() : TAutomask("ce0500a")
|
||||
{
|
||||
first_focus(F_IDCESPITE);
|
||||
@ -728,7 +735,7 @@ void TAnacespi::init_mask(TMask& m)
|
||||
dc.init_mask(m);
|
||||
const bool can_edit = !dc.bollato_stampato() && m.field(F_DTALIEN).empty();
|
||||
m.enable(DLG_SAVEREC, can_edit);
|
||||
m.enable(DLG_DELREC, can_edit);
|
||||
m.enable(DLG_DELREC, can_edit && m.edit_mode());
|
||||
m.disable(DLG_NEWREC);
|
||||
|
||||
_emask->set_stato_attivita(_qmask->stato_attivita());
|
||||
@ -893,12 +900,18 @@ void TAnacespi::kill_cespite(const TString& idcespite, int lfile, int key)
|
||||
TCursor cur(&rel, "", key, &filter, &filter);
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
const TRectype& curr = rel.curr();
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
rel.remove();
|
||||
{
|
||||
int err = curr.remove(rel.lfile());
|
||||
if (err != NOERR)
|
||||
error_box("Errore %d di cancellazione sul file %d", err, lfile);
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnacespi::remove()
|
||||
{
|
||||
|
||||
const int staat = _qmask->stato_attivita();
|
||||
bool yes = FALSE;
|
||||
if (staat == 3)
|
||||
@ -911,12 +924,12 @@ bool TAnacespi::remove()
|
||||
if (yes)
|
||||
{
|
||||
const TString16 idcespite = get_relation()->curr().get(CESPI_IDCESPITE);
|
||||
TRelation_application::remove();
|
||||
kill_cespite(idcespite, LF_SALCE);
|
||||
kill_cespite(idcespite, LF_MOVCE, 2);
|
||||
kill_cespite(idcespite, LF_MOVAM);
|
||||
kill_cespite(idcespite, LF_AMMMV);
|
||||
kill_cespite(idcespite, LF_SALCE);
|
||||
kill_cespite(idcespite, LF_AMMCE);
|
||||
TRelation_application::remove();
|
||||
}
|
||||
return yes;
|
||||
}
|
||||
|
||||
@ -177,6 +177,11 @@ void TConversione_cespiti::main_loop()
|
||||
if (msk.run() == K_ENTER && yesno_box("Confermare la conversione dei cespiti?"))
|
||||
{
|
||||
msk.lista_ditte(_ditte);
|
||||
if (_ditte.items() == 0)
|
||||
{
|
||||
warning_box("Nessuna ditta selezionata");
|
||||
return;
|
||||
}
|
||||
open_log();
|
||||
TString80 s;
|
||||
write_log("");
|
||||
|
||||
@ -127,7 +127,7 @@ void TQuery_mask::calc_res(bool prec)
|
||||
const TRectype& ammce2=ces.amm_pro();
|
||||
// determinazione del residuo fiscale
|
||||
_residuof = ZERO;
|
||||
_residuof = salce2.get_real(SALCE_CSTO)-salce2.get_real(SALCE_VNONAMM)+salce2.get_real(SALCE_RIV75)+salce2.get_real(SALCE_RIV83)+salce2.get_real(SALCE_RIV90)+salce2.get_real(SALCE_RIV91)+salce2.get_real(SALCE_RIVGF);
|
||||
_residuof = salce2.get_real(SALCE_CSTO)-salce2.get_real(SALCE_VNONAMM)-salce2.get_real(SALCE_PLUSREIN)+salce2.get_real(SALCE_RIV75)+salce2.get_real(SALCE_RIV83)+salce2.get_real(SALCE_RIV90)+salce2.get_real(SALCE_RIV91)+salce2.get_real(SALCE_RIVGF);
|
||||
_residuof -= ammce2.get_real(AMMCE_QNORP)+ammce2.get_real(AMMCE_QACCP)+ammce2.get_real(AMMCE_QANTP)+ammce2.get_real(AMMCE_QPERSEP)+ammce2.get_real(AMMCE_FPRIVATOP)+ammce2.get_real(AMMCE_QPPRIVATEP);
|
||||
if (!prec)
|
||||
_residuof -= ammce2.get_real(AMMCE_QNOR)+ammce2.get_real(AMMCE_QACC)+ammce2.get_real(AMMCE_QANT)+ammce2.get_real(AMMCE_QPERSE)+ammce2.get_real(AMMCE_FPRIVATO)+ammce2.get_real(AMMCE_QPPRIVATE);
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#include "celib.h"
|
||||
|
||||
#include "ce1201a.h"
|
||||
#include "ce1201b.h"
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "movce.h"
|
||||
@ -43,7 +42,7 @@ public:
|
||||
real get_residuoc() const { return _residuoc; }
|
||||
real get_plusminusf() const { return _difff; }
|
||||
real get_plusminusc() const { return _diffc; }
|
||||
void calc_res_mov(TCespite& ces, const TRectype& movce, const TRectype& movam);
|
||||
void calc_res_mov(TCespite& ces, const TRectype& movce, TRectype& ammmv);
|
||||
|
||||
TForce_mov_qmask();
|
||||
};
|
||||
@ -81,33 +80,33 @@ int TForce_mov_qmask::calcola_ammo_eliminate()
|
||||
return _ammoelim;
|
||||
}
|
||||
|
||||
void TForce_mov_qmask::calc_res_mov(TCespite& ces, const TRectype& movce, const TRectype& movam)
|
||||
void TForce_mov_qmask::calc_res_mov(TCespite& ces, const TRectype& movce, TRectype& ammmv)
|
||||
{
|
||||
// calcolo ammortamento sul cespite (per sit. fiscale(tpamm=1) o civilistica(tpamm=2))
|
||||
const TDate dtmov = movce.get_date(MOVCE_DTMOV);
|
||||
const int tpamm = movam.get_int(MOVAM_TPAMM); //in base al movam passato prendo il tpamm corrispondente
|
||||
const int tpamm = ammmv.get_int(AMMMV_TPAMM);
|
||||
ces.calc_amm(tpamm, dtmov);
|
||||
TLocalisamfile f_ammmv (LF_AMMMV);
|
||||
ammmv.read(f_ammmv); //il record di movam si rilegge in versione aggiornata dal calc_amm
|
||||
|
||||
const real impven = movce.get_real(MOVCE_IMPVEN);
|
||||
real plus = ammmv.get_real(AMMMV_PLUS);
|
||||
if (plus == ZERO)
|
||||
plus = - ammmv.get_real(AMMMV_MINUS);
|
||||
|
||||
ces.calc_amm(tpamm, FALSE, dtmov);
|
||||
|
||||
const real residuo = impven - plus;
|
||||
// determinazione del residuo fiscale
|
||||
if (tpamm == 1)
|
||||
{
|
||||
_residuof = ZERO;
|
||||
_residuof = movce.get_real(MOVCE_CSTO)-movce.get_real(MOVCE_VNONAMM)+movce.get_real(MOVCE_RIV75)+movce.get_real(MOVCE_RIV83)+movce.get_real(MOVCE_RIV90)+movce.get_real(MOVCE_RIV91)+movce.get_real(MOVCE_RIVGF);
|
||||
_residuof -= movam.get_real(MOVAM_QNOR)+movam.get_real(MOVAM_QACC)+movam.get_real(MOVAM_QANT)+movam.get_real(MOVAM_QPERSE)+movam.get_real(MOVAM_FPRIVATO)+movam.get_real(MOVAM_QPPRIVATE);
|
||||
//calcolo di plus/minus valenze sparse
|
||||
_difff = movce.get_real(MOVCE_IMPVEN) - _residuof;
|
||||
_residuof = residuo;
|
||||
_difff = plus;
|
||||
}
|
||||
// determinazione del residuo civilistico
|
||||
if (tpamm == 2)
|
||||
{
|
||||
_residuoc = ZERO;
|
||||
_residuoc = movce.get_real(MOVCE_CSTO)+movce.get_real(MOVCE_RIV75)+movce.get_real(MOVCE_RIV83)+movce.get_real(MOVCE_RIV90)+movce.get_real(MOVCE_RIV91)+movce.get_real(MOVCE_RIVGC);
|
||||
_residuoc -= movam.get_real(MOVAM_QNOR)+movam.get_real(MOVAM_QACC)+movam.get_real(MOVAM_QANT);
|
||||
_diffc = movce.get_real(MOVCE_IMPVEN) - _residuoc;
|
||||
}
|
||||
|
||||
|
||||
_residuoc = residuo;
|
||||
_diffc = plus;
|
||||
}
|
||||
}
|
||||
|
||||
bool TForce_mov_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
@ -196,14 +195,14 @@ bool TForce_mov_qmask::on_field_event(TOperable_field& o, TField_event e, long j
|
||||
movam.put(MOVAM_TPAMM, 1);
|
||||
if (movam.read() != NOERR)
|
||||
return error_box("Movimenti dei fondi fiscali incoerenti per il movimento selezionato");
|
||||
const TRectype movam1 = movam.curr();
|
||||
TRectype movam1 = movam.curr();
|
||||
|
||||
movam.put(MOVAM_IDCESPITE, idcespite);
|
||||
movam.put(MOVAM_IDMOV, get(F_IDMOV));
|
||||
movam.put(MOVAM_TPAMM, 2);
|
||||
if (movam.read() != NOERR)
|
||||
return error_box("Movimenti dei fondi civilistici incoerenti per il movimento selezionato");
|
||||
const TRectype movam2 = movam.curr();
|
||||
TRectype movam2 = movam.curr();
|
||||
|
||||
TLocalisamfile ammmv(LF_AMMMV); // controlla la consistenza degli ammortamenti sui movimenti
|
||||
ammmv.put(AMMMV_IDCESPITE, idcespite);
|
||||
@ -211,18 +210,16 @@ bool TForce_mov_qmask::on_field_event(TOperable_field& o, TField_event e, long j
|
||||
ammmv.put(AMMMV_TPAMM, 1);
|
||||
if (ammmv.read() != NOERR)
|
||||
return error_box("Ammortamenti fiscali sui movimenti incoerenti per il movimento selezionato");
|
||||
calc_res_mov(ces, curr_movce, ammmv.curr()); //calcolo del residuo fiscale in uscita maschera di selezione
|
||||
if (_residuof==ZERO)
|
||||
return error_box("Impossibile forzare ammortamento perché non esiste residuo fiscale\nda ammortizzare per le parti eliminate del cespite");
|
||||
|
||||
ammmv.put(AMMMV_IDCESPITE, idcespite);
|
||||
ammmv.put(AMMMV_IDMOV, get(F_IDMOV));
|
||||
ammmv.put(AMMMV_TPAMM, 2);
|
||||
if (ammmv.read() != NOERR)
|
||||
return error_box("Ammortamenti civilistici sui movimenti incoerenti per il movimento selezionato");
|
||||
|
||||
|
||||
calc_res_mov(ces, curr_movce, movam1); //calcolo del residuo fiscale in uscita maschera di selezione
|
||||
if (_residuof==ZERO)
|
||||
return error_box("Impossibile forzare ammortamento perché non esiste residuo fiscale\nda ammortizzare per le parti eliminate del cespite");
|
||||
|
||||
calc_res_mov(ces, curr_movce, movam2); //calcolo del residuo civilistico in uscita maschera di selezione
|
||||
return error_box("Ammortamenti civilistici sui movimenti incoerenti per il movimento selezionato");
|
||||
calc_res_mov(ces, curr_movce, ammmv.curr()); //calcolo del residuo civilistico in uscita maschera di selezione
|
||||
if (_residuoc==ZERO)
|
||||
return error_box("Impossibile forzare ammortamento perché non esiste residuo civilistico\nda ammortizzare per le parti eliminate del cespite");
|
||||
|
||||
@ -362,7 +359,7 @@ TMask* TForza_amm_movce::get_mask(int mode)
|
||||
return mode == MODE_QUERY ? (TMask*)_qmask : (TMask*)_fmask;
|
||||
}
|
||||
|
||||
void TForza_amm_movce::init_mask(TMask& m) //funzione per settare i dati ditta in uscita
|
||||
void TForza_amm_movce::init_mask(TMask& m) //funzione per settare i dati ditta in ingresso
|
||||
{
|
||||
const int ese = _qmask->get_int(F_ESERCIZIO);
|
||||
const int gru = _qmask->get_int(F_GRUPPO);
|
||||
@ -377,20 +374,18 @@ void TForza_amm_movce::init_mask(TMask& m) //funzione per settare i dati dit
|
||||
|
||||
_fmask->set_stato_attivita(_qmask->stato_attivita()); //copia lo stato attivitá della precedente
|
||||
|
||||
TCespite ces(_fmask->get(F_IDCESPI));
|
||||
TCespite ces(_fmask->get(F_IDCESPITE));
|
||||
const TRectype& movce = get_relation()->curr();
|
||||
const TRectype& movam1 = get_relation()->curr(-69);
|
||||
TRectype ammmv1 = get_relation()->curr(-69);
|
||||
|
||||
_qmask->calc_res_mov(ces, movce, movam1); // ricalcola il residuo fiscale in forzatura
|
||||
_qmask->calc_res_mov(ces, movce, ammmv1); // ricalcola il residuo fiscale in forzatura
|
||||
_fmask->set(F_RESIDUO_F, _qmask->get_residuof()); //prende il residuo fiscale del cespite calcolato in Qmask e lo mette in Fmask
|
||||
// _fmask->set_residuof_ini(_qmask->get_residuof()); //mette il valore del residuo precedente la forzatura nella var _rediduof_ini
|
||||
_fmask->set(F_PLUSMINUS_F, _qmask->get_plusminusf());
|
||||
|
||||
const TRectype& movam2 = get_relation()->curr(-77);
|
||||
TRectype ammmv2 = get_relation()->curr(-77);
|
||||
|
||||
_qmask->calc_res_mov(ces, movce, movam2); // ricalcola il residuo civilistico in forzatura
|
||||
_qmask->calc_res_mov(ces, movce, ammmv2); // ricalcola il residuo civilistico in forzatura
|
||||
_fmask->set(F_RESIDUO_C, _qmask->get_residuoc()); //prende il residuo civilistico del cespite calcolato in Qmask e lo mette in Fmask
|
||||
// _fmask->set_residuoc_ini(_qmask->get_residuoc()); //mette il valore del residuo precedente la forzatura nella var _rediduoc_ini
|
||||
_fmask->set(F_PLUSMINUS_C, _qmask->get_plusminusc());
|
||||
}
|
||||
|
||||
@ -455,11 +450,12 @@ void TForza_amm_movce::init_modify_mode(TMask& m)
|
||||
|
||||
// funzione per il ricalcolo degli ammortamenti dopo la forzatura
|
||||
void TForza_amm_movce::update_amm(const TMask& m)
|
||||
{
|
||||
TCespite ces(m.get(F_IDCESPITE));
|
||||
{
|
||||
const TString16 idces = m.get(F_IDCESPITE);
|
||||
TCespite ces(idces);
|
||||
TDate dtmov = m.get_date(F_DTMOV);
|
||||
ces.calc_amm(1, FALSE, dtmov);
|
||||
ces.calc_amm(2, FALSE, dtmov);
|
||||
ces.calc_amm(1, dtmov);
|
||||
ces.calc_amm(2, dtmov);
|
||||
}
|
||||
|
||||
//funzione per l'aggiornamento dei campi plus-minusvalenza sul file AMMMV
|
||||
@ -508,10 +504,12 @@ bool TForza_amm_movce::user_create()
|
||||
expr69 << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==1";
|
||||
_rel->add(LF_AMMMV, expr69, 1, 0, 69); // prima relazione su AMMMV (alias 69): TPAMM=1
|
||||
_rel->write_enable(-69);
|
||||
_rel->add(LF_MOVAM, expr69, 1, 0, 691); // prima relazione su MOVAM (alias 691): TPAMM=1
|
||||
TString expr77;
|
||||
expr77 << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==2";
|
||||
_rel->add(LF_AMMMV, expr77, 1, 0, 77); // seconda relazione su AMMMV (alias 77): TPAMM=2
|
||||
_rel->write_enable(-77);
|
||||
_rel->write_enable(-77);
|
||||
_rel->add(LF_MOVAM, expr77, 1, 0, 771); // seconda relazione su MOVAM (alias 771): TPAMM=2
|
||||
|
||||
_qmask = new TForce_mov_qmask;
|
||||
_fmask = new TForce_mov_fmask;
|
||||
|
||||
40
ce/ce1201a.h
40
ce/ce1201a.h
@ -1,4 +1,4 @@
|
||||
// per ce1201a.uml
|
||||
// per ce1201a.uml e ce1201b.uml
|
||||
#define F_DITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_ESERCIZIO 103
|
||||
@ -8,13 +8,45 @@
|
||||
#define F_GRUPPO 107
|
||||
#define F_SPECIE 108
|
||||
#define F_DESC_GRSP 109
|
||||
|
||||
#define F_SITUAZIONE 110
|
||||
#define F_IDCESPITE 111
|
||||
#define F_DESC_CES 112
|
||||
#define F_IDMOV 113
|
||||
#define F_DESC_MOV 123
|
||||
#define F_CODMOV 124
|
||||
#define F_DTMOV 125
|
||||
|
||||
#define F_FORZATURA_Q_F 126
|
||||
#define F_FORZATURA_P_F 127
|
||||
#define F_FORZATURA_Q_C 128
|
||||
#define F_FORZATURA_P_C 129
|
||||
|
||||
#define F_AMMNOR_F 130
|
||||
#define F_AMMACC_F 131
|
||||
#define F_AMMANT_F 132
|
||||
#define F_AMMNOR_C 133
|
||||
#define F_AMMACC_C 134
|
||||
#define F_AMMANT_C 135
|
||||
#define F_QUOTE_PERSE 136
|
||||
#define F_PRIVATO 137
|
||||
#define F_QUOTE_PRIV 138
|
||||
#define F_P_AMMNOR_F 139
|
||||
#define F_P_AMMACC_F 140
|
||||
#define F_P_AMMANT_F 141
|
||||
#define F_P_AMMNOR_C 142
|
||||
#define F_P_AMMACC_C 143
|
||||
#define F_P_AMMANT_C 144
|
||||
|
||||
|
||||
|
||||
#define F_RIS_AMMNOR_F 145
|
||||
#define F_RIS_AMMACC_F 146
|
||||
#define F_RIS_AMMANT_F 147
|
||||
#define F_RIS_AMMNOR_C 148
|
||||
#define F_RIS_AMMACC_C 149
|
||||
#define F_RIS_AMMANT_C 150
|
||||
#define F_RIS_QUOTE_PERSE 151
|
||||
#define F_RIS_PRIVATO 152
|
||||
#define F_RIS_QUOTE_PRIV 153
|
||||
#define F_RESIDUO_F 154
|
||||
#define F_RESIDUO_C 155
|
||||
#define F_PLUSMINUS_F 156
|
||||
#define F_PLUSMINUS_C 157
|
||||
@ -1,4 +1,4 @@
|
||||
#include "ce1201b.h"
|
||||
#include "ce1201a.h"
|
||||
|
||||
TOOLBAR "Toolbar" 0 -2 0 2
|
||||
|
||||
@ -104,7 +104,7 @@ BEGIN
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_IDCESPI 10
|
||||
NUMBER F_IDCESPITE 10
|
||||
BEGIN
|
||||
PROMPT 1 5 "Cespite "
|
||||
FLAGS "DZ"
|
||||
@ -112,13 +112,13 @@ BEGIN
|
||||
KEY 1
|
||||
END
|
||||
|
||||
STRING F_DESC 53
|
||||
STRING F_DESC_CES 53
|
||||
BEGIN
|
||||
PROMPT 23 5 ""
|
||||
FLAGS "D"
|
||||
USE LF_CESPI
|
||||
INPUT IDCESPITE F_IDCESPI
|
||||
OUTPUT F_DESC DESC
|
||||
INPUT IDCESPITE F_IDCESPITE
|
||||
OUTPUT F_DESC_CES DESC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
@ -129,7 +129,7 @@ BEGIN
|
||||
FIELD DTMOV
|
||||
END
|
||||
|
||||
NUMBER F_IDMOVIM 11
|
||||
NUMBER F_IDMOV 11
|
||||
BEGIN
|
||||
PROMPT 33 6 "N. Mov. "
|
||||
FLAGS "DZ"
|
||||
@ -143,7 +143,7 @@ BEGIN
|
||||
FIELD CODMOV
|
||||
END
|
||||
|
||||
STRING F_DESCMOV 63
|
||||
STRING F_DESC_MOV 63
|
||||
BEGIN
|
||||
PROMPT 1 7 "Descrizione "
|
||||
FLAGS "D"
|
||||
@ -281,7 +281,7 @@ BEGIN
|
||||
GROUP 5
|
||||
END
|
||||
|
||||
NUMBER F_QUOTE_PERSE 15
|
||||
CURRENCY F_QUOTE_PERSE 15
|
||||
BEGIN
|
||||
PROMPT 1 15 "Quote perse "
|
||||
FIELD 69@->QPERSE
|
||||
@ -289,7 +289,7 @@ BEGIN
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
NUMBER F_PRIVATO 15
|
||||
CURRENCY F_PRIVATO 15
|
||||
BEGIN
|
||||
PROMPT 1 16 "Privato "
|
||||
FIELD 69@->FPRIVATO
|
||||
@ -297,7 +297,7 @@ BEGIN
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
NUMBER F_QUOTE_PRIV 15
|
||||
CURRENCY F_QUOTE_PRIV 15
|
||||
BEGIN
|
||||
PROMPT 1 17 "Quote per priv. "
|
||||
FIELD 69@->QPPRIVATE
|
||||
|
||||
809
ce/ce1300.cpp
809
ce/ce1300.cpp
@ -9,20 +9,53 @@
|
||||
#include "celib.h"
|
||||
|
||||
#include "ce1301a.h"
|
||||
//#include "ce1301b.h"
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
|
||||
#include "cespi.h"
|
||||
#include "salce.h"
|
||||
#include "ammce.h"
|
||||
#include "catdi.h"
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
//Applicazione principale: prima puntata...
|
||||
/////////////////////////////////////////////////////////
|
||||
class TSelect_ammoces : public TRelation_application
|
||||
{
|
||||
TRelation* _rel;
|
||||
TAutomask* _msk[4];
|
||||
int _tipo;
|
||||
real _aliqmax, _aliqmin, _aliqant;
|
||||
|
||||
private:
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual TRelation* get_relation() const { return _rel; };
|
||||
virtual bool changing_mask(int mode) { return TRUE; }
|
||||
virtual TMask* get_mask(int mode);
|
||||
|
||||
void init_mask(TMask& m);
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
|
||||
public:
|
||||
void set_tipo_beni(int t) { _tipo = t; }
|
||||
};
|
||||
|
||||
inline TSelect_ammoces& app() { return (TSelect_ammoces&)main_app(); }
|
||||
//Continua piú avanti...
|
||||
//-----------------------------------------------------------------------------------------------------------------------//
|
||||
//Maschera di selezione
|
||||
class TSelect_ammoces_qmask : public TAutomask
|
||||
/////////////////////////////////////
|
||||
//Maschera di query
|
||||
/////////////////////////////////////
|
||||
class TSelam_qmask : public TAutomask
|
||||
{
|
||||
int _staat;
|
||||
real _residuof, _residuoc;
|
||||
real _residuof, _residuoc, _uniprice;
|
||||
bool _ammo100;
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
@ -37,10 +70,11 @@ public:
|
||||
real get_residuoc() const { return _residuoc; }
|
||||
void calc_res(bool prec);
|
||||
|
||||
TSelect_ammoces_qmask();
|
||||
TSelam_qmask();
|
||||
};
|
||||
|
||||
void TSelect_ammoces_qmask::on_search_event(TOperable_field& o)
|
||||
//scelta tipo ordinamento
|
||||
void TSelam_qmask::on_search_event(TOperable_field& o)
|
||||
{
|
||||
TToken_string order, fields, header;
|
||||
if (o.dlg() >= F_SEARCH3)
|
||||
@ -80,7 +114,7 @@ void TSelect_ammoces_qmask::on_search_event(TOperable_field& o)
|
||||
}
|
||||
}
|
||||
|
||||
int TSelect_ammoces_qmask::calcola_stato_attivita()
|
||||
int TSelam_qmask::calcola_stato_attivita()
|
||||
{
|
||||
const int ese = get_int(F_ESERCIZIO);
|
||||
const int gru = get_int(F_GRUPPO);
|
||||
@ -99,7 +133,7 @@ int TSelect_ammoces_qmask::calcola_stato_attivita()
|
||||
return _staat;
|
||||
}
|
||||
|
||||
bool TSelect_ammoces_qmask::cespite_ok() const
|
||||
bool TSelam_qmask::cespite_ok() const
|
||||
{
|
||||
TLocalisamfile cespi(LF_CESPI);
|
||||
cespi.put(CESPI_IDCESPITE, get(F_IDCESPITE));
|
||||
@ -107,12 +141,12 @@ bool TSelect_ammoces_qmask::cespite_ok() const
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TSelect_ammoces_qmask::calc_res(bool prec)
|
||||
void TSelam_qmask::calc_res(bool prec)
|
||||
{
|
||||
TCespite ces (get(F_IDCESPITE));
|
||||
// calcolo ammortamento sul cespite (per sit. fiscale(1) e civilistica(2))
|
||||
TDate fine_es = get(F_FINE_ES);
|
||||
ces.calc_amm(1, FALSE, fine_es);
|
||||
ces.calc_amm(1, fine_es);
|
||||
const TRectype& salce2=ces.sal_pro(); //rectype giá di "tipo fiscale"
|
||||
const TRectype& ammce2=ces.amm_pro();
|
||||
// determinazione del residuo fiscale
|
||||
@ -122,7 +156,7 @@ void TSelect_ammoces_qmask::calc_res(bool prec)
|
||||
if (!prec)
|
||||
_residuof -= ammce2.get_real(AMMCE_QNOR)+ammce2.get_real(AMMCE_QACC)+ammce2.get_real(AMMCE_QANT)+ammce2.get_real(AMMCE_QPERSE)+ammce2.get_real(AMMCE_FPRIVATO)+ammce2.get_real(AMMCE_QPPRIVATE);
|
||||
|
||||
ces.calc_amm(2, FALSE, fine_es);
|
||||
ces.calc_amm(2, fine_es);
|
||||
//rectype giá di "tipo civilistico"
|
||||
// determinazione del residuo civilistico
|
||||
_residuoc = ZERO;
|
||||
@ -133,7 +167,7 @@ void TSelect_ammoces_qmask::calc_res(bool prec)
|
||||
}
|
||||
|
||||
|
||||
bool TSelect_ammoces_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
bool TSelam_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch (o.dlg())
|
||||
{
|
||||
@ -156,39 +190,83 @@ bool TSelect_ammoces_qmask::on_field_event(TOperable_field& o, TField_event e, l
|
||||
if (!cespite_ok())
|
||||
return error_box("Inserire un cespite valido"); //controlla che esista il cespite
|
||||
if (stato_attivita() == 1)
|
||||
warning_box("E' stato stampato il bollato dell'anno:\nnon sono permesse forzature"); //il bollato é stato stampato
|
||||
|
||||
|
||||
TLocalisamfile salce(LF_SALCE); // controlla che esista almeno un saldo
|
||||
salce.put(SALCE_IDCESPITE, get(F_IDCESPITE));
|
||||
salce.put(SALCE_CODES, get(F_ESERCIZIO));
|
||||
salce.put(SALCE_TPSALDO, 1);
|
||||
if (salce.read() != NOERR)
|
||||
return error_box("Non esistono saldi per l'anno selezionato");
|
||||
|
||||
TLocalisamfile ammce(LF_AMMCE); // controlla che esista almeno un ammortamento (sennó che forzamo?)
|
||||
ammce.put(AMMCE_IDCESPITE, get(F_IDCESPITE));
|
||||
ammce.put(AMMCE_CODES, get(F_ESERCIZIO));
|
||||
ammce.put(AMMCE_TPSALDO, 1);
|
||||
ammce.put(AMMCE_TPAMM, 1);
|
||||
if (ammce.read() != NOERR)
|
||||
return error_box("Non esistono ammortamenti per l'anno selezionato");
|
||||
warning_box("E' stato stampato il bollato dell'anno:\nnon sono permesse modifiche"); //il bollato é stato stampato
|
||||
|
||||
TCespite ces (get(F_IDCESPITE)); // controlla che la categoria del cespite sia ammortizzabile
|
||||
const TRectype& categoria = ces.categoria();
|
||||
bool non_ammortizzabile = categoria.get_bool("B0");
|
||||
if (non_ammortizzabile)
|
||||
return error_box("La categoria del cespite selezionato non é ammortizzabile");
|
||||
return error_box("Impossibile effettuare ammortamenti perché il cespite\nappartiene ad una categoria di beni non ammortizzabili");
|
||||
|
||||
calc_res(TRUE); // controllo dei residui fiscale e civilistico in ingresso (prec=TRUE)
|
||||
if (_residuof==ZERO)
|
||||
return error_box("Impossibile forzare ammortamento perché non esiste residuo fiscale da ammortizzare per il cespite");
|
||||
int materiale = categoria.get_int("I0");
|
||||
app().set_tipo_beni(materiale); //inizializza la variabile tipo
|
||||
|
||||
if (materiale == 0) // controlla che il cespite non sia per caso in leasing
|
||||
{ // solo i cespiti materiali possono essere in leasing..
|
||||
if (ces.get_bool(CESPI_LEASING) == TRUE)
|
||||
return error_box("Impossibile impostare le scelte per cespiti ceduti in leasing");
|
||||
}
|
||||
|
||||
if (_residuoc==ZERO)
|
||||
return error_box("Impossibile forzare ammortamento perché non esiste residuo civilistico da ammortizzare per il cespite");
|
||||
const TDate& datafunz = ces.get_date("DTFUNZ"); // se la data di entrata in funzione non é nulla....
|
||||
if (datafunz.ok())
|
||||
{
|
||||
calc_res(TRUE); // controllo dei residui fiscale e civilistico in ingresso (prec=TRUE)
|
||||
if (_residuof==ZERO)
|
||||
{
|
||||
message_box("Il valore fiscale del cespite risulta giá completamente ammortizzato");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (_residuoc==ZERO)
|
||||
{
|
||||
message_box("Il valore civilistico del cespite risulta giá completamente ammortizzato");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
TLocalisamfile ammce(LF_AMMCE); // controlla eventuali forzature precedenti
|
||||
ammce.put(AMMCE_IDCESPITE, get(F_IDCESPITE));
|
||||
ammce.put(AMMCE_CODES, get(F_ESERCIZIO));
|
||||
ammce.put(AMMCE_TPSALDO, 2);
|
||||
ammce.put(AMMCE_TPAMM, 1);
|
||||
if (ammce.read() == NOERR)
|
||||
{
|
||||
if (ammce.get_bool(AMMCE_FZPER) == TRUE)
|
||||
return error_box("Sul cespite sono state forzate le Percentuali:\nprocedere dalla forzatura ammortamenti su cespite");
|
||||
if (ammce.get_bool(AMMCE_FZQUO) == TRUE)
|
||||
return error_box("Sul cespite sono state forzate le Quote:\nprocedere dalla forzatura ammortamenti su cespite");
|
||||
}
|
||||
|
||||
TLocalisamfile salce(LF_SALCE); // controlla se ammesso ammortamento 100% per beni inferiori a 516.46 Euro
|
||||
salce.put(SALCE_IDCESPITE, get(F_IDCESPITE));
|
||||
salce.put(SALCE_CODES, get(F_ESERCIZIO));
|
||||
salce.put(SALCE_TPSALDO, 1);
|
||||
_ammo100 = FALSE;
|
||||
_uniprice = 516.46;
|
||||
if (! salce.get_date(SALCE_DTSTBOLL).ok())
|
||||
{
|
||||
if (datafunz.ok() && (datafunz > get_date(F_INIZIO_ES) && datafunz < get_date(F_FINE_ES)) && salce.get_int(SALCE_ANNIAMM) == 0)
|
||||
{
|
||||
if (ces.get_bool(CESPI_TUIR) == TRUE)
|
||||
{
|
||||
const TDate& data_fine_es = get_date(F_FINE_ES);
|
||||
ces.calc_amm(2, data_fine_es);
|
||||
real valore = salce.get_real(SALCE_CSTO)-salce.get_real(SALCE_VNONAMM)+salce.get_real(SALCE_RIV75)+salce.get_real(SALCE_RIV83)+salce.get_real(SALCE_RIV90)+salce.get_real(SALCE_RIV91)+salce.get_real(SALCE_RIVGF);
|
||||
real valoreuni = valore / salce.get_int(SALCE_NUMELE);
|
||||
if (valoreuni <= _uniprice)
|
||||
_ammo100 = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
real valore = salce.get_real(SALCE_CSTO)-salce.get_real(SALCE_VNONAMM)+salce.get_real(SALCE_RIV75)+salce.get_real(SALCE_RIV83)+salce.get_real(SALCE_RIV90)+salce.get_real(SALCE_RIV91)+salce.get_real(SALCE_RIVGF);
|
||||
real valoreuni = valore / salce.get_int(SALCE_NUMELE);
|
||||
if (valoreuni <= _uniprice)
|
||||
_ammo100 = TRUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -197,140 +275,323 @@ bool TSelect_ammoces_qmask::on_field_event(TOperable_field& o, TField_event e, l
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TSelect_ammoces_qmask::TSelect_ammoces_qmask() : TAutomask("ce1301a")
|
||||
TSelam_qmask::TSelam_qmask() : TAutomask("ce1301a")
|
||||
{
|
||||
first_focus(F_IDCESPITE);
|
||||
}
|
||||
/*
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------//
|
||||
//Maschera di selezione ammortamento sul cespite
|
||||
class TSelect_ammoces_smask : public TAutomask
|
||||
{
|
||||
TTipo_cespite _tipo;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//Maschera BENI MATERIALI
|
||||
//////////////////////////////////////////////////////////////////
|
||||
class TSelam_mmask : public TAutomask
|
||||
{
|
||||
int _staat;
|
||||
real _residuof_ini,_residuoc_ini;
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
|
||||
bool test_min(short quota, short minimo) const;
|
||||
bool test_max(short nor, short ant, short acc) const;
|
||||
|
||||
public:
|
||||
void set_stato_attivita(int sa) { _staat = sa; }
|
||||
int stato_attivita() const { return _staat; }
|
||||
|
||||
void set_tipo_cespite(TTipo_cespite tc) { _tipo = tc; }
|
||||
TTipo_cespite tipo_cespite() const { return _tipo; }
|
||||
|
||||
void set_residuof_ini(const real& rfini) { _residuof_ini = rfini; }
|
||||
void set_residuoc_ini(const real& rcini) { _residuoc_ini = rcini; }
|
||||
|
||||
TSelect_ammoces_smask() : TAutomask("ce1301b") { }
|
||||
TSelam_mmask() : TAutomask("ce1301b") { }
|
||||
};
|
||||
|
||||
bool TSelam_mmask::test_min(short quota, short minimo) const
|
||||
{
|
||||
bool warning = FALSE;
|
||||
const bool ammrit = get_bool(F_AMMRIT_CE);
|
||||
if (!ammrit)
|
||||
{
|
||||
const real perq = get(quota);
|
||||
const real minq = get(minimo);
|
||||
warning = perq < minq;
|
||||
}
|
||||
return warning;
|
||||
}
|
||||
|
||||
bool TForce_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
bool TSelam_mmask::test_max(short nor, short ant, short acc) const
|
||||
{
|
||||
real tot;
|
||||
tot += get_real(nor);
|
||||
tot += get_real(ant);
|
||||
tot += get_real(acc);
|
||||
return tot > 100.0;
|
||||
}
|
||||
|
||||
bool TSelam_mmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_CATEGORIA:
|
||||
ditta_cespiti().on_category_event(o, e, jolly);
|
||||
break;
|
||||
|
||||
case F_FORZATURA_Q_F: //gestione reset dei vari checkbox di forzatura
|
||||
if (e==fe_modify && o.get()=="X" && get(F_FORZATURA_P_F)=="X")
|
||||
reset(F_FORZATURA_P_F);
|
||||
break;
|
||||
|
||||
case F_FORZATURA_P_F:
|
||||
if (e==fe_modify && o.get()=="X" && get(F_FORZATURA_Q_F)=="X")
|
||||
reset(F_FORZATURA_Q_F);
|
||||
break;
|
||||
|
||||
case F_FORZATURA_Q_C:
|
||||
if (e==fe_modify && o.get()=="X" && get(F_FORZATURA_P_C)=="X")
|
||||
reset(F_FORZATURA_P_C);
|
||||
break;
|
||||
|
||||
case F_FORZATURA_P_C:
|
||||
if (e==fe_modify && o.get()=="X" && get(F_FORZATURA_Q_C)=="X")
|
||||
reset(F_FORZATURA_Q_C);
|
||||
break;
|
||||
|
||||
case F_AMMNOR_F: // controlla che residuof sia < della somma dei campi quota fiscali (al variare di
|
||||
case F_AMMACC_F: // ognuno dei campi quota componenti, in modo che in caso di errore il campo sia
|
||||
case F_AMMANT_F: // subito identificato
|
||||
case F_QUOTE_PERSE:
|
||||
case F_PRIVATO:
|
||||
case F_QUOTE_PRIV:
|
||||
if (e==fe_close||e==fe_modify)
|
||||
{
|
||||
real sumf = get_real(F_AMMNOR_F)+get_real(F_AMMACC_F)+get_real(F_AMMANT_F)+get_real(F_QUOTE_PERSE)+get_real(F_PRIVATO)+get_real(F_QUOTE_PRIV);
|
||||
if (sumf > _residuof_ini)
|
||||
return error_box("Attenzione: l'ammortamento richiesto supera il residuo fiscale del cespite");
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
dc.on_category_event(o, e, jolly);
|
||||
}
|
||||
break;
|
||||
case F_AMMNOR_C: // controlla che residuoc sia < della somma dei campi quota civilistici
|
||||
case F_AMMACC_C:
|
||||
case F_AMMANT_C:
|
||||
if (e==fe_close||e==fe_modify)
|
||||
|
||||
case F_AMMFISC_NOR_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
if (get_bool(F_AMM100_CE) == FALSE)
|
||||
{
|
||||
if (test_min(F_AMMFISC_NOR_CE, F_NORMIN)) // controlla se si producono quote perse fiscali
|
||||
warning_box("L'ammortamento normale è inferiore al minimo della tabella ministeriale:\n"
|
||||
"Se non si seleziona l'ammortamento ritardato verranno generate delle quote perse");
|
||||
if (test_max(F_AMMFISC_NOR_CE, F_AMMFISC_ANT_CE, F_AMMFISC_ACC_CE)) // controlla totale percentuali impostate fiscali
|
||||
return error_box("Il totale delle percentuali di ammortamento fiscale supera il 100%");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMFISC_ACC_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
real sumc = get_real(F_AMMNOR_C)+get_real(F_AMMACC_C)+get_real(F_AMMANT_C);
|
||||
if (sumc > _residuoc_ini)
|
||||
return error_box("Attenzione: l'ammortamento richiesto supera il residuo civilistico del cespite");
|
||||
if (test_max(F_AMMFISC_NOR_CE, F_AMMFISC_ANT_CE, F_AMMFISC_ACC_CE)) // controlla totale percentuali impostate fiscali
|
||||
return error_box("Il totale delle percentuali di ammortamento fiscale supera il 100%");
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMFISC_ANT_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
if (test_max(F_AMMFISC_NOR_CE, F_AMMFISC_ANT_CE, F_AMMFISC_ACC_CE)) // controlla totale percentuali impostate fiscali
|
||||
return error_box("Il totale delle percentuali di ammortamento fiscale supera il 100%");
|
||||
|
||||
if (!o.empty() && test_min(F_AMMFISC_NOR_CE, F_NORMAX))
|
||||
return error_box("E' necessario completare l'ammortamento normale fiscale prima di calcolare quello anticipato fiscale");
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMCIV_NOR_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
if (test_max(F_AMMCIV_NOR_CE, F_AMMCIV_ANT_CE, F_AMMCIV_ACC_CE)) // controlla totale percentuali impostate civilistiche
|
||||
return error_box("Il totale delle percentuali di ammortamento civilistico supera il 100%");
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMCIV_ANT_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
if (test_max(F_AMMCIV_NOR_CE, F_AMMCIV_ANT_CE, F_AMMCIV_ACC_CE)) // controlla totale percentuali impostate civilistiche
|
||||
return error_box("Il totale delle percentuali di ammortamento civilistico supera il 100%");
|
||||
|
||||
if (!o.empty() && test_min(F_AMMCIV_NOR_CE, F_NORMAX))
|
||||
return error_box("E' necessario completare l'ammortamento normale civilistico prima di calcolare quello anticipato civilistico");
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMCIV_ACC_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
if (test_max(F_AMMCIV_NOR_CE, F_AMMCIV_ANT_CE, F_AMMCIV_ACC_CE)) // controlla totale percentuali impostate civilistiche
|
||||
return error_box("Il totale delle percentuali di ammortamento civilistico supera il 100%");
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMRIT_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
if (get_bool(F_AMMRIT_CE) == TRUE)
|
||||
{
|
||||
if ((get_real(F_AMMFISC_NOR_CE) >= get_real(F_NORMIN)) || (get_real(F_AMMCIV_NOR_CE) >= get_real(F_NORMIN)))
|
||||
return error_box("Indicata la scelta di ammortamento ritardato ma il Normale supera il Minimo ministeriale");
|
||||
if (get_real(F_AMMFISC_ACC_CE) != 0 || get_real(F_AMMCIV_ACC_CE) != 0)
|
||||
return error_box("Impossibile scegliere contemporaneamente ammortamento Accelerato e Ritardato");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case F_ANTMIN:
|
||||
case F_SCELTA:
|
||||
if (e == fe_modify || e == fe_init)
|
||||
{
|
||||
if (((get_int(F_SCELTA) == 1) && (get_real(F_ANTMIN) == 0)) || get_int(F_SCELTA) != 1)
|
||||
{
|
||||
disable(F_AMMFISC_ANT_CE);
|
||||
reset(F_AMMFISC_ANT_CE);
|
||||
}
|
||||
else
|
||||
enable(F_AMMFISC_ANT_CE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
} */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------//
|
||||
//Applicazione
|
||||
class TSelect_ammoces : public TRelation_application
|
||||
{
|
||||
TRelation* _ammce;
|
||||
|
||||
TSelect_ammoces_qmask* _qmask;
|
||||
// TSelect_ammoces_smask* _smask;
|
||||
|
||||
private:
|
||||
void protect_fields(TMask& m, TToken_string& enabling) const;
|
||||
void init_mask(TMask& m);
|
||||
void update_amm(const TMask& m);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//Maschera BENI IMMATERIALI
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class TSelam_imask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
// @cmember Inizializzazione dei dati dell'utente
|
||||
virtual bool user_create();
|
||||
// @cmember Distruzione dei dati dell'utente
|
||||
virtual bool user_destroy();
|
||||
virtual bool changing_mask(int mode);
|
||||
// @cmember Richiede la maschera da usare
|
||||
virtual TMask* get_mask(int mode);
|
||||
// @cmember Ritorna la relazione da modificare
|
||||
virtual TRelation* get_relation() const;
|
||||
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
virtual int write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TSelam_imask() : TAutomask("ce1301c") { }
|
||||
};
|
||||
|
||||
bool TSelect_ammoces::changing_mask(int)
|
||||
bool TSelam_imask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_CATEGORIA:
|
||||
case F_DESC_CAT:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
return dc.on_category_event(o, e, jolly);
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMFISC_CE:
|
||||
case F_AMMCIV_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
TCespite ces = get(F_IDCESPITE);
|
||||
if ( (ces.get_int(CESPI_VINCOLO) != 2) && ( (get(F_AMMFISC_CE) > get(F_ALIQMAX)) || (get(F_AMMCIV_CE) > get(F_ALIQMAX)) ) )
|
||||
return error_box("L' ammortamento richiesto supera il limite della categoria");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TMask* TSelect_ammoces::get_mask(int mode)
|
||||
//-----------------------------------------------------------------------------------------------------------------------//
|
||||
///////////////////////////////////////////////////////////
|
||||
// Maschera di costi pluriennali
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TSelam_pmask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TSelam_pmask() : TAutomask("ce1301d") { }
|
||||
};
|
||||
|
||||
bool TSelam_pmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
// return mode == MODE_QUERY ? (TMask*)_qmask : (TMask*)_smask;
|
||||
return mode == MODE_QUERY ? (TMask*)_qmask : (TMask*)_qmask;
|
||||
switch (o.dlg())
|
||||
{
|
||||
case F_CATEGORIA:
|
||||
case F_DESC_CAT:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
return dc.on_category_event(o, e, jolly);
|
||||
}
|
||||
break;
|
||||
|
||||
case F_AMMFISC_CE:
|
||||
case F_AMMCIV_CE:
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
TCespite ces = get(F_IDCESPITE);
|
||||
if (ces.get_int(CESPI_VINCOLO) == 1)
|
||||
{
|
||||
if (ces.get_int(CESPI_ANNIRIC) == 0)
|
||||
{
|
||||
real amm_fisc = o.get();
|
||||
if (amm_fisc == ZERO) //controlla l'obbligatorietá e la validitá dei campi (fiscale)
|
||||
return error_box("Compilare l'ammortamento scelto");
|
||||
else
|
||||
{
|
||||
if (amm_fisc < get_real(F_ALIQMIN))
|
||||
return error_box("L'ammortamento scelto é inferiore al minimo da Tabella");
|
||||
if (amm_fisc > get_real(F_ALIQMAX))
|
||||
return error_box("L'ammortamento scelto é superiore al minimo da Tabella");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
real anni_ammo = get_real(F_ANNIAMMOREQ);
|
||||
if ((anni_ammo == 0) && ces.get_bool(CESPI_LEASING) == TRUE)
|
||||
return error_box("Compilare gli anni ammortamento richiesti");
|
||||
else if (anni_ammo > get_int(F_ENTROANNI))
|
||||
return error_box("Il numero di anni di ammortamento scelti supera il limite da tabella");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TRelation* TSelect_ammoces::get_relation() const
|
||||
{
|
||||
return _ammce;
|
||||
//---------------------------------------------------------------------------------------------------------//
|
||||
///////////////////////////////////////////////////////////
|
||||
// Applicazione principale: seconda puntata
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
TMask* TSelect_ammoces::get_mask(int mode)
|
||||
{
|
||||
TMask* m = NULL;
|
||||
if (mode == MODE_QUERY || mode == MODE_QUERYINS)
|
||||
{
|
||||
if (_msk[0] == NULL)
|
||||
_msk[0] = new TSelam_qmask;
|
||||
m = _msk[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(_tipo)
|
||||
{
|
||||
case 1:
|
||||
if (_msk[2] == NULL)
|
||||
_msk[2] = new TSelam_imask;
|
||||
break;
|
||||
case 2:
|
||||
if (_msk[3] == NULL)
|
||||
_msk[3] = new TSelam_pmask;
|
||||
break;
|
||||
default:
|
||||
if (_msk[1] == NULL)
|
||||
_msk[1] = new TSelam_mmask;
|
||||
break;
|
||||
}
|
||||
m = _msk[_tipo+1];
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
bool TSelect_ammoces::user_create()
|
||||
{
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CESPI, LF_SALCE, LF_AMMCE, LF_CATDI, 0);
|
||||
_rel = new TRelation (LF_AMMCE); // relazione principale su AMMCE
|
||||
TString expr69, expr77;
|
||||
expr69 << "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==TPSALDO|TPAMM==2"; //seconda relazione su AMMCE (quella con i TPAMM=2)
|
||||
_rel->add(LF_AMMCE, expr69, 1, 0, 69); //69 é l'alias di AMMCE
|
||||
_rel->write_enable(-69); //abilita la scrittura su secondo AMMCE
|
||||
expr77 << "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==TPSALDO|TPAMM==3"; //terza relazione su AMMCE (quella con i TPAMM=3)
|
||||
_rel->add(LF_AMMCE, expr77, 1, 0, 77); //77 é l'alias di AMMCE
|
||||
_rel->write_enable(-77); //abilita la scrittura su terzo AMMCE
|
||||
_rel->add(LF_CESPI, "IDCESPITE==IDCESPITE"); //estende la relazione con CESPI
|
||||
_rel->add(LF_SALCE, "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==TPSALDO");
|
||||
memset(_msk, 0, sizeof(_msk));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSelect_ammoces::user_destroy()
|
||||
{
|
||||
for (int m = 3; m >= 0; m--)
|
||||
if (_msk[m]) delete _msk[m];
|
||||
delete _rel;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TSelect_ammoces::init_query_mode(TMask& m)
|
||||
@ -341,135 +602,183 @@ void TSelect_ammoces::init_query_mode(TMask& m)
|
||||
void TSelect_ammoces::init_mask(TMask& m)
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti(); //se il bollato dell'esercizio é stato stampato inibisce il REGISTRA
|
||||
const int ese = _msk[0]->get_int(F_ESERCIZIO); //prende i dati attivitá dalla maschera di selezione
|
||||
const int gru = _msk[0]->get_int(F_GRUPPO);
|
||||
const char* spe = _msk[0]->get(F_SPECIE);
|
||||
dc.set_attivita(ese, gru, spe);
|
||||
dc.init_mask(m);
|
||||
const bool can_edit = !dc.bollato_stampato() ;
|
||||
m.enable(DLG_SAVEREC, can_edit);
|
||||
const bool can_edit = !dc.bollato_stampato();
|
||||
m.enable(DLG_SAVEREC, can_edit); // inibisce la registrazione se bollato stampato
|
||||
m.enable(DLG_DELREC, can_edit);
|
||||
const TString16 idcespite = m.get(F_IDCESPITE);
|
||||
const TCespite ces (idcespite);
|
||||
|
||||
/* _smask->set_stato_attivita(_qmask->stato_attivita()); //copia lo stato attivitá della precedente
|
||||
|
||||
_qmask->calc_res(TRUE); //calcola residuo precedente (prec=TRUE)
|
||||
_smask->set_residuof_ini(_qmask->get_residuof()); //memorizza i residui precedenti nella maschera (non a video)
|
||||
_smask->set_residuoc_ini(_qmask->get_residuoc());
|
||||
TLocalisamfile catdi(LF_CATDI); //legge i valori dal file CATDI e li mette nei campi solo output delle msk
|
||||
catdi.put(CATDI_CODES, m.get_int(F_ESERCIZIO));
|
||||
catdi.put(CATDI_CODCGRA, m.get_int(F_GRUPPO));
|
||||
catdi.put(CATDI_CODSPA, m.get(F_SPECIE));
|
||||
catdi.put(CATDI_CODCAT, m.get_int(F_CATEGORIA));
|
||||
if (catdi.read() != NOERR)
|
||||
catdi.zero();
|
||||
const int annofunz = m.get_date(F_DTFUNZ).year(); //getta l'anno di entrata in funzione del cespite
|
||||
|
||||
_qmask->calc_res(FALSE); // ricalcola il residuo fiscale e civilistico in forzatura (prec=FALSE)
|
||||
_smask->set(F_RESIDUO_F, _qmask->get_residuof()); //prende il residuo fiscale (civilistico) del cespite calcolato
|
||||
_smask->set(F_RESIDUO_C, _qmask->get_residuoc()); //nella maschera di selezione e lo mette nella maschera di forzatura
|
||||
*/}
|
||||
|
||||
|
||||
void TSelect_ammoces::protect_fields(TMask& m, TToken_string& enabling) const
|
||||
{
|
||||
for (int f = m.fields()-1; f >= 0; f--)
|
||||
TLocalisamfile salce1(LF_SALCE);
|
||||
salce1.put(SALCE_IDCESPITE, m.get(F_IDCESPITE));
|
||||
salce1.put(SALCE_CODES, m.get_int(F_ESERCIZIO));
|
||||
salce1.put(SALCE_TPSALDO, 1);
|
||||
|
||||
switch (_tipo)
|
||||
{
|
||||
TMask_field& fld = m.fld(f);
|
||||
const short id = fld.dlg();
|
||||
if (id > 100 && id < 1000 && fld.is_editable() && fld.enabled_default())
|
||||
{
|
||||
const bool on = enabling.empty() || enabling.get_pos(fld.dlg()) >= 0;
|
||||
fld.enable(on);
|
||||
case 1: //immateriali
|
||||
if (ces.get_int(CESPI_VINCOLO) == 2) //Controllo tipo ammortamento da categoria
|
||||
{
|
||||
m.clear(F_ALIQMAX);
|
||||
m.clear(F_AMMFISC_CE);
|
||||
m.clear(F_AMMCIV_CE);
|
||||
m.set(F_ANNIAMMOREQ, ces.get_int(CESPI_ANNIRIC));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.set(F_ALIQMAX, ces.get_real(CESPI_PIMM));
|
||||
m.set(F_AMMFISC_CE, _rel->curr().get_real(AMMCE_PNOR));
|
||||
m.set(F_AMMCIV_CE, _rel->curr(-69).get_real(AMMCE_PNOR));
|
||||
m.clear(F_ANNIAMMOREQ);
|
||||
}
|
||||
|
||||
if (annofunz < 1988) //mette i valori di categoria nei campi solo output
|
||||
{
|
||||
m.set(F_AMMFISC_CT, catdi.get(CATDI_PFNORVN));
|
||||
m.set(F_AMMCIV_CT, catdi.get(CATDI_PCNORVN));
|
||||
}
|
||||
else if (annofunz == 1988)
|
||||
{
|
||||
m.set(F_AMMFISC_CT, catdi.get(CATDI_PFNORVT));
|
||||
m.set(F_AMMCIV_CT, catdi.get(CATDI_PCNORVT));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.set(F_AMMFISC_CT, catdi.get(CATDI_PFNORNT));
|
||||
m.set(F_AMMCIV_CT, catdi.get(CATDI_PCNORNT));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2: //pluriennali
|
||||
m.set(F_ENTROANNI, ces.categoria().get("I3")); //scrive sulla maschera il numero di anni per l'ammortamento
|
||||
|
||||
if (annofunz < 1988) //mette i valori di categoria nei campi solo output
|
||||
{
|
||||
m.set(F_AMMFISC_CT, catdi.get(CATDI_PFNORVN));
|
||||
m.set(F_AMMCIV_CT, catdi.get(CATDI_PCNORVN));
|
||||
}
|
||||
else if (annofunz == 1988)
|
||||
{
|
||||
m.set(F_AMMFISC_CT, catdi.get(CATDI_PFNORVT));
|
||||
m.set(F_AMMCIV_CT, catdi.get(CATDI_PCNORVT));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.set(F_AMMFISC_CT, catdi.get(CATDI_PFNORNT));
|
||||
m.set(F_AMMCIV_CT, catdi.get(CATDI_PCNORNT));
|
||||
}
|
||||
|
||||
if (ces.get_int(CESPI_VINCOLO) == 3) //se il cespite é a quote costanti...
|
||||
{
|
||||
if (salce1.read() == NOERR)
|
||||
{
|
||||
if (salce1.get_int(SALCE_ANNIAMM) != 0) //controlla la modificabilitá delle scelte dopo il primo anno
|
||||
{
|
||||
m.disable(DLG_SAVEREC);
|
||||
error_box("Ammortamento in quote costanti:\nimpossibile modificare le scelte dopo il primo esercizio di ammortamento");
|
||||
}
|
||||
else
|
||||
{
|
||||
m.disable(F_AMMFISC_CE);
|
||||
m.disable(F_AMMCIV_CE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m.get_int(F_ENTROANNI) <= m.get_int(F_NUMESERAMM))
|
||||
{
|
||||
m.disable(DLG_SAVEREC);
|
||||
error_box("Impossibile proseguire:\nammortamento oltre il limite di anni della Tabella");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default: //materiali
|
||||
{
|
||||
_aliqmax = ces.get_real(CESPI_PMAT); // calcola i valori predefiniti delle aliquote limite per cespiti materiali
|
||||
_aliqmin = _aliqmax * 0.5;
|
||||
if (salce1.read() == NOERR)
|
||||
{
|
||||
if (ces.get_bool(CESPI_USATO) == FALSE)
|
||||
{
|
||||
if (salce1.get_int(SALCE_ANNIAMM) <= 2)
|
||||
{
|
||||
if (ces.get_bool(CESPI_TUIR) == TRUE)
|
||||
_aliqant = _aliqmax;
|
||||
else
|
||||
_aliqant = 15.0;
|
||||
}
|
||||
else
|
||||
_aliqant = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (salce1.get_int(SALCE_ANNIAMM) != 0)
|
||||
_aliqant = 0.0;
|
||||
else
|
||||
_aliqant = _aliqmax;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m.set(F_NORMIN, _aliqmin);
|
||||
m.set(F_NORMAX, _aliqmax);
|
||||
m.set(F_ANTMIN, _aliqant);
|
||||
|
||||
if (annofunz < 1988) //mette i valori di categoria nei campi solo output
|
||||
{
|
||||
m.set(F_AMMFISC_NOR_CT, catdi.get(CATDI_PFNORVN));
|
||||
m.set(F_AMMFISC_ANT_CT, catdi.get(CATDI_PFANTVN));
|
||||
m.set(F_AMMCIV_NOR_CT, catdi.get(CATDI_PCNORVN));
|
||||
m.set(F_AMMCIV_ANT_CT, catdi.get(CATDI_PCANTVN));
|
||||
}
|
||||
else if (annofunz == 1988)
|
||||
{
|
||||
m.set(F_AMMFISC_NOR_CT, catdi.get(CATDI_PFNORVT));
|
||||
m.set(F_AMMFISC_ANT_CT, catdi.get(CATDI_PFANTVT));
|
||||
m.set(F_AMMCIV_NOR_CT, catdi.get(CATDI_PCNORVT));
|
||||
m.set(F_AMMCIV_ANT_CT, catdi.get(CATDI_PCANTVT));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.set(F_AMMFISC_NOR_CT, catdi.get(CATDI_PFNORNT));
|
||||
m.set(F_AMMFISC_ANT_CT, catdi.get(CATDI_PFANTNT));
|
||||
m.set(F_AMMCIV_NOR_CT, catdi.get(CATDI_PCNORNT));
|
||||
m.set(F_AMMCIV_ANT_CT, catdi.get(CATDI_PCANTNT));
|
||||
}
|
||||
|
||||
m.set(F_AMMFISC_ACC_CT, catdi.get(CATDI_PFACC));
|
||||
m.set(F_AMMCIV_ACC_CT, catdi.get(CATDI_PCACC));
|
||||
m.set(F_AMMRIT_CT, catdi.get(CATDI_AMMRIT));
|
||||
m.set(F_AMM100_CT, catdi.get(CATDI_CSCEN));
|
||||
break;
|
||||
} //chiude lo switch
|
||||
|
||||
|
||||
}
|
||||
|
||||
void TSelect_ammoces::init_insert_mode(TMask& m)
|
||||
{
|
||||
init_mask(m);
|
||||
}
|
||||
|
||||
void TSelect_ammoces::init_modify_mode(TMask& m)
|
||||
{
|
||||
init_mask(m);
|
||||
|
||||
/* const bool accendiforzatura=_smask->stato_attivita()!=1;
|
||||
m.enable(F_FORZATURA_Q_F, accendiforzatura); //abilita i checks della forzatura quando il bollato NON é stampato
|
||||
m.enable(F_FORZATURA_P_F, accendiforzatura);
|
||||
m.enable(F_FORZATURA_Q_C, accendiforzatura);
|
||||
m.enable(F_FORZATURA_P_C, accendiforzatura);
|
||||
|
||||
if (accendiforzatura) //se lo stato attivitá lascia liberi di forzare, controlla se il tipocespite fa altrettanto...
|
||||
{
|
||||
TCespite ces(m.get(F_IDCESPITE));
|
||||
const TRectype& cac = ces.categoria();
|
||||
switch (ces.tipo())
|
||||
{
|
||||
case tc_immateriale:
|
||||
if (cac.get_int("I1")!=0)
|
||||
{
|
||||
m.disable(F_FORZATURA_P_F);
|
||||
m.disable(F_FORZATURA_P_C);
|
||||
}
|
||||
break;
|
||||
|
||||
case tc_pluriennale:
|
||||
if (cac.get_int("I2")==3)
|
||||
{
|
||||
m.disable(F_FORZATURA_P_F);
|
||||
m.disable(F_FORZATURA_P_C);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// aggiornamento della colonna dei valori risultanti
|
||||
m.set(F_RIS_AMMNOR_F, m.get_real(F_AMMNOR_F));
|
||||
m.set(F_RIS_AMMACC_F, m.get_real(F_AMMACC_F));
|
||||
m.set(F_RIS_AMMANT_F, m.get_real(F_AMMANT_F));
|
||||
m.set(F_RIS_QUOTE_PERSE, m.get_real(F_QUOTE_PERSE));
|
||||
m.set(F_RIS_PRIVATO, m.get_real(F_PRIVATO));
|
||||
m.set(F_RIS_QUOTE_PRIV, m.get_real(F_QUOTE_PRIV));
|
||||
|
||||
m.set(F_RIS_AMMNOR_C, m.get_real(F_AMMNOR_C));
|
||||
m.set(F_RIS_AMMACC_C, m.get_real(F_AMMACC_C));
|
||||
m.set(F_RIS_AMMANT_C, m.get_real(F_AMMANT_C)); */
|
||||
}
|
||||
|
||||
// funzione per il ricalcolo degli ammortamenti dopo la forzatura
|
||||
void TSelect_ammoces::update_amm(const TMask& m)
|
||||
{
|
||||
TCespite ces(m.get(F_IDCESPITE));
|
||||
TDate fine_es = m.get_date(F_FINE_ES);
|
||||
ces.calc_amm(1, FALSE, fine_es);
|
||||
ces.calc_amm(2, FALSE, fine_es);
|
||||
}
|
||||
|
||||
|
||||
//funzione per il ricalcolo automatico dei valori degli ammortamenti dopo la forzatura (in caso di prima forzatura)
|
||||
int TSelect_ammoces::write(const TMask& m)
|
||||
{
|
||||
int err = TRelation_application::write(m);
|
||||
if (err==NOERR)
|
||||
update_amm(m);
|
||||
return err;
|
||||
}
|
||||
|
||||
//funzione per il ricalcolo automatico dei valori degli ammortamenti dopo la forzatura
|
||||
int TSelect_ammoces::rewrite(const TMask& m)
|
||||
{
|
||||
int err = TRelation_application::rewrite(m);
|
||||
if (err==NOERR)
|
||||
update_amm(m);
|
||||
return err;
|
||||
}
|
||||
|
||||
bool TSelect_ammoces::user_create()
|
||||
{
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CESPI, LF_SALCE, LF_AMMCE, 0);
|
||||
_ammce = new TRelation (LF_AMMCE); // relazione principale su AMMCE
|
||||
TString expr;
|
||||
expr << "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==TPSALDO|TPAMM==2"; //seconda relazione su AMMCE
|
||||
_ammce->add(LF_AMMCE, expr, 1, 0, 69); //69 é l'alias di AMMCE
|
||||
_ammce->write_enable(-69); //abilita la scrittura su secondo AMMCE
|
||||
_ammce->add(LF_CESPI, "IDCESPITE==IDCESPITE"); //estende la relazione con CESPI
|
||||
|
||||
_qmask = new TSelect_ammoces_qmask;
|
||||
// _smask = new TForce_mask;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSelect_ammoces::user_destroy()
|
||||
{
|
||||
// delete _smask;
|
||||
delete _qmask;
|
||||
delete _ammce;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int ce1300(int argc, char* argv[])
|
||||
|
||||
45
ce/ce1301a.h
45
ce/ce1301a.h
@ -20,4 +20,47 @@
|
||||
#define F_DESC 121
|
||||
#define F_IDCESPITE_I 122
|
||||
#define F_DESC_I 123
|
||||
|
||||
|
||||
#define F_SITUAZIONE 200
|
||||
#define F_CATEGORIA 201
|
||||
#define F_DESC_CAT 202
|
||||
#define F_DTFUNZ 203
|
||||
#define F_NUMESERAMM 204
|
||||
#define F_NORMIN 205
|
||||
#define F_ANTMIN 206
|
||||
#define F_NORMAX 207
|
||||
#define F_SCELTA 208
|
||||
#define F_SCELTA2 209
|
||||
#define F_SCELTA3 210
|
||||
|
||||
#define F_AMMFISC_NOR_CT 230
|
||||
#define F_AMMFISC_ACC_CT 231
|
||||
#define F_AMMFISC_ANT_CT 232
|
||||
#define F_AMMCIV_NOR_CT 233
|
||||
#define F_AMMCIV_ACC_CT 234
|
||||
#define F_AMMCIV_ANT_CT 235
|
||||
#define F_AMMRIT_CT 236
|
||||
#define F_AMM100_CT 237
|
||||
|
||||
#define F_AMMFISC_NOR_CE 240
|
||||
#define F_AMMFISC_ACC_CE 241
|
||||
#define F_AMMFISC_ANT_CE 242
|
||||
#define F_AMMCIV_NOR_CE 243
|
||||
#define F_AMMCIV_ACC_CE 244
|
||||
#define F_AMMCIV_ANT_CE 245
|
||||
#define F_AMMRIT_CE 246
|
||||
#define F_AMMRIT_CE2 247
|
||||
#define F_AMMRIT_CE3 248
|
||||
#define F_AMM100_CE 249
|
||||
#define F_AMM1002_CE 250
|
||||
#define F_AMM1003_CE 251
|
||||
|
||||
#define F_ALIQMAX 301
|
||||
#define F_AMMFISC_CT 302
|
||||
#define F_AMMFISC_CE 303
|
||||
#define F_AMMCIV_CT 304
|
||||
#define F_AMMCIV_CE 305
|
||||
#define F_ANNIAMMOREQ 306
|
||||
|
||||
#define F_ALIQMIN 401
|
||||
#define F_ENTROANNI 402
|
||||
@ -174,7 +174,6 @@ BEGIN
|
||||
DISPLAY "Data Ali.@10" DTALIEN
|
||||
COPY OUTPUT F_IDCESPITE
|
||||
CHECKTYPE REQUIRED
|
||||
FIELD DESC
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
@ -203,7 +202,6 @@ BEGIN
|
||||
COPY OUTPUT F_IDCESPITE_I
|
||||
CHECKTYPE REQUIRED
|
||||
MESSAGE COPY,F_DESC
|
||||
FIELD DESC
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
@ -211,7 +209,7 @@ LIST DLG_NULL 1
|
||||
BEGIN
|
||||
PROMPT 1 90 ""
|
||||
FLAGS "D"
|
||||
ITEM "2|2"
|
||||
ITEM "1|1"
|
||||
FIELD TPSALDO
|
||||
KEY 1
|
||||
END
|
||||
|
||||
@ -194,14 +194,28 @@ BEGIN
|
||||
FLAGS "Z"
|
||||
PROMPT 15 9 ""
|
||||
ITEM "0|Tab. Ministeriale"
|
||||
MESSAGE DISABLE,1@
|
||||
MESSAGE DISABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA3
|
||||
ITEM "1|Cespite"
|
||||
MESSAGE ENABLE,1@
|
||||
MESSAGE ENABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA3
|
||||
ITEM "2|Categoria"
|
||||
MESSAGE DISABLE,1@
|
||||
MESSAGE DISABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA3
|
||||
FIELD SCELTE
|
||||
END
|
||||
|
||||
NUMBER F_SCELTA2 1
|
||||
BEGIN
|
||||
PROMPT 15 100 ""
|
||||
FLAGS "D"
|
||||
FIELD 69@->SCELTE
|
||||
END
|
||||
|
||||
NUMBER F_SCELTA3 1
|
||||
BEGIN
|
||||
PROMPT 15 100 ""
|
||||
FLAGS "D"
|
||||
FIELD 77@->SCELTE
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 0 11 "@bScelta su categoria"
|
||||
@ -311,7 +325,7 @@ BEGIN
|
||||
PROMPT 67 18 ""
|
||||
FLAGS "U"
|
||||
FIELD PANT
|
||||
NUM_EXPR (#THIS_FIELD>=#F_ANTMIN)&&(#THIS_FIELD<=100)
|
||||
NUM_EXPR (#THIS_FIELD<=#F_ANTMIN)&&(#THIS_FIELD<=100)
|
||||
WARNING "L'ammortamento fiscale anticipato scelto supera il limite ministeriale"
|
||||
END
|
||||
|
||||
@ -345,7 +359,7 @@ BEGIN
|
||||
PROMPT 67 19 ""
|
||||
FLAGS "U"
|
||||
FIELD 69@->PANT
|
||||
NUM_EXPR (#THIS_FIELD>=#F_ANTMIN)&&(#THIS_FIELD<=100)
|
||||
NUM_EXPR (#THIS_FIELD<=#F_ANTMIN)&&(#THIS_FIELD<=100)
|
||||
WARNING "L'ammortamento civilistico anticipato scelto supera il limite ministeriale"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
@ -156,19 +156,33 @@ BEGIN
|
||||
PROMPT 1 11 "Tipo Scelta"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_SCELTA 1 72
|
||||
RADIOBUTTON F_SCELTA 1 70
|
||||
BEGIN
|
||||
FLAGS "Z"
|
||||
PROMPT 15 10 ""
|
||||
ITEM "0|Tab. Ministeriale"
|
||||
MESSAGE DISABLE,1@
|
||||
MESSAGE DISABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA2
|
||||
ITEM "1|Cespite"
|
||||
MESSAGE ENABLE,1@
|
||||
MESSAGE ENABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA2
|
||||
ITEM "2|Categoria"
|
||||
MESSAGE DISABLE,1@
|
||||
MESSAGE DISABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA2
|
||||
FIELD SCELTE
|
||||
END
|
||||
|
||||
NUMBER F_SCELTA2 1
|
||||
BEGIN
|
||||
PROMPT 15 100 ""
|
||||
FLAGS "D"
|
||||
FIELD 69@->SCELTE
|
||||
END
|
||||
|
||||
NUMBER F_SCELTA3 1
|
||||
BEGIN
|
||||
PROMPT 15 100 ""
|
||||
FLAGS "D"
|
||||
FIELD 77@->SCELTE
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 0 13 "@bTabelle ministeriali"
|
||||
|
||||
@ -161,14 +161,28 @@ BEGIN
|
||||
FLAGS "Z"
|
||||
PROMPT 15 10 ""
|
||||
ITEM "0|Tab. Ministeriale"
|
||||
MESSAGE DISABLE,1@
|
||||
MESSAGE DISABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA3
|
||||
ITEM "1|Cespite"
|
||||
MESSAGE ENABLE,1@
|
||||
MESSAGE ENABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA3
|
||||
ITEM "2|Categoria"
|
||||
MESSAGE DISABLE,1@
|
||||
MESSAGE DISABLE,1@|COPY,F_SCELTA2|COPY,F_SCELTA3
|
||||
FIELD SCELTE
|
||||
END
|
||||
|
||||
NUMBER F_SCELTA2 1
|
||||
BEGIN
|
||||
PROMPT 15 100 ""
|
||||
FLAGS "D"
|
||||
FIELD 69@->SCELTE
|
||||
END
|
||||
|
||||
NUMBER F_SCELTA3 1
|
||||
BEGIN
|
||||
PROMPT 15 100 ""
|
||||
FLAGS "D"
|
||||
FIELD 77@->SCELTE
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 5
|
||||
BEGIN
|
||||
PROMPT 0 12 "@bTabelle ministeriali"
|
||||
@ -252,14 +266,7 @@ END
|
||||
NUMBER F_ANNIAMMOREQ 8
|
||||
BEGIN
|
||||
PROMPT 65 20 ""
|
||||
FIELD AMMRIC
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER F_ANNIAMMOREQ2 8
|
||||
BEGIN
|
||||
PROMPT 65 20 ""
|
||||
FIELD 69@->AMMRIC
|
||||
FIELD LF_CESPI->ANNIRIC
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
|
||||
@ -76,7 +76,9 @@ bool TSac_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
bool ok = dc.on_category_event(o, e, jolly);
|
||||
if (!ok)
|
||||
if (ok)
|
||||
set(F_CATEGORIA2, get(F_CATEGORIA));
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
case F_CATEGORIA2:
|
||||
@ -86,7 +88,7 @@ bool TSac_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
const int gr = get_int(F_GRUPPO);
|
||||
const char* sp = get(F_SPECIE);
|
||||
const int ca = get_int(F_CATEGORIA);
|
||||
const int ca = get_int(F_CATEGORIA2);
|
||||
const TRectype& cac = dc.categoria(gr, sp, ca);
|
||||
bool ok = !cac.empty();
|
||||
if (ok && (o.dlg() == F_CATEGORIA || o.dlg() == F_CATEGORIA2))
|
||||
@ -120,7 +122,7 @@ bool TSac_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ok && o.dlg() == F_CATEGORIA2)
|
||||
if (!ok && !o.empty() && o.dlg() == F_CATEGORIA2)
|
||||
return error_box("E' neccessario specificare una categoria valida");
|
||||
if (ok && e == fe_button && o.dlg() == F_CATEGORIA)
|
||||
send_key(K_ENTER, 0);
|
||||
@ -311,7 +313,7 @@ public:
|
||||
bool TPlu_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch (o.dlg())
|
||||
{
|
||||
{
|
||||
case F_CATEGORIA:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
@ -352,6 +354,7 @@ TMask* TScelta_amm_cat::get_mask(int mode)
|
||||
default:
|
||||
if (_msk[1] == NULL)
|
||||
_msk[1] = new TMat_mask;
|
||||
_tipo = 0;
|
||||
break;
|
||||
}
|
||||
m = _msk[_tipo+1];
|
||||
@ -415,9 +418,10 @@ void TScelta_amm_cat::init_mask(TMask& m)
|
||||
const int ese = _msk[0]->get_int(F_ESERCIZIO);
|
||||
const int gru = _msk[0]->get_int(F_GRUPPO);
|
||||
const char* spe = _msk[0]->get(F_SPECIE);
|
||||
const int cat = _msk[0]->get_int(F_CATEGORIA);
|
||||
const int cat = _msk[0]->get_int(F_CATEGORIA2);
|
||||
dc.set_attivita(ese, gru, spe);
|
||||
dc.init_mask(m);
|
||||
m.set(F_CATEGORIA, cat);
|
||||
|
||||
const TRectype& cac = dc.categoria(gru, spe, cat);
|
||||
switch (_tipo)
|
||||
@ -446,6 +450,11 @@ void TScelta_amm_cat::init_mask(TMask& m)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
const bool can_edit = !dc.bollato_stampato();
|
||||
m.enable(DLG_SAVEREC, can_edit);
|
||||
m.enable(DLG_NEWREC, can_edit);
|
||||
m.enable(DLG_DELREC, can_edit);
|
||||
}
|
||||
|
||||
void TScelta_amm_cat::init_insert_mode(TMask& m)
|
||||
|
||||
@ -32,7 +32,7 @@ END
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 1 3 "Esercizio "
|
||||
FLAGS "AZD"
|
||||
FLAGS "DGZ"
|
||||
USE ESC
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
|
||||
@ -32,7 +32,7 @@ END
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 1 3 "Esercizio "
|
||||
FLAGS "DZ"
|
||||
FLAGS "DGZ"
|
||||
USE ESC
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
@ -161,6 +161,7 @@ BEGIN
|
||||
PROMPT 32 14 ""
|
||||
NUM_EXPR #THIS_FIELD<=#F_MAX_AMM
|
||||
WARNING "La quota di ammortamento supera il limite della tabella ministeriale"
|
||||
FIELD PFNORVN
|
||||
END
|
||||
|
||||
NUMBER F_NORCIV 6 2
|
||||
@ -168,6 +169,7 @@ BEGIN
|
||||
PROMPT 56 14 ""
|
||||
FLAGS "U"
|
||||
NUM_EXPR #THIS_FIELD<=100
|
||||
FIELD PCNORVN
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
@ -32,7 +32,7 @@ END
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 1 3 "Esercizio "
|
||||
FLAGS "DZ"
|
||||
FLAGS "DGZ"
|
||||
USE ESC
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
@ -168,6 +168,7 @@ BEGIN
|
||||
PROMPT 32 15 ""
|
||||
NUM_EXPR (#THIS_FIELD>=#F_MIN_AMM)&&(#THIS_FIELD<=#F_MAX_AMM)
|
||||
WARNING "La quota di ammortamento deve essere compresa tra i limiti della tabella ministeriale"
|
||||
FIELD PFNORVN
|
||||
END
|
||||
|
||||
NUMBER F_NORCIV 6 2
|
||||
@ -175,6 +176,7 @@ BEGIN
|
||||
PROMPT 56 15 ""
|
||||
FLAGS "U"
|
||||
NUM_EXPR #THIS_FIELD<=100
|
||||
FIELD PCNORVN
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
498
ce/ce1500.cpp
498
ce/ce1500.cpp
@ -35,16 +35,17 @@ class TMovicespi : public TRelation_application
|
||||
TMov_qmask* _qmask;
|
||||
TMov_emask* _emask;
|
||||
TFilename _prima_nota;
|
||||
int _cg_line;
|
||||
|
||||
private:
|
||||
void kill_mov(const TString& idcespite, const TString& idmov, int lfile);
|
||||
void kill_rett(const TString& id, const TString& idmov);
|
||||
|
||||
void set_prompt(TMask_field& fld, bool plus);
|
||||
void show_plus_minus(TMask& m);
|
||||
|
||||
protected:
|
||||
virtual bool changing_mask(int mode) { return TRUE; }
|
||||
virtual TMask* get_mask(int mode);
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
virtual const char* get_next_key();
|
||||
virtual bool protected_record(TRelation &r);
|
||||
virtual bool user_create();
|
||||
@ -52,16 +53,18 @@ protected:
|
||||
virtual void init_query_mode(TMask& m);
|
||||
virtual void init_insert_mode(TMask& m);
|
||||
virtual void init_modify_mode(TMask& m);
|
||||
|
||||
virtual int write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
virtual bool remove();
|
||||
|
||||
public:
|
||||
int tipo_cr(int gruppo, int conto, long sottoconto) const;
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
|
||||
void calc_residuo(long numreg);
|
||||
void cg_mode();
|
||||
bool select_mov(long numreg, TString& idmov) const;
|
||||
int init_mask(TMask& m);
|
||||
|
||||
void save_if_dirty() { save(TRUE); }
|
||||
void save_if_dirty();
|
||||
};
|
||||
|
||||
TMovicespi& app() { return (TMovicespi&)main_app(); }
|
||||
@ -76,7 +79,9 @@ class TMov_qmask : public TAutomask
|
||||
int _staat;
|
||||
|
||||
protected:
|
||||
virtual bool can_be_closed() const;
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
virtual void on_firm_change();
|
||||
int calcola_stato_attivita();
|
||||
|
||||
public:
|
||||
@ -144,12 +149,45 @@ bool TMov_qmask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
m.browse()->set_filter(filter);
|
||||
}
|
||||
break;
|
||||
case F_NUMREG:
|
||||
if (e == fe_modify)
|
||||
{
|
||||
TEdit_field& m = efield(F_IDMOV);
|
||||
if (!m.empty())
|
||||
m.on_key(K_TAB);
|
||||
}
|
||||
break;
|
||||
case F_CGROWS:
|
||||
if (e == se_query_add || e == se_query_del)
|
||||
return FALSE;
|
||||
break;
|
||||
case DLG_QUIT:
|
||||
if (e == fe_button)
|
||||
{
|
||||
TMask_field& f = efield(F_TOTRES);
|
||||
if (f.shown() && !f.empty())
|
||||
return yesno_box("Attenzione: la registrazione contabile non è ancora del tutto evasa:\n"
|
||||
"Si desidera uscire ugualmente?");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TMov_qmask::can_be_closed() const
|
||||
{
|
||||
TButton_field& f = (TButton_field&)field(DLG_QUIT);
|
||||
return ((TMov_qmask*)this)->on_field_event(f, fe_button, 0);
|
||||
}
|
||||
|
||||
void TMov_qmask::on_firm_change()
|
||||
{
|
||||
TAutomask::on_firm_change();
|
||||
ditta_cespiti().init_mask(*this);
|
||||
}
|
||||
|
||||
TMov_qmask::TMov_qmask() : TAutomask("ce1500a")
|
||||
{
|
||||
first_focus(F_IDMOV);
|
||||
@ -172,10 +210,12 @@ private:
|
||||
void set_fondi_inputability();
|
||||
|
||||
real calc_riv(const TRectype& salpro, int tipo) const;
|
||||
void calc_amm(int tipo);
|
||||
bool calc_amm(int tipo);
|
||||
void calc_plus_minus(int tipo, real& plus, real& minus) const;
|
||||
|
||||
bool cespite_nuovo() const;
|
||||
TCurrency sum_fields(const short* f) const;
|
||||
void super_polish();
|
||||
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
@ -183,6 +223,8 @@ protected:
|
||||
|
||||
public:
|
||||
void set_stato_attivita(int s) { _staat = s; }
|
||||
void recalc_amm();
|
||||
|
||||
TMov_emask();
|
||||
};
|
||||
|
||||
@ -208,6 +250,16 @@ TCurrency TMov_emask::sum_fields(const short* f) const
|
||||
return sum;
|
||||
}
|
||||
|
||||
// Toglie tutti i dirty
|
||||
void TMov_emask::super_polish()
|
||||
{
|
||||
for (int f = fields()-1; f >= 0; f--)
|
||||
{
|
||||
TMask_field& c = fld(f);
|
||||
c.set_dirty(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void TMov_emask::set_inputability(short id, char flag)
|
||||
{
|
||||
TMask_field& f = field(id);
|
||||
@ -458,7 +510,7 @@ bool TMov_emask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
}
|
||||
break;
|
||||
case S_TIPO:
|
||||
if (e == fe_modify)
|
||||
if (e == fe_init || e == fe_modify)
|
||||
calc_amm(atoi(o.get()));
|
||||
break;
|
||||
default:
|
||||
@ -473,17 +525,53 @@ real TMov_emask::calc_riv(const TRectype& salpro, int tipo) const
|
||||
real riv;
|
||||
for (int i = 0; riv_ids[i]; i++)
|
||||
riv += salpro.get_real(riv_ids[i]);
|
||||
if (tipo == 1)
|
||||
riv += salpro.get_real(SALCE_RIVGF);
|
||||
if (tipo == 2)
|
||||
riv += salpro.get_real(SALCE_RIVGC);
|
||||
else
|
||||
riv += salpro.get_real(SALCE_RIVGF);
|
||||
return riv;
|
||||
}
|
||||
|
||||
void TMov_emask::calc_amm(int tipo)
|
||||
}
|
||||
|
||||
void TMov_emask::calc_plus_minus(int tipo, real& plus, real& minus) const
|
||||
{
|
||||
TDitta_cespiti& cce = ditta_cespiti();
|
||||
TDate inies, fines;
|
||||
const int esercizio = cce.esercizio_corrente(inies, fines);
|
||||
const TDate dtlim = get(F_DTMOV);
|
||||
_cespite.calc_amm(tipo, FALSE, dtlim);
|
||||
|
||||
TRelation rel(LF_MOVCE);
|
||||
TString expr; expr << "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==\"" << tipo << '"';
|
||||
rel.add(LF_AMMMV, expr);
|
||||
|
||||
TRectype& movsem = rel.curr();
|
||||
TRectype& ammmv = rel.curr(LF_AMMMV);
|
||||
const TString idcespite = get(F_IDCESPITE);
|
||||
movsem.put(MOVCE_IDCESPITE, idcespite);
|
||||
TString filtro;
|
||||
filtro << "(ANSI(DTMOV)>=\"" << inies.string(ANSI) << "\")";
|
||||
filtro << "&&(ANSI(DTMOV)<=\"" << dtlim.string(ANSI) << "\")";
|
||||
TCursor cur(&rel, filtro, 2, &movsem, &movsem);
|
||||
const long items = cur.items();
|
||||
plus = minus = ZERO;
|
||||
if (items > 0) // Continua solo se esistono movimenti
|
||||
{
|
||||
cur.freeze();
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
plus += ammmv.get_real(AMMMV_PLUS);
|
||||
minus += ammmv.get_real(AMMMV_MINUS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TMov_emask::calc_amm(int tipo)
|
||||
{
|
||||
const TString& idcespite = _cespite.get(CESPI_IDCESPITE);
|
||||
if (idcespite.empty())
|
||||
return FALSE;
|
||||
|
||||
const TDate dtlim = get(F_DTMOV);
|
||||
_cespite.calc_amm(tipo, dtlim);
|
||||
set(S_DATAMOV, dtlim);
|
||||
|
||||
const TRectype& s = _cespite.sal_pro();
|
||||
@ -498,12 +586,12 @@ void TMov_emask::calc_amm(int tipo)
|
||||
set(S_TOTVAL, tot_val);
|
||||
|
||||
const TRectype& a = _cespite.amm_pro();
|
||||
set(S_NORMALE, a.get(AMMCE_QNOR));
|
||||
set(S_ACCELERATO, a.get(AMMCE_QACC));
|
||||
set(S_ANTICIPATO, a.get(AMMCE_QANT));
|
||||
set(S_QPERSE, a.get(AMMCE_QPERSE));
|
||||
set(S_FPRIVATO, a.get(AMMCE_FPRIVATO));
|
||||
set(S_QPERSEP, a.get(AMMCE_QPERSEP));
|
||||
set(S_NORMALE, a.get(AMMCE_QNORP));
|
||||
set(S_ACCELERATO, a.get(AMMCE_QACCP));
|
||||
set(S_ANTICIPATO, a.get(AMMCE_QANTP));
|
||||
set(S_QPERSE, a.get(AMMCE_QPERSEP));
|
||||
set(S_FPRIVATO, a.get(AMMCE_FPRIVATOP));
|
||||
set(S_QPERSEP, a.get(AMMCE_QPPRIVATEP));
|
||||
real tot_fon;
|
||||
tot_fon += get_real(S_NORMALE); tot_fon += get_real(S_ACCELERATO);
|
||||
tot_fon += get_real(S_ANTICIPATO); tot_fon += get_real(S_QPERSE);
|
||||
@ -513,11 +601,12 @@ void TMov_emask::calc_amm(int tipo)
|
||||
const real tot_res = tot_val-tot_fon;
|
||||
set(S_RESIDUO, tot_res);
|
||||
|
||||
TString key;
|
||||
key << get(F_IDCESPITE) << '|' << get(F_IDMOV) << '|' << tipo;
|
||||
const TRectype& ammmv = cache().get(LF_AMMMV, key);
|
||||
set(S_PLUS, ammmv.get(AMMMV_PLUS));
|
||||
set(S_MINUS, ammmv.get(AMMMV_MINUS));
|
||||
real plus, minus;
|
||||
calc_plus_minus(tipo, plus, minus);
|
||||
set(S_PLUS, plus);
|
||||
set(S_MINUS, minus);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TMov_emask::set_fondi_inputability()
|
||||
@ -543,6 +632,13 @@ void TMov_emask::set_fondi_inputability()
|
||||
}
|
||||
}
|
||||
|
||||
void TMov_emask::recalc_amm()
|
||||
{
|
||||
const TDate dtlim = get(F_FINE_ES);
|
||||
for (int tipo = 1; tipo <= 3; tipo++)
|
||||
_cespite.calc_amm(tipo, dtlim);
|
||||
}
|
||||
|
||||
bool TMov_emask::on_key(KEY k)
|
||||
{
|
||||
// Try to predict next page!
|
||||
@ -560,24 +656,33 @@ bool TMov_emask::on_key(KEY k)
|
||||
}
|
||||
|
||||
// If page will change ...
|
||||
if (old_page != new_page) switch(new_page)
|
||||
if (old_page != new_page)
|
||||
{
|
||||
case 3:
|
||||
set_fondi_inputability();
|
||||
break;
|
||||
case 4:
|
||||
if (dirty() < S_TIPO)
|
||||
switch(new_page)
|
||||
{
|
||||
app().save_if_dirty();
|
||||
for (int f = fields()-1; f >= 0; f--)
|
||||
case 3:
|
||||
set_fondi_inputability();
|
||||
break;
|
||||
case 4:
|
||||
if (dirty() < S_TIPO)
|
||||
{
|
||||
TMask_field& c = fld(f);
|
||||
c.set_dirty(FALSE);
|
||||
app().save_if_dirty();
|
||||
super_polish();
|
||||
}
|
||||
set(S_TIPO, 1, TRUE);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
if (old_page == 4)
|
||||
{
|
||||
recalc_amm();
|
||||
TRelation& rel = *app().get_relation();
|
||||
if (rel.read() == NOERR)
|
||||
{
|
||||
autoload(rel);
|
||||
super_polish();
|
||||
}
|
||||
}
|
||||
set(S_TIPO, 1, TRUE);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return TAutomask::on_key(k);
|
||||
}
|
||||
@ -597,7 +702,8 @@ TMask* TMovicespi::get_mask(int mode)
|
||||
|
||||
bool TMovicespi::user_create()
|
||||
{
|
||||
open_files(LF_TAB, LF_TABCOM, LF_CESPI, LF_AMMCE, LF_SALCE, LF_MOVCE, LF_MOVAM, LF_AMMMV, 0);
|
||||
open_files(LF_TAB, LF_TABCOM, LF_PCON, LF_CLIFO, 0);
|
||||
open_files(LF_CESPI, LF_AMMCE, LF_SALCE, LF_MOVCE, LF_MOVAM, LF_AMMMV, 0);
|
||||
|
||||
_rel = new TRelation(LF_MOVCE);
|
||||
_rel->add(LF_MOVAM, "IDCESPITE==IDCESPITE|IDMOV==IDMOV|TPAMM==1");
|
||||
@ -613,12 +719,10 @@ bool TMovicespi::user_create()
|
||||
{
|
||||
_prima_nota = argv(2);
|
||||
_prima_nota.ltrim(2);
|
||||
_cg_line = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_prima_nota.cut(0);
|
||||
_cg_line = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -635,7 +739,7 @@ bool TMovicespi::user_destroy()
|
||||
const char* TMovicespi::get_next_key()
|
||||
{
|
||||
real num = 1;
|
||||
TLocalisamfile& cespi = _rel->lfile(LF_MOVCE);
|
||||
TLocalisamfile cespi(LF_MOVCE);
|
||||
if (cespi.last() == NOERR)
|
||||
num = cespi.get_real(MOVCE_IDMOV) + 1;
|
||||
return format("%d|%s", F_IDMOV, num.string());
|
||||
@ -647,105 +751,179 @@ bool TMovicespi::protected_record(TRelation &r)
|
||||
return stampato;
|
||||
}
|
||||
|
||||
int TMovicespi::tipo_cr(int gruppo, int conto, long sottoconto) const
|
||||
{
|
||||
TString16 str;
|
||||
str.format("%d|%d|%ld", gruppo, conto, sottoconto);
|
||||
const TRectype& pcon = cache().get(LF_PCON, str);
|
||||
const int t = pcon.get_int(PCN_TIPOSPRIC);
|
||||
return t;
|
||||
}
|
||||
void TMovicespi::calc_residuo(long numreg)
|
||||
{
|
||||
TSheet_field& s = _qmask->sfield(F_CGROWS);
|
||||
|
||||
// Mette tutti i residui uguali importi
|
||||
real tot_imp = ZERO;
|
||||
for (int r = s.items()-1; r >= 0; r--)
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
real imp = row.get(0);
|
||||
row.add(imp.string(), 1);
|
||||
tot_imp += imp;
|
||||
}
|
||||
real tot_res = tot_imp;
|
||||
|
||||
bool TMovicespi::select_mov(long numreg, TString& idmov) const
|
||||
{
|
||||
TRelation rel(LF_MOVCE);
|
||||
TString filter; filter << MOV_NUMREG << "==" << numreg;
|
||||
TCursor cur(&rel, filter, 3);
|
||||
long items = cur.items();
|
||||
if (items == 0L)
|
||||
{
|
||||
cur.setkey(1);
|
||||
cur.setfilter("");
|
||||
items = cur.items();
|
||||
}
|
||||
bool ok = items > 0;
|
||||
if (ok)
|
||||
const long items = cur.items();
|
||||
if (items > 0)
|
||||
{
|
||||
long selected = 0;
|
||||
if (items > 1)
|
||||
{
|
||||
TCursor_sheet sheet(&cur, "NUMREG|IDMOV|DTMOV|DESC", "Movimenti cespiti",
|
||||
"Registazione|Movimento@11|Data@10|Descrizione Movimento@50", 0, 1);
|
||||
ok = sheet.run() == K_ENTER;
|
||||
if (ok)
|
||||
selected = sheet.selected();
|
||||
cur.freeze();
|
||||
TRectype& movce = cur.curr();
|
||||
|
||||
TAssoc_array ignore;
|
||||
// Prima cerca movimenti con importo identico ...
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
const char segno = movce.get_char(MOVCE_SEGNO);
|
||||
real imp = movce.get(segno == '-' ? MOVCE_IMPVEN : MOVCE_CSTO);
|
||||
if (imp > ZERO) // Cerca una riga con lo stesso importo
|
||||
{
|
||||
for (int r = 0; r < s.items(); r++)
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
const real res = row.get(1);
|
||||
if (imp == res)
|
||||
{
|
||||
imp = ZERO;
|
||||
row.add(" ", 1);
|
||||
tot_res -= res;
|
||||
ignore.add(movce.get(MOVCE_IDMOV));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok)
|
||||
{
|
||||
cur = selected;
|
||||
idmov = cur.curr().get(MOVCE_IDMOV);
|
||||
// ... poi scala dalle varie righe l'importo fino ad esaurimento
|
||||
for (cur = 0L; cur.pos() < items && tot_res > ZERO; ++cur)
|
||||
{
|
||||
if (ignore.is_key(movce.get(MOVCE_IDMOV)))
|
||||
continue;
|
||||
const char segno = movce.get_char(MOVCE_SEGNO);
|
||||
real imp = movce.get(segno == '-' ? MOVCE_IMPVEN : MOVCE_CSTO);
|
||||
for (int r = 0; r < s.items() && imp > ZERO; r++)
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
real res = row.get(1);
|
||||
if (res > ZERO)
|
||||
{
|
||||
const real quota = (res > imp) ? imp : res;
|
||||
res -= quota;
|
||||
imp -= quota;
|
||||
row.add(res.string(), 1);
|
||||
tot_res -= quota;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
// s.force_update();
|
||||
_qmask->set(F_TOTIMP, tot_imp);
|
||||
_qmask->set(F_TOTRES, tot_res);
|
||||
}
|
||||
|
||||
void TMovicespi::set_prompt(TMask_field& fld, bool plus)
|
||||
{
|
||||
TString str = fld.prompt();
|
||||
if (plus)
|
||||
{
|
||||
if (str[0] != 'P')
|
||||
{
|
||||
str.ltrim(3);
|
||||
str.insert("Pl");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (str[0] != 'M')
|
||||
{
|
||||
str.ltrim(2);
|
||||
str.insert("Min");
|
||||
}
|
||||
}
|
||||
fld.set_prompt(str);
|
||||
}
|
||||
|
||||
void TMovicespi::show_plus_minus(TMask& m)
|
||||
{
|
||||
TToken_string key;
|
||||
short id_txt = F_PLUSMIN_FIS_TXT;
|
||||
short id_fld = F_PLUSMIN_FIS;
|
||||
for (int tipo = 1; tipo <= 3; tipo++, id_txt+= 2, id_fld+=2)
|
||||
{
|
||||
key = m.get(F_IDCESPITE);
|
||||
key.add(m.get(F_IDMOV));
|
||||
key.add(tipo);
|
||||
const TRectype& ammmv = cache().get(LF_AMMMV, key);
|
||||
const real plus = ammmv.get(AMMMV_PLUS);
|
||||
const real minus = ammmv.get(AMMMV_MINUS);
|
||||
const bool on = !plus.is_zero() || !minus.is_zero();
|
||||
if (on)
|
||||
{
|
||||
if (!plus.is_zero())
|
||||
{
|
||||
set_prompt(m.field(id_txt), TRUE);
|
||||
m.set(id_fld, plus);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_prompt(m.field(id_txt), FALSE);
|
||||
m.set(id_fld, minus);
|
||||
}
|
||||
}
|
||||
m.show(id_txt, on);
|
||||
m.show(id_fld, on);
|
||||
}
|
||||
}
|
||||
|
||||
void TMovicespi::cg_mode()
|
||||
{
|
||||
TConfig ini(_prima_nota, "Transaction");
|
||||
char action = ini.get("Action")[0];
|
||||
|
||||
const char action = ini.get("Action")[0];
|
||||
|
||||
TString8 para;
|
||||
para.format("%d", LF_MOV);
|
||||
ini.set_paragraph(para);
|
||||
|
||||
// Al primo inserimento devo impostare anche l'anno e l'attività
|
||||
if (_cg_line == 1 && action == 'I')
|
||||
{
|
||||
_qmask->set(F_ESERCIZIO, ini.get(MOV_ANNOES), TRUE);
|
||||
if (!_qmask->efield(F_SPECIE).on_key(K_F9))
|
||||
action = ' ';
|
||||
}
|
||||
ini.set_paragraph(para);
|
||||
const long numreg = ini.get_long(MOV_NUMREG);
|
||||
_qmask->set(F_NUMREG, numreg);
|
||||
|
||||
// Al primo inserimento devo impostare anche l'anno
|
||||
_qmask->set(F_ESERCIZIO, ini.get(MOV_ANNOES), TRUE);
|
||||
|
||||
if (action == 'I')
|
||||
{
|
||||
for (int i = _cg_line; ; i++)
|
||||
{
|
||||
para.format("%d,%d", LF_RMOV, i);
|
||||
if (ini.set_paragraph(para))
|
||||
{
|
||||
const int gruppo = ini.get_int(RMV_GRUPPO);
|
||||
const int conto = ini.get_int(RMV_CONTO);
|
||||
const int sottoconto = ini.get_int(RMV_SOTTOCONTO);
|
||||
const int tipo = tipo_cr(gruppo, conto, sottoconto);
|
||||
if (tipo == 2 || tipo == 3 || tipo == 4 || tipo == 8)
|
||||
{
|
||||
_cg_line = i;
|
||||
_qmask->send_key(K_SPACE, DLG_NEWREC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (action != 'I' && action != 'M')
|
||||
{
|
||||
_qmask->hide(-8);
|
||||
return;
|
||||
}
|
||||
else
|
||||
_qmask->show(-8);
|
||||
|
||||
TSheet_field& s = _qmask->sfield(F_CGROWS);
|
||||
for (int i = 1; ; i++)
|
||||
{
|
||||
para.format("%d,%d", LF_RMOV, i);
|
||||
if (ini.set_paragraph(para))
|
||||
{
|
||||
const int gruppo = ini.get_int(RMV_GRUPPO);
|
||||
const int conto = ini.get_int(RMV_CONTO);
|
||||
const long sottoconto = ini.get_long(RMV_SOTTOCONTO);
|
||||
const TBill zio(gruppo, conto, sottoconto);
|
||||
const int tipo = zio.tipo_cr();
|
||||
if (tipo == 2 || tipo == 3 || tipo == 4 || tipo == 8)
|
||||
{
|
||||
action = ' ';
|
||||
break;
|
||||
TToken_string& row = s.row(-1);
|
||||
row = ini.get(RMV_IMPORTO);
|
||||
row.add("");
|
||||
row.add(zio.string(0x2));
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (action == 'M' || action == 'D')
|
||||
{
|
||||
const long numreg = ini.get_long(MOV_NUMREG);
|
||||
TString16 idmov;
|
||||
if (select_mov(numreg, idmov))
|
||||
{
|
||||
_qmask->set(F_IDMOV, idmov, TRUE);
|
||||
_qmask->send_key(K_AUTO_ENTER, 0);
|
||||
}
|
||||
else
|
||||
action = ' ';
|
||||
break;
|
||||
}
|
||||
// Caso artificiale per terminare la transazione
|
||||
if (action == ' ')
|
||||
stop_run();
|
||||
calc_residuo(numreg);
|
||||
}
|
||||
|
||||
void TMovicespi::init_query_mode(TMask& m)
|
||||
@ -754,8 +932,10 @@ void TMovicespi::init_query_mode(TMask& m)
|
||||
dc.init_mask(m);
|
||||
|
||||
// Collegamento da prima nota
|
||||
if (_cg_line > 0)
|
||||
if (_prima_nota.not_empty())
|
||||
cg_mode();
|
||||
else
|
||||
m.hide(-8); // Nascondi campi collegamento prima nota
|
||||
}
|
||||
|
||||
int TMovicespi::init_mask(TMask& m)
|
||||
@ -777,8 +957,10 @@ void TMovicespi::init_insert_mode(TMask& m)
|
||||
m.enable(F_DESC_CES);
|
||||
m.enable(DLG_SAVEREC, staat != 3);
|
||||
|
||||
if (_cg_line > 0)
|
||||
if (_prima_nota.not_empty())
|
||||
{
|
||||
m.disable(DLG_QUIT); // Altrimenti non riesco a controllare il residuo
|
||||
|
||||
TString16 para;
|
||||
para.format("%d", LF_MOV);
|
||||
TConfig ini(_prima_nota, para);
|
||||
@ -793,17 +975,29 @@ void TMovicespi::init_insert_mode(TMask& m)
|
||||
m.set(F_DTDOC, ini.get(MOV_DATADOC), TRUE);
|
||||
|
||||
TString desc = ini.get(MOV_DESCR);
|
||||
desc.strip("\"");
|
||||
if (desc.empty())
|
||||
desc = cau.get(CAU_DESCR);
|
||||
m.set(F_DESC_MOV, desc, TRUE);
|
||||
|
||||
if (m.field(F_COSTO).enabled())
|
||||
|
||||
TString16 codreg = ini.get(MOV_REG);
|
||||
if (codreg.not_empty())
|
||||
{
|
||||
para.format("%d,%d", LF_RMOV, _cg_line);
|
||||
m.set(F_COSTO, ini.get(RMV_IMPORTO, para));
|
||||
codreg.insert(format("%04d", ini.get_int(MOV_ANNOIVA)));
|
||||
const int iva = atoi(cache().get("REG", codreg, "I0"));
|
||||
TSheet_field& s = _qmask->sfield(F_CGROWS);
|
||||
for (int r = 0; r < s.items(); r++)
|
||||
{
|
||||
const real res = s.row(r).get(1);
|
||||
if (res > 0)
|
||||
{
|
||||
m.set(iva==1 ? F_IMPVEN : F_COSTO, res);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
_cg_line++;
|
||||
}
|
||||
show_plus_minus(m);
|
||||
}
|
||||
|
||||
void TMovicespi::init_modify_mode(TMask& m)
|
||||
@ -832,20 +1026,35 @@ void TMovicespi::init_modify_mode(TMask& m)
|
||||
msg << esc.date2esc(dtmov);
|
||||
xvt_statbar_set(msg);
|
||||
}
|
||||
if (_prima_nota.not_empty())
|
||||
m.disable(DLG_QUIT); // Altrimenti non riesco a controllare il residuo
|
||||
|
||||
show_plus_minus(m);
|
||||
}
|
||||
|
||||
void TMovicespi::kill_mov(const TString& idcespite, const TString& idmov, int lfile)
|
||||
{
|
||||
CHECKD(lfile == LF_MOVAM || lfile == LF_AMMMV, "Invalid file ", lfile);
|
||||
TRelation rel(lfile);
|
||||
TRectype& filter = rel.curr();
|
||||
TRectype filter(rel.curr());
|
||||
filter.zero();
|
||||
filter.put("IDCESPITE", idcespite);
|
||||
filter.put("IDMOV", idmov);
|
||||
TCursor cur(&rel, "", 1, &filter, &filter);
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
rel.remove();
|
||||
if (items > 0)
|
||||
{
|
||||
cur.freeze();
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
int err = rel.remove();
|
||||
if (err != NOERR)
|
||||
{
|
||||
const int tpamm = rel.curr().get_int("TPAMM");
|
||||
error_box("Errore %d nella cancellazione dell'ammortamento (%d) del movimento %s", err, tpamm, (const char*)idmov);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TMovicespi::kill_rett(const TString& id, const TString& idmov)
|
||||
@ -882,16 +1091,41 @@ void TMovicespi::kill_rett(const TString& id, const TString& idmov)
|
||||
}
|
||||
}
|
||||
|
||||
int TMovicespi::write(const TMask& m)
|
||||
{
|
||||
int err = TRelation_application::write(m);
|
||||
if (err == NOERR)
|
||||
_emask->recalc_amm();
|
||||
return err;
|
||||
}
|
||||
|
||||
int TMovicespi::rewrite(const TMask& m)
|
||||
{
|
||||
int err = TRelation_application::rewrite(m);
|
||||
if (err == NOERR)
|
||||
_emask->recalc_amm();
|
||||
return err;
|
||||
}
|
||||
|
||||
void TMovicespi::save_if_dirty()
|
||||
{
|
||||
if (save(TRUE))
|
||||
set_mode(MODE_MOD);
|
||||
}
|
||||
|
||||
bool TMovicespi::remove()
|
||||
{
|
||||
const TRectype& curr = get_relation()->curr();
|
||||
|
||||
const TString16 idcespite = curr.get(MOVCE_IDCESPITE);
|
||||
const TString16 idmov = curr.get(MOVCE_IDMOV);
|
||||
TRelation_application::remove();
|
||||
kill_mov(idcespite, idmov, LF_MOVAM);
|
||||
kill_mov(idcespite, idmov, LF_AMMMV);
|
||||
kill_rett(idcespite, idmov);
|
||||
TRelation_application::remove();
|
||||
|
||||
_emask->recalc_amm();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
85
ce/ce1500a.h
85
ce/ce1500a.h
@ -1,39 +1,44 @@
|
||||
#define F_DITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_ESERCIZIO 103
|
||||
#define F_INIZIO_ES 104
|
||||
#define F_FINE_ES 105
|
||||
#define F_SELECT 106
|
||||
#define F_GRUPPO 107
|
||||
#define F_SPECIE 108
|
||||
#define F_DESC_GRSP 109
|
||||
#define F_DESC_IMP 111
|
||||
#define F_DITTA 151
|
||||
#define F_RAGSOC 152
|
||||
#define F_ESERCIZIO 153
|
||||
#define F_INIZIO_ES 154
|
||||
#define F_FINE_ES 155
|
||||
#define F_SELECT 156
|
||||
#define F_GRUPPO 157
|
||||
#define F_SPECIE 158
|
||||
#define F_DESC_GRSP 159
|
||||
#define F_DESC_IMP 160
|
||||
|
||||
#define F_IDMOV 122
|
||||
#define F_DESC_MOV 123
|
||||
#define F_CODMOV 126
|
||||
#define F_CODMOV_DES 127
|
||||
#define F_TPDOC 128
|
||||
#define F_TPDOC_DES 129
|
||||
#define F_DTMOV 130
|
||||
#define F_DTDOC 131
|
||||
#define F_NDOC 132
|
||||
#define F_NUMREG 133
|
||||
#define F_IDMOV 162
|
||||
#define F_DESC_MOV 163
|
||||
#define F_CODMOV 166
|
||||
#define F_CODMOV_DES 167
|
||||
#define F_TPDOC 168
|
||||
#define F_TPDOC_DES 169
|
||||
#define F_DTMOV 170
|
||||
#define F_DTDOC 171
|
||||
#define F_NDOC 172
|
||||
#define F_NUMREG 173
|
||||
|
||||
#define F_IDRET 140
|
||||
#define F_DESC_RET 141
|
||||
#define F_CODMOV_RET 142
|
||||
#define F_CODMOV_DES_RET 143
|
||||
#define F_DTMOV_RET 144
|
||||
#define F_TPDOC_RET 145
|
||||
#define F_DTDOC_RET 146
|
||||
#define F_NDOC_RET 147
|
||||
// GROUP 8
|
||||
#define F_CGROWS 175
|
||||
#define F_TOTIMP 176
|
||||
#define F_TOTRES 177
|
||||
|
||||
#define F_IDCESPITE 150
|
||||
#define F_DESC_CES 151
|
||||
#define F_CATEGORIA 152
|
||||
#define F_DESC_CAT 153
|
||||
#define F_IMPIANTO 154
|
||||
#define F_IDRET 180
|
||||
#define F_DESC_RET 181
|
||||
#define F_CODMOV_RET 182
|
||||
#define F_CODMOV_DES_RET 183
|
||||
#define F_DTMOV_RET 184
|
||||
#define F_TPDOC_RET 185
|
||||
#define F_DTDOC_RET 186
|
||||
#define F_NDOC_RET 187
|
||||
|
||||
#define F_IDCESPITE 190
|
||||
#define F_DESC_CES 191
|
||||
#define F_CATEGORIA 192
|
||||
#define F_DESC_CAT 193
|
||||
#define F_IMPIANTO 194
|
||||
|
||||
#define F_SEGNO 201
|
||||
#define F_ELEMENTI 202
|
||||
@ -48,6 +53,13 @@
|
||||
#define F_RIVGC 211
|
||||
#define F_IMPVEN 212
|
||||
|
||||
#define F_PLUSMIN_FIS_TXT 221
|
||||
#define F_PLUSMIN_FIS 222
|
||||
#define F_PLUSMIN_CIV_TXT 223
|
||||
#define F_PLUSMIN_CIV 224
|
||||
#define F_PLUSMIN_GES_TXT 225
|
||||
#define F_PLUSMIN_GES 226
|
||||
|
||||
#define F_IDMOVAM 251
|
||||
#define F_IDCESAM 252
|
||||
#define F_IDMOVAM2 253
|
||||
@ -88,3 +100,10 @@
|
||||
#define S_RESIDUO 422
|
||||
#define S_PLUS 423
|
||||
#define S_MINUS 424
|
||||
|
||||
#define S_IMPORTO 101
|
||||
#define S_RESIMP 102
|
||||
#define S_GRUPPO 103
|
||||
#define S_CONTO 104
|
||||
#define S_SOTTOCONTO 105
|
||||
#define S_DESCR 106
|
||||
|
||||
@ -173,7 +173,6 @@ BEGIN
|
||||
DISPLAY "Descrizione Cespite@50" LF_CESPI->DESC
|
||||
DISPLAY "Impianto@10" LF_CESPI->CODIMP
|
||||
OUTPUT F_IDMOV IDMOV
|
||||
OUTPUT F_IDRET IDRET
|
||||
OUTPUT F_DESC_MOV DESC
|
||||
CHECKTYPE REQUIRED
|
||||
FIELD IDMOV
|
||||
@ -188,7 +187,7 @@ END
|
||||
|
||||
NUMBER F_NUMREG 7
|
||||
BEGIN
|
||||
PROMPT 1 12 "Selezione per numero di registrazione di prima nota "
|
||||
PROMPT 1 11 "Selezione per numero di registrazione di prima nota "
|
||||
USE LF_MOVCE KEY 3
|
||||
JOIN LF_CESPI INTO IDCESPITE==IDCESPITE
|
||||
INPUT NUMREG F_NUMREG
|
||||
@ -198,17 +197,86 @@ BEGIN
|
||||
DISPLAY "Descrizione Movimento@50" DESC
|
||||
DISPLAY "Cespite@10" IDCESPITE
|
||||
DISPLAY "Descrizione Cespite@50" LF_CESPI->DESC
|
||||
DISPLAY "Costo storico@18" CSTO
|
||||
DISPLAY "Importo vendita@18" IMPVEN
|
||||
OUTPUT F_NUMREG NUMREG
|
||||
OUTPUT F_IDMOV IDMOV
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER F_IDRET 11
|
||||
SPREADSHEET F_CGROWS 0 -2
|
||||
BEGIN
|
||||
PROMPT 1 11 "Rettifica "
|
||||
FIELD IDRET
|
||||
FLAGS "DZ"
|
||||
KEY 1
|
||||
PROMPT 0 12 ""
|
||||
ITEM "Importo@18"
|
||||
ITEM "Residuo@18"
|
||||
ITEM "Gruppo"
|
||||
ITEM "Conto"
|
||||
ITEM "Sottoconto"
|
||||
ITEM "Descrizione"
|
||||
GROUP 8
|
||||
END
|
||||
|
||||
CURRENCY F_TOTIMP 18
|
||||
BEGIN
|
||||
PROMPT 1 -1 "@bTotale Importi "
|
||||
FLAGS "D"
|
||||
GROUP 8
|
||||
END
|
||||
|
||||
CURRENCY F_TOTRES 18
|
||||
BEGIN
|
||||
PROMPT 41 -1 "@bTotale Residuo "
|
||||
FLAGS "D"
|
||||
GROUP 8
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Riga" -1 -1 60 6
|
||||
|
||||
CURRENCY S_IMPORTO 18
|
||||
BEGIN
|
||||
PROMPT 1 1 "Importo "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
CURRENCY S_RESIMP 18
|
||||
BEGIN
|
||||
PROMPT 1 2 "Residuo "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER S_GRUPPO 3
|
||||
BEGIN
|
||||
PROMPT 1 3 "Gruppo "
|
||||
END
|
||||
|
||||
NUMBER S_CONTO 3
|
||||
BEGIN
|
||||
PROMPT 21 3 "Conto "
|
||||
END
|
||||
|
||||
NUMBER S_SOTTOCONTO 6
|
||||
BEGIN
|
||||
PROMPT 41 3 "Sottoconto "
|
||||
END
|
||||
|
||||
STRING S_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 1 4 "Descr. "
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
@ -114,6 +114,7 @@ BEGIN
|
||||
PROMPT 26 6 ""
|
||||
FIELD DESC
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "È necessario inserire una descrizione"
|
||||
END
|
||||
|
||||
STRING F_CODMOV 1
|
||||
@ -506,6 +507,39 @@ BEGIN
|
||||
FIELD IMPVEN
|
||||
END
|
||||
|
||||
TEXT F_PLUSMIN_FIS_TXT
|
||||
BEGIN
|
||||
PROMPT 54 12 "Minusvalenza fiscale"
|
||||
END
|
||||
|
||||
CURRENCY F_PLUSMIN_FIS 15
|
||||
BEGIN
|
||||
PROMPT 61 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
TEXT F_PLUSMIN_CIV_TXT
|
||||
BEGIN
|
||||
PROMPT 54 15 "Minusvalenza civilistica"
|
||||
END
|
||||
|
||||
CURRENCY F_PLUSMIN_CIV 15
|
||||
BEGIN
|
||||
PROMPT 61 16 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
TEXT F_PLUSMIN_GES_TXT
|
||||
BEGIN
|
||||
PROMPT 54 18 "Minusvalenza gestionale"
|
||||
END
|
||||
|
||||
CURRENCY F_PLUSMIN_GES 15
|
||||
BEGIN
|
||||
PROMPT 61 19 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Fondi" -1 -1 78 18
|
||||
|
||||
@ -92,7 +92,9 @@ bool TCalcamm::calcola_ammortamenti()
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
TProgind pi(items, "Calcolo ammortamenti...", TRUE, TRUE);
|
||||
TString msg;
|
||||
msg << "Calcolo ammortamenti di " << items << " cespiti...";
|
||||
TProgind pi(items, msg, TRUE, TRUE);
|
||||
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
@ -115,7 +117,7 @@ bool TCalcamm::calcola_ammortamenti()
|
||||
|
||||
bool TCalcamm::create()
|
||||
{
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CESPI, LF_AMMCE, LF_AMMMV, LF_SALCE, LF_MOVCE, 0);
|
||||
open_files(LF_TABCOM, LF_TAB, LF_CESPI, LF_SALCE, LF_AMMCE, LF_MOVCE, LF_MOVAM, LF_AMMMV, 0);
|
||||
_mask = new TCalcamm_mask;
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
HIDDEN void log(const char* fmt, ...)
|
||||
{
|
||||
/*
|
||||
#ifdef DBG
|
||||
char msg[256];
|
||||
va_list argptr;
|
||||
va_start(argptr,fmt);
|
||||
@ -35,7 +35,7 @@ HIDDEN void log(const char* fmt, ...)
|
||||
fprintf(f, "%s\n", msg);
|
||||
fclose(f);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -188,8 +188,12 @@ void TCespite::read_amm(int esercizio)
|
||||
void TCespite::save_sal() const
|
||||
{
|
||||
TLocalisamfile salce(LF_SALCE);
|
||||
if (_salpro.rewrite(salce) != NOERR)
|
||||
_salpro.write(salce);
|
||||
int err = _salpro.rewrite(salce);
|
||||
if (err != NOERR)
|
||||
err = _salpro.write(salce);
|
||||
if (err != NOERR)
|
||||
error_box("Errore %d durante la scrittura sui saldi del cespite %s", (const char*)get(CESPI_IDCESPITE));
|
||||
log("- Scrittura salpro %d: errore %d", _tipo_sit, err);
|
||||
}
|
||||
|
||||
// Salva AMMPRO
|
||||
@ -197,8 +201,12 @@ void TCespite::save_sal() const
|
||||
void TCespite::save_amm() const
|
||||
{
|
||||
TLocalisamfile ammce(LF_AMMCE);
|
||||
if (_ammpro.rewrite(ammce) != NOERR)
|
||||
_ammpro.write(ammce);
|
||||
int err = _ammpro.rewrite(ammce);
|
||||
if (err != NOERR)
|
||||
err = _ammpro.write(ammce);
|
||||
if (err != NOERR)
|
||||
error_box("Errore %d durante la scrittura sugli ammortamenti del cespite %s", (const char*)get(CESPI_IDCESPITE));
|
||||
log("- Scrittura ammpro %d: errore %d", _tipo_sit, err);
|
||||
}
|
||||
|
||||
// Ritorna il record della categoria del cespite
|
||||
@ -337,14 +345,14 @@ real TCespite::val_amm() const
|
||||
real TCespite::res_amm() const
|
||||
{
|
||||
const real valamm = val_amm(); // Valore ammortizzabile
|
||||
real fondo; // Fondo ammortamento
|
||||
real fondo; // Fondo ammortamento
|
||||
fondo += _ammpro.get_real(AMMCE_QNORP);
|
||||
fondo += _ammpro.get_real(AMMCE_QANTP);
|
||||
fondo += _ammpro.get_real(AMMCE_QACCP);
|
||||
fondo += _ammpro.get_real(AMMCE_QPERSEP);
|
||||
fondo += _ammpro.get_real(AMMCE_QPPRIVATEP);
|
||||
fondo += _ammpro.get_real(AMMCE_FPRIVATOP);
|
||||
const real resamm = valamm - fondo; // Residuo da ammortizzare
|
||||
const real resamm = valamm - fondo; // Residuo da ammortizzare
|
||||
return resamm;
|
||||
}
|
||||
|
||||
@ -605,10 +613,10 @@ real TCespite::mov_val_amm(const TRectype& tmv) const
|
||||
// Certified 50%
|
||||
real TCespite::mov_res_amm(const TRectype& tmv, const TRectype& tmvam) const
|
||||
{
|
||||
real resamm = mov_val_amm(tmv);
|
||||
resamm -= tmvam.get_real(MOVAM_QNOR);
|
||||
resamm -= tmvam.get_real(MOVAM_QANT);
|
||||
resamm -= tmvam.get_real(MOVAM_QACC);
|
||||
const real valamm = mov_val_amm(tmv);
|
||||
const real fondam = sum_fields(tmvam, MOVAM_QNOR, MOVAM_QANT, MOVAM_QACC,
|
||||
MOVAM_QPERSE, MOVAM_FPRIVATO, MOVAM_QPPRIVATE);
|
||||
const real resamm = valamm - fondam;
|
||||
return resamm;
|
||||
}
|
||||
|
||||
@ -976,9 +984,9 @@ TString& TCespite::ammini_get(const char* pstar) const
|
||||
}
|
||||
const int anno_funz = dtfunz.year();
|
||||
if (anno_funz < 1988)
|
||||
_val = catdi_get(pcatdi, CATDI_PFNORVN, _tipo_sit);
|
||||
_val = catdi_get(pcatdi, CATDI_PFANTVN, _tipo_sit);
|
||||
else
|
||||
_val = catdi_get(pcatdi, anno_funz < 1989 ? CATDI_PFNORVT : CATDI_PFNORNT, _tipo_sit);
|
||||
_val = catdi_get(pcatdi, anno_funz < 1989 ? CATDI_PFANTVT : CATDI_PFANTNT, _tipo_sit);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -1009,14 +1017,14 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
|
||||
|
||||
TRectype& ammmv = rel.curr(LF_AMMMV);
|
||||
|
||||
if (ammmv.get_bool(AMMMV_FZQUO)) // Forztura per quote
|
||||
if (ammmv.get_bool(AMMMV_FZQUO)) // Forzatura per quote
|
||||
{
|
||||
// Leggo comunque le percentuali teoriche
|
||||
ammmv.put(AMMMV_PNOR, ammini_get(AMMCE_PNOR));
|
||||
ammmv.put(AMMMV_PACC, ammini_get(AMMCE_PACC));
|
||||
ammmv.put(AMMMV_PANT, ammini_get(AMMCE_PANT));
|
||||
|
||||
real resamm = mov_res_amm(tmv, tmvam);
|
||||
real resamm = mov_res_amm(tmv, tmvam) - ammmv.get_real(AMMMV_FPRIVATO);
|
||||
if (resamm > ZERO)
|
||||
{
|
||||
real penor;
|
||||
@ -1031,7 +1039,7 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
|
||||
}
|
||||
ammmv.put(AMMMV_PENOR, penor);
|
||||
ammmv.put(AMMMV_PNOR, penor); // Per chiarezza di stampa
|
||||
resamm -= ammmv.get_real(AMMMV_QNOR) + ammmv.get_real(AMMMV_FPRIVATO);
|
||||
resamm -= ammmv.get_real(AMMMV_QNOR);
|
||||
if (resamm > ZERO)
|
||||
{
|
||||
real peacc;
|
||||
@ -1085,7 +1093,7 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
|
||||
ammmv.put(AMMMV_PEANT, ammmv.get(AMMMV_PANT));
|
||||
ammmv.put(AMMMV_PEACC, ammmv.get(AMMMV_PACC));
|
||||
|
||||
real resamm = mov_res_amm(tmv, tmvam);
|
||||
real resamm = mov_res_amm(tmv, tmvam) - ammmv.get_real(AMMMV_FPRIVATO);
|
||||
if (resamm > ZERO)
|
||||
{
|
||||
const real penor = ammmv.get(AMMMV_PENOR);
|
||||
@ -1094,7 +1102,7 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
|
||||
ammmv.put(AMMMV_QNOR, qnor);
|
||||
ammmv.put(AMMMV_PENOR, per_eff);
|
||||
|
||||
resamm -= qnor + ammmv.get_real(AMMMV_FPRIVATO);
|
||||
resamm -= qnor;
|
||||
const real peacc = ammmv.get(AMMMV_PEACC);
|
||||
if (resamm > ZERO && peacc > ZERO)
|
||||
{
|
||||
@ -1150,7 +1158,7 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
|
||||
{
|
||||
// Calcolare quota ammortamento normale
|
||||
const real valamm = mov_val_amm(tmv);
|
||||
const real penor = ammmv.get_real(AMMMV_PENOR);
|
||||
const real penor = ammmv.get_real(AMMMV_PENOR); // Attenzione: usare PENOR, non PNOR!
|
||||
real per_eff;
|
||||
const real qnor = calc_quota(valamm, penor, resamm, per_eff, &rel);
|
||||
ammmv.put(AMMMV_QNOR, qnor);
|
||||
@ -1169,8 +1177,10 @@ void TCespite::calc_perc(TRelation& rel, const TRectype& tmv, const TRectype& tm
|
||||
ammmv.zero(AMMMV_QPPRIVATE);
|
||||
}
|
||||
|
||||
// Calcolare quota ammortamento accelerato
|
||||
// Togliere FPRIVATO solo ora, in quanto ricalcolato da calc_quota
|
||||
resamm -= ammmv.get_real(AMMMV_QNOR) + ammmv.get_real(AMMMV_FPRIVATO);
|
||||
|
||||
// Calcolare quota ammortamento accelerato
|
||||
if (resamm > ZERO && ammmv.get_real(AMMMV_PEACC) > ZERO && ammmv.get_real(AMMMV_QPERSE) == ZERO)
|
||||
{
|
||||
const real peacc = ammmv.get_real(AMMMV_PEACC);
|
||||
@ -1487,7 +1497,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
const real coeff_durata = cce.coefficiente_durata_esercizio();
|
||||
if (fzquo) // Forzatura quota
|
||||
{
|
||||
real resamm = res_amm();
|
||||
real resamm = res_amm() - _ammpro.get_real(AMMCE_FPRIVATO);
|
||||
if (resamm > ZERO)
|
||||
{
|
||||
real qnor = _ammpro.get(AMMCE_QNOR);
|
||||
@ -1497,7 +1507,7 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
const real pnor = qnor / coeff_durata * 100.0 / val_amm();
|
||||
_ammpro.put(AMMCE_PNOR, pnor);
|
||||
|
||||
resamm -= qnor + _ammpro.get_real(AMMCE_FPRIVATO);
|
||||
resamm -= qnor;
|
||||
if (resamm > ZERO)
|
||||
{
|
||||
real qacc = _ammpro.get(AMMCE_QACC);
|
||||
@ -1533,16 +1543,16 @@ void TCespite::calc_amm_residui(bool is_valid)
|
||||
} else
|
||||
if (fzper) // Forzatura percentuale
|
||||
{
|
||||
real resamm = res_amm();
|
||||
real resamm = res_amm() - _ammpro.get_real(AMMCE_FPRIVATO);
|
||||
if (resamm > ZERO)
|
||||
{
|
||||
{
|
||||
const real valamm = val_amm();
|
||||
const real pnor = _ammpro.get_real(AMMCE_PNOR);
|
||||
real per_eff;
|
||||
const real qnor = calc_quota(valamm, pnor, resamm, per_eff);
|
||||
_ammpro.put(AMMCE_QNOR, qnor);
|
||||
_ammpro.put(AMMCE_PNOR, per_eff);
|
||||
resamm -= qnor + _ammpro.get_real(AMMCE_FPRIVATO);
|
||||
resamm -= qnor;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1787,8 +1797,10 @@ bool TCespite::calc_amm(int tipo_sit, const TDate& data_limite, bool recalc_spe_
|
||||
log("* Inizio calcolo situazione %d cespite %s", tipo_sit, (const char*)idcespite);
|
||||
|
||||
#ifdef DBG
|
||||
if (tipo_sit == 1 && atol(idcespite) == 33L)
|
||||
if (tipo_sit == 1 && atol(idcespite) == 25L)
|
||||
{
|
||||
tipo_sit = 1; // Put your breakpoint here
|
||||
}
|
||||
#endif
|
||||
|
||||
const bool is_valid = valido();
|
||||
|
||||
@ -38,7 +38,8 @@ TOpenesc_mask::TOpenesc_mask()
|
||||
|
||||
// Controlla che siano stati stampati i bollati e chiuse le attivita
|
||||
bool TOpenesc_mask::check_oldes()
|
||||
{
|
||||
{
|
||||
bool ok = TRUE;
|
||||
TRelation rel("CCB");
|
||||
TRectype& ccb = rel.curr();
|
||||
ccb.put("CODTAB", get(F_OLDES));
|
||||
@ -59,10 +60,11 @@ bool TOpenesc_mask::check_oldes()
|
||||
msg << "è già stata effettuata la chiusura";
|
||||
const TString8 codatt = ccb.get("CODTAB").mid(4);
|
||||
msg << "\ndell'attività " << cache().get("%CAT", codatt, "S0");
|
||||
return error_box(msg);
|
||||
ok = error_box(msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TOpenesc_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
@ -165,18 +167,25 @@ real TOpenesc::calc_coeff(const TDate& ies, const TDate& fes) const
|
||||
void TOpenesc::crea_esercizio(int oldes, int newes, const TDate& ies, const TDate& fes) const
|
||||
{
|
||||
// Crea l'esercizio contabile se necessario
|
||||
if (!has_module(CGAUT))
|
||||
TTable esc("ESC");
|
||||
esc.put("CODTAB", newes);
|
||||
if (esc.read() != NOERR)
|
||||
{
|
||||
TTable esc("ESC");
|
||||
esc.put("CODTAB", newes);
|
||||
if (esc.read() != NOERR)
|
||||
if (!has_module(CGAUT))
|
||||
{
|
||||
esc.zero();
|
||||
TTable esc("ESC");
|
||||
esc.put("CODTAB", newes);
|
||||
esc.put("D0", ies);
|
||||
esc.put("D1", fes);
|
||||
esc.write();
|
||||
if (esc.read() != NOERR)
|
||||
{
|
||||
esc.zero();
|
||||
esc.put("CODTAB", newes);
|
||||
esc.put("D0", ies);
|
||||
esc.put("D1", fes);
|
||||
esc.write();
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box("Attenzione: non esiste ancora l'esercizio contabile %04d", newes);
|
||||
}
|
||||
|
||||
// Crea l'esercizio cespiti se necessario
|
||||
@ -184,21 +193,26 @@ void TOpenesc::crea_esercizio(int oldes, int newes, const TDate& ies, const TDat
|
||||
TString8 key; key.format("%04d", oldes);
|
||||
const TRectype& oldrec = cache().get("CCE", key);
|
||||
cce.put("CODTAB", newes);
|
||||
if (cce.read() != NOERR)
|
||||
const bool found = cce.read() == NOERR;
|
||||
if (!found)
|
||||
{
|
||||
cce.zero();
|
||||
cce.put("CODTAB", newes);
|
||||
cce.put("S5", calc_coeff(ies, fes)); // Calcola coefficiente durata esercizio
|
||||
cce.put("S6", oldrec.get("S6")); // Copia tipo arrotondamento
|
||||
cce.put("I0", oldrec.get("I0")); // Copia tipo contabilità
|
||||
cce.put("I1", oldrec.get("I1")); // Copia tipo riproporzionamento
|
||||
cce.put("I2", oldrec.get("I2")); // Copia assoggettamento art.14 C.2 legge 449/97
|
||||
cce.put("I3", fes - ies + 1); // Calcola durata esercizio
|
||||
cce.put("B0", oldrec.get("B0")); // Copia ditta relativa a professionista
|
||||
cce.put("B3", oldrec.get("B3")); // Copia ammortamento parti vendute
|
||||
if (cce.write() != NOERR)
|
||||
error_box("Errore di creazione dell'esercizio cespiti %d", newes);
|
||||
}
|
||||
cce.put("S5", calc_coeff(ies, fes)); // Calcola coefficiente durata esercizio
|
||||
cce.put("S6", oldrec.get("S6")); // Copia tipo arrotondamento
|
||||
cce.put("I0", oldrec.get("I0")); // Copia tipo contabilità
|
||||
cce.put("I1", oldrec.get("I1")); // Copia tipo riproporzionamento
|
||||
cce.put("I2", oldrec.get("I2")); // Copia assoggettamento art.14 C.2 legge 449/97
|
||||
cce.put("I3", fes - ies + 1); // Calcola durata esercizio
|
||||
cce.put("B0", oldrec.get("B0")); // Copia ditta relativa a professionista
|
||||
cce.put("B3", oldrec.get("B3")); // Copia ammortamento parti vendute
|
||||
cce.put("B4", oldrec.get("B4")); // Ragguaglio parti vendute
|
||||
cce.put("B5", oldrec.get("B5")); // Esposizione su libro cespiti
|
||||
if (found)
|
||||
cce.rewrite();
|
||||
else
|
||||
cce.write();
|
||||
}
|
||||
|
||||
void TOpenesc::crea_attivita(int oldes, int newes) const
|
||||
@ -345,7 +359,9 @@ void TOpenesc::incr_zero(TRectype& rec, const char* val, const char* valp) const
|
||||
void TOpenesc::crea_ammortamenti(int oldes, int newes) const
|
||||
{
|
||||
TRelation rel(LF_AMMCE);
|
||||
rel.add(LF_AMMCE, "IDCESPITE==IDCESPITE|CODES==CODES|TPSALDO==1|TPAMM==TPAMM", 1, 0, 883);
|
||||
TRectype& rec = rel.curr();
|
||||
const TRectype& ammce1 = rel.curr(-883);
|
||||
TString str;
|
||||
str << '(' << SALCE_CODES << "==" << oldes << ")&&(" << SALCE_TPSALDO << "==2)";
|
||||
TCursor cur(&rel, str);
|
||||
@ -359,13 +375,18 @@ void TOpenesc::crea_ammortamenti(int oldes, int newes) const
|
||||
rec.put(AMMCE_CODES, newes); // Aggiorna anno di esercizio
|
||||
rec.put(AMMCE_TPSALDO, 1); // Aggiorna tipo saldo ad "iniziale"
|
||||
rec.zero(AMMCE_CSCEN);
|
||||
rec.zero(AMMCE_PNOR);
|
||||
rec.zero(AMMCE_FZPER);
|
||||
rec.zero(AMMCE_FZQUO);
|
||||
rec.put(AMMCE_PNOR, ammce1.get(AMMCE_PNOR));
|
||||
rec.put(AMMCE_PACC, ammce1.get(AMMCE_PACC));
|
||||
rec.put(AMMCE_PANT, ammce1.get(AMMCE_PANT));
|
||||
incr_zero(rec, AMMCE_QNOR, AMMCE_QNORP);
|
||||
incr_zero(rec, AMMCE_QACC, AMMCE_QACCP);
|
||||
incr_zero(rec, AMMCE_QANT, AMMCE_QANTP);
|
||||
incr_zero(rec, AMMCE_QPERSE, AMMCE_QPERSEP);
|
||||
incr_zero(rec, AMMCE_FPRIVATO, AMMCE_FPRIVATOP);
|
||||
incr_zero(rec, AMMCE_QPPRIVATE, AMMCE_QPPRIVATEP);
|
||||
|
||||
const int err = rel.write();
|
||||
if (err != NOERR) // Should never happen!
|
||||
rel.rewrite();
|
||||
|
||||
@ -4,12 +4,12 @@ TOOLBAR "Toolbar" 0 -3 0 3
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
PROMPT -12 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
14
ce/ce3.cpp
14
ce/ce3.cpp
@ -7,12 +7,14 @@ int main(int argc,char** argv)
|
||||
const int r = (argc > 1) ? (argv[1][1]-'0') : 0;
|
||||
switch (r)
|
||||
{
|
||||
case 1:
|
||||
ce3200(argc,argv) ; break;
|
||||
case 2:
|
||||
ce3300(argc,argv) ; break;
|
||||
default:
|
||||
ce3100(argc,argv) ; break;
|
||||
case 1: ce3200(argc,argv) ; break; // Stampa schede cespiti
|
||||
case 2: ce3300(argc,argv) ; break; // Stampa prospetto cespiti
|
||||
case 3: ce3400(argc,argv) ; break; // Stampa prospetto rivalutazioni cespiti
|
||||
case 4: ce3500(argc,argv) ; break; // Stampa lista cespiti
|
||||
case 5: ce3600(argc,argv) ; break; // Stampa lista movimenti cespiti
|
||||
case 6: ce3700(argc,argv) ; break; // Stampa elenco cespiti promisqui :-)
|
||||
case 7: ce3800(argc,argv) ; break; // Stampa elenco cespiti etero :-)
|
||||
default: ce3100(argc,argv) ; break; // Stampa registro cespiti
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
5
ce/ce3.h
5
ce/ce3.h
@ -4,6 +4,11 @@
|
||||
int ce3100(int argc, char* argv[]);
|
||||
int ce3200(int argc, char* argv[]);
|
||||
int ce3300(int argc, char* argv[]);
|
||||
int ce3400(int argc, char* argv[]);
|
||||
int ce3500(int argc, char* argv[]);
|
||||
int ce3600(int argc, char* argv[]);
|
||||
int ce3700(int argc, char* argv[]);
|
||||
int ce3800(int argc, char* argv[]);
|
||||
|
||||
#endif // __CE3_H
|
||||
|
||||
|
||||
349
ce/ce3100.cpp
349
ce/ce3100.cpp
@ -4,6 +4,7 @@
|
||||
#include <form.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "ce3.h"
|
||||
@ -13,6 +14,7 @@
|
||||
#include "movam.h"
|
||||
#include "movce.h"
|
||||
#include "salce.h"
|
||||
#include "ce2101.h"
|
||||
#include "ce3100a.h"
|
||||
#include "ce3100.h"
|
||||
|
||||
@ -28,19 +30,19 @@ public:
|
||||
virtual bool validate(TForm_item& fld, TToken_string& val);
|
||||
TForm_registroce(const char *name);
|
||||
virtual ~TForm_registroce();
|
||||
void set_testata() { set_header(1, TRUE); };
|
||||
void set_piede() { set_footer(0,FALSE); set_footer(0, TRUE);};
|
||||
void set_pagina() { set_footer(0, TRUE);};
|
||||
TPrint_section& get_testata_cespite() { return section('H', odd_page); };
|
||||
TPrint_section& get_testata_categoria() { return section('H', even_page); };
|
||||
TPrint_section& get_piede_categoria() { return section('F', even_page); };
|
||||
TPrint_section& get_piede_registro() { return section('F', odd_page); };
|
||||
TPrint_section& get_saldiiniziali() { return section('H', last_page); };
|
||||
TPrint_section& get_movimenti() { return section('B', first_page); };
|
||||
TPrint_section& get_valorifinali() { return section('B', even_page); };
|
||||
TPrint_section& get_totali() { return section('B', odd_page); };
|
||||
virtual TCursor* cursor() const {return _newcursor; };
|
||||
virtual TRelation* relation() const {return _newrelation; };
|
||||
void set_testata() { set_header(1, TRUE); set_background(1, TRUE); }
|
||||
void set_piede() { set_footer(0,FALSE); set_footer(0, TRUE);}
|
||||
void set_pagina() { set_footer(0, TRUE);}
|
||||
TPrint_section& get_testata_cespite() { return section('H', odd_page); }
|
||||
TPrint_section& get_testata_categoria() { return section('H', even_page); }
|
||||
TPrint_section& get_piede_categoria() { return section('F', even_page); }
|
||||
TPrint_section& get_piede_registro() { return section('F', odd_page); }
|
||||
TPrint_section& get_saldiiniziali() { return section('H', last_page); }
|
||||
TPrint_section& get_movimenti() { return section('B', first_page); }
|
||||
TPrint_section& get_valorifinali() { return section('B', even_page); }
|
||||
TPrint_section& get_totali() { return section('B', odd_page); }
|
||||
virtual TCursor* cursor() const {return _newcursor; }
|
||||
virtual TRelation* relation() const {return _newrelation; }
|
||||
};
|
||||
|
||||
TForm_registroce::TForm_registroce(const char *name):
|
||||
@ -82,6 +84,7 @@ class TRegistro_cespiti : public TSkeleton_application
|
||||
int _tipoamm;
|
||||
bool _bollato;
|
||||
TEsercizi_contabili _esc;
|
||||
TString _idspese5, _idspese25;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -100,6 +103,9 @@ public:
|
||||
void print_movimenti();
|
||||
void print_valorifinali();
|
||||
void aggiorna_bollato();
|
||||
void crea_cespite_man();
|
||||
void distruggi_cespite_man();
|
||||
void costruisci_cespite(int cat, const real& spese);
|
||||
void stampa_movimento(TRectype& removce, TRectype& removam, TRectype& recammmv);
|
||||
void stampa_sezione(TPrint_section& section);
|
||||
TRegistro_cespiti() {}
|
||||
@ -110,6 +116,7 @@ bool TRegistro_cespiti::create()
|
||||
{
|
||||
open_files(LF_CESPI,0);
|
||||
_mask = new TMask("ce3100a");
|
||||
_mask->set_handler(F_ESERCIZIO,attivita_handler);
|
||||
_mask->set_handler(F_SPECIE,attivita_handler);
|
||||
_dittace = new TDitta_cespiti();
|
||||
_dittace->init_mask(*_mask);
|
||||
@ -135,28 +142,40 @@ bool TRegistro_cespiti::attivita_handler(TMask_field& f, KEY k)
|
||||
const TString16 specie = m.get(F_SPECIE);
|
||||
TString80 key; key.format("%4d%02d%s",esercizio, gruppo, (const char*) specie);
|
||||
const TRectype& ccb = cache().get("CCB", key);
|
||||
TDate dataultcalc = ccb.get_date("D0");
|
||||
const TDate dataultcalc = ccb.get_date("D0");
|
||||
m.set(F_DATAULTCALC, dataultcalc);
|
||||
if (ccb.get_bool("B2"))
|
||||
{
|
||||
if (m.is_running())
|
||||
return f.error_box("Attenzione! Esercizio chiuso. \nNon é possibile stampare il registro.");
|
||||
|
||||
bool calc_on = TRUE, reg_on = TRUE;
|
||||
if (dataultcalc.empty())
|
||||
{
|
||||
calc_on = FALSE;
|
||||
m.set(F_CALCOLO,"X");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dataultcalc.empty())
|
||||
{
|
||||
m.set(F_CALCOLO, "X");
|
||||
m.disable(F_CALCOLO);
|
||||
m.set(F_TIPOREGISTRO,"B");
|
||||
m.disable(F_TIPOREGISTRO);
|
||||
}
|
||||
if (ccb.get_bool("B2"))
|
||||
{
|
||||
calc_on = reg_on = FALSE;
|
||||
m.reset(F_CALCOLO);
|
||||
xvt_statbar_set("L'esercizio é stato chiuso");
|
||||
}
|
||||
else
|
||||
if (ccb.get_bool("B1"))
|
||||
{
|
||||
m.set(F_TIPOREGISTRO,"B");
|
||||
m.disable(F_TIPOREGISTRO);
|
||||
m.disable(F_CALCOLO);
|
||||
calc_on = reg_on = FALSE;
|
||||
m.set(F_CALCOLO,"X");
|
||||
xvt_statbar_set("Il bollato dell'esercizio é stato stampato");
|
||||
}
|
||||
else
|
||||
xvt_statbar_set("");
|
||||
|
||||
m.enable(F_TIPOREGISTRO, reg_on);
|
||||
m.enable(F_CALCOLO, calc_on);
|
||||
if (!reg_on)
|
||||
m.set(F_TIPOREGISTRO,"1");
|
||||
|
||||
if (m.get_int(F_TIPOREGISTRO) == 2 && ccb.get_bool("B2"))
|
||||
{
|
||||
if (k == K_ENTER)
|
||||
return f.error_box("Attenzione! Esercizio chiuso. \nNon è possibile stampare il registro bollato.");
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@ -166,7 +185,7 @@ void TRegistro_cespiti::main_loop()
|
||||
{
|
||||
while (_mask->run() == K_ENTER)
|
||||
{
|
||||
// Aggiunto da Guy
|
||||
// Esecuzione calcolo globale
|
||||
if (_mask->get_bool(F_CALCOLO))
|
||||
{
|
||||
const int es = _mask->get_int(F_ESERCIZIO);
|
||||
@ -175,7 +194,12 @@ void TRegistro_cespiti::main_loop()
|
||||
ditta_cespiti().set_attivita(es, gr, sp); // Fissa attività per calcolo
|
||||
TExternal_app cal("ce2 -0 A");
|
||||
cal.run(); // Esegue programma di calcolo in batch
|
||||
}
|
||||
}
|
||||
|
||||
// flag bollato per aggiornamenti
|
||||
_bollato = (_mask->get_int(F_TIPOREGISTRO)==2);
|
||||
if (_bollato)
|
||||
crea_cespite_man(); //crea il cespite della manutenzione per cespiti materiali nell'esercizio selezionato
|
||||
|
||||
TRectype darec(LF_CESPI),arec(LF_CESPI);
|
||||
TString filtro;
|
||||
@ -210,17 +234,25 @@ void TRegistro_cespiti::main_loop()
|
||||
_form->find_field('B', first_page, FR_MV_RIVGC).hide();
|
||||
_form->find_field('B', even_page, FR_FE_RIVGF).hide();
|
||||
_form->find_field('B', even_page, FR_FE_RIVGC).hide();
|
||||
// flag bollato per aggiornamenti
|
||||
_bollato = (_mask->get_int(F_TIPOREGISTRO)==1);
|
||||
_form->cursor()->setregion(darec,arec);
|
||||
_form->cursor()->setfilter(filtro,TRUE);
|
||||
long num = _form->cursor()->items();
|
||||
_form->cursor()->freeze();
|
||||
// scrive sull'intestazione del form il tipo di situazione da stampare
|
||||
if (_tipoamm == 1)
|
||||
_form->find_field('H', first_page, FR_SITUAZIONE).set("@bSituazione Fiscale@r");
|
||||
if (_tipoamm == 2)
|
||||
_form->find_field('H', first_page, FR_SITUAZIONE).set("@bSituazione Civilistica@r");
|
||||
|
||||
TCursor& cur = *_form->cursor();
|
||||
cur.setregion(darec,arec);
|
||||
cur.setfilter(filtro,TRUE);
|
||||
|
||||
const long num = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
printer().open();
|
||||
header_registro();
|
||||
TRectype& reccesp = _form->cursor()->curr();
|
||||
int catatt = -1;
|
||||
for (*_form->cursor()=0; _form->cursor()->pos()<num; ++(*_form->cursor()))
|
||||
|
||||
const TRectype& reccesp = cur.curr();
|
||||
int catatt = -1; // Memorizza ultima categoria stampata (inizialmente nessuna)
|
||||
for (cur=0; cur.pos()<num; ++cur)
|
||||
{
|
||||
if (catatt != reccesp.get_int(CESPI_CODCAT))
|
||||
{
|
||||
@ -234,19 +266,202 @@ void TRegistro_cespiti::main_loop()
|
||||
if (catatt != -1)
|
||||
{
|
||||
footer_categoria();
|
||||
_form->set_pagina();
|
||||
footer_registro();
|
||||
_form->set_pagina();
|
||||
}
|
||||
_form->cursor()->freeze(FALSE);
|
||||
printer().close();
|
||||
if (_bollato)
|
||||
aggiorna_bollato();
|
||||
cur.freeze(FALSE);
|
||||
printer().close();
|
||||
//trattazione del bollato: aggiorna i campi su files e tab solo dopo conferma, in caso contrario distrugge il cespite
|
||||
//della manutenzione creato precedentemente
|
||||
if (_bollato)
|
||||
{
|
||||
if (yesno_box("Bollato stampato in modo corretto ?"))
|
||||
aggiorna_bollato();
|
||||
else
|
||||
distruggi_cespite_man();
|
||||
}
|
||||
}
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
void TRegistro_cespiti::costruisci_cespite(int cat, const real& spese)
|
||||
{
|
||||
int es;
|
||||
TString4 gr, sp;
|
||||
ditta_cespiti().get_attivita(es, gr, sp);
|
||||
const TDate datafine = _mask->get(F_DATAFINE);
|
||||
|
||||
TString& idcespite = (cat == 91) ? _idspese5 : _idspese25;
|
||||
|
||||
{ // Scrittura anagrafica cespite
|
||||
TLocalisamfile cespi(LF_CESPI);
|
||||
cespi.last();
|
||||
const real num = cespi.get_real(CESPI_IDCESPITE) + 1;
|
||||
idcespite = num.string("@@@@@@@@@@");
|
||||
|
||||
cespi.zero();
|
||||
cespi.put(CESPI_IDCESPITE, idcespite); //zero filled field!
|
||||
cespi.put(CESPI_CODCGRA, gr);
|
||||
cespi.put(CESPI_CODSPA, sp);
|
||||
cespi.put(CESPI_CODCAT, cat);
|
||||
cespi.put(CESPI_DTCOMP, datafine);
|
||||
cespi.put(CESPI_DTFUNZ, datafine);
|
||||
cespi.put(CESPI_AMMPROP, "X");
|
||||
cespi.put(CESPI_TUIR, "X");
|
||||
cespi.put(CESPI_USOPROM, 1);
|
||||
cespi.put(CESPI_FLGTPVEI, 1);
|
||||
cespi.put(CESPI_TPSPEMAN, 1);
|
||||
|
||||
TString desc = "Importo spese di manutenzione sostenute - beni materiali ";
|
||||
desc << (cat == 91 ? 5 : 25) << '%';
|
||||
cespi.put(CESPI_DESC, desc);
|
||||
|
||||
const TRectype& cac = ditta_cespiti().categoria(0, NULL, cat);
|
||||
cespi.put(CESPI_VINCOLO, cac.get("I2"));
|
||||
cespi.put(CESPI_ANNIRIC, cac.get("I3"));
|
||||
cespi.put(CESPI_PMINP, cac.get("R14"));
|
||||
cespi.put(CESPI_PMAXP, cac.get("R15"));
|
||||
|
||||
cespi.write(); //abbiamo creato il cespite su CESPI!
|
||||
}
|
||||
|
||||
{ // Scrittura saldo iniziale
|
||||
TLocalisamfile salce(LF_SALCE);
|
||||
salce.put(SALCE_IDCESPITE, idcespite);
|
||||
salce.put(SALCE_CODES, es);
|
||||
salce.put(SALCE_TPSALDO, 1);
|
||||
salce.put(SALCE_NUMELE, 1);
|
||||
salce.put(SALCE_CSTO, spese);
|
||||
salce.write(); //abbiamo creato il cespite su SALCE!
|
||||
}
|
||||
|
||||
// Calcola ammortamenti per cespite (creando anche salce 2 e i 6 ammce)
|
||||
TCespite ces(idcespite);
|
||||
for (int i = 1; i <= 3; i++)
|
||||
ces.calc_amm(i, datafine);
|
||||
}
|
||||
|
||||
void TRegistro_cespiti::crea_cespite_man()
|
||||
{
|
||||
_idspese5 = _idspese25 = "";
|
||||
const TRectype& ccb = ditta_cespiti().get_attivita();
|
||||
const real speseman_5 = ccb.get_real("R2");
|
||||
if (speseman_5 != ZERO)
|
||||
costruisci_cespite(91, speseman_5);
|
||||
|
||||
const real speseman_25 = ccb.get_real("R3");
|
||||
if (speseman_25 != ZERO)
|
||||
costruisci_cespite(92, speseman_25);
|
||||
}
|
||||
|
||||
HIDDEN void kill_rec(TLocalisamfile& f)
|
||||
{
|
||||
int err = f.read();
|
||||
if (err == NOERR)
|
||||
{
|
||||
err = f.remove();
|
||||
if (err == NOERR && f.read() == NOERR)
|
||||
err = _iskeyerr;
|
||||
}
|
||||
if (err != NOERR)
|
||||
error_box("Errore %d durante la cancellazione del cespite %s dal file: %d",
|
||||
err, (const char*)f.get("IDCESPITE"), f.num());
|
||||
}
|
||||
|
||||
void TRegistro_cespiti::distruggi_cespite_man()
|
||||
{
|
||||
TLocalisamfile cespi(LF_CESPI);
|
||||
TLocalisamfile salce(LF_SALCE);
|
||||
TLocalisamfile ammce(LF_AMMCE);
|
||||
const int es = _mask->get_int(F_ESERCIZIO);
|
||||
|
||||
for (int cat = 91; cat <= 92; cat++)
|
||||
{
|
||||
TString& idcespite = (cat == 91) ? _idspese5 : _idspese25;
|
||||
if (idcespite.not_empty())
|
||||
{
|
||||
cespi.zero();
|
||||
cespi.put(CESPI_IDCESPITE, idcespite);
|
||||
kill_rec(cespi);
|
||||
|
||||
for (int tpsaldo = 1; tpsaldo <= 2; tpsaldo++)
|
||||
{
|
||||
salce.zero();
|
||||
salce.put(SALCE_IDCESPITE, idcespite);
|
||||
salce.put(SALCE_CODES, es);
|
||||
salce.put(SALCE_TPSALDO, tpsaldo);
|
||||
kill_rec(salce);
|
||||
for (int tpamm = 1; tpamm <= 3; tpamm++)
|
||||
{
|
||||
ammce.zero();
|
||||
ammce.put(AMMCE_IDCESPITE, idcespite);
|
||||
ammce.put(AMMCE_CODES, es);
|
||||
ammce.put(AMMCE_TPSALDO, tpsaldo);
|
||||
ammce.put(AMMCE_TPAMM, tpamm);
|
||||
kill_rec(ammce);
|
||||
}
|
||||
}
|
||||
}
|
||||
idcespite.cut(0);
|
||||
}
|
||||
}
|
||||
|
||||
void TRegistro_cespiti::aggiorna_bollato()
|
||||
{
|
||||
return;
|
||||
{
|
||||
{ //aggiorna la tabella CCB
|
||||
TTable ccb("CCB");
|
||||
ccb.curr() = ditta_cespiti().get_attivita();
|
||||
ccb.put("B1", "X"); //bollato stampato
|
||||
ccb.rewrite();
|
||||
}
|
||||
|
||||
const TDate oggi(TODAY);
|
||||
|
||||
{ //aggiorna il file SALCE
|
||||
TRelation rel (LF_SALCE);
|
||||
TString expr = "CODES=";
|
||||
expr << _mask->get(F_ESERCIZIO);
|
||||
TCursor cursor(&rel, expr);
|
||||
const long items = cursor.items();
|
||||
cursor.freeze();
|
||||
|
||||
TRectype& curr = cursor.curr();
|
||||
for (cursor = 0; cursor.pos() < items; ++cursor)
|
||||
{
|
||||
const TString16 idcespite = curr.get(SALCE_IDCESPITE); //controlla che il cespite appartenga all'attivitá selezionata
|
||||
const TRectype& ces = cache().get(LF_CESPI, idcespite);
|
||||
if (ces.get_int(CESPI_CODCGRA) != _mask->get_int(F_GRUPPO))
|
||||
continue;
|
||||
if (ces.get(CESPI_CODSPA) != _mask->get(F_SPECIE))
|
||||
continue;
|
||||
|
||||
curr.put(SALCE_DTSTBOLL, oggi);
|
||||
rel.rewrite();
|
||||
}
|
||||
}
|
||||
|
||||
{ //aggiorna il file MOVCE
|
||||
TRelation rel (LF_MOVCE);
|
||||
TString expr;
|
||||
expr << "(ANSI(DTMOV)>=\""<<_mask->get_date(F_DATAINIZIO).string(ANSI)<<"\")&&";
|
||||
expr << "(ANSI(DTMOV)<=\""<<_mask->get_date(F_DATAFINE).string(ANSI)<<"\")";
|
||||
TCursor cursor(&rel, expr);
|
||||
TRectype& curr = cursor.curr();
|
||||
const long items = cursor.items();
|
||||
cursor.freeze();
|
||||
for (cursor = 0; cursor.pos() < items; ++cursor)
|
||||
{
|
||||
const TString16 idcespite = curr.get(MOVCE_IDCESPITE); //controlla che il cespite appartenga all'attivitá selezionata
|
||||
const TRectype& ces = cache().get(LF_CESPI, idcespite);
|
||||
if (ces.get_int(CESPI_CODCGRA) != _mask->get_int(F_GRUPPO))
|
||||
continue;
|
||||
if (ces.get(CESPI_CODSPA) != _mask->get(F_SPECIE))
|
||||
continue;
|
||||
curr.put(MOVCE_STAMPATO, "X");
|
||||
rel.rewrite();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TRegistro_cespiti::header_registro()
|
||||
@ -259,16 +474,19 @@ void TRegistro_cespiti::header_registro()
|
||||
_form->find_field('H', first_page, FR_D_SPECIE).set(_mask->get(F_D_SPECIE));
|
||||
_form->find_field('H', first_page, FR_DATAINIZIO).set(_mask->get(F_DATAINIZIO));
|
||||
_form->find_field('H', first_page, FR_DATAFINE).set(_mask->get(F_DATAFINE));
|
||||
TString80 key; key.format("%04d",_mask->get_int(F_ESERCIZIO));
|
||||
TString key; key.format("%04d",_mask->get_int(F_ESERCIZIO));
|
||||
|
||||
const TRectype& cce = cache().get("CCE", key);
|
||||
_form->find_field('H', first_page, FR_NUMGIOSOL).set(cce.get("I3"));
|
||||
long giorni = (_mask->get_date(F_DATAFINE) - _mask->get_date(F_DATAINIZIO) + 1);
|
||||
const int giorni = int(_mask->get_date(F_DATAFINE) - _mask->get_date(F_DATAINIZIO) + 1);
|
||||
key.format("%3d",giorni);
|
||||
_form->find_field('H', first_page, FR_NUMGIORNI).set(key);
|
||||
|
||||
_form->find_field('H', first_page, FR_LIBROCESPITI).enable(_bollato);
|
||||
_form->find_field('H', first_page, FR_LIBROCESPITI); // .enable(_bollato);
|
||||
_form->set_testata();
|
||||
|
||||
//se stampa bollato -> nascondi data stampa
|
||||
_form->find_field('F', last_page, FR_DATASTAMPA).show(_mask->get_int(F_TIPOREGISTRO) != 2);
|
||||
_form->set_piede();
|
||||
}
|
||||
|
||||
@ -333,11 +551,11 @@ void TRegistro_cespiti::stampa_sezione(TPrint_section& section)
|
||||
word y2 = section.find_field(FR_MV_QANT).y();
|
||||
for (word i = 0; i < section.height(); i++)
|
||||
{
|
||||
if (i+1>=y1 && i+1<= y2)
|
||||
if (i>=y1-1 && i<= y2-1)
|
||||
{
|
||||
TPrintrow& row = section.row(i);
|
||||
TString rowstr = row.row();
|
||||
if (!rowstr.blank())
|
||||
if (!rowstr.blank()) //se almeno 1 valore della riga è <> 0 allora la riga viene stampata, in caso contrario viene saltata
|
||||
printer().print(section.row(i));
|
||||
}
|
||||
else
|
||||
@ -353,7 +571,6 @@ void TRegistro_cespiti::stampa_movimento(TRectype& recmovce, TRectype& recmovam,
|
||||
_form->cursor()->curr(LF_MOVAM) = recmovam; //copia il record del cursore che scannerizza movimenti e rettifiche nel
|
||||
_form->cursor()->curr(LF_AMMMV) = recammmv; //cursore principale del form
|
||||
|
||||
|
||||
if (recmovce.get_char(MOVCE_SEGNO)=='-')
|
||||
{
|
||||
section.find_field(FR_MV_SEGNO).set("-1");
|
||||
@ -363,16 +580,16 @@ void TRegistro_cespiti::stampa_movimento(TRectype& recmovce, TRectype& recmovam,
|
||||
section.find_field(FR_MV_SEGNO).set("1");
|
||||
}
|
||||
|
||||
section.update();
|
||||
_form->set_pagina();
|
||||
section.update();
|
||||
_form->set_pagina();
|
||||
|
||||
for (word i = 0; i < section.height(); i++)
|
||||
{
|
||||
TPrintrow& row = section.row(i);
|
||||
TString rowstr = row.row();
|
||||
if (!rowstr.blank())
|
||||
printer().print(row);
|
||||
}
|
||||
for (word i = 0; i < section.height(); i++)
|
||||
{
|
||||
TPrintrow& row = section.row(i);
|
||||
TString rowstr = row.row();
|
||||
if (!rowstr.blank())
|
||||
printer().print(row);
|
||||
}
|
||||
}
|
||||
|
||||
void TRegistro_cespiti::print_movimenti()
|
||||
@ -424,15 +641,19 @@ void TRegistro_cespiti::print_movimenti()
|
||||
toret.put(MOVCE_IDCESPITE, id);
|
||||
|
||||
TString filtro;
|
||||
filtro << MOVCE_IDRET << "==" << recmovce.get(MOVCE_IDMOV); //confronta numericamente IDRET e IDMOV
|
||||
filtro << MOVCE_IDRET << "==\"" << recmovce.get(MOVCE_IDMOV) << '"'; //confronta numericamente IDRET e IDMOV
|
||||
//ed ecco il cursore!
|
||||
TCursor rettcur(&rel_rettif, filtro, 2, &fromret, &toret);
|
||||
const long items = rettcur.items();
|
||||
if (items > 0)
|
||||
{
|
||||
_form->cursor()->relation()->save_status(); //salva posizione di tutti i files del cursore
|
||||
//(serve per rettifiche "staccate" dai loro movimenti)
|
||||
rettcur.freeze();
|
||||
for (rettcur = 0l ; rettcur.pos()<items; ++rettcur)
|
||||
stampa_movimento(rettcur.curr(LF_MOVCE), rettcur.curr(LF_MOVAM), rettcur.curr(LF_AMMMV));
|
||||
|
||||
_form->cursor()->relation()->restore_status(); //ripristina la posizione di tutti i files del cursore
|
||||
}
|
||||
|
||||
stampa_sezione(totali);
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
#define FR_NUMGIORNI 9
|
||||
#define FR_NUMGIOSOL 10
|
||||
#define FR_LIBROCESPITI 11
|
||||
#define FR_SITUAZIONE 12
|
||||
#define FR_DATASTAMPA 13
|
||||
|
||||
#define FR_CAT 21
|
||||
#define FR_D_CAT 22
|
||||
@ -29,6 +31,7 @@
|
||||
#define FR_MV_CSTO 43
|
||||
#define FR_MV_VNONAMM 44
|
||||
#define FR_MV_IMPVEN 45
|
||||
#define FR_MV_IMPVEN_S 64
|
||||
#define FR_MV_RIVGF 46
|
||||
#define FR_MV_RIVGC 47
|
||||
#define FR_MV_TOTRIV 48
|
||||
@ -40,6 +43,8 @@
|
||||
#define FR_MV_QNOR 54
|
||||
#define FR_MV_QACC 55
|
||||
#define FR_MV_QANT 56
|
||||
#define FR_MV_QNONAMM4 64
|
||||
#define FR_MV_QNONAMM4_SEGNO 65
|
||||
#define FR_MV_TOTFONDOAMM 57
|
||||
#define FR_MV_QNOR_SEGNO 58
|
||||
#define FR_MV_QACC_SEGNO 59
|
||||
@ -90,6 +95,8 @@
|
||||
#define FR_TC_TOTRIV 114
|
||||
#define FR_TC_VALAMM 115
|
||||
#define FR_TC_RESAMM 116
|
||||
#define FR_TC_MINUSVALENZA 127
|
||||
#define FR_TC_PLUSVALENZA 128
|
||||
#define FR_TC_PLUSREIN 117
|
||||
#define FR_TC_FONDOAMM 118
|
||||
#define FR_TC_QNONAMM 119
|
||||
@ -107,6 +114,8 @@
|
||||
#define FR_TG_TOTRIV 154
|
||||
#define FR_TG_VALAMM 155
|
||||
#define FR_TG_RESAMM 156
|
||||
#define FR_TG_MINUSVALENZA 167
|
||||
#define FR_TG_PLUSVALENZA 168
|
||||
#define FR_TG_PLUSREIN 157
|
||||
#define FR_TG_FONDOAMM 158
|
||||
#define FR_TG_QNONAMM 159
|
||||
|
||||
507
ce/ce3100a.frm
507
ce/ce3100a.frm
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,16 @@
|
||||
#include "ce3100a.h"
|
||||
|
||||
TOOLBAR "" 0 -2 0 2
|
||||
TOOLBAR "" 0 -3 0 3
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
PROMPT -12 -11 ""
|
||||
PICTURE BMP_PRINT
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
@ -46,8 +47,8 @@ BEGIN
|
||||
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio" 105@->D0
|
||||
DISPLAY "Data fine@10" 105@->D1
|
||||
DISPLAY "Data inizio esercizio" 105@->D0
|
||||
DISPLAY "Data fine esercizio" 105@->D1
|
||||
OUTPUT F_ESERCIZIO CODTAB
|
||||
OUTPUT F_DATAINIZIO 105@->D0
|
||||
OUTPUT F_DATAFINE 105@->D1
|
||||
@ -131,6 +132,7 @@ BEGIN
|
||||
OUTPUT F_CATINI CODTAB[7,8]
|
||||
OUTPUT F_D_CATINI S0
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_D_CATINI 60 50
|
||||
@ -144,6 +146,7 @@ BEGIN
|
||||
DISPLAY "Specie" CODTAB[3,6]
|
||||
COPY OUTPUT F_CATINI
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_CATFIN 2
|
||||
@ -160,6 +163,7 @@ BEGIN
|
||||
OUTPUT F_CATFIN CODTAB[7,8]
|
||||
OUTPUT F_D_CATFIN S0
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_D_CATFIN 60 50
|
||||
@ -173,6 +177,7 @@ BEGIN
|
||||
DISPLAY "Specie" CODTAB[3,6]
|
||||
COPY OUTPUT F_CATFIN
|
||||
CHECKTYPE SEARCH
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPOREGISTRO 30
|
||||
@ -180,9 +185,9 @@ BEGIN
|
||||
PROMPT 2 9 "Stampa registro"
|
||||
ITEM "1|di Prova"
|
||||
MESSAGE CLEAR,F_CODREG|DISABLE,F_CODREG
|
||||
MESSAGE ENABLE, F_AMMORTAMENTI
|
||||
MESSAGE ENABLE, F_AMMORTAMENTI|ENABLE,1@
|
||||
ITEM "2|Bollato"
|
||||
MESSAGE ENABLE,F_CODREG
|
||||
MESSAGE ENABLE,F_CODREG|"X",F_CALCOLO|CLEAR,1@
|
||||
MESSAGE "1",F_AMMORTAMENTI|DISABLE,F_AMMORTAMENTI
|
||||
FLAGS "Z"
|
||||
END
|
||||
|
||||
@ -204,8 +204,8 @@ void TStampa_prospetto::set_intestazione( const int tipo, const int ordinamento)
|
||||
// in base all'ordinamento (per categoria o per impianto) scrive la riga con codice e descrizione
|
||||
if (ordinamento == 0)
|
||||
{
|
||||
_form->find_field('H', first_page, FR_INT_COD).set("Cat.");
|
||||
_form->find_field('H', first_page, FR_INT_DESC).set("Descrizione categoria");
|
||||
_form->find_field('H', first_page, FR_INT_COD).set("@bCat.@r");
|
||||
_form->find_field('H', first_page, FR_INT_DESC).set("@bDescrizione categoria@r");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -394,7 +394,8 @@ void TStampa_prospetto::aggiorna_totali(TCursor& cur, const int tipo, TTipo_cesp
|
||||
{
|
||||
const TString8 codmov = mov.get(MOVCE_CODMOV);
|
||||
const char tmc = cache().get("%TMC", codmov, "S6")[0]; //prende il valore del campo S6 nella tabella tipi movimento
|
||||
const char segno = mov.get_char(MOVCE_SEGNO);
|
||||
const char segno = mov.get_char(MOVCE_SEGNO);
|
||||
const real signum = segno == '-' ? -1.0 : +1.0; //serve per sommare i movimenti con il loro segno effettivo
|
||||
riv75 = mov.get_real(MOVCE_RIV75);
|
||||
riv83 = mov.get_real(MOVCE_RIV83);
|
||||
riv90 = mov.get_real(MOVCE_RIV90);
|
||||
@ -408,28 +409,28 @@ void TStampa_prospetto::aggiorna_totali(TCursor& cur, const int tipo, TTipo_cesp
|
||||
real qant = amm.get_real(MOVAM_QANT);
|
||||
|
||||
if (tmc == 'R')
|
||||
_cat._tot_riveser += riv75 + riv83 + riv90 + riv91 + rivg;
|
||||
_cat._tot_riveser += (riv75 + riv83 + riv90 + riv91 + rivg) * signum;
|
||||
if (tmc == 'I' || (tmc <= ' ' && segno == '+'))
|
||||
{
|
||||
_cat._tot_acqincr += csto - vnonamm2 + riv75 + riv83 + riv90 + riv91 + rivg;
|
||||
_cat._tot_incr += qnor + qacc + qant;
|
||||
_cat._tot_acqincr += (csto - vnonamm2 + riv75 + riv83 + riv90 + riv91 + rivg) * signum;
|
||||
_cat._tot_incr += (qnor + qacc + qant) * signum;
|
||||
}
|
||||
if (tmc == 'E' || (tmc <= ' ' && segno == '-'))
|
||||
{
|
||||
_cat._tot_cesselim2 += csto - vnonamm2 + riv75 + riv83 + riv90 + riv91 + rivg;
|
||||
_cat._tot_cesselim3 += qnor + qant + qacc;
|
||||
_cat._tot_cesselim2 += (csto - vnonamm2 + riv75 + riv83 + riv90 + riv91 + rivg) * (-signum);
|
||||
_cat._tot_cesselim3 += (qnor + qant + qacc) * (-signum);
|
||||
}
|
||||
if (tmc == 'P')
|
||||
_cat._tot_reinplus += mov.get_real(MOVCE_PLUSREIN);
|
||||
_cat._tot_reinplus += (mov.get_real(MOVCE_PLUSREIN)) * signum;
|
||||
|
||||
// solo nei casi con tipo =2 e/o 3 viene preso l'ammortamento da ammmv (che verrá poi sommato nella riga 4, piú sotto, a quello
|
||||
// preso da ammce); l'ammortamento viene preso qui in quanto é relativo ai movimenti che vengono qui scanditi
|
||||
|
||||
if (tipo != 1)
|
||||
{
|
||||
amv_ammnor += amv.get_real(AMMMV_QNOR);
|
||||
amv_ammacc += amv.get_real(AMMMV_QACC);
|
||||
amv_ammant += amv.get_real(AMMMV_QANT);
|
||||
amv_ammnor += (amv.get_real(AMMMV_QNOR)) * signum;
|
||||
amv_ammacc += (amv.get_real(AMMMV_QACC)) * signum;
|
||||
amv_ammant += (amv.get_real(AMMMV_QANT)) * signum;
|
||||
}
|
||||
|
||||
} //fine controllo sulle date
|
||||
|
||||
@ -13,13 +13,13 @@ SECTION HEADER FIRST 12
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "titolo"
|
||||
PROMPT 36 1 "ALLEGATO AL BILANCIO FISCALE"
|
||||
PROMPT 36 1 "@bALLEGATO AL BILANCIO FISCALE@r"
|
||||
END
|
||||
|
||||
STRINGA FR_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "Ditta "
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
@ -32,7 +32,7 @@ STRINGA FR_CODDITTA
|
||||
STRINGA FR_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 3 "Gruppo "
|
||||
PROMPT 1 3 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
@ -45,7 +45,7 @@ STRINGA FR_CODDITTA
|
||||
STRINGA FR_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 4 "Specie "
|
||||
PROMPT 1 4 "@bSpecie@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
@ -58,19 +58,19 @@ STRINGA FR_CODDITTA
|
||||
DATA FR_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Data inizio esercizio"
|
||||
PROMPT 1 5 "Esercizio "
|
||||
PROMPT 1 5 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
DATA FR_DATAFINE
|
||||
BEGIN
|
||||
KEY "Data fine esercizio"
|
||||
PROMPT 25 5 " - "
|
||||
PROMPT 25 5 " @b-@r "
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "tipo situaz. da stampare"
|
||||
PROMPT 1 6 "Situazione "
|
||||
PROMPT 1 6 "@bSituazione@r "
|
||||
END
|
||||
|
||||
STRINGA FR_SITUAZIONE
|
||||
@ -81,7 +81,7 @@ STRINGA FR_CODDITTA
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 7 "==================================================================================================================================================="
|
||||
PROMPT 1 7 "@b===================================================================================================================================================@r"
|
||||
END
|
||||
|
||||
STRINGA FR_INT_COD
|
||||
@ -99,103 +99,103 @@ STRINGA FR_CODDITTA
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 64 8 "Costo storico"
|
||||
PROMPT 64 8 "@bCosto storico@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 106 8 "Tot. rivalutazioni"
|
||||
PROMPT 106 8 "@bTot. rivalutazioni@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 130 8 "Val. inizio eser."
|
||||
PROMPT 130 8 "@bVal. inizio eser.@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 59 9 "Rival. esercizio"
|
||||
PROMPT 59 9 "@bRival. esercizio@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 82 9 "Acq/incrementi"
|
||||
PROMPT 82 9 "@bAcq/incrementi@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 106 9 "Cessioni/Elimin."
|
||||
PROMPT 106 9 "@bCessioni/Elimin.@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 128 9 "Valore a bilancio"
|
||||
PROMPT 128 9 "@bValore a bilancio@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 55 10 "Fondo inizio eser."
|
||||
PROMPT 55 10 "@bFondo inizio eser.@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 84 10 "Incrementi"
|
||||
PROMPT 84 10 "@bIncrementi@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 104 10 "Cessioni/Elimin."
|
||||
PROMPT 104 10 "@bCessioni/Elimin.@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 127 10 "Reinvest. Plusv."
|
||||
PROMPT 127 10 "@bReinvest. Plusv.@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 34 11 "Amm. normale"
|
||||
PROMPT 34 11 "@bAmm. normale@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 56 11 "Amm. accelerato"
|
||||
PROMPT 56 11 "@bAmm. accelerato@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 77 11 "Amm. anticipato"
|
||||
PROMPT 77 11 "@bAmm. anticipato@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 102 11 "Fondo a bilancio"
|
||||
PROMPT 102 11 "@bFondo a bilancio@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Intestazione stampa"
|
||||
PROMPT 123 11 "Residuo a bilancio"
|
||||
PROMPT 123 11 "@bResiduo a bilancio@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "riga"
|
||||
PROMPT 1 12 "==================================================================================================================================================="
|
||||
PROMPT 1 12 "@b===================================================================================================================================================@r"
|
||||
END
|
||||
|
||||
END //section header first
|
||||
@ -218,102 +218,118 @@ SECTION BODY ODD 5
|
||||
BEGIN
|
||||
KEY "costo storico"
|
||||
PROMPT 62 1 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_TOTRIV 15
|
||||
BEGIN
|
||||
KEY "totale rivalutazioni"
|
||||
PROMPT 109 1 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_VALINIES 15
|
||||
BEGIN
|
||||
KEY "valore inizio esercizio"
|
||||
PROMPT 132 1 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_RIVALES 15
|
||||
BEGIN
|
||||
KEY "rivalutazione esercizio"
|
||||
PROMPT 60 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_ACQINCR 15
|
||||
BEGIN
|
||||
KEY "acquisti/incrementi"
|
||||
PROMPT 81 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_CESSELIM2 15
|
||||
BEGIN
|
||||
KEY "cessioni/elimin. riga 2"
|
||||
PROMPT 107 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_VALBIL 15
|
||||
BEGIN
|
||||
KEY "valore a bilancio"
|
||||
PROMPT 130 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_FONDINIES 15
|
||||
BEGIN
|
||||
KEY "fondo inizio esercizio"
|
||||
PROMPT 58 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_INCR 15
|
||||
BEGIN
|
||||
KEY "incrementi"
|
||||
PROMPT 79 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_CESSELIM3 15
|
||||
BEGIN
|
||||
KEY "cessioni/elimin. riga 3"
|
||||
PROMPT 105 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_REINPLUS 15
|
||||
BEGIN
|
||||
KEY "reinvest. plusv."
|
||||
PROMPT 128 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_AMMNOR 15
|
||||
BEGIN
|
||||
KEY "ammortamento normale"
|
||||
PROMPT 31 4 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_AMMACC 15
|
||||
BEGIN
|
||||
KEY "ammortamento accelerato"
|
||||
PROMPT 56 4 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_AMMANT 15
|
||||
BEGIN
|
||||
KEY "ammortamento anticipato"
|
||||
PROMPT 77 4 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_FONDBIL 15
|
||||
BEGIN
|
||||
KEY "fondo a bilancio"
|
||||
PROMPT 103 4 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA FR_TC_RESBIL 15
|
||||
BEGIN
|
||||
KEY "residuo a bilancio"
|
||||
PROMPT 126 4 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "riga"
|
||||
PROMPT 1 5 "---------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 5 "@b---------------------------------------------------------------------------------------------------------------------------------------------------@r"
|
||||
END
|
||||
|
||||
END //section body odd
|
||||
@ -324,20 +340,20 @@ SECTION FOOTER FIRST 4
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "riga"
|
||||
PROMPT 1 1 "---------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
PROMPT 1 1 "@b---------------------------------------------------------------------------------------------------------------------------------------------------@r"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Data"
|
||||
PROMPT 1 2 "Data Stampa "
|
||||
PROMPT 1 2 "@bData Stampa@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1 7
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
KEY "Nr. pagina"
|
||||
PROMPT 130 2 "Pagina n. "
|
||||
PROMPT 130 2 "@bPagina n.@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
|
||||
467
ce/ce3400.cpp
Executable file
467
ce/ce3400.cpp
Executable file
@ -0,0 +1,467 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
|
||||
#include "celib.h"
|
||||
#include "ce3400.h"
|
||||
#include "ce3400a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "cespi.h"
|
||||
#include "movce.h"
|
||||
#include "salce.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Generic Form
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
void TCespi_list_form::print_section(TPrint_section& sec)
|
||||
{
|
||||
TPrinter& pr = printer();
|
||||
sec.update();
|
||||
const unsigned int h = sec.height();
|
||||
if (h > pr.rows_left())
|
||||
pr.formfeed();
|
||||
for (unsigned int r = 0; r < h; r++)
|
||||
pr.print(sec.row(r));
|
||||
sec.reset();
|
||||
}
|
||||
|
||||
void TCespi_list_form::print_row(char filler)
|
||||
{
|
||||
TPrintrow row;
|
||||
if (filler > ' ')
|
||||
{
|
||||
TString256 spc;
|
||||
spc.fill(filler, 132);
|
||||
row.put(spc);
|
||||
}
|
||||
printer().print(row);
|
||||
}
|
||||
|
||||
void TCespi_list_form::print_separator()
|
||||
{
|
||||
print_row('_');
|
||||
}
|
||||
|
||||
void TCespi_list_form::set_testata(const TMask& m)
|
||||
{
|
||||
TPrint_section& header = section('H', odd_page);
|
||||
header.find_field(F_CODDITTA).set(m.get(F_CODDITTA));
|
||||
header.find_field(F_RAGSOC).set(m.get(F_RAGSOC));
|
||||
|
||||
header.find_field(F_ESERCIZIO).set(m.get(F_ESERCIZIO));
|
||||
header.find_field(F_DATAINIZIO).set(m.get(F_DATAINIZIO));
|
||||
header.find_field(F_DATAFINE).set(m.get(F_DATAFINE));
|
||||
|
||||
header.find_field(F_GRUPPO).set(m.get(F_GRUPPO));
|
||||
header.find_field(F_D_GRUPPO).set(m.get(F_D_GRUPPO));
|
||||
|
||||
header.find_field(F_SPECIE).set(m.get(F_SPECIE));
|
||||
header.find_field(F_D_SPECIE).set(m.get(F_D_SPECIE));
|
||||
|
||||
if (m.id2pos(F_SITUAZIONE) > 0)
|
||||
header.find_field(F_SITUAZIONE).set(m.get(F_SITUAZIONE));
|
||||
}
|
||||
|
||||
TCespi_list_form::TCespi_list_form(const char* name) : TForm(name)
|
||||
{
|
||||
_cur_form = this;
|
||||
printer().setheaderhandler(TForm::header_handler);
|
||||
printer().setfooterhandler(TForm::footer_handler);
|
||||
}
|
||||
|
||||
TCespi_list_form::~TCespi_list_form()
|
||||
{
|
||||
_cur_form = NULL;
|
||||
printer().setheaderhandler(NULL);
|
||||
printer().setfooterhandler(NULL);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Form
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TPR_form : public TCespi_list_form
|
||||
{
|
||||
public:
|
||||
TPrint_section& categoria() { return section('H', even_page); }
|
||||
TPrint_section& cespite() { return section('B', first_page); }
|
||||
TPrint_section& saldo() { return section('B', even_page); }
|
||||
TPrint_section& movimento() { return section('B', odd_page); }
|
||||
TPrint_section& totale() { return section('B', odd_page); }
|
||||
|
||||
TPR_form() : TCespi_list_form("ce3400a") { }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TPR_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TPR_mask() : TAutomask("ce3400a") { }
|
||||
};
|
||||
|
||||
bool TPR_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (f.dlg())
|
||||
{
|
||||
case F_FROM_CAT:
|
||||
case F_D_FROM_CAT:
|
||||
case F_TO_CAT:
|
||||
case F_D_TO_CAT:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
ok = dc.on_category_event(f, e, jolly);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Totalizer
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TTotalizer : public TAssoc_array
|
||||
{
|
||||
protected:
|
||||
void add_num(const TRectype& rec, const char* name, char segno);
|
||||
|
||||
public:
|
||||
void add_rec(const TRectype& rec, char segno = '+');
|
||||
TTotalizer& operator+=(TTotalizer& tot);
|
||||
real get_num(const char* name);
|
||||
const TString& get(const char* name) { return get_num(name).string(); }
|
||||
};
|
||||
|
||||
void TTotalizer::add_num(const TRectype& rec, const char* name, char segno)
|
||||
{
|
||||
real num = rec.get(name);
|
||||
if (!num.is_zero())
|
||||
{
|
||||
if (segno == '-')
|
||||
num = -num;
|
||||
real* val = (real*)objptr(name);
|
||||
if (val)
|
||||
*val += num;
|
||||
else
|
||||
add(name, num);
|
||||
}
|
||||
}
|
||||
|
||||
void TTotalizer::add_rec(const TRectype& rec, char segno)
|
||||
{
|
||||
add_num(rec, SALCE_CSTO, segno);
|
||||
add_num(rec, SALCE_RIV75, segno);
|
||||
add_num(rec, SALCE_RIV83, segno);
|
||||
add_num(rec, SALCE_RIV90, segno);
|
||||
add_num(rec, SALCE_RIV91, segno);
|
||||
add_num(rec, SALCE_RIVGF, segno);
|
||||
add_num(rec, SALCE_RIVGC, segno);
|
||||
}
|
||||
|
||||
TTotalizer& TTotalizer::operator+=(TTotalizer& tot)
|
||||
{
|
||||
FOR_EACH_ASSOC_OBJECT(tot, obj, name, itm)
|
||||
{
|
||||
real* val = (real*)objptr(name);
|
||||
if (val)
|
||||
*val += *(real*)itm;
|
||||
else
|
||||
add(name, *(real*)itm);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
real TTotalizer::get_num(const char* name)
|
||||
{
|
||||
real* val = (real*)objptr(name);
|
||||
return val ? *val : ZERO;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Application
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TPR_app : public TSkeleton_application
|
||||
{
|
||||
int _tipo_sit, _order;
|
||||
TTotalizer _tot_grp, _tot_gen;
|
||||
TPR_form* _form;
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
bool has_rivalutation(const TRectype& rec) const;
|
||||
|
||||
void print_categoria(const TString& codtab);
|
||||
void print_cespite(const TRectype& cespi, const TRectype& salini);
|
||||
void print_movimenti(const TRectype& salini);
|
||||
void print_saldo(const real& valore);
|
||||
void print_total(TTotalizer& tot, const char* prompt = NULL);
|
||||
};
|
||||
|
||||
bool TPR_app::has_rivalutation(const TRectype& rec) const
|
||||
{
|
||||
if (rec.get_real(_tipo_sit == 1 ? SALCE_RIVGF : SALCE_RIVGC) > ZERO)
|
||||
return TRUE;
|
||||
if (rec.get_real(SALCE_RIV91) > ZERO)
|
||||
return TRUE;
|
||||
if (rec.get_real(SALCE_RIV90) > ZERO)
|
||||
return TRUE;
|
||||
if (rec.get_real(SALCE_RIV83) > ZERO)
|
||||
return TRUE;
|
||||
if (rec.get_real(SALCE_RIV75) > ZERO)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TPR_app::print_categoria(const TString& codtab)
|
||||
{
|
||||
TPrint_section& header = _form->categoria();
|
||||
|
||||
header.find_field(F_CODTAB).set_prompt(_order == 1 ? "@bCategoria@r " : "@bImpianto@r ");
|
||||
header.find_field(F_CODTAB).set(codtab);
|
||||
TString80 descr;
|
||||
if (_order == 1)
|
||||
{
|
||||
const TRectype& cat = ditta_cespiti().categoria(0, NULL, atoi(codtab));
|
||||
descr = cat.get("S0");
|
||||
}
|
||||
else
|
||||
descr = cache().get("CIM", codtab, "S0");
|
||||
header.find_field(F_D_CODTAB).set(descr);
|
||||
_form->print_separator();
|
||||
_form->print_row();
|
||||
_form->print_section(header);
|
||||
_form->print_separator();
|
||||
_tot_grp.destroy();
|
||||
}
|
||||
|
||||
void TPR_app::print_cespite(const TRectype& cespi, const TRectype& salini)
|
||||
{
|
||||
TPrint_section& ces = _form->cespite();
|
||||
ces.find_field(1).set(cespi.get(CESPI_IDCESPITE));
|
||||
ces.find_field(2).set(cespi.get(CESPI_DESC));
|
||||
ces.find_field(3).set(cespi.get(CESPI_DTCOMP));
|
||||
_form->print_section(ces);
|
||||
|
||||
TTotalizer tot;
|
||||
tot.add_rec(salini);
|
||||
print_total(tot, "@bSaldi@r");
|
||||
_tot_grp += tot;
|
||||
}
|
||||
|
||||
void TPR_app::print_movimenti(const TRectype& salini)
|
||||
{
|
||||
const TString16 idcespite = salini.get(SALCE_IDCESPITE);
|
||||
const int codes = salini.get_int(SALCE_CODES);
|
||||
|
||||
TEsercizi_contabili esc;
|
||||
const TDate inies = esc[codes].inizio();
|
||||
const TDate fines = esc[codes].fine();
|
||||
|
||||
TRelation rel(LF_MOVCE);
|
||||
TRectype& movsem = rel.curr();
|
||||
movsem.put(MOVCE_IDCESPITE, idcespite);
|
||||
|
||||
TString filtro;
|
||||
filtro << "(ANSI(DTMOV)>=\"" << inies.string(ANSI) << "\")";
|
||||
filtro << "&&(ANSI(DTMOV)<=\"" << fines.string(ANSI) << "\")";
|
||||
|
||||
TCursor cur(&rel, filtro, 2, &movsem, &movsem);
|
||||
const long items = cur.items();
|
||||
|
||||
TTotalizer totces;
|
||||
totces.add_rec(salini);
|
||||
|
||||
if (items > 0)
|
||||
{
|
||||
cur.freeze();
|
||||
TTotalizer tot;
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
const TString4 codmov = movsem.get(MOVCE_CODMOV);
|
||||
const char tmv = cache().get("%TMC", codmov, "S6")[0];
|
||||
if (tmv == 'R')
|
||||
{
|
||||
const char segno = movsem.get_char(MOVCE_SEGNO);
|
||||
tot.add_rec(movsem, segno);
|
||||
}
|
||||
}
|
||||
print_total(tot, "@bRivalutazioni nell'esercizio@r");
|
||||
totces += tot;
|
||||
_tot_grp += tot;
|
||||
}
|
||||
|
||||
real valore = salini.get(SALCE_CSTO);
|
||||
valore += totces.get_num(SALCE_RIV75);
|
||||
valore += totces.get_num(SALCE_RIV83);
|
||||
valore += totces.get_num(SALCE_RIV90);
|
||||
valore += totces.get_num(SALCE_RIV91);
|
||||
valore += totces.get_num(_tipo_sit == 1 ? SALCE_RIVGF : SALCE_RIVGC);
|
||||
print_saldo(valore);
|
||||
}
|
||||
|
||||
void TPR_app::print_saldo(const real& valore)
|
||||
{
|
||||
TPrint_section& sal = _form->saldo();
|
||||
sal.find_field(1).set(valore.string());
|
||||
_form->print_section(sal);
|
||||
}
|
||||
|
||||
void TPR_app::print_total(TTotalizer& tot, const char* prompt)
|
||||
{
|
||||
if (prompt == NULL)
|
||||
{
|
||||
_form->print_separator();
|
||||
prompt = _order == 1 ? "@bTotale categoria@r " : "@bTotale impianto@r ";
|
||||
}
|
||||
|
||||
TPrint_section& body = _form->totale();
|
||||
body.find_field(1).set_prompt(prompt);
|
||||
|
||||
TForm_item& field = body.find_field(2);
|
||||
const real costo = tot.get(SALCE_CSTO);
|
||||
if (!costo.is_zero())
|
||||
{
|
||||
field.show();
|
||||
field.set(costo.string());
|
||||
}
|
||||
else
|
||||
field.hide();
|
||||
|
||||
body.find_field(3).set(tot.get(_tipo_sit == 1 ? SALCE_RIVGF : SALCE_RIVGC));
|
||||
body.find_field(4).set(tot.get(SALCE_RIV75));
|
||||
body.find_field(5).set(tot.get(SALCE_RIV83));
|
||||
body.find_field(6).set(tot.get(SALCE_RIV90));
|
||||
body.find_field(7).set(tot.get(SALCE_RIV91));
|
||||
_form->print_section(body);
|
||||
}
|
||||
|
||||
void TPR_app::main_loop()
|
||||
{
|
||||
TPR_mask m;
|
||||
ditta_cespiti().init_mask(m);
|
||||
while (m.run() != K_QUIT)
|
||||
{
|
||||
const int ese = m.get_int(F_ESERCIZIO);
|
||||
const int gruppo = m.get_int(F_GRUPPO);
|
||||
const TString4 specie = m.get(F_SPECIE);
|
||||
ditta_cespiti().set_attivita(ese, gruppo, specie);
|
||||
|
||||
TPR_form form;
|
||||
_form = &form;
|
||||
|
||||
TRelation rel(LF_CESPI);
|
||||
TString expr;
|
||||
expr << "IDCESPITE==IDCESPITE|CODES==" << m.get(F_ESERCIZIO) << "|TPSALDO==1";
|
||||
rel.add(LF_SALCE, expr, 1, LF_CESPI, 1);
|
||||
expr.rtrim(1); expr << '2';
|
||||
rel.add(LF_SALCE, expr, 1, LF_CESPI, 2);
|
||||
|
||||
const TRectype& cespi = rel.curr();
|
||||
const TRectype& salini = rel.curr(-1);
|
||||
const TRectype& salpro = rel.curr(-2);
|
||||
|
||||
_tipo_sit = m.get_int(F_SITUAZIONE);
|
||||
_order = m.get_int(F_ORDINAMENTO);
|
||||
|
||||
TString filter;
|
||||
if (_order == 1)
|
||||
{
|
||||
const int fc = m.get_int(F_FROM_CAT);
|
||||
const int tc = m.get_int(F_TO_CAT);
|
||||
if (fc != 0)
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODCAT << ">=" << fc << ')';
|
||||
}
|
||||
if (tc != 0)
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODCAT << "<=" << tc << ')' ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const TString& fi = m.get(F_FROM_IMP);
|
||||
const TString& ti = m.get(F_TO_IMP);
|
||||
if (!fi.blank())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODIMP << ">=" << fi << ')';
|
||||
}
|
||||
if (!fi.blank())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODIMP << "<=" << ti << ')';
|
||||
}
|
||||
}
|
||||
|
||||
const char* orderby = _order == 1 ? "CODCAT|IDCESPITE" : "CODIMP|IDCESPITE";
|
||||
TSorted_cursor cur(&rel, orderby, filter);
|
||||
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
printer().open();
|
||||
form.set_testata(m);
|
||||
|
||||
TString16 last_group = "@"; // Simbolo speciale per indicare nessuna stampa!
|
||||
_tot_gen.destroy();
|
||||
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
// Controllo qui la validità per non incasinare il valutatore con stringhe e numeri
|
||||
if (cespi.get_int(CESPI_CODCGRA) != gruppo || cespi.get(CESPI_CODSPA) != specie)
|
||||
continue;
|
||||
if (has_rivalutation(salpro))
|
||||
{
|
||||
const TString16 curr_group = cespi.get(_order == 1 ? CESPI_CODCAT : CESPI_CODIMP);
|
||||
if (curr_group != last_group)
|
||||
{
|
||||
if (last_group != "@")
|
||||
{
|
||||
print_total(_tot_grp);
|
||||
_tot_gen += _tot_grp;
|
||||
}
|
||||
last_group = curr_group;
|
||||
print_categoria(curr_group);
|
||||
}
|
||||
form.print_row();
|
||||
print_cespite(cespi, salini);
|
||||
print_movimenti(salini);
|
||||
}
|
||||
}
|
||||
if (last_group != "@")
|
||||
{
|
||||
print_total(_tot_grp);
|
||||
_tot_gen += _tot_grp;
|
||||
_form->print_separator();
|
||||
print_total(_tot_gen, "@bTOTALE GENERALE@r");
|
||||
printer().formfeed();
|
||||
}
|
||||
|
||||
printer().close();
|
||||
xvt_statbar_set("");
|
||||
}
|
||||
}
|
||||
|
||||
int ce3400(int argc, char* argv[])
|
||||
{
|
||||
TPR_app app;
|
||||
app.run(argc, argv, "Prospetto rivalutazioni");
|
||||
return 0;
|
||||
}
|
||||
21
ce/ce3400.h
Executable file
21
ce/ce3400.h
Executable file
@ -0,0 +1,21 @@
|
||||
#ifndef __CE3400_H
|
||||
#define __CE3400_H
|
||||
|
||||
#ifndef __FORM_H
|
||||
#include <form.h>
|
||||
#endif
|
||||
|
||||
class TCespi_list_form : public TForm
|
||||
{
|
||||
public:
|
||||
void print_section(TPrint_section& sec);
|
||||
void print_row(char spc = ' ');
|
||||
void print_separator();
|
||||
|
||||
void set_testata(const TMask& m);
|
||||
|
||||
TCespi_list_form(const char* name);
|
||||
virtual ~TCespi_list_form();
|
||||
};
|
||||
|
||||
#endif
|
||||
239
ce/ce3400a.frm
Executable file
239
ce/ce3400a.frm
Executable file
@ -0,0 +1,239 @@
|
||||
#include "ce3400a.h"
|
||||
|
||||
// Linee di sfondo
|
||||
|
||||
SECTION GRAPHICS ODD
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 6 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 -3 "B"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
// Testata
|
||||
|
||||
SECTION HEADER ODD 7
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Titolo"
|
||||
PROMPT 1 1 "@bPROSPETTO RIVALUTAZIONI"
|
||||
END
|
||||
|
||||
LISTA F_SITUAZIONE
|
||||
BEGIN
|
||||
KEY "Situazione"
|
||||
PROMPT 80 1 ""
|
||||
ITEM "1|Situazione Fiscale"
|
||||
ITEM "2|Situazione Civilistica"
|
||||
ITEM "3|Situazione Gestionale"
|
||||
END
|
||||
|
||||
STRINGA F_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_RAGSOC
|
||||
BEGIN
|
||||
KEY "Ragione sociale"
|
||||
PROMPT 20 2 ""
|
||||
END
|
||||
|
||||
STRINGA F_ESERCIZIO
|
||||
BEGIN
|
||||
KEY "Esercizio"
|
||||
PROMPT 1 3 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
STRINGA F_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Inizio Esercizio"
|
||||
PROMPT 20 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_DATAFINE
|
||||
BEGIN
|
||||
KEY "Fine Esercizio"
|
||||
PROMPT 33 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 4 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_D_GRUPPO
|
||||
BEGIN
|
||||
KEY "Descrizione Gruppo"
|
||||
PROMPT 20 4 ""
|
||||
END
|
||||
|
||||
STRINGA F_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 5 "@bSpecie@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_SPECIE
|
||||
BEGIN
|
||||
KEY "Descrizione Specie"
|
||||
PROMPT 20 5 ""
|
||||
END
|
||||
|
||||
STRINGA 2
|
||||
BEGIN
|
||||
PROMPT 22 7 "@bCosto Storico@r"
|
||||
END
|
||||
|
||||
STRINGA 3
|
||||
BEGIN
|
||||
PROMPT 37 7 "@bRival. generica@r"
|
||||
END
|
||||
|
||||
STRINGA 4
|
||||
BEGIN
|
||||
PROMPT 56 7 "@bRival. 576/75@r"
|
||||
END
|
||||
|
||||
STRINGA 5
|
||||
BEGIN
|
||||
PROMPT 74 7 "@bRival. 72/83@r"
|
||||
END
|
||||
|
||||
STRINGA 6
|
||||
BEGIN
|
||||
PROMPT 90 7 "@bRival. 413/90@r"
|
||||
END
|
||||
|
||||
STRINGA 7
|
||||
BEGIN
|
||||
PROMPT 107 7 "@bRival. 413/91@r"
|
||||
END
|
||||
END
|
||||
|
||||
SECTION HEADER EVEN 1
|
||||
STRINGA F_CODTAB
|
||||
BEGIN
|
||||
KEY "categoria o impianto"
|
||||
PROMPT 1 1 "@bCategoria@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_CODTAB
|
||||
BEGIN
|
||||
KEY "Descrizione"
|
||||
PROMPT 25 1 "@bDescrizione@r "
|
||||
END
|
||||
END
|
||||
|
||||
SECTION BODY FIRST 1
|
||||
|
||||
STRING 1
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bCespite@r "
|
||||
END
|
||||
|
||||
STRING 2
|
||||
BEGIN
|
||||
PROMPT 25 1 "@bDescrizione@r "
|
||||
END
|
||||
|
||||
STRING 3
|
||||
BEGIN
|
||||
PROMPT 100 1 "@bData acquisizione@r "
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION BODY ODD 1
|
||||
|
||||
STRINGA 1
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bTotale@r"
|
||||
END
|
||||
|
||||
VALUTA 2 15
|
||||
BEGIN
|
||||
KEY "Costo storico"
|
||||
PROMPT 20 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 3 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione generica"
|
||||
PROMPT 37 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 4 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione 75"
|
||||
PROMPT 54 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 5 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione 83"
|
||||
PROMPT 71 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 6 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione 90"
|
||||
PROMPT 88 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 7 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione 91"
|
||||
PROMPT 105 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION BODY EVEN 1
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bValore a bilancio@r"
|
||||
END
|
||||
|
||||
VALUTA 1 15
|
||||
BEGIN
|
||||
KEY "Totale a bilancio"
|
||||
PROMPT 20 1 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION FOOTER ODD 3
|
||||
|
||||
DATA -1
|
||||
BEGIN
|
||||
PROMPT 1 2 "@bData@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 120 2 "@bPagina@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
25
ce/ce3400a.h
Executable file
25
ce/ce3400a.h
Executable file
@ -0,0 +1,25 @@
|
||||
#define F_CODDITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_ESERCIZIO 103
|
||||
#define F_DATAINIZIO 104
|
||||
#define F_DATAFINE 105
|
||||
#define F_GRUPPO 106
|
||||
#define F_SPECIE 107
|
||||
#define F_D_GRUPPO 108
|
||||
#define F_D_SPECIE 109
|
||||
#define F_CODTAB 110
|
||||
#define F_D_CODTAB 111
|
||||
|
||||
#define F_FROM_CAT 112
|
||||
#define F_D_FROM_CAT 113
|
||||
#define F_TO_CAT 114
|
||||
#define F_D_TO_CAT 115
|
||||
|
||||
#define F_FROM_IMP 116
|
||||
#define F_D_FROM_IMP 117
|
||||
#define F_TO_IMP 118
|
||||
#define F_D_TO_IMP 119
|
||||
|
||||
#define F_SITUAZIONE 120
|
||||
#define F_ORDINAMENTO 121
|
||||
|
||||
221
ce/ce3400a.uml
Executable file
221
ce/ce3400a.uml
Executable file
@ -0,0 +1,221 @@
|
||||
#include "ce3400a.h"
|
||||
|
||||
TOOLBAR "" 0 -3 0 3
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Stampa"
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Prospetto rivalutazioni" -1 -1 78 6
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Ditta "
|
||||
FLAGS "DF"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 55
|
||||
BEGIN
|
||||
PROMPT 20 1 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 2 2 "Esercizio "
|
||||
FLAGS "Z"
|
||||
USE CCE
|
||||
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio" 105@->D0
|
||||
DISPLAY "Data fine@10" 105@->D1
|
||||
OUTPUT F_ESERCIZIO CODTAB
|
||||
OUTPUT F_DATAINIZIO 105@->D0
|
||||
OUTPUT F_DATAFINE 105@->D1
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
DATE F_DATAINIZIO
|
||||
BEGIN
|
||||
PROMPT 20 2 "Data inizio "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_DATAFINE
|
||||
BEGIN
|
||||
PROMPT 45 2 "Data fine "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_GRUPPO 2
|
||||
BEGIN
|
||||
PROMPT 2 3 "Gruppo "
|
||||
FLAGS "Z"
|
||||
USE CCB KEY 1
|
||||
JOIN %CGR ALIAS 106 INTO CODTAB==CODTAB[5,6]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Codice" CODTAB[5,6]
|
||||
DISPLAY "Descrizione@60" 106@->S0
|
||||
OUTPUT F_GRUPPO CODTAB[5,6]
|
||||
OUTPUT F_D_GRUPPO 106@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_SPECIE 4
|
||||
BEGIN
|
||||
PROMPT 2 4 "Specie "
|
||||
FLAGS "_"
|
||||
USE CCB KEY 1
|
||||
JOIN %CAT ALIAS 107 INTO CODTAB[1,2]==CODTAB[5,6] CODTAB[3,6]==CODTAB[7,10]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO SELECT
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Gruppo" CODTAB[5,6]
|
||||
DISPLAY "Specie" CODTAB[7,10]
|
||||
DISPLAY "Descrizione@60" 107@->S0
|
||||
OUTPUT F_SPECIE CODTAB[7,10]
|
||||
OUTPUT F_D_SPECIE 107@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_D_GRUPPO 60 55
|
||||
BEGIN
|
||||
PROMPT 20 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_SPECIE 60 55
|
||||
BEGIN
|
||||
PROMPT 20 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_SITUAZIONE 78
|
||||
BEGIN
|
||||
PROMPT 1 7 "@bSituazione"
|
||||
ITEM "1|Fiscale"
|
||||
ITEM "2|Civilistica"
|
||||
ITEM "3|Gestionale"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_ORDINAMENTO 78
|
||||
BEGIN
|
||||
PROMPT 1 12 "@bOrdinamento"
|
||||
ITEM "1|Per categoria"
|
||||
MESSAGE HIDE,2@|SHOW,1@
|
||||
ITEM "2|Per Impianto"
|
||||
MESSAGE HIDE,1@|SHOW,2@
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 1 16 "@bSelezione categoria"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER F_FROM_CAT 2
|
||||
BEGIN
|
||||
PROMPT 2 17 "Dalla "
|
||||
FLAGS "BZ"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_D_FROM_CAT 60 50
|
||||
BEGIN
|
||||
PROMPT 25 17 ""
|
||||
FLAGS "B"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER F_TO_CAT 2
|
||||
BEGIN
|
||||
PROMPT 2 18 "Alla "
|
||||
FLAGS "BZ"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_D_TO_CAT 60 50
|
||||
BEGIN
|
||||
PROMPT 25 18 ""
|
||||
FLAGS "B"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 1 16 "@bSelezione impianto"
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
NUMBER F_FROM_IMP 10
|
||||
BEGIN
|
||||
PROMPT 2 17 "Dal "
|
||||
FLAGS "Z"
|
||||
USE CIM
|
||||
INPUT CODTAB F_FROM_IMP
|
||||
DISPLAY "Codice Impianto" CODTAB
|
||||
DISPLAY "Descrizione@60" S0
|
||||
OUTPUT F_FROM_IMP CODTAB
|
||||
OUTPUT F_D_FROM_IMP S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRING F_D_FROM_IMP 50
|
||||
BEGIN
|
||||
PROMPT 25 17 ""
|
||||
USE CIM KEY 2
|
||||
INPUT S0 F_D_FROM_IMP
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice Impianto" CODTAB
|
||||
COPY OUTPUT F_FROM_IMP
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
NUMBER F_TO_IMP 10
|
||||
BEGIN
|
||||
PROMPT 2 18 "Al "
|
||||
FLAGS "Z"
|
||||
COPY USE F_FROM_IMP
|
||||
INPUT CODTAB F_TO_IMP
|
||||
COPY DISPLAY F_FROM_IMP
|
||||
OUTPUT F_TO_IMP CODTAB
|
||||
OUTPUT F_D_TO_IMP S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRING F_D_TO_IMP 50
|
||||
BEGIN
|
||||
PROMPT 25 18 ""
|
||||
COPY USE F_D_FROM_IMP
|
||||
INPUT S0 F_D_TO_IMP
|
||||
COPY DISPLAY F_D_FROM_IMP
|
||||
COPY OUTPUT F_TO_IMP
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
288
ce/ce3500.cpp
Executable file
288
ce/ce3500.cpp
Executable file
@ -0,0 +1,288 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
|
||||
#include "celib.h"
|
||||
#include "ce3400.h"
|
||||
#include "ce3500a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "ammce.h"
|
||||
#include "cespi.h"
|
||||
#include "salce.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Form
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TLC_form : public TCespi_list_form
|
||||
{
|
||||
TCursor* _cur;
|
||||
int _tiposit, _order;
|
||||
TString _str; // Jolly string
|
||||
|
||||
protected:
|
||||
virtual TRelation* relation() const { return _cur->relation(); }
|
||||
virtual TCursor* cursor() const { return _cur; }
|
||||
virtual bool validate(TForm_item& fld, TToken_string& val);
|
||||
|
||||
public:
|
||||
void set_cursor(TCursor& cur) { _cur = &cur; }
|
||||
void set_testata(const TMask& m, const TString& codtab);
|
||||
|
||||
TPrint_section& cespite() { return section('B', odd_page); }
|
||||
TPrint_section& totcat() { return section('B', even_page); }
|
||||
TPrint_section& totgen() { return section('B', last_page); }
|
||||
|
||||
const TString& decode_group(const char* cod, int sit=0);
|
||||
|
||||
TLC_form(bool extended) : TCespi_list_form(extended ? "ce3500b" : "ce3500a") { }
|
||||
};
|
||||
|
||||
const TString& TLC_form::decode_group(const char* codtab, int mode)
|
||||
{
|
||||
const int order = mode > 0 ? mode : _order;
|
||||
_str = "@b";
|
||||
_str << (order==1 ? "Categoria" : "Impianto") << "@r " << codtab << ' ';
|
||||
if (order == 1)
|
||||
{
|
||||
const TRectype& cat = ditta_cespiti().categoria(0, NULL, atoi(codtab));
|
||||
_str << cat.get("S0");
|
||||
}
|
||||
else
|
||||
_str << cache().get("CIM", codtab, "S0");
|
||||
return _str;
|
||||
}
|
||||
|
||||
void TLC_form::set_testata(const TMask& m, const TString& codtab)
|
||||
{
|
||||
TCespi_list_form::set_testata(m);
|
||||
|
||||
_tiposit = m.get_int(F_SITUAZIONE);
|
||||
_order = m.get_int(F_ORDINAMENTO);
|
||||
|
||||
TPrint_section& header = section('H', odd_page);
|
||||
header.find_field(F_CODTAB).set(decode_group(codtab));
|
||||
}
|
||||
|
||||
bool TLC_form::validate(TForm_item& fld, TToken_string& val)
|
||||
{
|
||||
const TRectype& cespi = relation()->curr();
|
||||
const char* cmd = val.get(0);
|
||||
if (stricmp(cmd, "_INVCODTAB") == 0)
|
||||
{
|
||||
// Se la stampa è ordinata per categoria allora stampo l'impianto e viceversa
|
||||
const TString16 codtab = cespi.get(_order == 1 ? CESPI_CODIMP : CESPI_CODCAT);
|
||||
if (codtab.not_empty())
|
||||
fld.set(decode_group(codtab, 3-_order));
|
||||
else
|
||||
fld.set("");
|
||||
return TRUE;
|
||||
}
|
||||
if (stricmp(cmd, "_USOPROM") == 0)
|
||||
{
|
||||
bool yes = cespi.get_bool(CESPI_VEIDIP);
|
||||
if (!yes)
|
||||
yes = cespi.get_int(CESPI_USOPROM) > 1;
|
||||
fld.set(yes ? "Si" : "No");
|
||||
return TRUE;
|
||||
}
|
||||
if (stricmp(cmd, "_TPSPEMAN") == 0)
|
||||
{
|
||||
switch(cespi.get_int(CESPI_TPSPEMAN))
|
||||
{
|
||||
case 2: fld.set("Incluso 5%"); break;
|
||||
case 3: fld.set("Incluso 24%"); break;
|
||||
case 4: fld.set("Art.14 L.449/97"); break;
|
||||
default: fld.set("Escluso"); break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
if (stricmp(cmd, "_RIVGEN") == 0)
|
||||
{
|
||||
const TRectype& salce = relation()->curr(LF_SALCE);
|
||||
fld.set(salce.get(_tiposit == 1 ? SALCE_RIVGF : SALCE_RIVGC));
|
||||
return TRUE;
|
||||
}
|
||||
return TCespi_list_form::validate(fld, val);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TLC_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TLC_mask() : TAutomask("ce3500a") { }
|
||||
};
|
||||
|
||||
bool TLC_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (f.dlg())
|
||||
{
|
||||
case F_FROM_CAT:
|
||||
case F_D_FROM_CAT:
|
||||
case F_TO_CAT:
|
||||
case F_D_TO_CAT:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
ok = dc.on_category_event(f, e, jolly);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Application
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TLC_app : public TSkeleton_application
|
||||
{
|
||||
int _tipo_sit, _order;
|
||||
TLC_form* _form;
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
void print_cespite();
|
||||
void print_total(int level, const char* prompt);
|
||||
};
|
||||
|
||||
void TLC_app::print_cespite()
|
||||
{
|
||||
TPrint_section& ces = _form->cespite();
|
||||
_form->print_section(ces);
|
||||
}
|
||||
|
||||
void TLC_app::print_total(int level, const char* prompt)
|
||||
{
|
||||
TPrint_section& body = level == 0 ? _form->totcat() : _form->totgen();
|
||||
if (level == 0)
|
||||
body.find_field(F_CODTAB).set(_form->decode_group(prompt));
|
||||
else
|
||||
body.find_field(F_CODTAB).set(prompt);
|
||||
_form->print_separator();
|
||||
_form->print_section(body);
|
||||
for (unsigned int i = 0; i < body.fields(); i++)
|
||||
body.field(i).set("");
|
||||
}
|
||||
|
||||
void TLC_app::main_loop()
|
||||
{
|
||||
TLC_mask m;
|
||||
ditta_cespiti().init_mask(m);
|
||||
while (m.run() != K_QUIT)
|
||||
{
|
||||
const int ese = m.get_int(F_ESERCIZIO);
|
||||
const int gruppo = m.get_int(F_GRUPPO);
|
||||
const TString4 specie = m.get(F_SPECIE);
|
||||
ditta_cespiti().set_attivita(ese, gruppo, specie);
|
||||
const bool extra = m.get_bool(F_SALDINI);
|
||||
TLC_form form(extra);
|
||||
_form = &form;
|
||||
_tipo_sit = m.get_int(F_SITUAZIONE);
|
||||
_order = m.get_int(F_ORDINAMENTO);
|
||||
|
||||
TRelation rel(LF_CESPI);
|
||||
TString expr;
|
||||
expr << "IDCESPITE==IDCESPITE|CODES==" << m.get(F_ESERCIZIO) << "|TPSALDO==1";
|
||||
rel.add(LF_SALCE, expr);
|
||||
|
||||
expr << "|TPAMM=" << _tipo_sit;
|
||||
rel.add(LF_AMMCE, expr);
|
||||
|
||||
const TRectype& cespi = rel.curr();
|
||||
|
||||
TString filter;
|
||||
if (_order == 1)
|
||||
{
|
||||
const int fc = m.get_int(F_FROM_CAT);
|
||||
const int tc = m.get_int(F_TO_CAT);
|
||||
if (fc != 0)
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODCAT << ">=" << fc << ')';
|
||||
}
|
||||
if (tc != 0)
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODCAT << "<=" << tc << ')' ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const TString& fi = m.get(F_FROM_IMP);
|
||||
const TString& ti = m.get(F_TO_IMP);
|
||||
if (!fi.blank())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODIMP << ">=" << fi << ')';
|
||||
}
|
||||
if (!fi.blank())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODIMP << "<=" << ti << ')';
|
||||
}
|
||||
}
|
||||
|
||||
const char* orderby = _order == 1 ? "CODCAT|DTCOMP|IDCESPITE" : "CODIMP|DTCOMP|IDCESPITE";
|
||||
TSorted_cursor cur(&rel, orderby, filter);
|
||||
form.set_cursor(cur);
|
||||
|
||||
const long items = cur.items();
|
||||
cur.freeze();
|
||||
|
||||
printer().open();
|
||||
|
||||
TString16 last_group = "@"; // Simbolo speciale per indicare nessuna stampa!
|
||||
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
// Controllo qui la validità per non incasinare il valutatore con stringhe e numeri
|
||||
if (cespi.get_int(CESPI_CODCGRA) != gruppo || cespi.get(CESPI_CODSPA) != specie)
|
||||
continue;
|
||||
|
||||
const TString16 curr_group = cespi.get(_order == 1 ? CESPI_CODCAT : CESPI_CODIMP);
|
||||
if (curr_group != last_group)
|
||||
{
|
||||
if (last_group != "@")
|
||||
{
|
||||
if (extra)
|
||||
print_total(0, last_group);
|
||||
printer().formfeed();
|
||||
}
|
||||
last_group = curr_group;
|
||||
form.set_testata(m, last_group);
|
||||
}
|
||||
print_cespite();
|
||||
}
|
||||
if (last_group != "@")
|
||||
{
|
||||
if (extra)
|
||||
{
|
||||
print_total(0, last_group);
|
||||
print_total(1, "GENERALE");
|
||||
}
|
||||
}
|
||||
|
||||
printer().close();
|
||||
xvt_statbar_set("");
|
||||
}
|
||||
}
|
||||
|
||||
int ce3500(int argc, char* argv[])
|
||||
{
|
||||
TLC_app app;
|
||||
app.run(argc, argv, "Lista Cespiti");
|
||||
return 0;
|
||||
}
|
||||
261
ce/ce3500a.frm
Executable file
261
ce/ce3500a.frm
Executable file
@ -0,0 +1,261 @@
|
||||
#include "ce3500a.h"
|
||||
|
||||
SECTION GRAPHICS ODD
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 7 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 10 ""
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 -3 "B"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION HEADER ODD 10
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Titolo"
|
||||
PROMPT 1 1 "@bLISTA CESPITI"
|
||||
END
|
||||
|
||||
LISTA F_SITUAZIONE
|
||||
BEGIN
|
||||
KEY "Situazione"
|
||||
PROMPT 80 1 ""
|
||||
ITEM "1|Situazione Fiscale"
|
||||
ITEM "2|Situazione Civilistica"
|
||||
ITEM "3|Situazione Gestionale"
|
||||
END
|
||||
|
||||
STRINGA F_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_RAGSOC
|
||||
BEGIN
|
||||
KEY "Ragione sociale"
|
||||
PROMPT 25 2 ""
|
||||
END
|
||||
|
||||
STRINGA F_ESERCIZIO
|
||||
BEGIN
|
||||
KEY "Esercizio"
|
||||
PROMPT 1 3 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
STRINGA F_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Inizio Esercizio"
|
||||
PROMPT 25 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_DATAFINE
|
||||
BEGIN
|
||||
KEY "Fine Esercizio"
|
||||
PROMPT 41 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 4 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_D_GRUPPO
|
||||
BEGIN
|
||||
KEY "Descrizione Gruppo"
|
||||
PROMPT 25 4 ""
|
||||
END
|
||||
|
||||
STRINGA F_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 5 "@bSpecie@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_SPECIE
|
||||
BEGIN
|
||||
KEY "Descrizione Specie"
|
||||
PROMPT 25 5 ""
|
||||
END
|
||||
|
||||
STRINGA F_CODTAB
|
||||
BEGIN
|
||||
KEY "categoria o impianto"
|
||||
PROMPT 1 6 ""
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 8 "@bCespite"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 8 "Descrizione"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 9 "@bData acq."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 9 "Data util."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 9 "Elementi"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 9 "Prop. da funz."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 9 "Rinvio a ricavi"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 9 "Tipo"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 9 "Uso prom."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 113 9 "Leasing"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 126 9 "Usato"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Valori cespite
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION BODY ODD 3
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 1 "@b"
|
||||
FIELD IDCESPITE
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 17 1 ""
|
||||
FIELD DESC
|
||||
END
|
||||
|
||||
STRINGA -1 65
|
||||
BEGIN
|
||||
PROMPT 65 1 ""
|
||||
MESSAGE _INVCODTAB
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 2 ""
|
||||
FIELD DTCOMP
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 17 2 ""
|
||||
FIELD DTFUNZ
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
KEY "Numero elementi"
|
||||
PROMPT 33 2 ""
|
||||
FIELD LF_SALCE->NUMELE
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD AMMPROP
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 65 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD ESCLPR
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 2 ""
|
||||
MESSAGE _TPSPEMAN
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 2 ""
|
||||
MESSAGE _USOPROM
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 113 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD LEASING
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 129 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD USATO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION FOOTER ODD 3
|
||||
|
||||
DATA -1
|
||||
BEGIN
|
||||
PROMPT 1 2 "@bData@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 120 2 "@bPagina@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
26
ce/ce3500a.h
Executable file
26
ce/ce3500a.h
Executable file
@ -0,0 +1,26 @@
|
||||
#define F_CODDITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_ESERCIZIO 103
|
||||
#define F_DATAINIZIO 104
|
||||
#define F_DATAFINE 105
|
||||
#define F_GRUPPO 106
|
||||
#define F_SPECIE 107
|
||||
#define F_D_GRUPPO 108
|
||||
#define F_D_SPECIE 109
|
||||
#define F_CODTAB 110
|
||||
|
||||
#define F_FROM_CAT 112
|
||||
#define F_D_FROM_CAT 113
|
||||
#define F_TO_CAT 114
|
||||
#define F_D_TO_CAT 115
|
||||
|
||||
#define F_FROM_IMP 116
|
||||
#define F_D_FROM_IMP 117
|
||||
#define F_TO_IMP 118
|
||||
#define F_D_TO_IMP 119
|
||||
|
||||
#define F_SITUAZIONE 120
|
||||
#define F_ORDINAMENTO 121
|
||||
#define F_SALDINI 122
|
||||
|
||||
|
||||
226
ce/ce3500a.uml
Executable file
226
ce/ce3500a.uml
Executable file
@ -0,0 +1,226 @@
|
||||
#include "ce3500a.h"
|
||||
|
||||
TOOLBAR "" 0 -3 0 3
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Stampa"
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Lista Cespiti" -1 -1 78 6
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Ditta "
|
||||
FLAGS "DF"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 55
|
||||
BEGIN
|
||||
PROMPT 20 1 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 2 2 "Esercizio "
|
||||
FLAGS "Z"
|
||||
USE CCE
|
||||
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio" 105@->D0
|
||||
DISPLAY "Data fine@10" 105@->D1
|
||||
OUTPUT F_ESERCIZIO CODTAB
|
||||
OUTPUT F_DATAINIZIO 105@->D0
|
||||
OUTPUT F_DATAFINE 105@->D1
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
DATE F_DATAINIZIO
|
||||
BEGIN
|
||||
PROMPT 20 2 "Data inizio "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_DATAFINE
|
||||
BEGIN
|
||||
PROMPT 45 2 "Data fine "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_GRUPPO 2
|
||||
BEGIN
|
||||
PROMPT 2 3 "Gruppo "
|
||||
FLAGS "Z"
|
||||
USE CCB KEY 1
|
||||
JOIN %CGR ALIAS 106 INTO CODTAB==CODTAB[5,6]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Codice" CODTAB[5,6]
|
||||
DISPLAY "Descrizione@60" 106@->S0
|
||||
OUTPUT F_GRUPPO CODTAB[5,6]
|
||||
OUTPUT F_D_GRUPPO 106@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_SPECIE 4
|
||||
BEGIN
|
||||
PROMPT 2 4 "Specie "
|
||||
FLAGS "_"
|
||||
USE CCB KEY 1
|
||||
JOIN %CAT ALIAS 107 INTO CODTAB[1,2]==CODTAB[5,6] CODTAB[3,6]==CODTAB[7,10]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO SELECT
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Gruppo" CODTAB[5,6]
|
||||
DISPLAY "Specie" CODTAB[7,10]
|
||||
DISPLAY "Descrizione@60" 107@->S0
|
||||
OUTPUT F_SPECIE CODTAB[7,10]
|
||||
OUTPUT F_D_SPECIE 107@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_D_GRUPPO 60 55
|
||||
BEGIN
|
||||
PROMPT 20 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_SPECIE 60 55
|
||||
BEGIN
|
||||
PROMPT 20 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_SITUAZIONE 78
|
||||
BEGIN
|
||||
PROMPT 1 6 "@bSituazione"
|
||||
ITEM "1|Fiscale"
|
||||
ITEM "2|Civilistica"
|
||||
ITEM "3|Gestionale"
|
||||
END
|
||||
|
||||
BOOLEAN F_SALDINI
|
||||
BEGIN
|
||||
PROMPT 2 11 "Mostra anche i valori dei saldi iniziali"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_ORDINAMENTO 78
|
||||
BEGIN
|
||||
PROMPT 1 12 "@bOrdinamento"
|
||||
ITEM "1|Per categoria"
|
||||
MESSAGE HIDE,2@|SHOW,1@
|
||||
ITEM "2|Per Impianto"
|
||||
MESSAGE HIDE,1@|SHOW,2@
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 1 16 "@bSelezione categoria"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER F_FROM_CAT 2
|
||||
BEGIN
|
||||
PROMPT 2 17 "Dalla "
|
||||
FLAGS "BZ"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_D_FROM_CAT 60 50
|
||||
BEGIN
|
||||
PROMPT 25 17 ""
|
||||
FLAGS "B"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER F_TO_CAT 2
|
||||
BEGIN
|
||||
PROMPT 2 18 "Alla "
|
||||
FLAGS "BZ"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_D_TO_CAT 60 50
|
||||
BEGIN
|
||||
PROMPT 25 18 ""
|
||||
FLAGS "B"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 4
|
||||
BEGIN
|
||||
PROMPT 1 16 "@bSelezione impianto"
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
NUMBER F_FROM_IMP 10
|
||||
BEGIN
|
||||
PROMPT 2 17 "Dal "
|
||||
FLAGS "Z"
|
||||
USE CIM
|
||||
INPUT CODTAB F_FROM_IMP
|
||||
DISPLAY "Codice Impianto" CODTAB
|
||||
DISPLAY "Descrizione@60" S0
|
||||
OUTPUT F_FROM_IMP CODTAB
|
||||
OUTPUT F_D_FROM_IMP S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRING F_D_FROM_IMP 50
|
||||
BEGIN
|
||||
PROMPT 25 17 ""
|
||||
USE CIM KEY 2
|
||||
INPUT S0 F_D_FROM_IMP
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice Impianto" CODTAB
|
||||
COPY OUTPUT F_FROM_IMP
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
NUMBER F_TO_IMP 10
|
||||
BEGIN
|
||||
PROMPT 2 18 "Al "
|
||||
FLAGS "Z"
|
||||
COPY USE F_FROM_IMP
|
||||
INPUT CODTAB F_TO_IMP
|
||||
COPY DISPLAY F_FROM_IMP
|
||||
OUTPUT F_TO_IMP CODTAB
|
||||
OUTPUT F_D_TO_IMP S0
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRING F_D_TO_IMP 50
|
||||
BEGIN
|
||||
PROMPT 25 18 ""
|
||||
COPY USE F_D_FROM_IMP
|
||||
INPUT S0 F_D_TO_IMP
|
||||
COPY DISPLAY F_D_FROM_IMP
|
||||
COPY OUTPUT F_TO_IMP
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
636
ce/ce3500b.frm
Executable file
636
ce/ce3500b.frm
Executable file
@ -0,0 +1,636 @@
|
||||
#include "ce3500a.h"
|
||||
|
||||
SECTION GRAPHICS ODD
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 7 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 12 ""
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 -3 "B"
|
||||
END
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Testata
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION HEADER ODD 12
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Titolo"
|
||||
PROMPT 1 1 "@bLISTA CESPITI"
|
||||
END
|
||||
|
||||
LISTA F_SITUAZIONE
|
||||
BEGIN
|
||||
KEY "Situazione"
|
||||
PROMPT 80 1 ""
|
||||
ITEM "1|Situazione Fiscale"
|
||||
ITEM "2|Situazione Civilistica"
|
||||
ITEM "3|Situazione Gestionale"
|
||||
END
|
||||
|
||||
STRINGA F_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_RAGSOC
|
||||
BEGIN
|
||||
KEY "Ragione sociale"
|
||||
PROMPT 25 2 ""
|
||||
END
|
||||
|
||||
STRINGA F_ESERCIZIO
|
||||
BEGIN
|
||||
KEY "Esercizio"
|
||||
PROMPT 1 3 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
STRINGA F_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Inizio Esercizio"
|
||||
PROMPT 25 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_DATAFINE
|
||||
BEGIN
|
||||
KEY "Fine Esercizio"
|
||||
PROMPT 38 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 4 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_D_GRUPPO
|
||||
BEGIN
|
||||
KEY "Descrizione Gruppo"
|
||||
PROMPT 25 4 ""
|
||||
END
|
||||
|
||||
STRINGA F_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 5 "@bSpecie@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_SPECIE
|
||||
BEGIN
|
||||
KEY "Descrizione Specie"
|
||||
PROMPT 25 5 ""
|
||||
END
|
||||
|
||||
STRINGA F_CODTAB
|
||||
BEGIN
|
||||
KEY "categoria o impianto"
|
||||
PROMPT 1 6 ""
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 8 "@bCespite"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 8 "Descrizione"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 9 "@bData acq."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 9 "Data util."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 9 "Elementi"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 9 "Prop. da funz."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 9 "Rinvio a ricavi"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 9 "Spese manut."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 9 "Uso prom."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 113 9 "Leasing"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 126 9 "Usato"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 10 "@bCosto storico"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 10 "Parte non amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 10 "Plusv. reinv."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 10 "Rival. gen."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 10 "Rival. 576/75"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 10 "Rival. 72/83"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 10 "Rival. 413/90"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 113 10 "Rival. 413/91"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 11 "@bFondo amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 11 "Quota non amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 11 "PRIVATO:"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 11 "@bFondo amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 11 "Quota non amm."
|
||||
END
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Valori cespite
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION BODY ODD 5
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 1 "@b"
|
||||
FIELD IDCESPITE
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 17 1 ""
|
||||
FIELD DESC
|
||||
END
|
||||
|
||||
STRINGA -1 65
|
||||
BEGIN
|
||||
PROMPT 65 1 ""
|
||||
MESSAGE _INVCODTAB
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 2 ""
|
||||
FIELD DTCOMP
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 17 2 ""
|
||||
FIELD DTFUNZ
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
KEY "Numero elementi"
|
||||
PROMPT 33 2 ""
|
||||
FIELD LF_SALCE->NUMELE
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD AMMPROP
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 65 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD ESCLPR
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 2 ""
|
||||
MESSAGE _TPSPEMAN
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 2 ""
|
||||
MESSAGE _USOPROM
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 113 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD LEASING
|
||||
END
|
||||
|
||||
LIST -1
|
||||
BEGIN
|
||||
PROMPT 129 2 ""
|
||||
ITEM "|No"
|
||||
ITEM "X|Si"
|
||||
FIELD USATO
|
||||
END
|
||||
|
||||
VALUTA 11 15
|
||||
BEGIN
|
||||
PROMPT 1 3 ""
|
||||
FIELD LF_SALCE->CSTO
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->11
|
||||
END
|
||||
|
||||
VALUTA 12 15
|
||||
BEGIN
|
||||
PROMPT 17 3 ""
|
||||
FIELD LF_SALCE->VNONAMM
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->12
|
||||
END
|
||||
|
||||
VALUTA 13 15
|
||||
BEGIN
|
||||
PROMPT 33 3 ""
|
||||
FIELD LF_SALCE->PLUSREIN
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->13
|
||||
END
|
||||
|
||||
VALUTA 14 15
|
||||
BEGIN
|
||||
PROMPT 49 3 ""
|
||||
MESSAGE _RIVGEN
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->14
|
||||
END
|
||||
|
||||
VALUTA 15 15
|
||||
BEGIN
|
||||
PROMPT 65 3 ""
|
||||
FIELD LF_SALCE->RIV75
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->15
|
||||
END
|
||||
|
||||
VALUTA 16 15
|
||||
BEGIN
|
||||
PROMPT 81 3 ""
|
||||
FIELD LF_SALCE->RIV83
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->16
|
||||
END
|
||||
|
||||
VALUTA 17 15
|
||||
BEGIN
|
||||
PROMPT 97 3 ""
|
||||
FIELD LF_SALCE->RIV90
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->17
|
||||
END
|
||||
|
||||
VALUTA 18 15
|
||||
BEGIN
|
||||
PROMPT 113 3 ""
|
||||
FIELD LF_SALCE->RIV91
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->18
|
||||
END
|
||||
|
||||
VALUTA 21 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento"
|
||||
PROMPT 1 4 ""
|
||||
MESSAGE _NUMEXPR,LF_AMMCE->QNOR+LF_AMMCE->QACC+LF_AMMCE->QANT
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->21
|
||||
END
|
||||
|
||||
VALUTA 22 15
|
||||
BEGIN
|
||||
KEY "Quote perse"
|
||||
PROMPT 17 4 ""
|
||||
FIELD LF_AMMCE->QPERSE
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->22
|
||||
END
|
||||
|
||||
VALUTA 23 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento privato"
|
||||
PROMPT 65 4 ""
|
||||
FIELD LF_AMMCE->FPRIVATO
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->23
|
||||
END
|
||||
|
||||
VALUTA 24 15
|
||||
BEGIN
|
||||
KEY "Quote perse private"
|
||||
PROMPT 81 4 ""
|
||||
FIELD LF_AMMCE->QPPRIVATE
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BE->24
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Totale di categoria
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION BODY EVEN 3
|
||||
|
||||
STRINGA F_CODTAB
|
||||
BEGIN
|
||||
KEY "Totale di categoria o impianto"
|
||||
PROMPT 1 1 "@bTOTALE "
|
||||
END
|
||||
|
||||
VALUTA 11 15
|
||||
BEGIN
|
||||
KEY "CSTO"
|
||||
PROMPT 1 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->11
|
||||
END
|
||||
|
||||
VALUTA 12 15
|
||||
BEGIN
|
||||
KEY "VNONAMM"
|
||||
PROMPT 17 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->12
|
||||
END
|
||||
|
||||
VALUTA 13 15
|
||||
BEGIN
|
||||
KEY "PLUSREIN"
|
||||
PROMPT 33 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->13
|
||||
END
|
||||
|
||||
VALUTA 14 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione generica"
|
||||
PROMPT 49 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->14
|
||||
END
|
||||
|
||||
VALUTA 15 15
|
||||
BEGIN
|
||||
KEY "RIV75"
|
||||
PROMPT 65 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->15
|
||||
END
|
||||
|
||||
VALUTA 16 15
|
||||
BEGIN
|
||||
KEY "RIV83"
|
||||
PROMPT 81 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->16
|
||||
END
|
||||
|
||||
VALUTA 17 15
|
||||
BEGIN
|
||||
KEY "RIV90"
|
||||
PROMPT 97 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->17
|
||||
END
|
||||
|
||||
VALUTA 18 15
|
||||
BEGIN
|
||||
KEY "RIV91"
|
||||
PROMPT 113 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->18
|
||||
END
|
||||
|
||||
VALUTA 21 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento"
|
||||
PROMPT 1 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->21
|
||||
END
|
||||
|
||||
VALUTA 22 15
|
||||
BEGIN
|
||||
KEY "Quote perse"
|
||||
PROMPT 17 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->22
|
||||
END
|
||||
|
||||
VALUTA 23 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento privato"
|
||||
PROMPT 65 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->23
|
||||
END
|
||||
|
||||
VALUTA 24 15
|
||||
BEGIN
|
||||
KEY "Quote perse private"
|
||||
PROMPT 81 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
MESSAGE ADD,BL->24
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Totale generale
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION BODY LAST 3
|
||||
|
||||
STRINGA F_CODTAB
|
||||
BEGIN
|
||||
KEY "Totale di categoria o impianto"
|
||||
PROMPT 1 1 "@bTOTALE "
|
||||
END
|
||||
|
||||
VALUTA 11 15
|
||||
BEGIN
|
||||
KEY "CSTO"
|
||||
PROMPT 1 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 12 15
|
||||
BEGIN
|
||||
KEY "VNONAMM"
|
||||
PROMPT 17 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 13 15
|
||||
BEGIN
|
||||
KEY "PLUSREIN"
|
||||
PROMPT 33 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 14 15
|
||||
BEGIN
|
||||
KEY "Rivalutazione generica"
|
||||
PROMPT 49 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 15 15
|
||||
BEGIN
|
||||
KEY "RIV75"
|
||||
PROMPT 65 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 16 15
|
||||
BEGIN
|
||||
KEY "RIV83"
|
||||
PROMPT 81 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 17 15
|
||||
BEGIN
|
||||
KEY "RIV90"
|
||||
PROMPT 97 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 18 15
|
||||
BEGIN
|
||||
KEY "RIV91"
|
||||
PROMPT 113 2 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 21 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento"
|
||||
PROMPT 1 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 22 15
|
||||
BEGIN
|
||||
KEY "Quote perse"
|
||||
PROMPT 17 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 23 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento privato"
|
||||
PROMPT 65 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 24 15
|
||||
BEGIN
|
||||
KEY "Quote perse private"
|
||||
PROMPT 81 3 ""
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION FOOTER ODD 3
|
||||
|
||||
DATA -1
|
||||
BEGIN
|
||||
PROMPT 1 2 "@bData@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 120 2 "@bPagina@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
190
ce/ce3600.cpp
Executable file
190
ce/ce3600.cpp
Executable file
@ -0,0 +1,190 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <form.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
|
||||
#include "celib.h"
|
||||
#include "ce3400.h"
|
||||
#include "ce3600a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "ammce.h"
|
||||
#include "ammmv.h"
|
||||
#include "cespi.h"
|
||||
#include "movce.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Form
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TLM_form : public TCespi_list_form
|
||||
{
|
||||
TCursor* _cur;
|
||||
int _tiposit;
|
||||
|
||||
protected:
|
||||
virtual TRelation* relation() const { return _cur->relation(); }
|
||||
virtual TCursor* cursor() const { return _cur; }
|
||||
virtual bool validate(TForm_item& fld, TToken_string& val);
|
||||
|
||||
public:
|
||||
void set_cursor(TCursor& cur) { _cur = &cur; }
|
||||
void set_testata(const TMask& m);
|
||||
|
||||
TPrint_section& corpo() { return section('B', odd_page); }
|
||||
|
||||
TLM_form();
|
||||
};
|
||||
|
||||
void TLM_form::set_testata(const TMask& m)
|
||||
{
|
||||
TCespi_list_form::set_testata(m);
|
||||
_tiposit = m.get_int(F_SITUAZIONE);
|
||||
}
|
||||
|
||||
bool TLM_form::validate(TForm_item& fld, TToken_string& val)
|
||||
{
|
||||
const char* cmd = val.get(0);
|
||||
if (stricmp(cmd, "_RIVGEN") == 0)
|
||||
{
|
||||
const TRectype& mov = relation()->curr();
|
||||
fld.set(mov.get(_tiposit == 1 ? MOVCE_RIVGF : MOVCE_RIVGC));
|
||||
return TRUE;
|
||||
}
|
||||
return TCespi_list_form::validate(fld, val);
|
||||
}
|
||||
|
||||
TLM_form::TLM_form() : TCespi_list_form("ce3600a")
|
||||
{ }
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TLM_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TLM_mask() : TAutomask("ce3600a") { }
|
||||
};
|
||||
|
||||
bool TLM_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (f.dlg())
|
||||
{
|
||||
case F_CODCAT:
|
||||
case F_D_CODCAT:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
ok = dc.on_category_event(f, e, jolly);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Application
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TLM_app : public TSkeleton_application
|
||||
{
|
||||
TLM_form* _form;
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
void print_mov();
|
||||
};
|
||||
|
||||
void TLM_app::print_mov()
|
||||
{
|
||||
TPrint_section& corpo = _form->corpo();
|
||||
_form->print_section(corpo);
|
||||
}
|
||||
|
||||
void TLM_app::main_loop()
|
||||
{
|
||||
TLM_mask m;
|
||||
ditta_cespiti().init_mask(m);
|
||||
while (m.run() != K_QUIT)
|
||||
{
|
||||
const int ese = m.get_int(F_ESERCIZIO);
|
||||
const int gruppo = m.get_int(F_GRUPPO);
|
||||
const TString4 specie = m.get(F_SPECIE);
|
||||
ditta_cespiti().set_attivita(ese, gruppo, specie);
|
||||
|
||||
const int tiposit = m.get_int(F_SITUAZIONE);
|
||||
const int order = m.get_int(F_ORDINAMENTO);
|
||||
const int codcat = m.get_int(F_CODCAT);
|
||||
const TString& codmov = m.get(F_TIPOMOV);
|
||||
const TString& codimp = m.get(F_CODIMP);
|
||||
|
||||
TLM_form form; _form = &form;
|
||||
|
||||
TRelation rel(LF_MOVCE);
|
||||
|
||||
TString expr;
|
||||
expr << "IDCESPITE==IDCESPITE";
|
||||
rel.add(LF_CESPI, expr);
|
||||
expr << "|IDMOV==IDMOV|TPAMM==" << tiposit;
|
||||
rel.add(LF_MOVAM, expr);
|
||||
|
||||
const TRectype& cespi = rel.curr(LF_CESPI);
|
||||
|
||||
TDate fromdate = m.get(F_FROM_DATE), todate = m.get(F_TO_DATE);
|
||||
TString filter;
|
||||
if (fromdate.ok())
|
||||
filter << "(ANSI(" << MOVCE_DTMOV << ")>=" << fromdate.string(ANSI) << ')';
|
||||
if (todate.ok())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << "(ANSI(" << MOVCE_DTMOV << ")<=" << todate.string(ANSI) << ')';
|
||||
}
|
||||
if (codmov.not_empty())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << MOVCE_CODMOV << "==\"" << codmov << "\")";
|
||||
}
|
||||
|
||||
const char* orderby = order == 1 ? "DTMOV|IDMOV" : "IDMOV";
|
||||
TSorted_cursor cur(&rel, orderby, filter);
|
||||
|
||||
const long items = cur.items();
|
||||
if (items > 0)
|
||||
{
|
||||
cur.freeze();
|
||||
form.set_cursor(cur);
|
||||
form.set_testata(m);
|
||||
printer().open();
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
// Controllo qui la validità per non incasinare il valutatore con stringhe e numeri
|
||||
if (cespi.get_int(CESPI_CODCGRA) != gruppo || cespi.get(CESPI_CODSPA) != specie)
|
||||
continue;
|
||||
if (codcat > 0 && cespi.get_int(CESPI_CODCAT) != codcat)
|
||||
continue;
|
||||
if (codimp.not_empty() && cespi.get(CESPI_CODIMP) != codimp)
|
||||
continue;
|
||||
|
||||
print_mov();
|
||||
}
|
||||
printer().close();
|
||||
}
|
||||
xvt_statbar_set("");
|
||||
}
|
||||
}
|
||||
|
||||
int ce3600(int argc, char* argv[])
|
||||
{
|
||||
TLM_app app;
|
||||
app.run(argc, argv, "Lista Movimenti");
|
||||
return 0;
|
||||
}
|
||||
398
ce/ce3600a.frm
Executable file
398
ce/ce3600a.frm
Executable file
@ -0,0 +1,398 @@
|
||||
#include "ce3600a.h"
|
||||
|
||||
SECTION GRAPHICS ODD
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 6 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 11 ""
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 -3 ""
|
||||
END
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Testata
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION HEADER ODD 11
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Titolo"
|
||||
PROMPT 1 1 "@bLISTA MOVIMENTI"
|
||||
END
|
||||
|
||||
LISTA F_SITUAZIONE
|
||||
BEGIN
|
||||
KEY "Situazione"
|
||||
PROMPT 80 1 ""
|
||||
ITEM "1|Situazione Fiscale"
|
||||
ITEM "2|Situazione Civilistica"
|
||||
ITEM "3|Situazione Gestionale"
|
||||
END
|
||||
|
||||
STRINGA F_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_RAGSOC
|
||||
BEGIN
|
||||
KEY "Ragione sociale"
|
||||
PROMPT 25 2 ""
|
||||
END
|
||||
|
||||
STRINGA F_ESERCIZIO
|
||||
BEGIN
|
||||
KEY "Esercizio"
|
||||
PROMPT 1 3 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
STRINGA F_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Inizio Esercizio"
|
||||
PROMPT 25 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_DATAFINE
|
||||
BEGIN
|
||||
KEY "Fine Esercizio"
|
||||
PROMPT 41 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 4 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_D_GRUPPO
|
||||
BEGIN
|
||||
KEY "Descrizione Gruppo"
|
||||
PROMPT 25 4 ""
|
||||
END
|
||||
|
||||
STRINGA F_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 5 "@bSpecie@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_SPECIE
|
||||
BEGIN
|
||||
KEY "Descrizione Specie"
|
||||
PROMPT 25 5 ""
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 7 "@bNumero"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 12 7 "Tipo"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 7 "Data"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 27 7 "Segno"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 7 "Importo"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 7 "Elementi"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 7 "Descrizione Movimento"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 8 "@bCespite"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 8 "Categoria"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 8 "Impianto"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 8 "Descrizione Cespite"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 9 "@bCosto storico"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 9 "Parte non amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 9 "Plusv. reinv."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 9 "Rival. gen."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 9 "Rival. 576/75"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 9 "Rival. 72/83"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 9 "Rival. 413/90"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 113 9 "Rival. 413/91"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 10 "@bFondo amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 10 "Quota non amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 10 "PRIVATO:"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 10 "@bFondo amm."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 10 "Quota non amm."
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Valori movimento
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
SECTION BODY ODD 5
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 1 "@b"
|
||||
FIELD IDMOV
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 14 1 "@r"
|
||||
FIELD CODMOV
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 17 1 ""
|
||||
FIELD DTMOV
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 29 1 ""
|
||||
FIELD SEGNO
|
||||
END
|
||||
|
||||
VALUTA -1 15
|
||||
BEGIN
|
||||
PROMPT 33 1 ""
|
||||
FIELD IMPVEN
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
NUMBERO -1
|
||||
BEGIN
|
||||
PROMPT 49 1 ""
|
||||
FIELD NUMELE
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 65 1 ""
|
||||
FIELD DESC
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 2 ""
|
||||
FIELD IDCESPITE
|
||||
END
|
||||
|
||||
NUMERO -1 2
|
||||
BEGIN
|
||||
PROMPT 17 2 ""
|
||||
PICTURE "@@"
|
||||
FIELD LF_CESPI->CODCAT
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 33 2 ""
|
||||
FIELD LF_CESPI->CODIMP
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
FIELD LF_CESPI->DESC
|
||||
END
|
||||
|
||||
VALUTA 11 15
|
||||
BEGIN
|
||||
PROMPT 1 3 ""
|
||||
FIELD CSTO
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 12 15
|
||||
BEGIN
|
||||
PROMPT 17 3 ""
|
||||
FIELD VNONAMM
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 13 15
|
||||
BEGIN
|
||||
PROMPT 33 3 ""
|
||||
FIELD PLUSREIN
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 14 15
|
||||
BEGIN
|
||||
PROMPT 49 3 ""
|
||||
MESSAGE _RIVGEN
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 15 15
|
||||
BEGIN
|
||||
PROMPT 65 3 ""
|
||||
FIELD RIV75
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 16 15
|
||||
BEGIN
|
||||
PROMPT 81 3 ""
|
||||
FIELD RIV83
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 17 15
|
||||
BEGIN
|
||||
PROMPT 97 3 ""
|
||||
FIELD RIV90
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 18 15
|
||||
BEGIN
|
||||
PROMPT 113 3 ""
|
||||
FIELD RIV91
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 21 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento"
|
||||
PROMPT 1 4 ""
|
||||
MESSAGE _NUMEXPR,LF_MOVAM->QNOR+LF_MOVAM->QACC+LF_MOVAM->QANT
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 22 15
|
||||
BEGIN
|
||||
KEY "Quote perse"
|
||||
PROMPT 17 4 ""
|
||||
FIELD LF_MOVAM->QPERSE
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 23 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento privato"
|
||||
PROMPT 65 4 ""
|
||||
FIELD LF_MOVAM->FPRIVATO
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
VALUTA 24 15
|
||||
BEGIN
|
||||
KEY "Quote perse private"
|
||||
PROMPT 81 4 ""
|
||||
FIELD LF_MOVAM->QPPRIVATE
|
||||
PICTURE "###.###.###.@@@"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION FOOTER ODD 3
|
||||
|
||||
DATA -1
|
||||
BEGIN
|
||||
PROMPT 1 2 "@bData@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 120 2 "@bPagina@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
23
ce/ce3600a.h
Executable file
23
ce/ce3600a.h
Executable file
@ -0,0 +1,23 @@
|
||||
#define F_CODDITTA 101
|
||||
#define F_RAGSOC 102
|
||||
#define F_ESERCIZIO 103
|
||||
#define F_DATAINIZIO 104
|
||||
#define F_DATAFINE 105
|
||||
#define F_GRUPPO 106
|
||||
#define F_SPECIE 107
|
||||
#define F_D_GRUPPO 108
|
||||
#define F_D_SPECIE 109
|
||||
|
||||
#define F_FROM_DATE 110
|
||||
#define F_TO_DATE 111
|
||||
#define F_TIPOMOV 112
|
||||
#define F_D_TIPOMOV 113
|
||||
#define F_CODCAT 115
|
||||
#define F_D_CODCAT 116
|
||||
#define F_CODIMP 117
|
||||
#define F_D_CODIMP 118
|
||||
|
||||
#define F_SITUAZIONE 120
|
||||
#define F_ORDINAMENTO 121
|
||||
|
||||
|
||||
199
ce/ce3600a.uml
Executable file
199
ce/ce3600a.uml
Executable file
@ -0,0 +1,199 @@
|
||||
#include "ce3600a.h"
|
||||
|
||||
TOOLBAR "" 0 -3 0 3
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Stampa"
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Lista movimenti" -1 -1 78 6
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Ditta "
|
||||
FLAGS "DF"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 55
|
||||
BEGIN
|
||||
PROMPT 20 1 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 2 2 "Esercizio "
|
||||
FLAGS "Z"
|
||||
USE CCE
|
||||
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio" 105@->D0
|
||||
DISPLAY "Data fine@10" 105@->D1
|
||||
OUTPUT F_ESERCIZIO CODTAB
|
||||
OUTPUT F_DATAINIZIO 105@->D0
|
||||
OUTPUT F_DATAFINE 105@->D1
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
DATE F_DATAINIZIO
|
||||
BEGIN
|
||||
PROMPT 20 2 "Data inizio "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_DATAFINE
|
||||
BEGIN
|
||||
PROMPT 45 2 "Data fine "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_GRUPPO 2
|
||||
BEGIN
|
||||
PROMPT 2 3 "Gruppo "
|
||||
FLAGS "Z"
|
||||
USE CCB KEY 1
|
||||
JOIN %CGR ALIAS 106 INTO CODTAB==CODTAB[5,6]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Codice" CODTAB[5,6]
|
||||
DISPLAY "Descrizione@60" 106@->S0
|
||||
OUTPUT F_GRUPPO CODTAB[5,6]
|
||||
OUTPUT F_D_GRUPPO 106@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_SPECIE 4
|
||||
BEGIN
|
||||
PROMPT 2 4 "Specie "
|
||||
FLAGS "_"
|
||||
USE CCB KEY 1
|
||||
JOIN %CAT ALIAS 107 INTO CODTAB[1,2]==CODTAB[5,6] CODTAB[3,6]==CODTAB[7,10]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO SELECT
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Gruppo" CODTAB[5,6]
|
||||
DISPLAY "Specie" CODTAB[7,10]
|
||||
DISPLAY "Descrizione@60" 107@->S0
|
||||
OUTPUT F_SPECIE CODTAB[7,10]
|
||||
OUTPUT F_D_SPECIE 107@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_D_GRUPPO 60 55
|
||||
BEGIN
|
||||
PROMPT 20 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_SPECIE 60 55
|
||||
BEGIN
|
||||
PROMPT 20 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_SITUAZIONE 78
|
||||
BEGIN
|
||||
PROMPT 1 6 "@bSituazione"
|
||||
ITEM "1|Fiscale"
|
||||
ITEM "2|Civilistica"
|
||||
ITEM "3|Gestionale"
|
||||
END
|
||||
|
||||
DATE F_FROM_DATE
|
||||
BEGIN
|
||||
PROMPT 1 11 "Dalla data "
|
||||
END
|
||||
|
||||
DATE F_TO_DATE
|
||||
BEGIN
|
||||
PROMPT 25 11 "Alla data "
|
||||
END
|
||||
|
||||
STRING F_TIPOMOV 1
|
||||
BEGIN
|
||||
PROMPT 1 12 "Tipo movimento "
|
||||
USE %TMC
|
||||
INPUT CODTAB F_TIPOMOV
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_TIPOMOV CODTAB
|
||||
OUTPUT F_D_TIPOMOV S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_D_TIPOMOV 50
|
||||
BEGIN
|
||||
PROMPT 25 12 ""
|
||||
USE %TMC KEY 2
|
||||
INPUT S0 F_D_TIPOMOV
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TIPOMOV
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER F_CODCAT 2
|
||||
BEGIN
|
||||
PROMPT 1 13 "Categoria "
|
||||
FLAGS "BZ"
|
||||
END
|
||||
|
||||
STRING F_D_CODCAT 70 50
|
||||
BEGIN
|
||||
PROMPT 25 13 ""
|
||||
FLAGS "B"
|
||||
END
|
||||
|
||||
NUMBER F_CODIMP 10
|
||||
BEGIN
|
||||
PROMPT 1 14 "Impianto "
|
||||
FLAGS "Z"
|
||||
USE CIM
|
||||
INPUT CODTAB F_CODIMP
|
||||
DISPLAY "Codice Impianto" CODTAB
|
||||
DISPLAY "Descrizione@60" S0
|
||||
OUTPUT F_CODIMP CODTAB
|
||||
OUTPUT F_D_CODIMP S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_D_CODIMP 50
|
||||
BEGIN
|
||||
PROMPT 25 14 ""
|
||||
USE CIM KEY 2
|
||||
INPUT S0 F_D_CODIMP
|
||||
DISPLAY "Descrizione@60" S0
|
||||
DISPLAY "Codice Impianto" CODTAB
|
||||
COPY OUTPUT F_CODIMP
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
RADIOBUTTON F_ORDINAMENTO 78
|
||||
BEGIN
|
||||
PROMPT 1 16 "@bOrdinamento"
|
||||
ITEM "1|Data movimento"
|
||||
ITEM "2|Numero registrazione"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
149
ce/ce3700.cpp
Executable file
149
ce/ce3700.cpp
Executable file
@ -0,0 +1,149 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
|
||||
#include "celib.h"
|
||||
#include "ce3400.h"
|
||||
#include "ce3700a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "cespi.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Form
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TECUP_form : public TCespi_list_form
|
||||
{
|
||||
protected:
|
||||
virtual bool validate(TForm_item& fld, TToken_string& val);
|
||||
|
||||
public:
|
||||
void set_testata(const TMask& m);
|
||||
|
||||
TECUP_form();
|
||||
};
|
||||
|
||||
void TECUP_form::set_testata(const TMask& m)
|
||||
{
|
||||
TCespi_list_form::set_testata(m);
|
||||
}
|
||||
|
||||
bool TECUP_form::validate(TForm_item& fld, TToken_string& val)
|
||||
{
|
||||
return TCespi_list_form::validate(fld, val);
|
||||
}
|
||||
|
||||
TECUP_form::TECUP_form() : TCespi_list_form("ce3700a")
|
||||
{ }
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TECUP_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TECUP_mask() : TAutomask("ce3700a") { }
|
||||
};
|
||||
|
||||
bool TECUP_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
switch (f.dlg())
|
||||
{
|
||||
case F_USOPROM1:
|
||||
if (e == fe_close)
|
||||
{
|
||||
for (int up = 2; up >= 0; up--)
|
||||
if (get_bool(F_USOPROM1+up))
|
||||
break;
|
||||
if (up < 0)
|
||||
return error_box("E' necessario specificare almeno una percentuale di deducibilità");
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Application
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TECUP_app : public TSkeleton_application
|
||||
{
|
||||
int _gruppo;
|
||||
TString4 _specie;
|
||||
bool _usoprom[3];
|
||||
int _veidip;
|
||||
|
||||
static bool promis_filter(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
};
|
||||
|
||||
TECUP_app& app() { return (TECUP_app&)main_app(); }
|
||||
|
||||
bool TECUP_app::promis_filter(const TRelation* rel)
|
||||
{
|
||||
const TRectype& cespi = rel->curr();
|
||||
const TECUP_app& a = app();
|
||||
|
||||
if (cespi.get_int(CESPI_CODCGRA) != a._gruppo)
|
||||
return FALSE;
|
||||
|
||||
if (cespi.get(CESPI_CODSPA) != a._specie)
|
||||
return FALSE;
|
||||
|
||||
int up = cespi.get_int(CESPI_USOPROM);
|
||||
if (up > 0) up--;
|
||||
if (a._usoprom[up] == FALSE)
|
||||
return FALSE;
|
||||
|
||||
if (a._veidip < 2)
|
||||
return cespi.get_bool(CESPI_VEIDIP) == a._veidip;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TECUP_app::main_loop()
|
||||
{
|
||||
TECUP_mask m;
|
||||
ditta_cespiti().init_mask(m);
|
||||
|
||||
m.set(F_USOPROM2, "X");
|
||||
m.set(F_USOPROM3, "X");
|
||||
m.set(F_VEIDIP, 2);
|
||||
|
||||
while (m.run() != K_QUIT)
|
||||
{
|
||||
const int ese = m.get_int(F_ESERCIZIO);
|
||||
_gruppo = m.get_int(F_GRUPPO);
|
||||
_specie = m.get(F_SPECIE);
|
||||
ditta_cespiti().set_attivita(ese, _gruppo, _specie);
|
||||
|
||||
for (int u = 0; u < 3; u++)
|
||||
_usoprom[u] = m.get_bool(F_USOPROM1+u);
|
||||
_veidip = m.get_int(F_VEIDIP);
|
||||
|
||||
TECUP_form form;
|
||||
form.cursor()->set_filterfunction(promis_filter);
|
||||
|
||||
form.set_testata(m);
|
||||
form.print();
|
||||
xvt_statbar_set("");
|
||||
}
|
||||
}
|
||||
|
||||
int ce3700(int argc, char* argv[])
|
||||
{
|
||||
TECUP_app app;
|
||||
app.run(argc, argv, "Cespiti uso promisquo");
|
||||
return 0;
|
||||
}
|
||||
214
ce/ce3700a.frm
Executable file
214
ce/ce3700a.frm
Executable file
@ -0,0 +1,214 @@
|
||||
#include "ce3700a.h"
|
||||
|
||||
USE LF_CESPI
|
||||
END
|
||||
|
||||
// Linee di sfondo
|
||||
|
||||
SECTION GRAPHICS ODD
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 6 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 9 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 -3 "B"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
// Testata
|
||||
|
||||
SECTION HEADER ODD 9
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Titolo"
|
||||
PROMPT 1 1 "@bELENCO CESPITI USO PROMISQUO"
|
||||
END
|
||||
|
||||
STRINGA F_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_RAGSOC
|
||||
BEGIN
|
||||
KEY "Ragione sociale"
|
||||
PROMPT 20 2 ""
|
||||
END
|
||||
|
||||
STRINGA F_ESERCIZIO
|
||||
BEGIN
|
||||
KEY "Esercizio"
|
||||
PROMPT 1 3 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
STRINGA F_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Inizio Esercizio"
|
||||
PROMPT 20 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_DATAFINE
|
||||
BEGIN
|
||||
KEY "Fine Esercizio"
|
||||
PROMPT 33 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 4 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_D_GRUPPO
|
||||
BEGIN
|
||||
KEY "Descrizione Gruppo"
|
||||
PROMPT 20 4 ""
|
||||
END
|
||||
|
||||
STRINGA F_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 5 "@bSpecie@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_SPECIE
|
||||
BEGIN
|
||||
KEY "Descrizione Specie"
|
||||
PROMPT 20 5 ""
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 7 "@bCod."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 8 "@bCat."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 6 7 "Cod."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 6 8 "Cespite"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 7 "Descrizione"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 68 7 "Percentuale"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 68 8 "Deducibilità"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 110 7 "Tipo"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 110 8 "Veicolo"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 126 7 "Uso a"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 126 8 "Dipend."
|
||||
END
|
||||
END
|
||||
|
||||
SECTION BODY ODD 2
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 2 1 ""
|
||||
PICTURE "@@"
|
||||
FIELD CODCAT
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 6 1 ""
|
||||
FIELD IDCESPITE
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 1 ""
|
||||
FIELD DESC
|
||||
END
|
||||
|
||||
LISTA -1
|
||||
BEGIN
|
||||
PROMPT 68 1 ""
|
||||
ITEM "1|100% - Esclusivamente strumentale"
|
||||
ITEM "2| 50% - Uso promiscuo"
|
||||
ITEM "3| 80% - Uso prom. agenti/rappresentanti"
|
||||
FIELD USOPROM
|
||||
END
|
||||
|
||||
LISTA -1
|
||||
BEGIN
|
||||
PROMPT 110 1 ""
|
||||
ITEM "1|Nessuno"
|
||||
ITEM "2|Auto, Autocaravan"
|
||||
ITEM "3|Motociclo"
|
||||
ITEM "4|Ciclomotore"
|
||||
ITEM "5|Altro"
|
||||
FIELD FLGTPVEI
|
||||
END
|
||||
|
||||
LISTA -1
|
||||
BEGIN
|
||||
PROMPT 129 1 ""
|
||||
ITEM "|NO"
|
||||
ITEM "X|SI"
|
||||
FIELD VEIDIP
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION FOOTER ODD 3
|
||||
|
||||
DATA -1
|
||||
BEGIN
|
||||
PROMPT 1 2 "@bData@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 120 2 "@bPagina@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
7
ce/ce3700a.h
Executable file
7
ce/ce3700a.h
Executable file
@ -0,0 +1,7 @@
|
||||
#include "ce3400a.h"
|
||||
|
||||
#define F_USOPROM1 201
|
||||
#define F_USOPROM2 202
|
||||
#define F_USOPROM3 203
|
||||
#define F_VEIDIP 204
|
||||
|
||||
142
ce/ce3700a.uml
Executable file
142
ce/ce3700a.uml
Executable file
@ -0,0 +1,142 @@
|
||||
#include "ce3700a.h"
|
||||
|
||||
TOOLBAR "" 0 -3 0 3
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Stampa"
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Cespiti uso promisquo" -1 -1 78 6
|
||||
|
||||
GROUPBOX DLG_NULL 78 6
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Ditta "
|
||||
FLAGS "DF"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 55
|
||||
BEGIN
|
||||
PROMPT 20 1 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_ESERCIZIO 4
|
||||
BEGIN
|
||||
PROMPT 2 2 "Esercizio "
|
||||
FLAGS "Z"
|
||||
USE CCE
|
||||
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_ESERCIZIO
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio" 105@->D0
|
||||
DISPLAY "Data fine@10" 105@->D1
|
||||
OUTPUT F_ESERCIZIO CODTAB
|
||||
OUTPUT F_DATAINIZIO 105@->D0
|
||||
OUTPUT F_DATAFINE 105@->D1
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
DATE F_DATAINIZIO
|
||||
BEGIN
|
||||
PROMPT 20 2 "Data inizio "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE F_DATAFINE
|
||||
BEGIN
|
||||
PROMPT 45 2 "Data fine "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_GRUPPO 2
|
||||
BEGIN
|
||||
PROMPT 2 3 "Gruppo "
|
||||
FLAGS "Z"
|
||||
USE CCB KEY 1
|
||||
JOIN %CGR ALIAS 106 INTO CODTAB==CODTAB[5,6]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Codice" CODTAB[5,6]
|
||||
DISPLAY "Descrizione@60" 106@->S0
|
||||
OUTPUT F_GRUPPO CODTAB[5,6]
|
||||
OUTPUT F_D_GRUPPO 106@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_SPECIE 4
|
||||
BEGIN
|
||||
PROMPT 2 4 "Specie "
|
||||
FLAGS "_"
|
||||
USE CCB KEY 1
|
||||
JOIN %CAT ALIAS 107 INTO CODTAB[1,2]==CODTAB[5,6] CODTAB[3,6]==CODTAB[7,10]
|
||||
INPUT CODTAB[1,4] F_ESERCIZIO SELECT
|
||||
INPUT CODTAB[5,6] F_GRUPPO SELECT
|
||||
INPUT CODTAB[7,10] F_SPECIE
|
||||
DISPLAY "Gruppo" CODTAB[5,6]
|
||||
DISPLAY "Specie" CODTAB[7,10]
|
||||
DISPLAY "Descrizione@60" 107@->S0
|
||||
OUTPUT F_SPECIE CODTAB[7,10]
|
||||
OUTPUT F_D_SPECIE 107@->S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_D_GRUPPO 60 55
|
||||
BEGIN
|
||||
PROMPT 20 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_SPECIE 60 55
|
||||
BEGIN
|
||||
PROMPT 20 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX -1 78 5
|
||||
BEGIN
|
||||
PROMPT 1 7 "@bPercentuale di deducibilità"
|
||||
END
|
||||
|
||||
BOOLEAN F_USOPROM1
|
||||
BEGIN
|
||||
PROMPT 2 8 "Deducibilità 100% - Esclusivamente strumentale"
|
||||
END
|
||||
|
||||
BOOLEAN F_USOPROM2
|
||||
BEGIN
|
||||
PROMPT 2 9 "Deducibilità 50% - Uso promiscuo"
|
||||
END
|
||||
|
||||
BOOLEAN F_USOPROM3
|
||||
BEGIN
|
||||
PROMPT 2 10 "Deducibilità 80% - Uso promiscuo agenti/rappresentanti"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_VEIDIP 1 78
|
||||
BEGIN
|
||||
PROMPT 1 13 "@bBeni in uso promiscuo a dipendente"
|
||||
ITEM "0|Escludere tutti i beni in uso a dipendente"
|
||||
ITEM "1|Includere solo i beni in uso a dipendente"
|
||||
ITEM "2|Includere tutti i beni"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
274
ce/ce3800.cpp
Executable file
274
ce/ce3800.cpp
Executable file
@ -0,0 +1,274 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
|
||||
#include "celib.h"
|
||||
#include "ce3400.h"
|
||||
#include "ce3400a.h"
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include "ammce.h"
|
||||
#include "cespi.h"
|
||||
#include "salce.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Form
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TECFE_form : public TCespi_list_form
|
||||
{
|
||||
TCursor* _cur;
|
||||
int _order, _tipo_sit;
|
||||
TString _str;
|
||||
|
||||
protected:
|
||||
virtual TRelation* relation() const { return _cur->relation(); }
|
||||
virtual TCursor* cursor() const { return _cur; }
|
||||
virtual bool validate(TForm_item& fld, TToken_string& val);
|
||||
|
||||
public:
|
||||
const TString& decode_group(const char* codtab, int mode = 0);
|
||||
TPrint_section& cespite() { return section('B', odd_page); }
|
||||
TPrint_section& totale() { return section('B', even_page); }
|
||||
|
||||
void set_cursor(TCursor& cur) { _cur = &cur; }
|
||||
void set_testata(const TMask& m, const TString& codtab);
|
||||
|
||||
TECFE_form();
|
||||
};
|
||||
|
||||
void TECFE_form::set_testata(const TMask& m, const TString& codtab)
|
||||
{
|
||||
TCespi_list_form::set_testata(m);
|
||||
_order = m.get_int(F_ORDINAMENTO);
|
||||
_tipo_sit = m.get_int(F_SITUAZIONE);
|
||||
|
||||
TPrint_section& header = section('H', odd_page);
|
||||
header.find_field(F_CODTAB).set(decode_group(codtab));
|
||||
}
|
||||
|
||||
const TString& TECFE_form::decode_group(const char* codtab, int mode)
|
||||
{
|
||||
const int order = mode > 0 ? mode : _order;
|
||||
_str = "@b";
|
||||
_str << (order==1 ? "Categoria" : "Impianto") << "@r " << codtab << ' ';
|
||||
if (order == 1)
|
||||
{
|
||||
const TRectype& cat = ditta_cespiti().categoria(0, NULL, atoi(codtab));
|
||||
_str << cat.get("S0");
|
||||
}
|
||||
else
|
||||
_str << cache().get("CIM", codtab, "S0");
|
||||
return _str;
|
||||
}
|
||||
|
||||
bool TECFE_form::validate(TForm_item& fld, TToken_string& val)
|
||||
{
|
||||
const char* cmd = val.get(0);
|
||||
if (stricmp(cmd, "_INVCODTAB") == 0)
|
||||
{
|
||||
const TRectype& cespi = relation()->curr();
|
||||
// Se la stampa è ordinata per categoria allora stampo l'impianto e viceversa
|
||||
const TString16 codtab = cespi.get(_order == 1 ? CESPI_CODIMP : CESPI_CODCAT);
|
||||
if (codtab.not_empty())
|
||||
fld.set(decode_group(codtab, 3-_order));
|
||||
else
|
||||
fld.set("");
|
||||
return TRUE;
|
||||
}
|
||||
if (stricmp(cmd, "_VALAMM") == 0)
|
||||
{
|
||||
const TRectype& salpro = relation()->curr(LF_SALCE);
|
||||
real val = salpro.get_real(SALCE_CSTO)-salpro.get_real(SALCE_VNONAMM)-salpro.get_real(SALCE_PLUSREIN)+
|
||||
salpro.get_real(SALCE_RIV75)+salpro.get_real(SALCE_RIV83)+salpro.get_real(SALCE_RIV90)+salpro.get_real(SALCE_RIV91);
|
||||
val += salpro.get_real(_tipo_sit == 1 ? SALCE_RIVGF : SALCE_RIVGC);
|
||||
fld.set(val.string());
|
||||
return TRUE;
|
||||
}
|
||||
return TCespi_list_form::validate(fld, val);
|
||||
}
|
||||
|
||||
TECFE_form::TECFE_form() : TCespi_list_form("ce3800a")
|
||||
{ }
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Mask
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TECFE_mask : public TAutomask
|
||||
{
|
||||
protected:
|
||||
virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly);
|
||||
|
||||
public:
|
||||
TECFE_mask() : TAutomask("ce3400a") { }
|
||||
};
|
||||
|
||||
bool TECFE_mask::on_field_event(TOperable_field& f, TField_event e, long jolly)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (f.dlg())
|
||||
{
|
||||
case F_FROM_CAT:
|
||||
case F_D_FROM_CAT:
|
||||
case F_TO_CAT:
|
||||
case F_D_TO_CAT:
|
||||
{
|
||||
TDitta_cespiti& dc = ditta_cespiti();
|
||||
ok = dc.on_category_event(f, e, jolly);
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Main Application
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TECFE_app : public TSkeleton_application
|
||||
{
|
||||
TECFE_form* _form;
|
||||
int _tipo_sit;
|
||||
int _order;
|
||||
static bool elenco_filter(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual void main_loop();
|
||||
|
||||
public:
|
||||
void print_cespite();
|
||||
void print_totale(const char* cod);
|
||||
};
|
||||
|
||||
void TECFE_app::print_cespite()
|
||||
{
|
||||
TPrint_section& ces = _form->cespite();
|
||||
_form->print_section(ces);
|
||||
}
|
||||
|
||||
void TECFE_app::print_totale(const char* cod)
|
||||
{
|
||||
TPrint_section& tot = _form->totale();
|
||||
tot.find_field(F_CODTAB).set(_form->decode_group(cod));
|
||||
_form->print_separator();
|
||||
_form->print_section(tot);
|
||||
for (unsigned int i = 0; i < tot.fields(); i++)
|
||||
tot.field(i).set("");
|
||||
printer().formfeed();
|
||||
}
|
||||
|
||||
bool TECFE_app::elenco_filter(const TRelation* rel)
|
||||
{
|
||||
const TRectype& salpro = rel->curr(LF_SALCE);
|
||||
const real num = salpro.get(SALCE_NUMELE);
|
||||
return num > ZERO;
|
||||
}
|
||||
|
||||
void TECFE_app::main_loop()
|
||||
{
|
||||
TECFE_mask m;
|
||||
m.set_caption("Elenco fine esercizio");
|
||||
ditta_cespiti().init_mask(m);
|
||||
|
||||
while (m.run() != K_QUIT)
|
||||
{
|
||||
const int ese = m.get_int(F_ESERCIZIO);
|
||||
const int gruppo = m.get_int(F_GRUPPO);
|
||||
const TString4 specie = m.get(F_SPECIE);
|
||||
ditta_cespiti().set_attivita(ese, gruppo, specie);
|
||||
|
||||
_tipo_sit = m.get_int(F_SITUAZIONE);
|
||||
_order = m.get_int(F_ORDINAMENTO);
|
||||
|
||||
TRelation rel(LF_CESPI);
|
||||
TString expr;
|
||||
expr << "IDCESPITE==IDCESPITE|CODES==" << m.get(F_ESERCIZIO) << "|TPSALDO==2";
|
||||
rel.add(LF_SALCE, expr);
|
||||
expr << "|TPAMM==" << _tipo_sit;
|
||||
rel.add(LF_AMMCE, expr);
|
||||
|
||||
TString filter;
|
||||
if (_order == 1)
|
||||
{
|
||||
const int fc = m.get_int(F_FROM_CAT);
|
||||
const int tc = m.get_int(F_TO_CAT);
|
||||
if (fc != 0)
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODCAT << ">=" << fc << ')';
|
||||
}
|
||||
if (tc != 0)
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODCAT << "<=" << tc << ')' ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const TString& fi = m.get(F_FROM_IMP);
|
||||
const TString& ti = m.get(F_TO_IMP);
|
||||
if (!fi.blank())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODIMP << ">=" << fi << ')';
|
||||
}
|
||||
if (!fi.blank())
|
||||
{
|
||||
if (filter.not_empty()) filter << "&&";
|
||||
filter << '(' << CESPI_CODIMP << "<=" << ti << ')';
|
||||
}
|
||||
}
|
||||
|
||||
const char* orderby = _order == 1 ? "CODCAT|DTCOMP|IDCESPITE" : "CODIMP|DTCOMP|IDCESPITE";
|
||||
TSorted_cursor cur(&rel, orderby, filter);
|
||||
cur.set_filterfunction(elenco_filter, TRUE);
|
||||
|
||||
const long items = cur.items();
|
||||
if (items > 0)
|
||||
{
|
||||
const TRectype& cespi = rel.curr();
|
||||
|
||||
TECFE_form form;
|
||||
form.set_cursor(cur);
|
||||
_form = &form;
|
||||
|
||||
printer().open();
|
||||
|
||||
TString16 last_group = "@"; // Simbolo speciale per indicare nessuna stampa!
|
||||
cur.freeze();
|
||||
for (cur = 0L; cur.pos() < items; ++cur)
|
||||
{
|
||||
// Controllo qui la validità per non incasinare il valutatore con stringhe e numeri
|
||||
const int gra = cespi.get_int(CESPI_CODCGRA);
|
||||
const TString& spa = cespi.get(CESPI_CODSPA);
|
||||
if (gra != gruppo || spa != specie)
|
||||
continue;
|
||||
const TString16 curr_group = cespi.get(_order == 1 ? CESPI_CODCAT : CESPI_CODIMP);
|
||||
if (curr_group != last_group)
|
||||
{
|
||||
if (last_group != "@")
|
||||
print_totale(last_group);
|
||||
last_group = curr_group;
|
||||
form.set_testata(m, curr_group);
|
||||
}
|
||||
print_cespite();
|
||||
}
|
||||
if (last_group != "@")
|
||||
print_totale(last_group);
|
||||
|
||||
printer().close();
|
||||
xvt_statbar_set("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ce3800(int argc, char* argv[])
|
||||
{
|
||||
TECFE_app app;
|
||||
app.run(argc, argv, "Elenco fine esercizio");
|
||||
return 0;
|
||||
}
|
||||
378
ce/ce3800a.frm
Executable file
378
ce/ce3800a.frm
Executable file
@ -0,0 +1,378 @@
|
||||
#include "ce3400a.h"
|
||||
|
||||
USE LF_CESPI
|
||||
END
|
||||
|
||||
// Linee di sfondo
|
||||
|
||||
SECTION GRAPHICS ODD
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 7 "B"
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 11 ""
|
||||
END
|
||||
|
||||
LINEA -1 132 1
|
||||
BEGIN
|
||||
PROMPT 1 -3 "B"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
// Testata
|
||||
|
||||
SECTION HEADER ODD 11
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
KEY "Titolo"
|
||||
PROMPT 1 1 "@bELENCO CESPITI FINE ESERCIZIO"
|
||||
END
|
||||
|
||||
LISTA F_SITUAZIONE
|
||||
BEGIN
|
||||
KEY "Situazione"
|
||||
PROMPT 80 1 ""
|
||||
ITEM "1|Situazione Fiscale"
|
||||
ITEM "2|Situazione Civilistica"
|
||||
ITEM "3|Situazione Gestionale"
|
||||
END
|
||||
|
||||
STRINGA F_CODDITTA
|
||||
BEGIN
|
||||
KEY "Codice ditta"
|
||||
PROMPT 1 2 "@bDitta@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_RAGSOC
|
||||
BEGIN
|
||||
KEY "Ragione sociale"
|
||||
PROMPT 20 2 ""
|
||||
END
|
||||
|
||||
STRINGA F_ESERCIZIO
|
||||
BEGIN
|
||||
KEY "Esercizio"
|
||||
PROMPT 1 3 "@bEsercizio@r "
|
||||
END
|
||||
|
||||
STRINGA F_DATAINIZIO
|
||||
BEGIN
|
||||
KEY "Inizio Esercizio"
|
||||
PROMPT 20 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_DATAFINE
|
||||
BEGIN
|
||||
KEY "Fine Esercizio"
|
||||
PROMPT 33 3 ""
|
||||
END
|
||||
|
||||
STRINGA F_GRUPPO
|
||||
BEGIN
|
||||
KEY "Gruppo"
|
||||
PROMPT 1 4 "@bGruppo@r "
|
||||
PICTURE "#####"
|
||||
END
|
||||
|
||||
STRINGA F_D_GRUPPO
|
||||
BEGIN
|
||||
KEY "Descrizione Gruppo"
|
||||
PROMPT 20 4 ""
|
||||
END
|
||||
|
||||
STRINGA F_SPECIE
|
||||
BEGIN
|
||||
KEY "Specie"
|
||||
PROMPT 1 5 "@bSpecie@r "
|
||||
END
|
||||
|
||||
STRINGA F_D_SPECIE
|
||||
BEGIN
|
||||
KEY "Descrizione Specie"
|
||||
PROMPT 20 5 ""
|
||||
END
|
||||
|
||||
STRINGA F_CODTAB
|
||||
BEGIN
|
||||
KEY "categoria o impianto"
|
||||
PROMPT 1 6 ""
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 8 "@bCespite"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 12 8 "Descrizione"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 8 "Data Acq."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 77 8 "Elem."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 9 "@bCosto storico"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 1 10 "@bTotale"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 9 "Costo storico"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 17 10 "Unitario"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 9 "Valore"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 33 10 "Ammortizzabile"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 9 "Fondo"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 49 10 "Ammortamento"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 9 "Valore non più"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 65 10 "ammortizzabile"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 9 "Fondo Privato"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 81 10 "Ammortamento"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 9 "Valore Privato"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 97 10 "non ammortizz."
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 113 9 "Residuo da"
|
||||
END
|
||||
|
||||
STRINGA -1
|
||||
BEGIN
|
||||
PROMPT 113 10 "ammortizzare"
|
||||
END
|
||||
END
|
||||
|
||||
SECTION BODY ODD 3
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 1 1 ""
|
||||
FIELD IDCESPITE
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 12 1 ""
|
||||
FIELD DESC
|
||||
END
|
||||
|
||||
STRING -1
|
||||
BEGIN
|
||||
PROMPT 65 1 ""
|
||||
FIELD DTCOMP
|
||||
END
|
||||
|
||||
NUMERO -1 5
|
||||
BEGIN
|
||||
KEY "Numero elementi"
|
||||
PROMPT 75 1 ""
|
||||
FIELD LF_SALCE->NUMELE
|
||||
PICTURE "####@"
|
||||
END
|
||||
|
||||
STRINGA -1 50
|
||||
BEGIN
|
||||
PROMPT 81 1 ""
|
||||
MESSAGE _INVCODTAB
|
||||
END
|
||||
|
||||
VALUTA 1 15
|
||||
BEGIN
|
||||
PROMPT 1 2 ""
|
||||
FIELD LF_SALCE->CSTO
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->1
|
||||
END
|
||||
|
||||
VALUTA 2 15
|
||||
BEGIN
|
||||
PROMPT 17 2 ""
|
||||
MESSAGE _NUMEXPR,IF(LF_SALCE->NUMELE>0;LF_SALCE->CSTO/LF_SALCE->NUMELE;0)
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 3 15
|
||||
BEGIN
|
||||
PROMPT 33 2 ""
|
||||
MESSAGE _VALAMM
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->3
|
||||
END
|
||||
|
||||
VALUTA 4 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento"
|
||||
PROMPT 49 2 ""
|
||||
MESSAGE _NUMEXPR,LF_AMMCE->QNORP+LF_AMMCE->QACCP+LF_AMMCE->QANTP
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->4
|
||||
END
|
||||
|
||||
VALUTA 5 15
|
||||
BEGIN
|
||||
KEY "Quote perse"
|
||||
PROMPT 65 2 ""
|
||||
FIELD LF_AMMCE->QPERSEP
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->5
|
||||
END
|
||||
|
||||
VALUTA 6 15
|
||||
BEGIN
|
||||
KEY "Fondo ammortamento private"
|
||||
PROMPT 81 2 ""
|
||||
FIELD LF_AMMCE->FPRIVATOP
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->6
|
||||
END
|
||||
|
||||
VALUTA 7 15
|
||||
BEGIN
|
||||
KEY "Quote perse private"
|
||||
PROMPT 97 2 ""
|
||||
FIELD LF_AMMCE->QPPRIVATEP
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->7
|
||||
END
|
||||
|
||||
VALUTA 8 15
|
||||
BEGIN
|
||||
KEY "Residuo da ammortizzare"
|
||||
PROMPT 113 2 ""
|
||||
MESSAGE _NUMEXPR,#3-#4-#5-#6-#7
|
||||
PICTURE "###.###.###.##@"
|
||||
MESSAGE ADD,BE->8
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION BODY EVEN 2
|
||||
|
||||
STRING F_CODTAB
|
||||
BEGIN
|
||||
PROMPT 1 1 "@bTOTALE "
|
||||
END
|
||||
|
||||
VALUTA 1 15
|
||||
BEGIN
|
||||
PROMPT 1 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 3 15
|
||||
BEGIN
|
||||
PROMPT 33 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 4 15
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 5 15
|
||||
BEGIN
|
||||
PROMPT 65 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 6 15
|
||||
BEGIN
|
||||
PROMPT 81 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 7 15
|
||||
BEGIN
|
||||
PROMPT 97 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
VALUTA 8 15
|
||||
BEGIN
|
||||
PROMPT 113 2 ""
|
||||
PICTURE "###.###.###.##@"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SECTION FOOTER ODD 3
|
||||
|
||||
DATA -1
|
||||
BEGIN
|
||||
PROMPT 1 2 "@bData@r "
|
||||
MESSAGE _TODAY
|
||||
END
|
||||
|
||||
NUMERO -1
|
||||
BEGIN
|
||||
PROMPT 120 2 "@bPagina@r "
|
||||
MESSAGE _PAGENO
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
@ -104,20 +104,20 @@ Caption = "Stampe giornaliere"
|
||||
Picture = <ce00.bmp>
|
||||
Module = 11
|
||||
Flags = ""
|
||||
Item_01 = "Lista cespiti", "", ""
|
||||
Item_02 = "Lista movimenti", "", ""
|
||||
Item_03 = "Lista cespiti ad uso promiscuo", "", ""
|
||||
Item_04 = "Lista cespiti a fine esercizio", "", ""
|
||||
Item_01 = "Lista cespiti", "ce3 -4", "F"
|
||||
Item_02 = "Lista movimenti", "ce3 -5", "F"
|
||||
Item_03 = "Lista cespiti ad uso promiscuo", "ce3 -6", "F"
|
||||
Item_04 = "Lista cespiti a fine esercizio", "ce3 -7", "F"
|
||||
|
||||
[PRASSICE_011]
|
||||
Caption = "Stampe di fine esercizio"
|
||||
Picture = <ce00.bmp>
|
||||
Module = 11
|
||||
Flags = ""
|
||||
Item_01 = "Scheda storico cespite", "ce3 -1", ""
|
||||
Item_02 = "Prospetto cespiti", "ce3 -2", ""
|
||||
Item_03 = "Prospetto rivalutazioni", "", ""
|
||||
Item_04 = "Registro cespiti", "ce3 -0", ""
|
||||
Item_01 = "Scheda storico cespite", "ce3 -1", "F"
|
||||
Item_02 = "Prospetto cespiti", "ce3 -2", "F"
|
||||
Item_03 = "Prospetto rivalutazioni", "ce3 -3", "F"
|
||||
Item_04 = "Registro cespiti", "ce3 -0", "F"
|
||||
|
||||
[PRASSICE_012]
|
||||
Caption = "Servizi"
|
||||
|
||||
@ -4,8 +4,7 @@ TOOLBAR "" 0 -4 0 4
|
||||
|
||||
BUTTON DLG_ATTIV 10 2
|
||||
BEGIN
|
||||
PROMPT -16 -3 "Attivitá"
|
||||
// MESSAGE RUN
|
||||
PROMPT -16 -3 "~Attivitá"
|
||||
END
|
||||
|
||||
#include <toolbar.h>
|
||||
@ -25,17 +24,7 @@ BEGIN
|
||||
PROMPT 2 1 "Codice esercizio "
|
||||
FLAGS "Z"
|
||||
KEY 1
|
||||
FIELD CODTAB
|
||||
/* USE CCE
|
||||
JOIN ESC ALIAS 105 INTO CODTAB==CODTAB
|
||||
INPUT CODTAB F_CODESER
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio esercizio" 105@->D0
|
||||
DISPLAY "Data fine esercizio" 105@->D1
|
||||
OUTPUT F_CODESER CODTAB
|
||||
OUTPUT F_DATAINI 105@->D0
|
||||
OUTPUT F_DATAFINE 105@->D1 */
|
||||
|
||||
FIELD CODTAB
|
||||
USE ESC
|
||||
INPUT CODTAB F_CODESER
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
@ -47,22 +36,6 @@ BEGIN
|
||||
CHECKTYPE FORCED
|
||||
END
|
||||
|
||||
/*NUMBER F_CODESERCONT 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice esercizio "
|
||||
FLAGS "HZ"
|
||||
KEY 1
|
||||
USE ESC
|
||||
INPUT CODTAB F_CODESERCONT
|
||||
DISPLAY "Codice esercizio" CODTAB
|
||||
DISPLAY "Data inizio esercizio" D0
|
||||
DISPLAY "Data fine esercizio" D1
|
||||
OUTPUT F_CODESERCONT CODTAB
|
||||
OUTPUT F_DATAINI D0
|
||||
OUTPUT F_DATAFINE D1
|
||||
CHECKTYPE REQUIRED
|
||||
MESSAGE COPY,F_CODESER
|
||||
END */
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
|
||||
34
ce/cgr.txt
Executable file
34
ce/cgr.txt
Executable file
@ -0,0 +1,34 @@
|
||||
[Header]
|
||||
Version=199517
|
||||
Fields=COD,3|CODTAB,25|S0,70|S1,70|S2,70|S3,70|S4,20|S5,20|S6,5|S7,5
|
||||
Fields=S8,5|S9,5|S10,5|S11,5|I0,7|I1,7|I2,7|I3,7|I4,7|I5,7
|
||||
Fields=I6,7|I7,7|I8,7|I9,7|I10,7|I11,7|I12,7|I13,7|I14,7|R0,18
|
||||
Fields=R1,18|R2,18|R3,18|R4,18|R5,18|R6,18|R7,18|R8,18|R9,18|R10,18
|
||||
Fields=R11,18|R12,18|R13,18|R14,18|R15,18|R16,18|R17,18|R18,18|R19,18|D0,10
|
||||
Fields=D1,10|D2,10|D3,10|D4,10|B0,1|B1,1|B2,1|B3,1|B4,1|B5,1
|
||||
Fields=B6,1|B7,1|B8,1|B9,1|FPC,1
|
||||
|
||||
[Data]
|
||||
CGR|01|INDUSTRIE AGRARIE E BOSCHIVE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|02|INDUSTRIE ZOOTECNICHE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|03|INDUSTRIE DELLA PESCA E DELLA CACCIA|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|04|INDUSTRIE ESTRATTIVE DI MINERALI METALLIFERI E NON METALLIF.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|05|INDUSTRIE MANIFATTURIERE ALIMENTARI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|06|INDUSTRIE MANIFATTURIERE DEL LEGNO|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|07|INDUSTRIE MANIFATTURIERE METALLURGICHE E MECCANICHE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|08|INDUSTRIE MANIFATTURIERE DEI MINERALI NON METALLIFERI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|09|INDUSTRIE MANIFATTURIERE CHIMICHE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|10|INDUSTRIE MANIFATTURIERE DELLA CARTA|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|11|INDUSTRIE MANIFATTURIERE DELLE PELLI E DEL CUOIO|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|12|INDUSTRIE MANIFATTURIERE TESSILI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|13|INDUSTRIE MANIFATTURIERE DEL VESTIARIO,ABBIGLIAM.,ARREDAM.|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|14|IND. MANIFATTURIERE DELLA GOMMA,GUTTAPERCA,MATERIE PLASTICHE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|15|INDUSTRIE POLIGRAFICHE, EDITORIALI ED AFFINI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|16|INDUSTRIE EDILIZIE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|17|INDUSTRIE DELL'ENERGIA ELETTRICA;DEL GAS E DELL'ACQUA|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|18|INDUSTRIE DEI TRASPORTI E DELLE COMUNICAZIONI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|19|ALBERGHI-RISTORANTI-BAR E ATTIVITA' AFFINI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|20|SERVIZI CULTURALI,SPORTIVI E RICREATIVI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|21|SERVIZI SANITARI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|22|SERVIZI IGIENICI ALLA PERSONA E DOMESTICI|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
CGR|99|ATTIVITA' NON PRECEDENTEMENTE SPECIFICATE|||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||X
|
||||
12
ce/clm.txt
Executable file
12
ce/clm.txt
Executable file
@ -0,0 +1,12 @@
|
||||
[Header]
|
||||
Version=199517
|
||||
Fields=COD,3|CODTAB,25|S0,70|S1,70|S2,70|S3,70|S4,20|S5,20|S6,5|S7,5
|
||||
Fields=S8,5|S9,5|S10,5|S11,5|I0,7|I1,7|I2,7|I3,7|I4,7|I5,7
|
||||
Fields=I6,7|I7,7|I8,7|I9,7|I10,7|I11,7|I12,7|I13,7|I14,7|R0,18
|
||||
Fields=R1,18|R2,18|R3,18|R4,18|R5,18|R6,18|R7,18|R8,18|R9,18|R10,18
|
||||
Fields=R11,18|R12,18|R13,18|R14,18|R15,18|R16,18|R17,18|R18,18|R19,18|D0,10
|
||||
Fields=D1,10|D2,10|D3,10|D4,10|B0,1|B1,1|B2,1|B3,1|B4,1|B5,1
|
||||
Fields=B6,1|B7,1|B8,1|B9,1|FPC,1
|
||||
|
||||
[Data]
|
||||
CLM|19971231||||||||||||||||||||||||||||18075.99|25822.84|4131.66|2065.83||||||||||||||||||||||||||||||||
|
||||
12
ce/clm_lire.txt
Executable file
12
ce/clm_lire.txt
Executable file
@ -0,0 +1,12 @@
|
||||
[Header]
|
||||
Version=199517
|
||||
Fields=COD,3|CODTAB,25|S0,70|S1,70|S2,70|S3,70|S4,20|S5,20|S6,5|S7,5
|
||||
Fields=S8,5|S9,5|S10,5|S11,5|I0,7|I1,7|I2,7|I3,7|I4,7|I5,7
|
||||
Fields=I6,7|I7,7|I8,7|I9,7|I10,7|I11,7|I12,7|I13,7|I14,7|R0,18
|
||||
Fields=R1,18|R2,18|R3,18|R4,18|R5,18|R6,18|R7,18|R8,18|R9,18|R10,18
|
||||
Fields=R11,18|R12,18|R13,18|R14,18|R15,18|R16,18|R17,18|R18,18|R19,18|D0,10
|
||||
Fields=D1,10|D2,10|D3,10|D4,10|B0,1|B1,1|B2,1|B3,1|B4,1|B5,1
|
||||
Fields=B6,1|B7,1|B8,1|B9,1|FPC,1
|
||||
|
||||
[Data]
|
||||
CLM|19971231||||||||||||||||||||||||||||35000000.00|50000000.00|8000000.00|4000000.00||||||||||||||||||||||||||||||||
|
||||
@ -24,6 +24,6 @@ RIVGC|4|18|3|Rivalutazione generica civilistica
|
||||
STAMPATO|8|1|0|Stampato su almeno un bollato in esercizi passati (STBOLLATO)
|
||||
NUMREG|3|7|0|Numero di registrazione corrispondente di prima nota
|
||||
3
|
||||
IDMOV+IDRET|
|
||||
IDMOV|
|
||||
IDCESPITE+IDMOV|
|
||||
NUMREG+IDMOV|
|
||||
|
||||
20
ce/tmc.txt
Executable file
20
ce/tmc.txt
Executable file
@ -0,0 +1,20 @@
|
||||
[Header]
|
||||
Version=199517
|
||||
Fields=COD,3|CODTAB,25|S0,70|S1,70|S2,70|S3,70|S4,20|S5,20|S6,5|S7,5
|
||||
Fields=S8,5|S9,5|S10,5|S11,5|I0,7|I1,7|I2,7|I3,7|I4,7|I5,7
|
||||
Fields=I6,7|I7,7|I8,7|I9,7|I10,7|I11,7|I12,7|I13,7|I14,7|R0,18
|
||||
Fields=R1,18|R2,18|R3,18|R4,18|R5,18|R6,18|R7,18|R8,18|R9,18|R10,18
|
||||
Fields=R11,18|R12,18|R13,18|R14,18|R15,18|R16,18|R17,18|R18,18|R19,18|D0,10
|
||||
Fields=D1,10|D2,10|D3,10|D4,10|B0,1|B1,1|B2,1|B3,1|B4,1|B5,1
|
||||
Fields=B6,1|B7,1|B8,1|B9,1|FPC,1
|
||||
|
||||
[Data]
|
||||
TMC|A|Acquisto cespite|||||O NOOSSNNNNNN|I|+|||||1||||||||||||||||||||||||||||||||||||||||X|X|X|X| | |||||
|
||||
TMC|T|Trasferimento Cespite|||||S SSSSSSSSSSS||=|||||1||||||||||||||||||||||||||||||||||||||||X|X|X|X| | |||||
|
||||
TMC|C|Sostenimento costi|||||N NSOSNNNNNNN|I|+|||||1|||||||||||||||||||||||||||||||||||||||| |X|X|X| | |||||
|
||||
TMC|M|Rettifica acq. esercizio precedente|||||S NSSNNNNNNNS||=|||||1||||||||||||||||||||||||||||||||||||||||X|X|X| |X| |||||
|
||||
TMC|V|Vendita Cespite|||||O OOSSSSSSSSS|E|-|||||1||||||||||||||||||||||||||||||||||||||||X|X| | |X|X|||||
|
||||
TMC|B|Rettifica acquisto Cespite|||||O NSSSNNNNNNN|I|=|A||||2||||||||||||||||||||||||||||||||||||||||X|X|X| | | |||||
|
||||
TMC|R|Rivalutazione|||||N SNSSSSSSSSS|R|+|||||1||||||||||||||||||||||||||||||||||||||||X| | | | | |||||
|
||||
TMC|Z|Rettifica vendita Cespite|||||O SSSSSSSSSSS|E|=|V||||2||||||||||||||||||||||||||||||||||||||||X| | | |X| |||||
|
||||
TMC|E|Eliminazione dal processo produttivo|||||N NOOSSSSSSSS|E|-|||||1||||||||||||||||||||||||||||||||||||||||X|X|X| |X|X|||||
|
||||
@ -333,6 +333,12 @@ BEGIN
|
||||
FIELD MOVIND
|
||||
END
|
||||
|
||||
BOOLEAN F_SOLAIVA
|
||||
BEGIN
|
||||
PROMPT 2 18 "Movimento di sola IVA"
|
||||
FIELD SOLOIVA
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
@ -222,6 +222,8 @@ bool TPrintclifo_app::preprocess_page(int file, int counter)
|
||||
if (!_telex.empty()) _telex << "/";
|
||||
_telex << get_field(LF_CLIFO, CLI_TELEX);
|
||||
_email = get_field(LF_CLIFO, CLI_MAIL);
|
||||
const int at = _email.find('@');
|
||||
if (at > 0) _email.insert("@", at); // Raddoppia la chiocciola!
|
||||
_indir = get_field(LF_CLIFO, CLI_INDCF);
|
||||
g_ric = atoi(get_field(LF_CLIFO, CLI_GRUPPORIC));
|
||||
c_ric = atoi(get_field(LF_CLIFO, CLI_CONTORIC));
|
||||
|
||||
@ -3363,7 +3363,6 @@ void TStampa_bilanci::stampa_totali()
|
||||
//per i conti patrimoniali stampo anche lo sbilancio es. precedente
|
||||
void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2)
|
||||
{
|
||||
const TString16 dep;
|
||||
real pareggio;
|
||||
real sbilancio = _tot_dare - r1 - (_tot_avere - r2);
|
||||
real sbilprec = r2 - r1;
|
||||
@ -3387,6 +3386,7 @@ void TStampa_bilanci::stampa_totali_uno(const real& r1,const real& r2)
|
||||
_cambiato_conto_1 = TRUE;
|
||||
_cambiato_conto_2 = TRUE;
|
||||
|
||||
const char* dep = "";
|
||||
set_row(_i++, (const char*)dep);
|
||||
set_row(_i++, (const char*)dep);
|
||||
set_row(_i++, (const char*)dep);
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
#include <clifo.h>
|
||||
#include <rcausali.h>
|
||||
|
||||
#define NEW_CESP 1
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Dati incasso immediato
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -356,7 +358,9 @@ bool TPrimanota_application::read_caus(const char* cod, int year)
|
||||
|
||||
const char tipo = nriga == 1 ? 'T' : ' ';
|
||||
if (nriga == 1 && tc.tipo() > ' ' && tc.ok())
|
||||
{
|
||||
m->set(tc.tipo() == 'C' ? F_CLIENTE : F_FORNITORE, tc.sottoconto());
|
||||
}
|
||||
set_cgs_row(-1,zero,tc,desc,tipo);
|
||||
}
|
||||
}
|
||||
@ -484,12 +488,8 @@ void TPrimanota_application::init_mask(TMask& m)
|
||||
|
||||
// Show/Hide campi valuta: F_VALUTAINTRA, F_CAMBIOINTRA, F_CORRLIRE, F_CORRVAL (GROUP 4)
|
||||
m.show(-4, causale().valintra());
|
||||
/* if (god_mode("IntraAutoIva"))
|
||||
{
|
||||
if (m.insert_mode() && causale().valintra() && !causale().intra())
|
||||
m.set(F_SOLAIVA, "X", TRUE); // Propone movimento di sola iva
|
||||
}
|
||||
*/
|
||||
if (causale().soloiva())
|
||||
m.set(F_SOLAIVA, "X", TRUE); // Propone movimento di sola iva
|
||||
|
||||
m.show(F_CODIVA, m.insert_mode()); // Codice IVA standard
|
||||
|
||||
@ -535,8 +535,6 @@ void TPrimanota_application::init_query_mode(TMask& m)
|
||||
else
|
||||
{
|
||||
m.set(F_DATAREG, _last_dreg);
|
||||
// DATACOMP new way
|
||||
// m.set(F_DATACOMP, _last_dcom);
|
||||
}
|
||||
|
||||
_incasso->_step = 0; // Azzera flag di incasso immediato
|
||||
@ -1266,6 +1264,8 @@ long TPrimanota_application::calcola_m770(int tipo_coll, real& spese, real& comp
|
||||
{
|
||||
if (m770 != 5)
|
||||
spese += imponibile;
|
||||
else
|
||||
compenso += imponibile; // MM000025
|
||||
}
|
||||
else
|
||||
compenso += imponibile;
|
||||
@ -1568,7 +1568,8 @@ void TPrimanota_application::ini2mask(TConfig& ini, TMask& msk, bool query)
|
||||
void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
||||
{
|
||||
TRelation_application::mask2ini(msk, ini);
|
||||
|
||||
|
||||
#ifndef NEW_CESP
|
||||
const char mov_cesp = causale().link_cespiti();
|
||||
if (mov_cesp > ' ')
|
||||
{
|
||||
@ -1580,7 +1581,8 @@ void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
||||
ini.set("INIZIOES", annoes.inizio());
|
||||
ini.set("FINEES", annoes.fine());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int i, f;
|
||||
for (i = 0; i < _rel->cg_items(); i++)
|
||||
{
|
||||
@ -1595,12 +1597,14 @@ void TPrimanota_application::mask2ini(const TMask& msk, TConfig& ini)
|
||||
ini.set(name, rec.get(name));
|
||||
}
|
||||
|
||||
#ifndef NEW_CESP
|
||||
const TBill zio(rec);
|
||||
ini.set("DESCRCONTO", zio.descrizione());
|
||||
ini.set("TIPOCR", zio.tipo_cr());
|
||||
|
||||
const TBill french(rec, TRUE);
|
||||
ini.set("DESCRCONTOC", french.descrizione());
|
||||
#endif
|
||||
}
|
||||
for ( ; ; i++)
|
||||
{
|
||||
@ -1672,10 +1676,15 @@ bool TPrimanota_application::link_cesp(const TMask& msk, const char* action)
|
||||
return FALSE;
|
||||
|
||||
// Controlla l'esistenza del programma cespiti
|
||||
#ifdef NEW_CESP
|
||||
if (!fexist("ce1.exe"))
|
||||
return FALSE;
|
||||
#else
|
||||
if (!fexist("cespcg.exe"))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
// Cerca una riga con tipo costo/ricavo
|
||||
// Cerca una riga con tipo costo/ricavo 2,3,4,8
|
||||
for (int i = _rel->cg_items()-1; i >= 0; i--)
|
||||
{
|
||||
const TRectype& rec = _rel->cg(i);
|
||||
@ -1691,14 +1700,23 @@ bool TPrimanota_application::link_cesp(const TMask& msk, const char* action)
|
||||
cespini.tempdir();
|
||||
cespini.add("ActCsp.ini");
|
||||
|
||||
TConfig cespo(cespini, "Transaction");
|
||||
cespo.set("Action", action);
|
||||
mask2ini(msk, cespo);
|
||||
if (action && *action) // Dummy test
|
||||
{
|
||||
TConfig cespo(cespini, "Transaction");
|
||||
cespo.set("Action", action);
|
||||
mask2ini(msk, cespo);
|
||||
}
|
||||
|
||||
TString appname;
|
||||
#ifdef NEW_CESP
|
||||
appname << "ce1 -4 /c" << cespini;
|
||||
TExternal_app app(appname);
|
||||
bool ok = app.run();
|
||||
#else
|
||||
appname << "cespcg -t /i" << cespini;
|
||||
TExternal_app app(appname);
|
||||
bool ok = app.run(FALSE, 0x3) == 0; // Force user name!
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
@ -33,27 +33,9 @@ BEGIN
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_NUMREG 7
|
||||
BEGIN
|
||||
PROMPT 3 6 "Numero operazione "
|
||||
HELP "Numero del movimento di prima nota da gestire"
|
||||
FLAGS "R"
|
||||
FIELD LF_MOV->NUMREG
|
||||
USE LF_MOV
|
||||
INPUT NUMREG F_NUMREG
|
||||
DISPLAY "Numero@7" NUMREG
|
||||
DISPLAY "Data@10" DATAREG
|
||||
DISPLAY "Causale" CODCAUS
|
||||
DISPLAY "Documento" NUMDOC
|
||||
DISPLAY "Protoc." PROTIVA
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_NUMREG NUMREG
|
||||
KEY 1
|
||||
END
|
||||
|
||||
DATE F_DATAREG
|
||||
BEGIN
|
||||
PROMPT 3 8 "Data operazione "
|
||||
PROMPT 3 6 "Data operazione "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data in cui viene registrata l'operazione"
|
||||
MESSAGE COPY,F_ANNOIVA,7,10
|
||||
@ -61,29 +43,13 @@ END
|
||||
|
||||
NUMBER F_ANNOIVA 4
|
||||
BEGIN
|
||||
PROMPT 52 8 "Anno IVA "
|
||||
PROMPT 52 6 "Anno IVA "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
||||
/* DATACOMP new way
|
||||
DATE F_DATACOMP
|
||||
BEGIN
|
||||
PROMPT 3 9 "Data di competenza "
|
||||
HELP "Data di competenza dell'operazione"
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
NUMBER F_ANNOES 4
|
||||
BEGIN
|
||||
PROMPT 52 9 "Codice esercizio "
|
||||
FLAGS "DRZ"
|
||||
END
|
||||
*/
|
||||
|
||||
STRING F_CODCAUS 3
|
||||
BEGIN
|
||||
PROMPT 3 10 "Causale "
|
||||
PROMPT 3 8 "Causale "
|
||||
FLAGS "UZ"
|
||||
FIELD CODCAUS
|
||||
USE LF_CAUSALI
|
||||
@ -101,7 +67,7 @@ END
|
||||
|
||||
STRING F_DESCRCAUS 50
|
||||
BEGIN
|
||||
PROMPT 23 10 ""
|
||||
PROMPT 23 8 ""
|
||||
USE LF_CAUSALI KEY 2
|
||||
CHECKTYPE NORMAL
|
||||
INPUT DESCR F_DESCRCAUS
|
||||
@ -112,6 +78,39 @@ BEGIN
|
||||
COPY OUTPUT F_CODCAUS
|
||||
ADD RUN cg0 -4
|
||||
END
|
||||
|
||||
NUMBER F_NUMREG 7
|
||||
BEGIN
|
||||
PROMPT 3 10 "Numero operazione "
|
||||
HELP "Numero del movimento di prima nota da gestire"
|
||||
FLAGS "R"
|
||||
FIELD LF_MOV->NUMREG
|
||||
USE LF_MOV
|
||||
INPUT NUMREG F_NUMREG
|
||||
DISPLAY "Numero@7" NUMREG
|
||||
DISPLAY "Data@10" DATAREG
|
||||
DISPLAY "Causale" CODCAUS
|
||||
DISPLAY "Documento" NUMDOC
|
||||
DISPLAY "Protoc." PROTIVA
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_NUMREG NUMREG
|
||||
KEY 1
|
||||
END
|
||||
|
||||
/* DATACOMP new way
|
||||
DATE F_DATACOMP
|
||||
BEGIN
|
||||
PROMPT 3 9 "Data di competenza "
|
||||
HELP "Data di competenza dell'operazione"
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
NUMBER F_ANNOES 4
|
||||
BEGIN
|
||||
PROMPT 52 9 "Codice esercizio "
|
||||
FLAGS "DRZ"
|
||||
END
|
||||
*/
|
||||
|
||||
ENDPAGE
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ PAGE "Dati cliente/fornitore occasionale" -1 -1 72 14
|
||||
STRING O_CODICE 16
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice fiscale / Partita IVA / Codice progressivo "
|
||||
FLAGS "U"
|
||||
USE LF_OCCAS
|
||||
INPUT CFPI O_CODICE
|
||||
DISPLAY "Codice@16" CFPI
|
||||
|
||||
@ -653,7 +653,6 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
||||
if (errato && a._as400 && speso.is_zero())
|
||||
errato = FALSE;
|
||||
|
||||
/* Richiesto da Cover ed inculato da PRASSI
|
||||
if (nota && errato && speso.is_zero())
|
||||
{
|
||||
const int annorif = m.get_int(F_ANNORIF);
|
||||
@ -665,7 +664,6 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
|
||||
errato = !a.crea_partita(bill, annorif, numrif, currig, importo);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (errato)
|
||||
{
|
||||
@ -971,7 +969,7 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
|
||||
const TString desc(a.causale().desc_agg(k));
|
||||
const char sez = a.causale().sezione(k);
|
||||
const real imp(cg.mask().get(K_RESIDUO));
|
||||
TImporto importo(sez, imp);
|
||||
TImporto importo(sez, imp); importo.normalize();
|
||||
a.set_cgs_row(r, importo, conto, desc, tipo);
|
||||
|
||||
if (tipo == 'K')
|
||||
@ -1690,11 +1688,12 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
||||
a._skip_giornale_check = FALSE;
|
||||
a._skip_bollato_check = FALSE;
|
||||
|
||||
const long max = a._lastreg+1;
|
||||
const long num = f.empty() ? max : atol(f.get());
|
||||
if (num < max)
|
||||
{
|
||||
if (a.find(1))
|
||||
// const long max = a._lastreg+1;
|
||||
// const long num = f.empty() ? max : atol(f.get());
|
||||
// if (num < max)
|
||||
// {
|
||||
// if (a.find(1))
|
||||
if (!cache().get(LF_MOV, f.get()).empty())
|
||||
{
|
||||
const TLocalisamfile& mov = a._rel->lfile();
|
||||
bool ok = TRUE;
|
||||
@ -1737,14 +1736,17 @@ bool TPrimanota_application::num_handler(TMask_field& f, KEY key)
|
||||
m.stop_run(K_FORCE_CLOSE);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (num > max)
|
||||
/* else if (num > max)
|
||||
{
|
||||
f.set(format("%ld", max));
|
||||
return f.error_box("Non e' possibile inserire movimenti superiori al %ld", max);
|
||||
}
|
||||
}
|
||||
} */
|
||||
// }
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1764,12 +1766,12 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
|
||||
const TipoIVA i = app().cau2IVA(cau, ann); // Cerca causale e suo tipo
|
||||
if (i != iva_errata)
|
||||
{
|
||||
const bool ok = suspended_handler(f, key); // Controlla sospensione
|
||||
/* const bool ok = suspended_handler(f, key); // Controlla sospensione
|
||||
if (ok && key == K_TAB)
|
||||
{
|
||||
f.set_focusdirty(FALSE);
|
||||
return f.mask().stop_run(K_INS); // Entra in modo inserimento
|
||||
}
|
||||
} */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2205,13 +2207,13 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
|
||||
TEdit_field& upi = m.efield(F_RIEPILOGO);
|
||||
upi.check_type(alleg == 3 ? CHECK_REQUIRED : CHECK_NORMAL);
|
||||
|
||||
if (f.focusdirty() && m.is_running())
|
||||
TEdit_field& cp = m.efield(F_CODPAG);
|
||||
if ((f.focusdirty() && m.is_running()) || (cp.empty() && !m.is_running()))
|
||||
{
|
||||
const TString& oldpag = m.get(F_CODPAG);
|
||||
const TString& oldpag = cp.get();
|
||||
const TString& s = clifo.get(CLI_CODPAG);
|
||||
if (s != oldpag)
|
||||
{
|
||||
TEdit_field& cp = m.efield(F_CODPAG);
|
||||
if (cp.active()) // Se il campo F_CODPAG e' attivo
|
||||
{
|
||||
cp.set(s); // Setta il codice di pagamento sulla maschera
|
||||
@ -2547,14 +2549,16 @@ HIDDEN void inventa_cambio_intra(TMask& m)
|
||||
{
|
||||
TTable cam("CAM");
|
||||
cam.put("CODTAB", codval);
|
||||
int err = cam.read(_isgteq);
|
||||
if (err == NOERR)
|
||||
const int err = cam.read(_isgteq);
|
||||
bool yes = err != NOERR;
|
||||
if (!yes)
|
||||
{
|
||||
TString16 v = cam.get("CODTAB");
|
||||
v.cut(3).rtrim();
|
||||
if (v != codval)
|
||||
m.set(F_CAMBIOINTRA, cache().get("%VAL", codval, "S4"));
|
||||
yes = v != codval;
|
||||
}
|
||||
if (yes)
|
||||
m.set(F_CAMBIOINTRA, cache().get("%VAL", codval, "S4"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,14 +33,7 @@ bool TCausale::read(const char* cod, int year)
|
||||
if (*cod > ' ')
|
||||
{
|
||||
int err;
|
||||
/*
|
||||
TLocalisamfile caus(LF_CAUSALI);
|
||||
caus.put(CAU_CODCAUS, cod);
|
||||
err = caus.read();
|
||||
if (err != NOERR)
|
||||
return FALSE;
|
||||
_rec = caus.curr();
|
||||
*/
|
||||
|
||||
_rec = cache().get(LF_CAUSALI, cod);
|
||||
if (_rec.empty())
|
||||
return FALSE;
|
||||
@ -58,12 +51,6 @@ bool TCausale::read(const char* cod, int year)
|
||||
add(rcaus.curr(), riga);
|
||||
}
|
||||
|
||||
/*
|
||||
rcaus.zero();
|
||||
for (int riga = 1; riga < size(); riga++) // Fill gaps
|
||||
if (row(riga) == NULL) add(rcaus.curr(), riga);
|
||||
*/
|
||||
|
||||
const TString16 codreg(_rec.get(CAU_REG));
|
||||
const bool ok = _reg.read(codreg, year); // Read register
|
||||
if (!ok && codreg.not_empty())
|
||||
@ -101,12 +88,6 @@ const char* TCausale::desc_agg(int num) const
|
||||
const TString& cod = rec->get(RCA_CODDESC);
|
||||
if (cod.not_empty())
|
||||
{
|
||||
/*
|
||||
TTable da("%DPN");
|
||||
da.put("CODTAB", cod);
|
||||
if (da.read() == NOERR)
|
||||
deag = da.get("S0");
|
||||
*/
|
||||
const TRectype& da = cache().get("%DPN", cod);
|
||||
deag = da.get("S0");
|
||||
}
|
||||
@ -146,6 +127,9 @@ bool TCausale::intra() const
|
||||
bool TCausale::valintra() const
|
||||
{ return _rec.get_bool(CAU_VALINTRA); }
|
||||
|
||||
bool TCausale::soloiva() const
|
||||
{ return _rec.get_bool(CAU_SOLOIVA); }
|
||||
|
||||
const TString& TCausale::causale_inc_imm() const
|
||||
{ return _rec.get(CAU_CODCAUSIM); }
|
||||
|
||||
@ -168,10 +152,6 @@ bool TCausale::ok() const
|
||||
{
|
||||
if (iva() == iva_errata)
|
||||
return FALSE;
|
||||
/* Non segnalare piu' questa incongruenza di poco conto
|
||||
if (corrispettivi() != reg().corrispettivi())
|
||||
return error_box("Tipo documento e registro incongruenti per i corrispettivi");
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ public:
|
||||
bool valuta() const;
|
||||
bool intra() const;
|
||||
bool valintra() const;
|
||||
bool soloiva() const;
|
||||
const TString& causale_inc_imm() const;
|
||||
const TString& tipo_doc() const;
|
||||
|
||||
|
||||
@ -328,10 +328,7 @@ bool TPrimanota_application::codpag_handler(TMask_field& f, KEY key)
|
||||
if (set_scad && f.get().empty())
|
||||
{
|
||||
f.error_box("Il codice di pagamento e' obbligatorio!");
|
||||
/*
|
||||
"Se possibile esso verra' proposto, ma potra'\n"
|
||||
"essere modificato prima di registrare il movimento.");
|
||||
*/
|
||||
|
||||
const char typ = a.clifo();
|
||||
const long cod = m.get_long(typ == 'C' ? F_CLIENTE : F_FORNITORE);
|
||||
|
||||
@ -368,10 +365,6 @@ bool TPrimanota_application::annorif_handler(TMask_field& f, KEY key)
|
||||
const TString& anno = m.get(F_DATADOC).right(4);
|
||||
f.set(anno);
|
||||
ok = error_box("L'anno di riferimento partita e' obbligatorio!");
|
||||
/*
|
||||
"Se possibile esso verra' proposto, ma potra'\n"
|
||||
"essere modificato prima di registrare il movimento.");
|
||||
*/
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
@ -1123,8 +1116,9 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
const TRiga_partite& somma = p.riga(nrigp);
|
||||
const int riga_contabile = somma.get_int(PART_NUMRIG); // Riga movimento
|
||||
TSheet_field& sheet = cgs();
|
||||
TBill new_conto; new_conto.get(new_pag, TRUE);
|
||||
|
||||
if (_as400)
|
||||
if (_as400 || !new_conto.ok())
|
||||
deleting = -1; // Ignora contropartite
|
||||
|
||||
if (deleting >= 0)
|
||||
@ -1137,17 +1131,23 @@ bool TPrimanota_application::notify_edit_pagamento(TPartita& p, TRectype& new_pa
|
||||
TBill old_conto; old_conto.get(old_pag, TRUE);
|
||||
|
||||
const TImporto new_importo(controsez, new_pag.get_real(PAGSCA_IMPORTO));
|
||||
TBill new_conto; new_conto.get(new_pag, TRUE);
|
||||
|
||||
if (old_importo != new_importo || old_conto != new_conto)
|
||||
{
|
||||
const int old_riga = bill2pos(old_conto, 'I');
|
||||
int old_riga = bill2pos(old_conto, 'I');
|
||||
if (old_riga >= 0)
|
||||
{
|
||||
const bool empty = sub_cgs_imp(old_riga, old_importo);
|
||||
if (empty && (new_importo.is_zero() || new_conto != old_conto))
|
||||
sheet.destroy(old_riga);
|
||||
}
|
||||
else
|
||||
if (!old_importo.is_zero())
|
||||
{
|
||||
TImporto imp = old_importo; imp.swap_section();
|
||||
set_cgs_row(old_riga, imp, old_conto, "", 'I');
|
||||
}
|
||||
|
||||
|
||||
// Importo della contropartita
|
||||
if (!new_importo.is_zero() && new_conto.ok())
|
||||
|
||||
@ -351,8 +351,10 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
|
||||
#else
|
||||
set_handler(S_GRUPPO, conto_handler);
|
||||
set_handler(S_CONTO, conto_handler);
|
||||
const bool mostra_conto = !sum.is_nota_credito();
|
||||
const bool mostra_conto = !sum.is_nota_credito() && app().curr_mask().get_real(F_TOTALE) != ZERO;
|
||||
show(-2, mostra_conto); // mostra/nasconde conto contropartita
|
||||
if (!mostra_conto)
|
||||
reset(-2);
|
||||
#endif
|
||||
|
||||
// Gestione data-pagamento: non puo' precedere la data del documento
|
||||
@ -1831,7 +1833,7 @@ bool TGame_mask::edit_pagamento(TPartita& p, int nriga, int nrata, int nrigp) co
|
||||
TMask_field& imp = m.field(S_IMPORTO);
|
||||
imp.set_dirty();
|
||||
imp.on_key(K_F8);
|
||||
}
|
||||
}
|
||||
|
||||
KEY key = m.run();
|
||||
|
||||
|
||||
@ -163,8 +163,6 @@ BEGIN
|
||||
INPUT CODTAB[1,5] FS_VSABI
|
||||
COPY DISPLAY FS_NSABI
|
||||
OUTPUT FS_VSABI CODTAB[1,5]
|
||||
OUTPUT FS_VSCAB CODTAB[6,10]
|
||||
OUTPUT FS_DESCVSABI S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#define __MAIN__
|
||||
#define __MAIN__
|
||||
#include "cg3.h"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
@ -9,13 +9,13 @@ int main(int argc,char** argv)
|
||||
switch (s)
|
||||
{
|
||||
case 1 : cg3200(argc,argv) ; break; // Stampa mastrini
|
||||
// case 2 : cg3300(argc,argv) ; break; // Stampa allegati iva
|
||||
case 2 : cg3300(argc,argv) ; break; // Stampa allegati iva
|
||||
case 3 : cg3400(argc,argv) ; break; // Stampa libro giornale
|
||||
case 4 : cg3500(argc,argv) ; break; // Stampa ripilogo gruppi conti
|
||||
case 5 : cg3600(argc,argv) ; break; // Visualizzazione mastrini
|
||||
case 6 : cg3700(argc,argv) ; break; // Lista fatture
|
||||
default: cg3100(argc,argv) ; break; // Lista movimenti
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
173
cg/cg3200.cpp
173
cg/cg3200.cpp
@ -102,14 +102,14 @@ class TMastrini_application : public TPrintapp
|
||||
real _saldo_movimenti,_saldo_progressivi,_totale_saldo,_riporto_footer_dare,_riporto_footer_avere;
|
||||
TString _ragsoc,_indulc,_civulc,_capulc,_com,_prov,_comulc;
|
||||
long _codice_ditta,_s_prec;
|
||||
TString _tipodoc,_codcaus,_descrcaus,_descrdociva,_regiva,_g_contr,_c_contr,_s_contr;
|
||||
TString _tipodoc,_codcaus,_descrcaus,_descrdociva,_regiva,_g_contr,_c_contr,_s_contr,_descrcontr;
|
||||
char _sezivd,_lettivd;
|
||||
TString _descrizione,_sezione,_numdoc,_descrizionemov,_numrivd,_descr;
|
||||
TString _dataregs, _datadocs;
|
||||
int _gruppocontr,_contocontr,_nummast,_pagina;
|
||||
long _sottocontocontr;
|
||||
|
||||
bool _stampaprogre,_stampatotiva,_stampatot,_stampa_mov_prov;
|
||||
bool _stampaprogre,_stampatotiva,_stampatot,_stampa_mov_prov, _stampa_des_contro;
|
||||
bool _stampato,_devi_stampare_footer;
|
||||
|
||||
int _annomsk,_annoesmsk,_annoes,_annomsksucc,_tipo_mask,_anno_ghost;
|
||||
@ -1000,10 +1000,21 @@ void TMastrini_application::fai_stampa198()
|
||||
set_row (_rw,"@34g#7t", &_numdoc);
|
||||
set_row (_rw,"@42g#3t", &_codcaus);
|
||||
|
||||
// Stampa saldo movimenti
|
||||
|
||||
set_row (_rw,"@151g#t", &_saldo_movimenti_str);
|
||||
set_row (_rw,"@168g#t #t #t", &_g_contr, &_c_contr, &_s_contr);
|
||||
// Stampa saldo movimenti / Descrizione contropartita
|
||||
|
||||
if (_stampa_des_contro)
|
||||
{
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
_descrcontr.cut(0);
|
||||
_descrcontr << _g_contr << ' ' << _c_contr << ' ' << _s_contr << ' ' << tc.descrizione();
|
||||
_descrcontr.cut(47);
|
||||
set_row (_rw,"@135g#t", &_descrcontr);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_row (_rw,"@151g#t", &_saldo_movimenti_str);
|
||||
set_row (_rw,"@168g#t #t #t", &_g_contr, &_c_contr, &_s_contr);
|
||||
}
|
||||
}
|
||||
|
||||
void TMastrini_application::stampa_totali132()
|
||||
@ -1013,7 +1024,7 @@ void TMastrini_application::stampa_totali132()
|
||||
if (_nummast == 1 || _nummast == 3)
|
||||
_rw = 2;
|
||||
|
||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||
sep.fill('_'); //Stampa 132 - (sep(132))
|
||||
set_row(_rw++,"@0g%s", (const char*)sep);
|
||||
|
||||
_totprogre_dare=_progredare+_totale_periodo_dare;
|
||||
@ -1066,7 +1077,7 @@ void TMastrini_application::carica_array_totali132()
|
||||
_lista.add(r);
|
||||
r = "";
|
||||
|
||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||
sep.fill('_'); //Stampa 132 - (sep(132))
|
||||
r.add("@0g%s");
|
||||
r.add(sep);
|
||||
_lista.add(r);
|
||||
@ -1205,7 +1216,7 @@ void TMastrini_application::stampa_totali198()
|
||||
_rw = 1;
|
||||
|
||||
TString sep(198);
|
||||
sep.fill('-'); //Stampa 198 - (sep(198))
|
||||
sep.fill('_'); //Stampa 198 - (sep(198))
|
||||
set_row(_rw++,"@0g%s", (const char*)sep);
|
||||
|
||||
_totprogre_dare=_progredare+_totale_periodo_dare;
|
||||
@ -1213,17 +1224,22 @@ void TMastrini_application::stampa_totali198()
|
||||
|
||||
set_row (_rw,"@32g%s@100g%r", trans("TOTALI PERIODO"), &_totale_periodo_dare);
|
||||
set_row (_rw,"@117g%r", &_totale_periodo_avere);
|
||||
set_row (_rw++,"@151g%r", &_saldo_movimenti);
|
||||
|
||||
set_row (_rw,"@32g%s@100g%r", trans("TOTALI PROGRESSIVI"), &_totprogre_dare);
|
||||
set_row (_rw,"@117g%r", &_totprogre_avere);
|
||||
set_row (_rw++,"@134g%r", &_saldo_progressivi);
|
||||
|
||||
set_row (_rw++,"@135g%r", &_saldo_progressivi);
|
||||
if (!_stampa_des_contro)
|
||||
set_row (_rw++,"@151g%r", &_saldo_movimenti);
|
||||
|
||||
if (_stampaprogre) //Progressivi attuali
|
||||
{
|
||||
_saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al;
|
||||
set_row(_rw,"@32g%s@55g%s", trans("TOTALI PROGRESSIVI AL"), _ultima_data_reg.string());
|
||||
set_row (_rw,"@100g%r", &_totprogre_dare_al);
|
||||
set_row (_rw,"@117g%r", &_totprogre_avere_al);
|
||||
set_row (_rw,"@134g%r", &_saldo_progressivi);
|
||||
if (!_stampa_des_contro)
|
||||
set_row (_rw,"@135g%r", &_saldo_progre_al);
|
||||
}
|
||||
_devi_stampare_footer = FALSE;
|
||||
}
|
||||
@ -1242,7 +1258,7 @@ void TMastrini_application::carica_array_totali198()
|
||||
_lista.add(r);
|
||||
r = "";
|
||||
|
||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||
sep.fill('_'); //Stampa 132 - (sep(132))
|
||||
r.add("@0g%s");
|
||||
r.add(sep);
|
||||
_lista.add(r);
|
||||
@ -1251,7 +1267,10 @@ void TMastrini_application::carica_array_totali198()
|
||||
_totprogre_dare=_progredare+_totale_periodo_dare;
|
||||
_totprogre_avere=_progreavere+_totale_periodo_avere;
|
||||
|
||||
r.add("@32g%s@100g%s@117g%s@151g%s");
|
||||
if (_stampa_des_contro)
|
||||
r.add("@32g%s@100g%s@117g%s");
|
||||
else
|
||||
r.add("@32g%s@100g%s@117g%s@151g%s");
|
||||
r.add(trans("TOTALI PERIODO"));
|
||||
r.add(real2str(_totale_periodo_dare));
|
||||
r.add(real2str(_totale_periodo_avere));
|
||||
@ -1259,7 +1278,10 @@ void TMastrini_application::carica_array_totali198()
|
||||
_lista.add(r);
|
||||
r = "";
|
||||
|
||||
r.add("@32g%s@100g%s@117g%s@134g%s");
|
||||
if (_stampa_des_contro)
|
||||
r.add("@32g%s@100g%s@117g%s");
|
||||
else
|
||||
r.add("@32g%s@100g%s@117g%s@135g%s");
|
||||
r.add(trans("TOTALI PROGRESSIVI"));
|
||||
r.add(real2str(_totprogre_dare));
|
||||
r.add(real2str(_totprogre_avere));
|
||||
@ -1270,7 +1292,7 @@ void TMastrini_application::carica_array_totali198()
|
||||
if (_stampaprogre) //Progressivi attuali
|
||||
{
|
||||
_saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al;
|
||||
r.add("@32g%s@55g%s@100g%s@117g%s@134g%s");
|
||||
r.add("@32g%s@55g%s@100g%s@117g%s@135g%s");
|
||||
r.add(trans("TOTALI PROGRESSIVI AL"));
|
||||
r.add(_ultima_data_reg.string());
|
||||
r.add(real2str(_totprogre_dare_al));
|
||||
@ -1290,11 +1312,6 @@ void TMastrini_application::carica_array_totali198()
|
||||
_lista.add(r);
|
||||
r = "";
|
||||
|
||||
// Guy: Real dick programmig!
|
||||
// TString fmt ("@0g%s");
|
||||
// TString fmt1(format("@%dg", _ddociva_len));
|
||||
// fmt << fmt1 << "%15s";
|
||||
|
||||
TString16 fmt;
|
||||
fmt << "@0g%s@" << _ddociva_len << "g%15s";
|
||||
|
||||
@ -1371,8 +1388,10 @@ void TMastrini_application::stampa_totali198_II()
|
||||
TString arg2 (data.get(2));
|
||||
TString arg3 (data.get(3));
|
||||
TString arg4 (data.get(4));
|
||||
TString arg5 (data.get(5));
|
||||
|
||||
set_row(_rw++,fmt, (const char*) arg1, (const char*) arg2, (const char*) arg3, (const char*) arg4);
|
||||
set_row(_rw++,fmt, (const char*)arg1, (const char*)arg2, (const char*)arg3,
|
||||
(const char*)arg4, (const char*)arg5);
|
||||
|
||||
_indice_lista++;
|
||||
}
|
||||
@ -1657,15 +1676,12 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
conto(_gruppocontr,_contocontr,FALSE);
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
TString80 descr_contr = tc.descrizione();
|
||||
//set_row (1,"@42g%.18s", (const char*) _descrcaus);
|
||||
//if (descr_contr != "Sconosciuto")
|
||||
// set_row (1,"@61g%.23s", (const char*) descr_contr);
|
||||
_descrcontr = tc.descrizione();
|
||||
*_d18 = (const char*) _descrcaus;
|
||||
set_row (_rw,"@42g#a", _d18);
|
||||
if (descr_contr != "Sconosciuto")
|
||||
if (_descrcontr != "Sconosciuto")
|
||||
{
|
||||
*_d22 = (const char*) descr_contr;
|
||||
*_d22 = (const char*) _descrcontr;
|
||||
set_row (_rw,"@61g#a", _d22);
|
||||
}
|
||||
}
|
||||
@ -1706,15 +1722,12 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
conto(_gruppocontr,_contocontr,FALSE);
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
TString descr_contr = tc.descrizione();
|
||||
//set_row (1,"@46g%.23s", (const char*) _descrcaus);
|
||||
//if (descr_contr != "Sconosciuto")
|
||||
// set_row (1,"@70g%.30s", (const char*) descr_contr);
|
||||
_descrcontr = tc.descrizione();
|
||||
*_d22 = (const char*) _descrcaus;
|
||||
set_row (_rw,"@46g#a", _d22);
|
||||
if (descr_contr != "Sconosciuto")
|
||||
if (_descrcontr != "Sconosciuto")
|
||||
{
|
||||
*_d30 = (const char*) descr_contr;
|
||||
*_d30 = (const char*)_descrcontr;
|
||||
set_row (_rw,"@70g#a", _d30);
|
||||
}
|
||||
}
|
||||
@ -1746,10 +1759,10 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
conto(_gruppocontr,_contocontr,FALSE);
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
TString80 descr_contr = tc.descrizione();
|
||||
_descrcontr = tc.descrizione();
|
||||
d18 = _descrcaus;
|
||||
if (descr_contr != "Sconosciuto")
|
||||
d23 = descr_contr;
|
||||
if (_descrcontr != "Sconosciuto")
|
||||
d23 = _descrcontr;
|
||||
}
|
||||
|
||||
TParagraph_string d_18 (d18,18);
|
||||
@ -1795,10 +1808,10 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
conto(_gruppocontr,_contocontr,FALSE);
|
||||
TConto tc (_gruppocontr,_contocontr,_sottocontocontr,_tipo_contr);
|
||||
TString descr_contr = tc.descrizione();
|
||||
_descrcontr = tc.descrizione();
|
||||
d23 = _descrcaus;
|
||||
if (descr_contr != "Sconosciuto")
|
||||
d30 = descr_contr;
|
||||
if (_descrcontr != "Sconosciuto")
|
||||
d30 = _descrcontr;
|
||||
}
|
||||
|
||||
TParagraph_string d_23 (d23,23);
|
||||
@ -2047,8 +2060,8 @@ bool TMastrini_application::preprocess_page(int file, int counter)
|
||||
_saldo_progressivi -= _saldo_progre_prec;
|
||||
_flag_del_cazzo = FALSE;
|
||||
}
|
||||
else
|
||||
set_row (_rw,"@134g%r", &_saldo_progressivi);
|
||||
if (!_stampa_des_contro)
|
||||
set_row (_rw,"@135g%r", &saldo_prog);
|
||||
}
|
||||
|
||||
rmov.readat(rec);
|
||||
@ -2456,6 +2469,7 @@ bool TMastrini_application::set_print(int)
|
||||
_tipostampa = _msk->get_int(F_TIPOSTAMPA);
|
||||
|
||||
_numcarat = _msk->get_int(F_NUMCARAT);
|
||||
_stampa_des_contro = (_numcarat==2) && _msk->get_bool(F_CONTRODES);
|
||||
_nummast = _msk->get_int(F_NUMMAST);
|
||||
_data_ini = _msk->get_date(F_DATAINI);
|
||||
_data_fine = _msk->get_date(F_DATAFINE);
|
||||
@ -2788,7 +2802,7 @@ void TMastrini_application::crea_intestazione()
|
||||
|
||||
if (_numcarat == 1)
|
||||
{
|
||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||
sep.fill('_'); //Stampa 132 - (sep(132))
|
||||
set_header (6, (const char *) sep);
|
||||
set_header (7,"%s@19g%s@117g%s@132g%s",
|
||||
trans("Operazione"), trans("Documento"), trans("Contro"), trans("A"));
|
||||
@ -2802,29 +2816,49 @@ void TMastrini_application::crea_intestazione()
|
||||
trans("Dare"), trans("Avere"), trans("Partita"), trans("Prot."), trans("C"));
|
||||
if (_stampa_mov_prov)
|
||||
set_header(8,"@130g%s", trans("P"));
|
||||
sep.fill('-');
|
||||
sep.fill('_');
|
||||
set_header (9, (const char *) sep);
|
||||
}
|
||||
else if (_numcarat == 2)
|
||||
{
|
||||
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
||||
sep1.fill('_'); //Stampa 198 - (sep1(198))
|
||||
set_header (6,"@0g%s", (const char*)sep1);
|
||||
set_header (7,"%s@23g%s@34g%s@169g%s@183g%s@190g%s@197g%s",
|
||||
trans("Operazione"), trans("Data"), trans("Numero"), trans("Contro"),
|
||||
trans("Reg"), trans("Numero"), trans("A"));
|
||||
if (_stampa_des_contro)
|
||||
{
|
||||
set_header (7,"%s@23g%s@34g%s@183g%s@190g%s@197g%s",
|
||||
trans("Operazione"), trans("Data"), trans("Numero"),
|
||||
trans("Reg"), trans("Numero"), trans("A"));
|
||||
}
|
||||
else
|
||||
{
|
||||
set_header (7,"%s@23g%s@34g%s@169g%s@183g%s@190g%s@197g%s",
|
||||
trans("Operazione"), trans("Data"), trans("Numero"), trans("Contro"),
|
||||
trans("Reg"), trans("Numero"), trans("A"));
|
||||
}
|
||||
if (_stampa_mov_prov)
|
||||
set_header(7,"@195g%s", trans("M"));
|
||||
set_header (8,trans("Data"));
|
||||
if (_stampanum < 3)
|
||||
set_header (8,"@11g%s", trans("Numero"));
|
||||
set_header (8,"@23g%s@42g%s@70g%s@112g%s@127g%s@135g%s@152g%s@169g%s@183g%s@189g%s@197g%s",
|
||||
trans("Documento"), trans("Cod.Causale"), trans("Descrizione"), trans("Dare"), trans("Avere"),
|
||||
trans("Saldo progre."), trans("Saldo movim."), trans("Partita"), trans("Iva"),
|
||||
trans("Protoc."), trans("C"));
|
||||
|
||||
if (_stampa_des_contro)
|
||||
{
|
||||
set_header (8,"@23g%s@42g%s@70g%s@112g%s@127g%s@135g%s@183g%s@189g%s@197g%s",
|
||||
trans("Documento"), trans("Cod.Causale"), trans("Descrizione"), trans("Dare"), trans("Avere"),
|
||||
trans("Contropartita"), trans("Iva"),
|
||||
trans("Protoc."), trans("C"));
|
||||
}
|
||||
else
|
||||
{
|
||||
set_header (8,"@23g%s@42g%s@70g%s@112g%s@127g%s@135g%s@152g%s@169g%s@183g%s@189g%s@197g%s",
|
||||
trans("Documento"), trans("Cod.Causale"), trans("Descrizione"), trans("Dare"), trans("Avere"),
|
||||
trans("Saldo progre."), trans("Saldo movim."), trans("Partita"), trans("Iva"),
|
||||
trans("Protoc."), trans("C"));
|
||||
}
|
||||
|
||||
if (_stampa_mov_prov)
|
||||
set_header(8,"@195g%s", trans("P"));
|
||||
sep1.fill('-');
|
||||
sep1.fill('_');
|
||||
set_header (9,"@0g%s", (const char*)sep1);
|
||||
}
|
||||
|
||||
@ -2843,7 +2877,8 @@ void TMastrini_application::crea_intestazione()
|
||||
{
|
||||
set_header (10,"@70g%s@100g%s", trans("PROGRESSIVI PRECEDENTI"), real2str(_progredare));
|
||||
set_header (10,"@117g%s", real2str(_progreavere));
|
||||
set_header (10,"@134g%s", real2str(_saldo_progre_prec));
|
||||
if (!_stampa_des_contro)
|
||||
set_header (10,"@135g%s", real2str(_saldo_progre_prec));
|
||||
}
|
||||
_riporto_dare = _progredare;
|
||||
_riporto_avere = _progreavere;
|
||||
@ -2972,7 +3007,7 @@ int TMastrini_application::crea_intestazione(int start_riga)
|
||||
|
||||
if (_numcarat == 1)
|
||||
{
|
||||
sep.fill('-'); //Stampa 132 - (sep(132))
|
||||
sep.fill('_'); //Stampa 132 - (sep(132))
|
||||
set_row (r++,"@1g%s", (const char *) sep);
|
||||
set_row (r++,"%s@19g%s@117g%s@131g%s",
|
||||
trans("Operazione"), trans("Documento"), trans("Contro"), trans("A"));
|
||||
@ -2984,24 +3019,30 @@ int TMastrini_application::crea_intestazione(int start_riga)
|
||||
set_row (r++,"@19gData@30gNumero@38gCod.Causale@61gDescrizione@95gDare@111gAvere@117gPartita@131gC");
|
||||
if (_stampa_mov_prov)
|
||||
set_header(r-1,"@130gP");
|
||||
sep.fill('-');
|
||||
sep.fill('_');
|
||||
set_row (r++,"@1g%s", (const char*)sep);
|
||||
}
|
||||
else
|
||||
{
|
||||
sep1.fill('-'); //Stampa 198 - (sep1(198))
|
||||
sep1.fill('_'); //Stampa 198 - (sep1(198))
|
||||
set_row (r++,"@0g%s", (const char*)sep1);
|
||||
set_row (r++,"Operazione@23gData@34gNumero@169gContro@183gReg@190gNumero@197gA");
|
||||
if (_stampa_des_contro)
|
||||
set_row (r++,"Operazione@23gData@34gNumero@183gReg@190gNumero@197gA");
|
||||
else
|
||||
set_row (r++,"Operazione@23gData@34gNumero@169gContro@183gReg@190gNumero@197gA");
|
||||
if (_stampa_mov_prov)
|
||||
set_row(r-1,"@195gM");
|
||||
set_row (r,"Data");
|
||||
if (_stampanum < 3)
|
||||
set_row (r,"@11gnumero");
|
||||
set_row (r,"@23gDocumento@42gCod.Causale@70gDescrizione@112gDare@127gAvere");
|
||||
set_row (r++,"@135gSaldo progre.@152gSaldo movim.@169gPartita@183gIva@189gProtoc.@197gC");
|
||||
if (_stampa_des_contro)
|
||||
set_row (r++,"@135gContropartita@183gIva@189gProtoc.@197gC");
|
||||
else
|
||||
set_row (r++,"@135gSaldo progre.@152gSaldo movim.@169gPartita@183gIva@189gProtoc.@197gC");
|
||||
if (_stampa_mov_prov)
|
||||
set_row (r-1,"@195gP");
|
||||
sep1.fill('-');
|
||||
sep1.fill('_');
|
||||
set_row (r++,"@0g%s", (const char*)sep1);
|
||||
}
|
||||
_pagina = np;
|
||||
@ -3328,8 +3369,9 @@ void TMastrini_application::stampa_progressivi()
|
||||
else
|
||||
{
|
||||
set_row (_rw,"@70gPROGRESSIVI PRECEDENTI@100g%r", &_progredare);
|
||||
set_row (_rw,"@117g%r", &_progreavere);
|
||||
set_row (_rw++,"@134g%r", &_saldo_progre_prec);
|
||||
set_row (_rw,"@117g%r", &_progreavere);
|
||||
if (!_stampa_des_contro)
|
||||
set_row (_rw++,"@135g%r", &_saldo_progre_prec);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3347,7 +3389,8 @@ int TMastrini_application::stampa_progressivi(int start_riga)
|
||||
{
|
||||
set_row (r,"@70gPROGRESSIVI PRECEDENTI@100g%r", &_progredare);
|
||||
set_row (r,"@117g%r", &_progreavere);
|
||||
set_row (r++,"@134g%r", &_saldo_progre_prec);
|
||||
if (!_stampa_des_contro)
|
||||
set_row (r++,"@135g%r", &_saldo_progre_prec);
|
||||
}
|
||||
|
||||
return r;
|
||||
@ -3487,7 +3530,7 @@ void TMastrini_application::ricerca_clifo()
|
||||
|
||||
if (_numcarat == 2)
|
||||
{
|
||||
set_header (5,"@134g%-4s",(const char*) ptel);
|
||||
set_header (5,"@135g%-4s",(const char*) ptel);
|
||||
if (tel != "")
|
||||
set_header (5,"@138g/@139g%-10s",(const char*) tel);
|
||||
}
|
||||
@ -3626,7 +3669,7 @@ int TMastrini_application::ricerca_clifo(int start)
|
||||
|
||||
if (_numcarat == 2)
|
||||
{
|
||||
set_row (r,"@134g%-4s",(const char*) ptel);
|
||||
set_row (r,"@135g%-4s",(const char*) ptel);
|
||||
if (tel != "")
|
||||
set_row (r++,"@138g/@139g%-10s",(const char*) tel);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user