Patch level : 10.0 NO PATCH
Files correlati : pd6342 pd6342400a.msk Ricompilazione Demo : [ ] Commento : Aggiunto il programma che fa le qudrature (da controllare l'ultimo pezzo della registra) git-svn-id: svn://10.65.10.50/branches/R_10_00@20940 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b523cb6b04
commit
d2d15769e3
610
ps/pd6342400.cpp
Executable file
610
ps/pd6342400.cpp
Executable file
@ -0,0 +1,610 @@
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <defmask.h>
|
||||
#include <execp.h>
|
||||
#include <relation.h>
|
||||
#include <reprint.h>
|
||||
#include <reputils.h>
|
||||
|
||||
#include "pd6342400a.h"
|
||||
#include "../ca/calib01.h"
|
||||
#include "../ca/movana.h"
|
||||
#include "../ca/rmovana.h"
|
||||
#include "../ve/velib.h"
|
||||
|
||||
static int sort_by_numreg(TSheet_field& sheet, int r1, int r2)
|
||||
{
|
||||
TToken_string& row1 = sheet.row(r1);
|
||||
TToken_string& row2 = sheet.row(r2);
|
||||
|
||||
const long numreg1 = row1.get_long(sheet.cid2index(Q_NUMREG));
|
||||
const long numreg2 = row2.get_long(sheet.cid2index(Q_NUMREG));
|
||||
|
||||
int dif = numreg1 - numreg2;
|
||||
|
||||
if (dif == 0)
|
||||
{
|
||||
const int numriga1 = row1.get_int(sheet.cid2index(Q_NUMRIGA));
|
||||
const int numriga2 = row2.get_int(sheet.cid2index(Q_NUMRIGA));
|
||||
|
||||
dif = numriga2 - numriga1;
|
||||
}
|
||||
|
||||
return dif;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TQuadra_movana_msk
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TQuadra_movana_msk: public TAutomask
|
||||
{
|
||||
short _scdc_sid, _scdc_lid;
|
||||
short _scms_sid, _scms_lid;
|
||||
short _sfase_sid, _sfase_lid;
|
||||
short _sconto_sid, _sconto_lid;
|
||||
|
||||
protected:
|
||||
void costruisci_sheet(TSheet_field& s, const short dlg);
|
||||
void get_row_anal_fields(TToken_string& row, TString& cdc, TString& cms, TString& fase, TString& codconto, const short sdlg);
|
||||
void put_row_anal_fields(TToken_string& row, const TString& cdc, const TString& cms, const TString& fase, const TString& codconto, const short sdlg);
|
||||
void get_conto(TString& conto);
|
||||
|
||||
void calcola_totale(TSheet_field& sheet);
|
||||
|
||||
void riempi_sheets();
|
||||
void sposta_a_destra();
|
||||
void sposta_a_sinistra();
|
||||
|
||||
void crea_riga_quadratura();
|
||||
|
||||
void registra();
|
||||
|
||||
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||
public:
|
||||
TQuadra_movana_msk();
|
||||
};
|
||||
|
||||
void TQuadra_movana_msk::costruisci_sheet(TSheet_field& s, const short dlg)
|
||||
{
|
||||
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
|
||||
TConfig& ini = ca_config();
|
||||
TMask& sm = s.sheet_mask();
|
||||
int sy = 3;
|
||||
short sdlg = dlg;
|
||||
|
||||
_scdc_sid = _scdc_lid = _scms_sid = _scms_lid = _sfase_sid = _sfase_lid = _sconto_sid = _sconto_lid-1;
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
const TString& level = ini.get("Level", NULL, i+1); // Legge il livello 1 o 2
|
||||
|
||||
if (level == "CDC") // Crea centro di costo
|
||||
{
|
||||
if (fasinfo.parent() == LF_CDC)
|
||||
{
|
||||
int h = ca_multilevel_code_info(LF_CDC).levels();
|
||||
const int sh = ca_create_fields_compact(sm, 0, LF_FASI, 2, sy, sdlg, sdlg + 50);
|
||||
sy += 2;
|
||||
_scdc_sid = sdlg;
|
||||
_scdc_lid = sdlg + h - 1;
|
||||
_sfase_sid = _scdc_lid + 1;
|
||||
_sfase_lid = sdlg + sh - 1;
|
||||
sdlg += sh;
|
||||
}
|
||||
else
|
||||
{
|
||||
const int sh = ca_create_fields_compact(sm, 0, LF_CDC, 2, sy++, sdlg, sdlg + 50);
|
||||
_scdc_sid = sdlg;
|
||||
_scdc_lid = sdlg + sh - 1;
|
||||
sdlg += sh;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (level == "CMS") // Crea commessa
|
||||
{
|
||||
if (fasinfo.parent() == LF_COMMESSE)
|
||||
{
|
||||
int h = ca_multilevel_code_info(LF_COMMESSE).levels();
|
||||
const int sh = ca_create_fields_compact(sm, 0, LF_FASI, 2, sy, sdlg, sdlg + 50);
|
||||
sy += 2;
|
||||
_scms_sid = sdlg;
|
||||
_scms_lid = sdlg + h - 1;
|
||||
_sfase_sid = _scms_lid + 1;
|
||||
_sfase_lid = sdlg + sh - 1;
|
||||
sdlg += sh;
|
||||
}
|
||||
else
|
||||
{
|
||||
const int sh = ca_create_fields_compact(sm, 0, LF_COMMESSE, 2, sy++, sdlg, sdlg + 50);
|
||||
_scms_sid = sdlg;
|
||||
_scms_lid = sdlg + sh - 1;
|
||||
sdlg += sh;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fasinfo.levels() > 0 && fasinfo.parent() <= 0)
|
||||
{
|
||||
const int sh = ca_create_fields_compact(sm, 0, LF_FASI, 2, sy++, sdlg, sdlg + 50);
|
||||
_sfase_sid = sdlg;
|
||||
_sfase_lid = sdlg + sh - 1;
|
||||
sdlg += sh;
|
||||
}
|
||||
|
||||
const bool use_pdcc = ini.get_bool("UsePdcc");
|
||||
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||
const int nfields = ca_create_fields_compact(sm, 0, logicnum, 2, sy++, sdlg, sdlg + 50);
|
||||
_sconto_sid = sdlg;
|
||||
_sconto_lid = sdlg + nfields - 1;
|
||||
sdlg += nfields;
|
||||
|
||||
for (short id = NQ_CONT4 + 100; id >= NQ_CDC1 + 100; id--)
|
||||
{
|
||||
const int pos = sm.id2pos(id);
|
||||
if (pos >= 0)
|
||||
{
|
||||
TMask_field& f = sm.fld(pos);
|
||||
const int size = f.size();
|
||||
const TString prompt = ((TEditable_field &)f).get_warning();
|
||||
s.set_column_header(id, prompt);
|
||||
s.set_column_justify(id, f.is_kind_of(CLASS_REAL_FIELD));
|
||||
s.set_column_width(id, (max(3+size, prompt.len()+1)) * CHARX);
|
||||
s.enable_column(id);
|
||||
}
|
||||
else
|
||||
s.delete_column(id);
|
||||
}
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::get_row_anal_fields(TToken_string& row, TString& cdc, TString& cms, TString& fase, TString& codconto, const short sdlg)
|
||||
{
|
||||
TMask& m = sfield(sdlg).sheet_mask();
|
||||
TString val;
|
||||
|
||||
cdc.cut(0);
|
||||
if (_scdc_sid >= 0)
|
||||
for ( short id = _scdc_sid; id <= _scdc_lid; id++)
|
||||
{
|
||||
val = m.get(id);
|
||||
val.rpad(m.field(id).size());
|
||||
cdc << val;
|
||||
}
|
||||
cdc.trim();
|
||||
cms.cut(0);
|
||||
if (_scms_sid >= 0)
|
||||
for ( short id = _scms_sid; id <= _scms_lid; id++)
|
||||
{
|
||||
val = m.get(id);
|
||||
val.rpad(m.field(id).size());
|
||||
cms << val;
|
||||
}
|
||||
cms.trim();
|
||||
fase.cut(0);
|
||||
if (_sfase_sid >= 0)
|
||||
for ( short id = _sfase_sid; id <= _sfase_lid; id++)
|
||||
{
|
||||
val = m.get(id);
|
||||
val.rpad(m.field(id).size());
|
||||
fase << val;
|
||||
}
|
||||
fase.trim();
|
||||
|
||||
if (_sconto_sid >= 0)
|
||||
for ( short id = _sconto_sid; id <= _sconto_lid; id++)
|
||||
{
|
||||
val = m.get(id);
|
||||
val.rpad(m.field(id).size());
|
||||
codconto << val;
|
||||
}
|
||||
codconto.trim();
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::put_row_anal_fields(TToken_string& row, const TString& cdc, const TString& cms, const TString& fase, const TString& codconto, const short sdlg)
|
||||
{
|
||||
TSheet_field& s = sfield(sdlg);
|
||||
TMask& m = s.sheet_mask();
|
||||
int pos = 0;
|
||||
|
||||
if (_scdc_sid >= 0)
|
||||
for (short id = _scdc_sid; id <= _scdc_lid; id++)
|
||||
{
|
||||
const int len = m.field(id).size();
|
||||
row.add(cdc.mid(pos, len), s.cid2index(id));
|
||||
pos += len;
|
||||
}
|
||||
pos = 0;
|
||||
if (_scms_sid >= 0)
|
||||
for (short id = _scms_sid; id <= _scms_lid; id++)
|
||||
{
|
||||
const int len = m.field(id).size();
|
||||
row.add(cms.mid(pos, len), s.cid2index(id));
|
||||
pos += len;
|
||||
}
|
||||
pos = 0;
|
||||
if (_sfase_sid >= 0)
|
||||
for (short id = _sfase_sid; id <= _sfase_lid; id++)
|
||||
{
|
||||
const int len = m.field(id).size();
|
||||
row.add(fase.mid(pos, len), s.cid2index(id));
|
||||
pos += len;
|
||||
}
|
||||
|
||||
pos = 0;
|
||||
for (short id = _sconto_sid; id <= _sconto_lid; id++)
|
||||
{
|
||||
const int len = m.field(id).size();
|
||||
row.add(codconto.mid(pos, len), s.cid2index(id));
|
||||
pos += len;
|
||||
}
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::get_conto(TString& conto)
|
||||
{
|
||||
for (int i = 0; id2pos(F_CDC1 + i) > 0; i++)
|
||||
conto << get(F_CDC1 + i);
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::calcola_totale(TSheet_field& sheet)
|
||||
{
|
||||
TImporto totale;
|
||||
TImporto imp;
|
||||
FOR_EACH_SHEET_ROW(sheet, r, riga)
|
||||
{
|
||||
TToken_string& row = *(TToken_string*)riga;
|
||||
imp = row;
|
||||
totale += imp;
|
||||
}
|
||||
totale.normalize('A');
|
||||
set(F_TOTRIGHE, totale.valore());
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::riempi_sheets()
|
||||
{
|
||||
const TDate dadata = get_date(F_DADATA);
|
||||
const TDate adata = get_date(F_ADATA);
|
||||
|
||||
const long numregcg = get_int(F_NUMREGCG);
|
||||
const real totdoc = get_real(F_TOTDOC);
|
||||
|
||||
TConfig* conf = new TConfig("pd6342conf.ini", "MAIN");
|
||||
const TString4 codcau = conf->get("CodCau");
|
||||
|
||||
TSheet_field& ls = sfield(F_MOVNNQUAD);
|
||||
TSheet_field& rs = sfield(F_MOVQUAD);
|
||||
|
||||
TString query;
|
||||
query << "USE MOVANA KEY 2\n"
|
||||
<< "SELECT (CODCAUS=\"" << codcau << "\")&&(TRASFERITO=\"X\")\n"
|
||||
<< "FROM DATACOMP=#DADATA\n"
|
||||
<< "TO DATACOMP=#ADATA\n";
|
||||
|
||||
TISAM_recordset movana(query);
|
||||
movana.set_var("#DADATA", dadata);
|
||||
movana.set_var("#ADATA", adata);
|
||||
|
||||
for(bool ok = movana.move_first(); ok; ok = movana.move_next())
|
||||
{
|
||||
TAnal_mov amov(movana.cursor()->curr());
|
||||
const TRecord_array& righe = amov.body();
|
||||
|
||||
const int nrows = amov.body().rows();
|
||||
for (int r = 1; r <= nrows; r++)
|
||||
{
|
||||
const TRectype& row = amov.body().row(r);
|
||||
|
||||
const char sezione = row.get_char(RMOVANA_SEZIONE);
|
||||
const real importo = row.get_real(RMOVANA_IMPORTO);
|
||||
const TString80 descrizione = row.get(RMOVANA_DESCR);
|
||||
const TString80 codcosto = row.get(RMOVANA_CODCCOSTO);
|
||||
const TString80 codcms = row.get(RMOVANA_CODCMS);
|
||||
const TString16 codfase = row.get(RMOVANA_CODFASE);
|
||||
const TString80 codconto = row.get(RMOVANA_CODCONTO);
|
||||
const long numreg = row.get_long(RMOVANA_NUMREG);
|
||||
const int numriga = row.get_int(RMOVANA_NUMRIG);
|
||||
const TDate datacomp = row.get_date(RMOVANA_DATACOMP);
|
||||
|
||||
TToken_string& lrow = ls.row(-1);
|
||||
lrow.add(importo.string(), ls.cid2index(sezione == 'D' ? NQ_DARE : NQ_AVERE));
|
||||
lrow.add(descrizione, ls.cid2index(NQ_DESCR));
|
||||
lrow.add(numreg, ls.cid2index(NQ_NUMREG));
|
||||
lrow.add(numriga, ls.cid2index(NQ_NUMRIGA));
|
||||
lrow.add(datacomp, ls.cid2index(NQ_DATACOMP));
|
||||
put_row_anal_fields(lrow, codcosto, codcms, codfase, codconto, F_MOVNNQUAD);
|
||||
}
|
||||
}
|
||||
|
||||
query.cut(0);
|
||||
query << "USE MOVANA KEY 3\n"
|
||||
<< "FROM NUMREGCG=" << numregcg << "\n"
|
||||
<< "TO NUMREGCG=" << numregcg << "\n";
|
||||
|
||||
TISAM_recordset movanaquad(query);
|
||||
|
||||
for(bool ok = movanaquad.move_first(); ok; ok = movanaquad.move_next())
|
||||
{
|
||||
TAnal_mov amov(movanaquad.cursor()->curr());
|
||||
const TRecord_array& righe = amov.body();
|
||||
|
||||
const int nrows = amov.body().rows();
|
||||
for (int r = 1; r <= nrows; r++)
|
||||
{
|
||||
const TRectype& row = amov.body().row(r);
|
||||
|
||||
const char sezione = row.get_char(RMOVANA_SEZIONE);
|
||||
const real importo = row.get_real(RMOVANA_IMPORTO);
|
||||
const TString80 descrizione = row.get(RMOVANA_DESCR);
|
||||
const TString80 codcosto = row.get(RMOVANA_CODCCOSTO);
|
||||
const TString80 codcms = row.get(RMOVANA_CODCMS);
|
||||
const TString16 codfase = row.get(RMOVANA_CODFASE);
|
||||
const TString80 codconto = row.get(RMOVANA_CODCONTO);
|
||||
const long numreg = row.get_long(RMOVANA_NUMREG);
|
||||
const int numriga = row.get_int(RMOVANA_NUMRIG);
|
||||
const TDate datacomp = row.get_date(RMOVANA_DATACOMP);
|
||||
|
||||
TToken_string& rrow = rs.row(-1);
|
||||
rrow.add(importo.string(), rs.cid2index(sezione == 'D' ? Q_DARE : Q_AVERE));
|
||||
rrow.add(descrizione, rs.cid2index(Q_DESCR));
|
||||
rrow.add(numreg, rs.cid2index(Q_NUMREG));
|
||||
rrow.add(numriga, rs.cid2index(Q_NUMRIGA));
|
||||
rrow.add(datacomp, rs.cid2index(Q_DATACOMP));
|
||||
put_row_anal_fields(rrow, codcosto, codcms, codfase, codconto, F_MOVQUAD);
|
||||
|
||||
if(descrizione == "Riga quadratura")
|
||||
rs.disable_row(r - 1);
|
||||
}
|
||||
}
|
||||
|
||||
ls.force_update();
|
||||
rs.force_update();
|
||||
calcola_totale(rs);
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::sposta_a_destra()
|
||||
{
|
||||
TSheet_field& ls = sfield(F_MOVNNQUAD);
|
||||
TToken_string& lrow = ls.row(ls.selected());
|
||||
|
||||
TSheet_field& rs = sfield(F_MOVQUAD);
|
||||
TToken_string& rrow = rs.row(-1);
|
||||
|
||||
rrow = lrow;
|
||||
ls.destroy(ls.selected());
|
||||
|
||||
ls.force_update();
|
||||
rs.force_update();
|
||||
|
||||
calcola_totale(rs);
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::sposta_a_sinistra()
|
||||
{
|
||||
TSheet_field& rs = sfield(F_MOVQUAD);
|
||||
TToken_string& rrow = rs.row(rs.selected());
|
||||
|
||||
TSheet_field& ls = sfield(F_MOVNNQUAD);
|
||||
TToken_string& lrow = ls.row(-1);
|
||||
|
||||
lrow = rrow;
|
||||
rs.destroy(rs.selected());
|
||||
|
||||
ls.force_update();
|
||||
rs.force_update();
|
||||
|
||||
calcola_totale(rs);
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::crea_riga_quadratura()
|
||||
{
|
||||
TSheet_field& rs = sfield(F_MOVQUAD);
|
||||
FOR_EACH_SHEET_ROW_BACK(rs, r, riga)
|
||||
{
|
||||
TToken_string& row = *(TToken_string*)riga;
|
||||
const TString80 descrizione = row.get(rs.cid2index(Q_DESCR));
|
||||
|
||||
if(descrizione == "Riga di quadratura")
|
||||
{
|
||||
rs.destroy(r);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
calcola_totale(rs);
|
||||
|
||||
TString80 conto;
|
||||
get_conto(conto);
|
||||
|
||||
const real totale = get_real(F_TOTDOC);
|
||||
const real totrighe = get_real(F_TOTRIGHE);
|
||||
|
||||
TImporto impquad('A', totale - totrighe);
|
||||
impquad.normalize();
|
||||
|
||||
const char sezione = impquad.sezione();
|
||||
const real importo = impquad.valore();
|
||||
const TString80 descrizione = "Riga di quadratura";
|
||||
const TDate datacomp(TODAY);
|
||||
|
||||
TToken_string& rrow = rs.row(-1);
|
||||
rrow.add(importo.string(), rs.cid2index(sezione == 'D' ? Q_DARE : Q_AVERE));
|
||||
rrow.add(descrizione, rs.cid2index(Q_DESCR));
|
||||
rrow.add(datacomp, rs.cid2index(Q_DATACOMP));
|
||||
|
||||
const TString16 cdc = "";
|
||||
const TString16 cms = "";
|
||||
const TString16 fase = "";
|
||||
|
||||
put_row_anal_fields(rrow, cdc, cms, fase, conto, F_MOVQUAD);
|
||||
|
||||
rs.force_update();
|
||||
calcola_totale(rs);
|
||||
}
|
||||
|
||||
TQuadra_movana_msk::TQuadra_movana_msk() : TAutomask("pd6342400a")
|
||||
{
|
||||
TConfig& cfg = ca_config();
|
||||
const bool use_pdcc = cfg.get_bool("UsePdcc");
|
||||
|
||||
const int logicnum = use_pdcc ? LF_PCON : LF_PCONANA;
|
||||
const int nfields = ca_create_fields_compact(*this, 0, logicnum, 2, 6, F_CDC1, F_CDCD1);
|
||||
|
||||
for (int i = 0; i < nfields; i++)
|
||||
{
|
||||
TMask_field& conto = field(F_CDC1 + i);
|
||||
conto.set_group(1);
|
||||
conto.check_type(CHECK_NORMAL);
|
||||
}
|
||||
|
||||
//Parametri dell sheet di sinistra
|
||||
TSheet_field& ls = sfield(F_MOVNNQUAD);
|
||||
short lsdlg = NQ_CDC1 + 100;
|
||||
|
||||
//Parametri dell sheet di destra
|
||||
TSheet_field& rs = sfield(F_MOVQUAD);
|
||||
short rsdlg = Q_CDC1 + 100;
|
||||
|
||||
//sistema i campi degli sheet tenendo conto della configurazione dell'analitica
|
||||
costruisci_sheet(ls, lsdlg);
|
||||
costruisci_sheet(rs, rsdlg);
|
||||
|
||||
//rettangolo della finestra a video
|
||||
RCT wrect;
|
||||
xvt_vobj_get_client_rect(ls.parent(), &wrect);
|
||||
|
||||
//rettangolo dello sheet
|
||||
RCT srect;
|
||||
|
||||
//sistema le coordinate dello sheet di sinistra
|
||||
//non si può lavorare sullo coordinata sinistra perché se si modifica si incazza come una biscia!
|
||||
ls.get_rect(srect);
|
||||
srect.right = (wrect.left + wrect.right ) / 2 - CHARX;
|
||||
ls.set_rect(srect);
|
||||
|
||||
//sistema le coordinate dello sheet di destra
|
||||
rs.get_rect(srect);
|
||||
srect.right = wrect.right;
|
||||
rs.set_rect(srect);
|
||||
}
|
||||
|
||||
void TQuadra_movana_msk::registra()
|
||||
{
|
||||
TSheet_field& rs = sfield(F_MOVQUAD);
|
||||
rs.sort(sort_by_numreg);
|
||||
rs.force_update();
|
||||
|
||||
long numregold = 0L;
|
||||
TLocalisamfile file(LF_MOVANA);
|
||||
TAnal_mov movana(0);
|
||||
|
||||
FOR_EACH_SHEET_ROW(rs, r, riga)
|
||||
{
|
||||
TToken_string& row = *(TToken_string*)riga;
|
||||
|
||||
if(numregold < row.get_long(rs.cid2index(Q_NUMREG)))
|
||||
{
|
||||
if(!movana.empty())
|
||||
{
|
||||
movana.rewrite_write(file);
|
||||
movana.zero();
|
||||
movana.read(row.get_long(rs.cid2index(Q_NUMREG)));
|
||||
}
|
||||
movana.destroy_row(row.get_long(rs.cid2index(Q_NUMRIGA)), true);
|
||||
}
|
||||
}
|
||||
movana.rewrite_write(file);
|
||||
|
||||
const TDate oggi(TODAY);
|
||||
|
||||
movana.zero();
|
||||
movana.put(MOVANA_ANNOES, oggi.year());
|
||||
movana.put(MOVANA_DATAREG, oggi);
|
||||
movana.put(MOVANA_DATACOMP, oggi);
|
||||
movana.put(MOVANA_DESCR, "Movimento Quadrato");
|
||||
movana.put(MOVANA_NUMREGCG, get_long(F_NUMREGCG));
|
||||
|
||||
TImporto totale;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool TQuadra_movana_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
{
|
||||
switch(o.dlg())
|
||||
{
|
||||
case DLG_CERCA:
|
||||
if(e == fe_button)
|
||||
{
|
||||
riempi_sheets();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case DLG_OK:
|
||||
if(e == fe_button)
|
||||
{
|
||||
crea_riga_quadratura();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case DLG_SALVA:
|
||||
if(e == fe_button)
|
||||
{
|
||||
registra();
|
||||
return false;
|
||||
}
|
||||
case DLG_USER:
|
||||
if(e == fe_button)
|
||||
{
|
||||
switch(jolly)
|
||||
{
|
||||
case 1: sposta_a_destra(); break;
|
||||
case 2: sposta_a_sinistra(); break;
|
||||
default: break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case F_MOVNNQUAD:
|
||||
case F_MOVQUAD:
|
||||
if(e == se_query_add)
|
||||
return false;
|
||||
default: break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TQuadra_movana_app
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TQuadra_movana_app: public TSkeleton_application
|
||||
{
|
||||
protected:
|
||||
virtual bool check_autorization() const {return false;}
|
||||
virtual const char * extra_modules() const {return "ca";}
|
||||
|
||||
virtual void main_loop();
|
||||
|
||||
void elabora();
|
||||
};
|
||||
|
||||
void TQuadra_movana_app::elabora()
|
||||
{
|
||||
}
|
||||
|
||||
void TQuadra_movana_app::main_loop()
|
||||
{
|
||||
TQuadra_movana_msk m;
|
||||
bool running = true;
|
||||
|
||||
while(m.run() == K_ENTER)
|
||||
{
|
||||
elabora();
|
||||
}
|
||||
}
|
||||
|
||||
int pd6342400(int argc, char* argv[])
|
||||
{
|
||||
TQuadra_movana_app app;
|
||||
app.run(argc, argv, TR("Quadra movimenti analitici"));
|
||||
return 0;
|
||||
}
|
66
ps/pd6342400a.h
Executable file
66
ps/pd6342400a.h
Executable file
@ -0,0 +1,66 @@
|
||||
//Definizione campi per maschera pd6342400 - Quadratore movimenti Analitici
|
||||
#define F_DADATA 201
|
||||
#define F_ADATA 202
|
||||
#define F_NUMREGCG 203
|
||||
#define F_DESREGCG 204
|
||||
#define F_TOTDOC 205
|
||||
#define F_TOTRIGHE 206
|
||||
#define F_CDC1 207
|
||||
#define F_CDC2 208
|
||||
#define F_CDC3 209
|
||||
#define F_CDC4 210
|
||||
#define F_CDCD1 257
|
||||
#define F_CDCD2 258
|
||||
#define F_CDCD3 259
|
||||
#define F_CDCD4 260
|
||||
#define F_MOVNNQUAD 211
|
||||
#define F_MOVQUAD 212
|
||||
|
||||
#define DLG_CERCA 801
|
||||
#define DLG_SALVA 802
|
||||
|
||||
#define NQ_DARE 101
|
||||
#define NQ_AVERE 102
|
||||
#define NQ_DESCR 103
|
||||
#define NQ_CDC1 104
|
||||
#define NQ_CDC2 105
|
||||
#define NQ_CDC3 106
|
||||
#define NQ_CDC4 107
|
||||
#define NQ_CDC5 108
|
||||
#define NQ_CDC6 109
|
||||
#define NQ_CDC7 110
|
||||
#define NQ_CDC8 111
|
||||
#define NQ_CDC9 112
|
||||
#define NQ_CDC10 113
|
||||
#define NQ_CDC11 114
|
||||
#define NQ_CDC12 115
|
||||
#define NQ_CONT1 116
|
||||
#define NQ_CONT2 117
|
||||
#define NQ_CONT3 118
|
||||
#define NQ_CONT4 119
|
||||
#define NQ_NUMREG 120
|
||||
#define NQ_NUMRIGA 121
|
||||
#define NQ_DATACOMP 122
|
||||
|
||||
#define Q_DARE 101
|
||||
#define Q_AVERE 102
|
||||
#define Q_DESCR 103
|
||||
#define Q_CDC1 104
|
||||
#define Q_CDC2 105
|
||||
#define Q_CDC3 106
|
||||
#define Q_CDC4 107
|
||||
#define Q_CDC5 108
|
||||
#define Q_CDC6 109
|
||||
#define Q_CDC7 110
|
||||
#define Q_CDC8 111
|
||||
#define Q_CDC9 112
|
||||
#define Q_CDC10 113
|
||||
#define Q_CDC11 114
|
||||
#define Q_CDC12 115
|
||||
#define Q_CONT1 116
|
||||
#define Q_CONT2 117
|
||||
#define Q_CONT3 118
|
||||
#define Q_CONT4 119
|
||||
#define Q_NUMREG 120
|
||||
#define Q_NUMRIGA 121
|
||||
#define Q_DATACOMP 122
|
494
ps/pd6342400a.uml
Executable file
494
ps/pd6342400a.uml
Executable file
@ -0,0 +1,494 @@
|
||||
#include "pd6342400a.h"
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_CERCA
|
||||
BEGIN
|
||||
PROMPT 1 1 "Cerca"
|
||||
PICTURE TOOL_FINDREC
|
||||
END
|
||||
|
||||
BUTTON DLG_SALVA
|
||||
BEGIN
|
||||
PROMPT 1 1 "Salva"
|
||||
PICTURE TOOL_SAVEREC
|
||||
END
|
||||
|
||||
#include <elabar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Quadra movimenti" -1 -1 80 0
|
||||
|
||||
GROUPBOX DLG_NULL 78 3
|
||||
BEGIN
|
||||
PROMPT 1 0 "@bFiltro righe analitiche"
|
||||
END
|
||||
|
||||
DATE F_DADATA
|
||||
BEGIN
|
||||
PROMPT 2 1 "Considera i movimenti dal "
|
||||
END
|
||||
|
||||
DATE F_ADATA
|
||||
BEGIN
|
||||
PROMPT 42 1 "al "
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 78 5
|
||||
BEGIN
|
||||
PROMPT 1 3 "@bParametri per la quadratura"
|
||||
END
|
||||
|
||||
NUMBER F_NUMREGCG 7
|
||||
BEGIN
|
||||
PROMPT 2 4 "Mov. contabile "
|
||||
USE LF_MOV
|
||||
SELECT TOTDOC>0
|
||||
DISPLAY "Numreg" NUMREG
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPALY "Totale documento" TOTDOC
|
||||
OUTPUT F_NUMREGCG NUMREG
|
||||
OUTPUT F_DESREGCG DESCR
|
||||
OUTPUT F_TOTDOC TOTDOC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DESREGCG 47
|
||||
BEGIN
|
||||
PROMPT 30 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_TOTDOC 18 3
|
||||
BEGIN
|
||||
PROMPT 2 5 "Tot. da quadrare "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_TOTRIGHE 18 3
|
||||
BEGIN
|
||||
PROMPT 42 5 "Tot. righe "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
SPREADSHEET F_MOVNNQUAD
|
||||
BEGIN
|
||||
PROMPT 0 8 ""
|
||||
ITEM "Dare@9"
|
||||
ITEM "Avere@9"
|
||||
ITEM "Descrizione@15"
|
||||
ITEM "CDC1"
|
||||
ITEM "CDC2"
|
||||
ITEM "CDC3"
|
||||
ITEM "CDC4"
|
||||
ITEM "CDC5"
|
||||
ITEM "CDC6"
|
||||
ITEM "CDC7"
|
||||
ITEM "CDC8"
|
||||
ITEM "CDC9"
|
||||
ITEM "CDC10"
|
||||
ITEM "CDC11"
|
||||
ITEM "CDC12"
|
||||
ITEM "CONT1"
|
||||
ITEM "CONT2"
|
||||
ITEM "CONT3"
|
||||
ITEM "CONT4"
|
||||
ITEM "Reg@5"
|
||||
ITEM "Riga@5"
|
||||
ITEM "Data"
|
||||
END
|
||||
|
||||
SPREADSHEET F_MOVQUAD 39 0
|
||||
BEGIN
|
||||
PROMPT 41 8 ""
|
||||
ITEM "Dare@9"
|
||||
ITEM "Avere@9"
|
||||
ITEM "Descrizione@15"
|
||||
ITEM "CDC1"
|
||||
ITEM "CDC2"
|
||||
ITEM "CDC3"
|
||||
ITEM "CDC4"
|
||||
ITEM "CDC5"
|
||||
ITEM "CDC6"
|
||||
ITEM "CDC7"
|
||||
ITEM "CDC8"
|
||||
ITEM "CDC9"
|
||||
ITEM "CDC10"
|
||||
ITEM "CDC11"
|
||||
ITEM "CDC12"
|
||||
ITEM "CONT1"
|
||||
ITEM "CONT2"
|
||||
ITEM "CONT3"
|
||||
ITEM "CONT4"
|
||||
ITEM "Reg@5"
|
||||
ITEM "Riga@5"
|
||||
ITEM "Data"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
PAGE "Riga analitica" -1 -1 78 13
|
||||
|
||||
CURRENCY NQ_DARE 15
|
||||
BEGIN
|
||||
PROMPT 2 1 "Dare "
|
||||
END
|
||||
|
||||
CURRENCY NQ_AVERE 15
|
||||
BEGIN
|
||||
PROMPT 43 1 "Avere "
|
||||
END
|
||||
|
||||
STRING NQ_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 2 2 "Descrizione "
|
||||
END
|
||||
|
||||
STRING NQ_CDC1 20
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cdc 1"
|
||||
USE LF_CDC
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC2 20
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC3 20
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC4 20
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC5 20
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC6 20
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC7 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC8 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC9 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC10 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC11 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CDC12 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE NQ_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CONT1 20
|
||||
BEGIN
|
||||
PROMPT 2 5 "Con 1"
|
||||
USE LF_PCON
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CONT2 20
|
||||
BEGIN
|
||||
PROMPT 21 5 "Con 2"
|
||||
COPY USE NQ_CONT1
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CONT3 20
|
||||
BEGIN
|
||||
PROMPT 41 5 "Con 3"
|
||||
COPY USE NQ_CONT1
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING NQ_CONT4 20
|
||||
BEGIN
|
||||
PROMPT 61 5 "Con 4"
|
||||
COPY USE NQ_CONT1
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER NQ_NUMREG 10
|
||||
BEGIN
|
||||
PROMPT 2 7 "Num. registrazione"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER NQ_NUMRIGA 10
|
||||
BEGIN
|
||||
PROMPT 33 7 "Num. riga"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE NQ_DATACOMP
|
||||
BEGIN
|
||||
PROMPT 2 8 "Data competenza "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_USER 2 2
|
||||
BEGIN
|
||||
PROMPT 3 1 "Sposta"
|
||||
PICTURE BMP_LINK
|
||||
END
|
||||
|
||||
#include <stdbar.h>
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
PAGE "Riga analitica" -1 -1 78 13
|
||||
|
||||
CURRENCY Q_DARE 15
|
||||
BEGIN
|
||||
PROMPT 2 1 "Dare "
|
||||
END
|
||||
|
||||
CURRENCY Q_AVERE 15
|
||||
BEGIN
|
||||
PROMPT 43 1 "Avere "
|
||||
END
|
||||
|
||||
STRING Q_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 2 2 "Descrizione "
|
||||
END
|
||||
|
||||
STRING Q_CDC1 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 1"
|
||||
USE LF_CDC
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC2 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC3 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC4 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC5 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC6 20
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC7 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC8 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC9 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC10 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC11 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CDC12 20
|
||||
BEGIN
|
||||
PROMPT 2 4 "Cdc 2"
|
||||
COPY USE Q_CDC1
|
||||
CHECKTYPE NORMAL
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CONT1 20
|
||||
BEGIN
|
||||
PROMPT 2 5 "Con 1"
|
||||
USE LF_PCON
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CONT2 20
|
||||
BEGIN
|
||||
PROMPT 21 5 "Con 2"
|
||||
COPY USE Q_CONT1
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CONT3 20
|
||||
BEGIN
|
||||
PROMPT 41 5 "Con 3"
|
||||
COPY USE Q_CONT1
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
STRING Q_CONT4 20
|
||||
BEGIN
|
||||
PROMPT 61 5 "Con 4"
|
||||
COPY USE Q_CONT1
|
||||
CHECKTYPE NORMAL
|
||||
GROUP 1
|
||||
FLAGS "H"
|
||||
END
|
||||
|
||||
NUMBER Q_NUMREG 10
|
||||
BEGIN
|
||||
PROMPT 2 7 "Num. registrazione"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER Q_NUMRIGA 10
|
||||
BEGIN
|
||||
PROMPT 33 7 "Num. riga"
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
DATE Q_DATACOMP
|
||||
BEGIN
|
||||
PROMPT 2 8 "Data competenza "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "" 0 0 0 2
|
||||
|
||||
BUTTON DLG_USER 2 2
|
||||
BEGIN
|
||||
PROMPT 3 1 "Sposta"
|
||||
PICTURE BMP_LINK
|
||||
END
|
||||
|
||||
#include <stdbar.h>
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user