Patch level : 2.0 nopatch
Files correlati : cm0.exe cm0100a.msk Ricompilazione Demo : [ ] Commento : Aggiunta possibilita' di attivare o meno la stampa di: dettaglio, totale conto, totale commessa. Tutto cio' per agevolare la personalizzazione richiesta dallo studio Tampalini git-svn-id: svn://10.65.10.50/trunk@11600 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ed9cf46e22
commit
cfbff9b347
@ -18,9 +18,9 @@ class TForm_contixcdc : public TForm
|
||||
|
||||
public:
|
||||
virtual bool validate(TForm_item &cf, TToken_string &s);
|
||||
void set_testata() {set_header(1,TRUE);}
|
||||
TPrint_section& get_body() {return section('B', odd_page);}
|
||||
TPrint_section& get_section(char s, pagetype pos) {return section(s, pos);}
|
||||
void set_testata() { set_header(1,TRUE); }
|
||||
TPrint_section& get_body() { return section('B', odd_page); }
|
||||
TPrint_section& get_section(char s, pagetype pos) { return section(s, pos); }
|
||||
TForm_contixcdc();
|
||||
|
||||
virtual ~TForm_contixcdc();
|
||||
@ -111,9 +111,9 @@ bool TContixcdc_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
||||
if (e == fe_modify || e == fe_close)
|
||||
{
|
||||
TDate dataini(get(F_DATAINI));
|
||||
if (dataini.ok())
|
||||
if (dataini.ok() && !field(F_ANNO).empty())
|
||||
{
|
||||
TDate datainies = cache().get("ESC", field(F_ANNO).get(), "D0");
|
||||
const TDate datainies = cache().get("ESC", get(F_ANNO), "D0");
|
||||
if (dataini < datainies && datainies.ok())
|
||||
return error_box(TR("La data iniziale non può essere precedente alla data inizio esercizio %s"), (const char*) datainies.string());
|
||||
}
|
||||
@ -123,14 +123,11 @@ bool TContixcdc_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
||||
if (e == fe_modify || fe_close)
|
||||
{
|
||||
TDate datafin(get(F_DATAFIN));
|
||||
if (datafin.ok())
|
||||
if (datafin.ok() && !field(F_ANNO).empty())
|
||||
{
|
||||
TDate datafines = cache().get("ESC", field(F_ANNO).get(), "D1");
|
||||
if (datafin > datafines && datafines.ok())
|
||||
return error_box(FR("La data finale non può essere successiva alla data fine esercizio %s"), (const char*) datafines.string());
|
||||
TDate dataini(field(F_DATAINI).get());
|
||||
if (dataini > datafin)
|
||||
return error_box(TR("La data iniziale non può essere successiva alla data finale"));
|
||||
const TDate datafines = cache().get("ESC", get(F_ANNO), "D1");
|
||||
if (datafin > datafines && datafines.ok())
|
||||
return error_box(FR("La data finale non può essere successiva alla data fine esercizio %s"), (const char*) datafines.string());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -172,7 +169,8 @@ class TContixCdc : public TSkeleton_application
|
||||
int _currgruppo, _currconto, _oldgruppo, _oldconto;
|
||||
long _currsottoc, _oldsottoc;
|
||||
TString _currcms, _currfsc, _oldcms, _oldfsc;
|
||||
bool _saltopagina, _stampa_totconti, _headercms, _headerfsc;
|
||||
bool _saltopagina, _headercms, _headerfsc;
|
||||
bool _stampa_totconti, _stampa_totcms, _stampa_dettagli;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
@ -196,7 +194,6 @@ protected:
|
||||
|
||||
public:
|
||||
TContixCdc() {}
|
||||
|
||||
};
|
||||
|
||||
bool TContixCdc::create()
|
||||
@ -236,7 +233,8 @@ void TContixCdc::print_sottoc()
|
||||
set_field(FR_SOTTOC, _oldsottoc);
|
||||
set_field(FR_D_SOTTOC, pcon.get(PCN_DESCR));
|
||||
fill_body(_t_sottoc);
|
||||
print_body();
|
||||
if (_stampa_dettagli)
|
||||
print_body();
|
||||
_t_gruppo += _t_sottoc;
|
||||
_t_fsc += _t_sottoc;
|
||||
_t_cms += _t_sottoc;
|
||||
@ -268,10 +266,13 @@ void TContixCdc::print_footer_gruppo()
|
||||
|
||||
void TContixCdc::print_footer_cms()
|
||||
{
|
||||
if (!_t_cms._tot_periodo.is_zero())
|
||||
if (!_t_cms._tot_periodo.is_zero() && _stampa_totcms)
|
||||
{
|
||||
TString tmp;
|
||||
tmp.format(FR("TOTALE COMMESSA %s"), (const char*) _oldcms);
|
||||
tmp.format(FR("TOTALE COMMESSA %s"), (const char*)_oldcms);
|
||||
set_field(FR_GRUPPO, "");
|
||||
set_field(FR_CONTO, "");
|
||||
set_field(FR_SOTTOC, "");
|
||||
set_field(FR_D_SOTTOC, tmp);
|
||||
fill_body(_t_cms);
|
||||
print_body();
|
||||
@ -395,16 +396,18 @@ void TContixCdc::aggiorna_totali(const TImporto& importo, const TDate& data)
|
||||
|
||||
void TContixCdc::main_loop()
|
||||
{
|
||||
_mask->set(F_DETTAGLI, "X"); // Attiva stampa dettagli
|
||||
_mask->set(F_TOTCONTI, "X"); // Attiva stampa totali per conto
|
||||
_mask->set(F_TOTCMS, "X"); // Attiva stampa totali per commessa
|
||||
|
||||
while (_mask->run() == K_ENTER)
|
||||
{
|
||||
_codes = _mask->get_int(F_ANNO); // esercizio
|
||||
_dataini = _mask->get_date(F_DATAINI); // data iniziale
|
||||
_datafin = _mask->get_date(F_DATAFIN); // data finale
|
||||
if (_dataini.empty())
|
||||
if (_dataini.empty() && !_mask->field(F_ANNO).empty())
|
||||
_dataini = cache().get("ESC", _mask->get(F_ANNO)).get_date("D0");
|
||||
if (_datafin.empty())
|
||||
if (_datafin.empty() && !_mask->field(F_ANNO).empty())
|
||||
_datafin = cache().get("ESC", _mask->get(F_ANNO)).get_date("D1");
|
||||
TString80 dacdc = _mask->get(F_DACDC); // cdc/commessa iniziale
|
||||
TString80 dafsc = _mask->get(F_DAFSC); // fase iniziale
|
||||
@ -412,7 +415,7 @@ void TContixCdc::main_loop()
|
||||
TString80 afsc = _mask->get(F_AFSC); // fase finale
|
||||
TRelation relrmov(LF_RMOV);
|
||||
TString filtro = "";
|
||||
if (_codes != 0)
|
||||
if (_codes > 0)
|
||||
filtro.format("ANNOES==%d", _codes);
|
||||
if (dacdc.not_empty())
|
||||
{
|
||||
@ -481,7 +484,9 @@ void TContixCdc::main_loop()
|
||||
_headerfsc = (ctrlfsc) ? TRUE : FALSE;
|
||||
|
||||
_saltopagina = _mask->get_bool(F_SALTOPAGINA); // salto pagina a fine commessa
|
||||
_stampa_dettagli = _mask->get_bool(F_DETTAGLI);
|
||||
_stampa_totconti = _mask->get_bool(F_TOTCONTI);
|
||||
_stampa_totcms = _mask->get_bool(F_TOTCMS);
|
||||
|
||||
for (sortcur=0; sortcur.pos()<num; ++sortcur) //scansione su tutte le righe di movimento
|
||||
{
|
||||
|
@ -18,4 +18,8 @@
|
||||
#define F_SOTTOCFIN 116
|
||||
#define F_DESCRFIN 117
|
||||
#define F_SALTOPAGINA 118
|
||||
#define F_TOTCONTI 119
|
||||
|
||||
#define F_DETTAGLI 120
|
||||
#define F_TOTCONTI 121
|
||||
#define F_TOTCMS 122
|
||||
|
||||
|
@ -4,13 +4,13 @@ TOOLBAR "" 0 -2 0 2
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Stampa"
|
||||
PROMPT -12 -1 "~Stampa"
|
||||
MESSAGE EXIT,K_ENTER
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
@ -25,14 +25,13 @@ END
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FLAGS "FRD"
|
||||
USE LF_NDITTE KEY 1
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "DF"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
DISPLAY "Codice" CODDITTA
|
||||
DISPLAY "Ragione sociale@50" RAGSOC
|
||||
OUTPUT F_CODDITTA CODDITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_RAGSOC 50
|
||||
@ -58,8 +57,8 @@ BEGIN
|
||||
OUTPUT F_ANNO CODTAB
|
||||
FLAGS "RZ"
|
||||
ADD RUN cg0 -5 esc
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Codice esercizio obbligatorio"
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice esercizio assente"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
@ -70,6 +69,8 @@ END
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 50 5 "alla data "
|
||||
VALIDATE DATE_CMP_FUNC >= F_DATAINI
|
||||
WARNING "La data finale deve essere succeviva a quella iniziale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 79 5
|
||||
@ -128,7 +129,7 @@ BEGIN
|
||||
PROMPT 2 10 "Salto pagina a fine commessa"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 79 7
|
||||
GROUPBOX DLG_NULL 79 6
|
||||
BEGIN
|
||||
PROMPT 1 12 "@bSelezione conti"
|
||||
END
|
||||
@ -244,9 +245,24 @@ BEGIN
|
||||
ADD RUN cg0 -0
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 79 3
|
||||
BEGIN
|
||||
PROMPT 1 18 "@bSelezione elementi da stampare"
|
||||
END
|
||||
|
||||
BOOLEAN F_DETTAGLI
|
||||
BEGIN
|
||||
PROMPT 2 19 "Dettagli sottoconto"
|
||||
END
|
||||
|
||||
BOOLEAN F_TOTCONTI
|
||||
BEGIN
|
||||
PROMPT 2 17 "Stampa totali per conto"
|
||||
PROMPT 31 19 "Totali per conto"
|
||||
END
|
||||
|
||||
BOOLEAN F_TOTCMS
|
||||
BEGIN
|
||||
PROMPT 57 19 "Totali per commessa"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
Loading…
x
Reference in New Issue
Block a user