From 1d4f4e326750172664b05e3b391a6adf1f5fe32d Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 9 Sep 2002 14:10:14 +0000 Subject: [PATCH] Patch level : Files correlati : Ricompilazione Demo : [ ] Commento : Nuovo modulo commesse git-svn-id: svn://10.65.10.50/trunk@10473 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cm/cm0.cpp | 37 ++++ cm/cm0.h | 21 +++ cm/cm0.url | 3 + cm/cm0100.cpp | 449 +++++++++++++++++++++++++++++++++++++++++++++++++ cm/cm0100.h | 24 +++ cm/cm0100a.frm | 217 ++++++++++++++++++++++++ cm/cm0100a.h | 20 +++ cm/cm0100a.uml | 224 ++++++++++++++++++++++++ cm/cm0200.cpp | 436 +++++++++++++++++++++++++++++++++++++++++++++++ cm/cm0200.h | 25 +++ cm/cm0200a.frm | 226 +++++++++++++++++++++++++ cm/cm0200a.h | 20 +++ cm/cm0200a.uml | 224 ++++++++++++++++++++++++ 13 files changed, 1926 insertions(+) create mode 100755 cm/cm0.cpp create mode 100755 cm/cm0.h create mode 100755 cm/cm0.url create mode 100755 cm/cm0100.cpp create mode 100755 cm/cm0100.h create mode 100755 cm/cm0100a.frm create mode 100755 cm/cm0100a.h create mode 100755 cm/cm0100a.uml create mode 100755 cm/cm0200.cpp create mode 100755 cm/cm0200.h create mode 100755 cm/cm0200a.frm create mode 100755 cm/cm0200a.h create mode 100755 cm/cm0200a.uml diff --git a/cm/cm0.cpp b/cm/cm0.cpp new file mode 100755 index 000000000..961d5eb30 --- /dev/null +++ b/cm/cm0.cpp @@ -0,0 +1,37 @@ +#include + +#include "cm0.h" + +int main(int argc, char** argv) +{ + const int op = argc < 2 ? 0 : argv[1][1]-'0'; + switch (op) + { + case 1: cm0200(argc,argv); break; // scheda cdc/commessa + default: cm0100(argc,argv); break; // conti per cdc/commessa + } + exit(0); + return 0; +} + + + + + + + + + + + + + + + + + + + + + + diff --git a/cm/cm0.h b/cm/cm0.h new file mode 100755 index 000000000..3279dbcd3 --- /dev/null +++ b/cm/cm0.h @@ -0,0 +1,21 @@ +#ifndef __CM0_H +#define __CM0_H + +int cm0100(int argc, char* argv[]); +int cm0200(int argc, char* argv[]); + +#endif // __CM0_H + + + + + + + + + + + + + + diff --git a/cm/cm0.url b/cm/cm0.url new file mode 100755 index 000000000..1aa8af7fb --- /dev/null +++ b/cm/cm0.url @@ -0,0 +1,3 @@ +#include + +#include diff --git a/cm/cm0100.cpp b/cm/cm0100.cpp new file mode 100755 index 000000000..f3da265c9 --- /dev/null +++ b/cm/cm0100.cpp @@ -0,0 +1,449 @@ +#include +#include +#include +#include +#include +#include + +#include "cm0.h" + +#include "cm0100a.h" +#include "cm0100.h" + +#include "rmov.h" +#include "pconti.h" + +class TForm_contixcdc : public TForm +{ + +public: + virtual bool validate(TForm_item &cf, TToken_string &s); + void set_testata() {set_header(1,TRUE);} + //void set_pedata() {set_footer(1,FALSE); set_footer(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(); +}; + +TForm_contixcdc::TForm_contixcdc() :TForm("cm0100a") //costruttore +{ +} + +TForm_contixcdc::~TForm_contixcdc() //distruttore +{ +} + +bool TForm_contixcdc::validate(TForm_item &cf, TToken_string &s) +{ + return TForm::validate(cf,s); //richiama la validate standard della classe genitore +} + +class TContixcdc_mask : public TAutomask +{ + TRelation * _rel; + TCursor * _cur; + +protected: + bool on_field_event(TOperable_field& o, TField_event e, long jolly); +public: + + TContixcdc_mask(); + + virtual ~TContixcdc_mask(){}; +}; + +TContixcdc_mask::TContixcdc_mask() :TAutomask ("cm0100a") +{ +} + +bool TContixcdc_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) +{ + switch (o.dlg()) + { + case F_DACDC: + case F_ACDC: + if (e == fe_modify) + { + const bool on = !(field(F_DACDC).empty() && field(F_ACDC).empty()); + if (!on) + { + reset(F_DAFSC); + reset(F_AFSC); + } + enable(F_DAFSC, on); + enable(F_AFSC, on); + } + break; + default: break; + } + return TRUE; +} + +struct TTotali : public TObject +{ + TImporto _tot_progprec, _tot_periodo, _tot_saldocont; + void azzera(); + TTotali& operator += (const TTotali& t); +}; + +void TTotali::azzera() +{ + _tot_progprec = 0; + _tot_periodo = 0; + _tot_saldocont = 0; +} + +TTotali& TTotali::operator += (const TTotali& t) +{ + _tot_progprec += t._tot_progprec; + _tot_periodo += t._tot_periodo; + _tot_saldocont += t._tot_saldocont; + + return *this; //ritorna se stesso, quindi i valori dei totali +} + +class TContixCdc : public TSkeleton_application +{ + TContixcdc_mask * _mask; + TForm_contixcdc * _form; + int _codes; + TDate _dataini, _datafin; + TTotali _t_gruppo, _t_sottoc, _t_fsc, _t_cms; //sono i tre set di totali (gruppo/conto, sottoconto, commessa) + int _currgruppo, _currconto, _oldgruppo, _oldconto; + long _currsottoc, _oldsottoc; + TString _currcms, _currfsc, _oldcms, _oldfsc; + bool _saltopagina; + +protected: + virtual bool create(); + virtual bool destroy(); + virtual void main_loop(); + + void print_sottoc(); + void ctrl_commessa(); + void print_footer_gruppo(const int gruppo, const int conto); + void print_header_gruppo(const int gruppo, const int conto); + void print_footer_commessa(const TString& cms); + void print_header_commessa(const TString& cms); + void print_footer_fase(const TString& fsc); + void print_header_fase(const TString& fsc); + void set_intestazione(); + void fill_body(const TTotali& tot); //riempie il campo body con tutti i totali + void print_body(); //stampa effettivamente il body + void set_field(int id, const real& val); //mette in un campo del body odd un valore numerico + void set_field(int id, const char* val); //mette in un campo del body odd una stringa + void print_specialsection(char s, pagetype pos); // stampa una sezione qualunque ( + void aggiorna_totali(const TImporto importo, const TDate data); + +public: + TContixCdc() {} + +}; + +bool TContixCdc::create() +{ + open_files(LF_RMOV, 0); + _mask = new TContixcdc_mask; + _form = new TForm_contixcdc; + + return TSkeleton_application::create(); +} + +bool TContixCdc::destroy() +{ + delete _mask; + delete _form; + return TSkeleton_application::destroy(); +} + +void TContixCdc::print_sottoc() +{ + if (_oldsottoc != -1) + { + TString16 key; + key.format("%d|%d|%ld", _oldgruppo, _oldconto, _oldsottoc); + const TRectype& pcon = cache().get(LF_PCON, key); + set_field(FR_SOTTOC, _oldsottoc); + set_field(FR_D_SOTTOC, pcon.get(PCN_DESCR)); + // manca costo/ricavo + fill_body(_t_sottoc); + print_body(); + } + _oldsottoc = _currsottoc; + _t_sottoc.azzera(); +} + +void TContixCdc::print_footer_gruppo(const int gruppo, const int conto) +{ + TString16 key; + key.format("%d|%d", gruppo, conto); + TString tmp; + const TRectype& pcon = cache().get(LF_PCON, key); + tmp.format("TOTALE %d %d %s", gruppo, conto, (const char*) pcon.get(PCN_DESCR)); + set_field(FR_SOTTOC, ""); + set_field(FR_D_SOTTOC, tmp); + fill_body(_t_gruppo); + print_body(); +} + +void TContixCdc::print_header_gruppo(const int gruppo, const int conto) +{ + TString tmp; + TString16 key; + key.format("%d|%d", gruppo, conto); + const TRectype& pcon = cache().get(LF_PCON, key); + tmp.format("%d %d", gruppo, conto); + _form->find_field('H', even_page, FR_GRUPPOCONTO).set(tmp); + _form->find_field('H', even_page, FR_D_GRUPPOCONTO).set(pcon.get(PCN_DESCR)); + print_specialsection('H', even_page); +} + +void TContixCdc::print_footer_commessa(const TString& cms) +{ + TString tmp; + tmp.format("TOTALE COMMESSA %s", (const char*) cms); + set_field(FR_D_SOTTOC, tmp); + fill_body(_t_cms); + print_body(); + if (_saltopagina) + printer().formfeed(); +} + +void TContixCdc::print_footer_fase(const TString& fsc) +{ + TString tmp; + tmp.format("TOTALE FASE %s", (const char*) fsc); + set_field(FR_D_SOTTOC, tmp); + fill_body(_t_fsc); + print_body(); +} + +void TContixCdc::print_header_commessa(const TString& cms) +{ + _form->find_field('H', odd_page, FR_CMS).set(cms); + _form->find_field('H', odd_page, FR_D_CMS).set(cache().get("CMS", cms).get("S0")); + print_specialsection('H', odd_page); +} + +void TContixCdc::print_header_fase(const TString& fsc) +{ + _form->find_field('H', last_page, FR_FSC).set(fsc); + _form->find_field('H', last_page, FR_D_FSC).set(cache().get("FSC", fsc).get("S0")); + print_specialsection('H', last_page); +} + +void TContixCdc::set_intestazione() +{ +// scrive l'header first, contenente i dati della ditta e dell'esercizio e le selezioni di stampa + _form->find_field('H', first_page, FR_ESERCIZIO).set(_mask->get(F_ANNO)); + _form->find_field('H', first_page, FR_DATAINI).set(_mask->get(F_DATAINI)); + _form->find_field('H', first_page, FR_DATAFIN).set(_mask->get(F_DATAFIN)); + _form->find_field('H', first_page, FR_DACDC).set(_mask->get(F_DACDC)); + _form->find_field('H', first_page, FR_DAFSC).set(_mask->get(F_DAFSC)); + _form->find_field('H', first_page, FR_ACDC).set(_mask->get(F_ACDC)); + _form->find_field('H', first_page, FR_AFSC).set(_mask->get(F_AFSC)); + _form->set_testata(); +} + +void TContixCdc::print_body() +{ + TPrint_section& body = _form->get_body(); + body.update(); + if (body.height() > printer().rows_left()) + printer().formfeed(); + for (word i = 0; i < body.height(); i++) // stampa le righe del body + printer().print(body.row(i)); +} + +void TContixCdc::print_specialsection(char s, pagetype pos) +{ + TPrint_section& sec = _form->get_section(s, pos); + sec.update(); + if (sec.height() > printer().rows_left()) + printer().formfeed(); + for (word i = 0; i < sec.height(); i++) // stampa le righe del body + printer().print(sec.row(i)); +} + +void TContixCdc::set_field(int id, const real& val) +{ + _form->find_field('B', odd_page, id).set(val.string()); +} + +void TContixCdc::set_field(int id, const char* val) +{ + _form->find_field('B', odd_page, id).set(val); +} + +void TContixCdc::fill_body(const TTotali& tot) +{ +// riempie il body odd, contenente i totali; lo fa chiamando la set_field per ogni campo + set_field(FR_PROGPREC, tot._tot_progprec.valore()); + set_field(FR_PERIODO, tot._tot_periodo.valore()); + real tempval1 = tot._tot_progprec.valore()+tot._tot_periodo.valore(); + set_field(FR_PROG, tempval1); + set_field(FR_SALDOCONT, tot._tot_saldocont.valore()); +} + +void TContixCdc::aggiorna_totali(const TImporto importo, const TDate data) +{ + if (data < _dataini) + _t_sottoc._tot_progprec+=importo; + else if (data > _datafin) + _t_sottoc._tot_saldocont+=importo; + else + _t_sottoc._tot_periodo+=importo; +} + +void TContixCdc::ctrl_commessa() +{ + if (_oldcms != "@@") + print_footer_commessa(_oldcms); + _t_cms.azzera(); + print_header_commessa(_currcms); + _oldcms = _currcms; +} + +void TContixCdc::main_loop() +{ + while (_mask->run() == K_ENTER) + { + _saltopagina = _mask->get_bool(F_SALTOPAGINA); // salto pagina a fine commessa + _codes = _mask->get_int(F_ANNO); // esercizio + _dataini = _mask->get_date(F_DATAINI); // data iniziale + _datafin = _mask->get_date(F_DATAFIN); // data finale + TString80 dacdc = _mask->get(F_DACDC); // cdc/commessa iniziale + TString80 dafsc = _mask->get(F_DAFSC); // fase iniziale + TString80 acdc = _mask->get(F_ACDC); // cdc/commessa finale + TString80 afsc = _mask->get(F_AFSC); // fase finale + // relazione su rmov + TRelation relrmov(LF_RMOV); + // filtro + TString filtro = ""; + if (_codes != 0) + filtro.format("ANNOES==%d", _codes); + if (dacdc.not_empty()) + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(CODCMS>=\"" << dacdc << "\")"; + } + if (dafsc.not_empty()) + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(FASCMS>=\"" << dafsc << "\")"; + } + if (acdc.not_empty()) + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(CODCMS<=\"" << acdc << "\")"; + } + if (afsc.not_empty()) + + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(FASCMS<=\"" << afsc << "\")"; + } + if (filtro.empty()) + filtro.format("(CODCMS!=\"\")"); + else + if (dacdc.empty() && acdc.empty()) + filtro << " && " << "(CODCMS!=\"\")"; + TRectype darec(LF_RMOV), arec(LF_RMOV); + // servono per gruppo-conto-sottoconto + darec.zero(); + arec.zero(); + + darec.put(RMV_GRUPPO, _mask->get_int(F_GRUPPOINI)); + darec.put(RMV_CONTO, _mask->get_int(F_CONTOINI)); + darec.put(RMV_SOTTOCONTO, _mask->get_long(F_SOTTOCINI)); + arec.put(RMV_GRUPPO, _mask->get_int(F_GRUPPOFIN)); + arec.put(RMV_CONTO, _mask->get_int(F_CONTOFIN)); + arec.put(RMV_SOTTOCONTO, _mask->get_long(F_SOTTOCFIN)); + + // ordinamento per TSorted_cursor + TString ordin = "CODCMS|FASCMS|GRUPPO|CONTO|SOTTOCONTO|DATAREG|NUMREG|NUMRIG"; + TSorted_cursor sortcur (&relrmov, ordin, filtro, 2, &darec, &arec); + sortcur.setregion(darec,arec); + sortcur.setfilter(filtro,TRUE); + + long num = sortcur.items(); + sortcur.freeze(); + printer().open(); +// setta l'intestazione del form... + set_intestazione(); + TRectype currrec(LF_RMOV); + _oldcms = "@@"; + _oldfsc = "@@"; + _oldsottoc = -1; + _oldgruppo = -1; + _oldconto = -1; + _t_cms.azzera(); + _t_fsc.azzera(); + _t_gruppo.azzera(); + _t_sottoc.azzera(); + for (sortcur=0; sortcur.pos()0) + { + print_sottoc(); + print_footer_gruppo(_currgruppo, _currconto); + print_footer_fase(_currfsc); + print_footer_commessa(_currcms); + printer().formfeed(); + } + printer().close(); + } +} + +int cm0100(int argc, char* argv[]) +{ + TContixCdc a; + a.run(argc,argv,"Stampa conti per CDC/Commessa"); + return 0; +} \ No newline at end of file diff --git a/cm/cm0100.h b/cm/cm0100.h new file mode 100755 index 000000000..75b8ebf8a --- /dev/null +++ b/cm/cm0100.h @@ -0,0 +1,24 @@ +// campi del form cm0100a.frm + +#define FR_ESERCIZIO 11 +#define FR_DATAINI 12 +#define FR_DATAFIN 13 +#define FR_DACDC 14 +#define FR_DAFSC 15 +#define FR_ACDC 16 +#define FR_AFSC 17 + +#define FR_CMS 21 +#define FR_D_CMS 22 +#define FR_FSC 23 +#define FR_D_FSC 24 +#define FR_GRUPPOCONTO 25 +#define FR_D_GRUPPOCONTO 26 + +#define FR_SOTTOC 31 +#define FR_D_SOTTOC 32 +#define FR_CR_SOTTOC 33 +#define FR_PROGPREC 34 +#define FR_PERIODO 35 +#define FR_PROG 36 +#define FR_SALDOCONT 37 diff --git a/cm/cm0100a.frm b/cm/cm0100a.frm new file mode 100755 index 000000000..251735037 --- /dev/null +++ b/cm/cm0100a.frm @@ -0,0 +1,217 @@ +#include "cm0100.h" + +GENERAL +BEGIN + OFFSET 0 0 + FONT "Courier New" + SIZE 12 + GRID "" +END + +SECTION HEADER FIRST 7 + +STRINGA 1 40 1 +BEGIN + KEY "nome ditta" + PROMPT 1 1 "Ditta " + MESSAGE _DITTA, !RAGSOC +END + +STRINGA 2 10 +BEGIN + KEY "Data" + PROMPT 100 1 "Data " + MESSAGE _TODAY +END + +NUMERO 3 7 +BEGIN + KEY "Nr. pagina" + PROMPT 120 1 "Pagina " + MESSAGE _PAGENO +END + +STRINGA -1 22 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 2 "Conti per CDC/Commessa" +END + +NUMERO FR_ESERCIZIO 16 +BEGIN + KEY "Parametri stampa: codice esercizio" + PROMPT 1 3 "Esercizio: " +END + +DATA FR_DATAINI +BEGIN + KEY "Parametri stampa: data iniziale" + PROMPT 1 4 "Movimenti dal " +END + +DATA FR_DATAFIN +BEGIN + KEY "Parametri stampa: data finale" + PROMPT 40 4 "al " +END + +STRINGA FR_DACDC 20 +BEGIN + KEY "Parametri stampa: da commessa" + PROMPT 1 5 "Da CDC/commessa: " +END + +STRINGA FR_DAFSC 10 +BEGIN + KEY "Parametri stampa: da fase" + PROMPT 40 5 "Da fase: " +END + +STRINGA FR_ACDC 20 +BEGIN + KEY "Parametri stampa: a commessa" + PROMPT 1 6 "a CDC/commessa: " +END + +STRINGA FR_AFSC 10 +BEGIN + KEY "Parametri stampa: a fase" + PROMPT 40 6 "a fase: " +END + +END // section header first + +SECTION HEADER ODD 5 + +STRINGA FR_CMS 20 +BEGIN + KEY "Intestazione commessa" + PROMPT 1 1 "CDC/Commessa " +END + +STRINGA FR_D_CMS 50 +BEGIN + KEY "Intestazione commessa" + PROMPT 35 1 "" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 3 "------------------------------------------------------------------------------------------------------------------------" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 4 "Gruppo/Conto/Sottoconto" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 70 4 "Prog. prec." +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 85 4 "Tot. periodo" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 100 4 "Tot. progr." +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 115 4 "Saldo cont." +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 5 "------------------------------------------------------------------------------------------------------------------------" +END + +END // section header odd + +SECTION HEADER LAST 1 + +STRINGA FR_FSC 20 +BEGIN + KEY "Intestazione fase" + PROMPT 1 1 "Fase " +END + +STRINGA FR_D_FSC 50 +BEGIN + KEY "Intestazione fase" + PROMPT 35 1 "" +END + +END // section header last + +SECTION HEADER EVEN 1 + +STRINGA FR_GRUPPOCONTO 20 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 1 "Gruppo/Conto " +END + +STRINGA FR_D_GRUPPOCONTO 50 +BEGIN + KEY "Intestazione stampa" + PROMPT 21 1 "" +END + +END // section header even + +SECTION BODY ODD 1 + +NUMERO FR_SOTTOC 6 +BEGIN + PROMPT 1 1 "" +END + +STRINGA FR_D_SOTTOC 50 +BEGIN + PROMPT 8 1 "" +END + +STRINGA FR_CR_SOTTOC 1 +BEGIN + PROMPT 64 1 "" +END + +NUMERO FR_PROGPREC 14 2 +BEGIN + PROMPT 70 1 "" + PICTURE "###.###.###,##" +END + +NUMERO FR_PERIODO 14 2 +BEGIN + PROMPT 85 1 "" + PICTURE "###.###.###,##" +END + +NUMERO FR_PROG 14 2 +BEGIN + PROMPT 100 1 "" + PICTURE "###.###.###,##" +END + +NUMERO FR_SALDOCONT 14 2 +BEGIN + PROMPT 115 1 "" + PICTURE "###.###.###,##" +END + +END // section body + +END // form diff --git a/cm/cm0100a.h b/cm/cm0100a.h new file mode 100755 index 000000000..d36931a3b --- /dev/null +++ b/cm/cm0100a.h @@ -0,0 +1,20 @@ +// campi per la maschera cm0100a + +#define F_CODDITTA 101 +#define F_RAGSOC 102 +#define F_ANNO 103 +#define F_DATAINI 104 +#define F_DATAFIN 105 +#define F_DACDC 106 +#define F_ACDC 107 +#define F_DAFSC 108 +#define F_AFSC 109 +#define F_GRUPPOINI 110 +#define F_CONTOINI 111 +#define F_SOTTOCINI 112 +#define F_DESCRINI 113 +#define F_GRUPPOFIN 114 +#define F_CONTOFIN 115 +#define F_SOTTOCFIN 116 +#define F_DESCRFIN 117 +#define F_SALTOPAGINA 118 \ No newline at end of file diff --git a/cm/cm0100a.uml b/cm/cm0100a.uml new file mode 100755 index 000000000..9d79b38a3 --- /dev/null +++ b/cm/cm0100a.uml @@ -0,0 +1,224 @@ +#include "cm0100a.h" + +TOOLBAR "" 0 -2 0 2 + +BUTTON DLG_PRINT 10 2 +BEGIN + PROMPT -12 -11 "~Stampa" + MESSAGE EXIT,K_ENTER +END + +BUTTON DLG_QUIT 10 2 +BEGIN + PROMPT -22 -11 "" +END + +ENDPAGE + +PAGE "Conti per CDC/Commessa" -1 -1 76 20 + +NUMBER F_CODDITTA 5 +BEGIN + PROMPT 2 1 "Ditta " + FLAGS "FRD" + USE LF_NDITTE KEY 1 + CHECKTYPE REQUIRED + INPUT CODDITTA F_CODDITTA + DISPLAY "Codice" CODDITTA + DISPLAY "Ragione sociale@50" RAGSOC + OUTPUT F_CODDITTA CODDITTA + OUTPUT F_RAGSOC RAGSOC +END + +STRING F_RAGSOC 50 +BEGIN + PROMPT 2 2 "Ragione sociale " + FLAGS "D" +END + +NUMBER F_ANNO 4 +BEGIN + PROMPT 2 4 "Codice esercizio " + HELP "Codice esercizio per cui si vuole la lista" + USE ESC + CHECKTYPE NORMAL + INPUT CODTAB F_ANNO + DISPLAY "Codice" CODTAB + DISPLAY "Data inizio esercizio" D0 + DISPLAY "Data fine esercizio" D1 + OUTPUT F_ANNO CODTAB + FLAGS "RZ" + ADD RUN cg0 -5 esc +END + +DATE F_DATAINI +BEGIN + PROMPT 2 5 "Dalla data " +END + +DATE F_DATAFIN +BEGIN + PROMPT 50 5 "alla data " +END + +STRING F_DACDC 20 +BEGIN + PROMPT 2 7 "Da CDC/Commessa " + FLAGS "UZ" + USE CMS + INPUT CODTAB F_DACDC + DISPLAY "Codice@20" CODTAB + DISPLAY "Descrizione@70" S0 + OUTPUT F_DACDC CODTAB + CHECKTYPE SEARCH +END + +STRING F_DAFSC 10 +BEGIN + PROMPT 50 7 "Da fase " + FLAGS "UZ" + USE FSC + INPUT CODTAB F_DAFSC + DISPLAY "Codice@20" CODTAB + DISPLAY "Descrizione@70" S0 + OUTPUT F_DAFSC CODTAB + CHECKTYPE SEARCH +END + +STRING F_ACDC 20 +BEGIN + PROMPT 2 8 "A CDC/Commessa " + FLAGS "UZ" + COPY USE F_DACDC + INPUT CODTAB F_ACDC + COPY DISPLAY F_DACDC + OUTPUT F_ACDC CODTAB + CHECKTYPE SEARCH +END + +STRING F_AFSC 10 +BEGIN + PROMPT 50 8 "A fase " + FLAGS "UZ" + COPY USE F_DAFSC + INPUT CODTAB F_AFSC + COPY DISPLAY F_DAFSC + OUTPUT F_AFSC CODTAB + CHECKTYPE SEARCH +END + +NUMBER F_GRUPPOINI 3 +BEGIN + PROMPT 2 10 "Da Gruppo - Conto - Sottoconto " +END + +NUMBER F_CONTOINI 3 +BEGIN + PROMPT 39 10 "" + USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="") + INPUT GRUPPO F_GRUPPOINI + INPUT CONTO F_CONTOINI + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Descrizione@50" DESCR + DISPLAY "Tipo" TMCF + OUTPUT F_GRUPPOINI GRUPPO + OUTPUT F_CONTOINI CONTO + CHECKTYPE NORMAL + WARNING "Conto inesistente o mancante" + VALIDATE REQIF_FUNC 1 F_SOTTOCINI +END + +NUMBER F_SOTTOCINI 6 +BEGIN + PROMPT 46 10 "" + USE LF_PCON SELECT SOTTOCONTO!="" + INPUT GRUPPO F_GRUPPOINI + INPUT CONTO F_CONTOINI + INPUT SOTTOCONTO F_SOTTOCINI + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + DISPLAY "Descrizione@50" DESCR + OUTPUT F_GRUPPOINI GRUPPO + OUTPUT F_CONTOINI CONTO + OUTPUT F_SOTTOCINI SOTTOCONTO + OUTPUT F_DESCRINI DESCR + CHECKTYPE NORMAL +END + +STRING F_DESCRINI 50 +BEGIN + PROMPT 2 11 "Descrizione " + USE LF_PCON KEY 2 + CHECKTYPE NORMAL + INPUT DESCR F_DESCRINI + DISPLAY "Descrizione@50" DESCR + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + COPY OUTPUT F_SOTTOCINI +END + +NUMBER F_GRUPPOFIN 3 +BEGIN + PROMPT 2 12 "A Gruppo - Conto - Sottoconto " +END + +NUMBER F_CONTOFIN 3 +BEGIN + PROMPT 39 12 "" + USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="") + INPUT GRUPPO F_GRUPPOFIN + INPUT CONTO F_CONTOFIN + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Descrizione@50" DESCR + DISPLAY "Tipo" TMCF + OUTPUT F_GRUPPOFIN GRUPPO + OUTPUT F_CONTOFIN CONTO + CHECKTYPE NORMAL + VALIDATE REQIF_FUNC 1 F_SOTTOCFIN + WARNING "Conto inesistente o mancante" +END + +NUMBER F_SOTTOCFIN 6 +BEGIN + PROMPT 46 12 "" + USE LF_PCON SELECT SOTTOCONTO!="" + INPUT GRUPPO F_GRUPPOFIN + INPUT CONTO F_CONTOFIN + INPUT SOTTOCONTO F_SOTTOCFIN + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + DISPLAY "Descrizione@50" DESCR + OUTPUT F_GRUPPOFIN GRUPPO + OUTPUT F_CONTOFIN CONTO + OUTPUT F_SOTTOCFIN SOTTOCONTO + OUTPUT F_DESCRFIN DESCR + CHECKTYPE NORMAL + WARNING "Sottoconto inesistente o mancante" +END + +STRING F_DESCRFIN 50 +BEGIN + PROMPT 2 13 "Descrizione " + USE LF_PCON KEY 2 + CHECKTYPE NORMAL + INPUT DESCR F_DESCRFIN + DISPLAY "Descrizione@50" DESCR + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + COPY OUTPUT F_SOTTOCFIN +END + +BOOLEAN F_SALTOPAGINA +BEGIN + PROMPT 2 15 "Salto pagina a fine commessa" +END + +ENDPAGE + +ENDMASK diff --git a/cm/cm0200.cpp b/cm/cm0200.cpp new file mode 100755 index 000000000..cb50ec531 --- /dev/null +++ b/cm/cm0200.cpp @@ -0,0 +1,436 @@ +#include +#include +#include +#include +#include +#include + +#include "cm0.h" + +#include "cm0200a.h" +#include "cm0200.h" + +#include "mov.h" +#include "rmov.h" +#include "pconti.h" + +class TForm_schedacdc : 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);} + TForm_schedacdc(); + virtual ~TForm_schedacdc(); +}; + +TForm_schedacdc::TForm_schedacdc() :TForm("cm0200a") //costruttore +{ +} + +TForm_schedacdc::~TForm_schedacdc() //distruttore +{ +} + +bool TForm_schedacdc::validate(TForm_item &cf, TToken_string &s) +{ + return TForm::validate(cf,s); //richiama la validate standard della classe genitore +} + +class TSchedacdc_mask : public TAutomask +{ + TRelation * _rel; + TCursor * _cur; + +protected: + bool on_field_event(TOperable_field& o, TField_event e, long jolly); +public: + + TSchedacdc_mask(); + + virtual ~TSchedacdc_mask(){}; +}; + +TSchedacdc_mask::TSchedacdc_mask() :TAutomask ("cm0200a") +{ +} + +bool TSchedacdc_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) +{ + switch (o.dlg()) + { + case F_DACDC: + case F_ACDC: + if (e == fe_modify) + { + const bool on = !(field(F_DACDC).empty() && field(F_ACDC).empty()); + if (!on) + { + reset(F_DAFSC); + reset(F_AFSC); + } + enable(F_DAFSC, on); + enable(F_AFSC, on); + } + break; + default: break; + } + return TRUE; +} + +struct TTotalis : public TObject +{ + TImporto _tot_periodo, _tot_generale; + void azzera(); + TTotalis& operator += (const TTotalis& t); +}; + +void TTotalis::azzera() +{ + _tot_periodo = 0; + _tot_generale = 0; +} + +TTotalis& TTotalis::operator += (const TTotalis& t) +{ + _tot_periodo += t._tot_periodo; + _tot_generale += t._tot_generale; + + return *this; //ritorna se stesso, quindi i valori dei totali +} + +class TSchedacdc : public TSkeleton_application +{ + TSchedacdc_mask * _mask; + TForm_schedacdc * _form; + int _codes; + TDate _dataini, _datafin; + TTotalis _t_gruppo, _t_fsc, _t_cms; + int _currgruppo, _currconto, _oldgruppo, _oldconto; + long _currsottoc, _oldsottoc; + TString _currcms, _currfsc, _oldcms, _oldfsc; + bool _saltopagina; + +protected: + virtual bool create(); + virtual bool destroy(); + virtual void main_loop(); + + void print_movimento(TSorted_cursor& cur); + void print_progprec(real importo); + void ctrl_commessa(); + void print_footer_gruppo(const int gruppo, const int conto, const long sottoconto); + void print_header_gruppo(const int gruppo, const int conto, const long sottoconto); + void print_footer_commessa(const TString& cms); + void print_header_commessa(const TString& cms); + void print_footer_fase(const TString& fsc); + void print_header_fase(const TString& fsc); + void set_intestazione(); + void print_body(); //stampa effettivamente il body + void set_field(int id, const real& val); //mette in un campo del body odd un valore numerico + void set_field(int id, const char* val); //mette in un campo del body odd una stringa + void print_specialsection(char s, pagetype pos); // stampa una sezione qualunque ( + void aggiorna_totali(const TImporto importo, const TDate data); + +public: + TSchedacdc() {} + +}; + +bool TSchedacdc::create() +{ + open_files(LF_RMOV, 0); + _mask = new TSchedacdc_mask; + _form = new TForm_schedacdc; + + return TSkeleton_application::create(); +} + +bool TSchedacdc::destroy() +{ + delete _mask; + delete _form; + return TSkeleton_application::destroy(); +} + +void TSchedacdc::print_progprec(real importo) +{ + _form->find_field('B', first_page, FR_PROGPREC).set(importo.string()); + print_specialsection('B', first_page); +} + +void TSchedacdc::print_movimento(TSorted_cursor& cur) +{ + set_field(FR_DATAREG, cur.curr().get(RMV_DATAREG)); + set_field(FR_NUMREG, cur.curr().get(RMV_NUMREG)); + set_field(FR_DESCRMOV, cur.curr(LF_MOV).get(MOV_DESCR)); + set_field(FR_CODCAUS, cur.curr(LF_MOV).get(MOV_CODCAUS)); + const char sezione = cur.curr().get_char(RMV_SEZIONE); + const real importo = cur.curr().get_real(RMV_IMPORTO); + set_field(FR_DARE, ""); + set_field(FR_AVERE, ""); + if (sezione == 'D') + set_field(FR_DARE, importo.string()); + else + set_field(FR_AVERE, importo.string()); + + print_body(); +} + +void TSchedacdc::print_footer_gruppo(const int gruppo, const int conto, const long sottoconto) +{ + TString16 key; + key.format("%d|%d|%ld", gruppo, conto, sottoconto); + TString tmp; + const TRectype& pcon = cache().get(LF_PCON, key); + tmp.format("TOTALE %d %d %ld %s", gruppo, conto, sottoconto, (const char*) pcon.get(PCN_DESCR)); + //set_field(FR_SOTTOC, ""); + //set_field(FR_D_SOTTOC, tmp); + //fill_body(_t_gruppo); + //print_body(); +} + +void TSchedacdc::print_header_gruppo(const int gruppo, const int conto, const long sottoconto) +{ + TString tmp; + TString16 key; + key.format("%d|%d|%ld", gruppo, conto, sottoconto); + const TRectype& pcon = cache().get(LF_PCON, key); + tmp.format("%d %d %ld", gruppo, conto, sottoconto); + _form->find_field('H', even_page, FR_GRUPPOCONTO).set(tmp); + _form->find_field('H', even_page, FR_D_GRUPPOCONTO).set(pcon.get(PCN_DESCR)); + print_specialsection('H', even_page); +} + +void TSchedacdc::print_footer_commessa(const TString& cms) +{ + TString tmp; + tmp.format("TOTALE COMMESSA %s", (const char*) cms); + //set_field(FR_D_SOTTOC, tmp); + //fill_body(_t_cms); + //print_body(); + if (_saltopagina) + printer().formfeed(); +} + +void TSchedacdc::print_footer_fase(const TString& fsc) +{ + TString tmp; + tmp.format("TOTALE FASE %s", (const char*) fsc); + //set_field(FR_D_SOTTOC, tmp); + //fill_body(_t_fsc); + //print_body(); + if (_saltopagina) + printer().formfeed(); +} + +void TSchedacdc::print_header_commessa(const TString& cms) +{ + _form->find_field('H', odd_page, FR_CMS).set(cms); + _form->find_field('H', odd_page, FR_D_CMS).set(cache().get("CMS", cms).get("S0")); + print_specialsection('H', odd_page); +} + +void TSchedacdc::print_header_fase(const TString& fsc) +{ + _form->find_field('H', last_page, FR_FSC).set(fsc); + _form->find_field('H', last_page, FR_D_FSC).set(cache().get("FSC", fsc).get("S0")); + print_specialsection('H', last_page); +} + +void TSchedacdc::set_intestazione() +{ +// scrive l'header first, contenente i dati della ditta e dell'esercizio e le selezioni di stampa + _form->find_field('H', first_page, FR_ESERCIZIO).set(_mask->get(F_ANNO)); + _form->find_field('H', first_page, FR_DATAINI).set(_mask->get(F_DATAINI)); + _form->find_field('H', first_page, FR_DATAFIN).set(_mask->get(F_DATAFIN)); + _form->find_field('H', first_page, FR_DACDC).set(_mask->get(F_DACDC)); + _form->find_field('H', first_page, FR_DAFSC).set(_mask->get(F_DAFSC)); + _form->find_field('H', first_page, FR_ACDC).set(_mask->get(F_ACDC)); + _form->find_field('H', first_page, FR_AFSC).set(_mask->get(F_AFSC)); + _form->set_testata(); +} + +void TSchedacdc::print_body() +{ + TPrint_section& body = _form->get_body(); + body.update(); + if (body.height() > printer().rows_left()) + printer().formfeed(); + for (word i = 0; i < body.height(); i++) // stampa le righe del body + printer().print(body.row(i)); +} + +void TSchedacdc::print_specialsection(char s, pagetype pos) +{ + TPrint_section& sec = _form->get_section(s, pos); + sec.update(); + if (sec.height() > printer().rows_left()) + printer().formfeed(); + for (word i = 0; i < sec.height(); i++) // stampa le righe del body + printer().print(sec.row(i)); +} + +void TSchedacdc::set_field(int id, const real& val) +{ + _form->find_field('B', odd_page, id).set(val.string()); +} + +void TSchedacdc::set_field(int id, const char* val) +{ + _form->find_field('B', odd_page, id).set(val); +} + +void TSchedacdc::ctrl_commessa() +{ + if (_oldcms != "@@") + print_footer_commessa(_oldcms); + _t_cms.azzera(); + print_header_commessa(_currcms); + _oldcms = _currcms; +} + +void TSchedacdc::main_loop() +{ + while (_mask->run() == K_ENTER) + { + _saltopagina = _mask->get_bool(F_SALTOPAGINA); // salto pagina a fine commessa + _codes = _mask->get_int(F_ANNO); // esercizio + _dataini = _mask->get_date(F_DATAINI); // data iniziale + _datafin = _mask->get_date(F_DATAFIN); // data finale + TString80 dacdc = _mask->get(F_DACDC); // cdc/commessa iniziale + TString80 dafsc = _mask->get(F_DAFSC); // fase iniziale + TString80 acdc = _mask->get(F_ACDC); // cdc/commessa finale + TString80 afsc = _mask->get(F_AFSC); // fase finale + // relazione su rmov + TRelation relrmov(LF_RMOV); + relrmov.add(LF_MOV, "NUMREG==NUMREG"); + // filtro + TString filtro = ""; + if (_codes != 0) + filtro.format("ANNOES==%d", _codes); + if (dacdc.not_empty()) + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(CODCMS>=\"" << dacdc << "\")"; + } + if (dafsc.not_empty()) + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(FASCMS>=\"" << dafsc << "\")"; + } + if (acdc.not_empty()) + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(CODCMS<=\"" << acdc << "\")"; + } + if (afsc.not_empty()) + + { + if (filtro.not_empty()) + filtro << " && "; + filtro << "(FASCMS<=\"" << afsc << "\")"; + } + if (filtro.empty()) + filtro.format("(CODCMS!=\"\")"); + else + if (dacdc.empty() && acdc.empty()) + filtro << " && " << "(CODCMS!=\"\")"; + TRectype darec(LF_RMOV), arec(LF_RMOV); + // servono per gruppo-conto-sottoconto + darec.zero(); + arec.zero(); + + darec.put(RMV_GRUPPO, _mask->get_int(F_GRUPPOINI)); + darec.put(RMV_CONTO, _mask->get_int(F_CONTOINI)); + darec.put(RMV_SOTTOCONTO, _mask->get_long(F_SOTTOCINI)); + arec.put(RMV_GRUPPO, _mask->get_int(F_GRUPPOFIN)); + arec.put(RMV_CONTO, _mask->get_int(F_CONTOFIN)); + arec.put(RMV_SOTTOCONTO, _mask->get_long(F_SOTTOCFIN)); + + // ordinamento per TSorted_cursor + TString ordin = "CODCMS|FASCMS|GRUPPO|CONTO|SOTTOCONTO|DATAREG|NUMREG|NUMRIG"; + TSorted_cursor sortcur (&relrmov, ordin, filtro, 2, &darec, &arec); + sortcur.setregion(darec,arec); + sortcur.setfilter(filtro,TRUE); + + long num = sortcur.items(); + sortcur.freeze(); + printer().open(); +// setta l'intestazione del form... + set_intestazione(); + TRectype currrec(LF_RMOV); + _oldcms = "@@"; + _oldfsc = "@@"; + _oldsottoc = -1; + _oldgruppo = -1; + _oldconto = -1; + _t_cms.azzera(); + _t_fsc.azzera(); + _t_gruppo.azzera(); + real tot_progprec = ZERO; + for (sortcur=0; sortcur.pos() 0) + { + print_footer_gruppo(_currgruppo, _currconto, _currsottoc); + print_footer_fase(_currfsc); + print_footer_commessa(_currcms); + printer().formfeed(); + } + printer().close(); + } +} + +int cm0200(int argc, char* argv[]) +{ + TSchedacdc a; + a.run(argc,argv,"Stampa scheda per CDC/Commessa"); + return 0; +} \ No newline at end of file diff --git a/cm/cm0200.h b/cm/cm0200.h new file mode 100755 index 000000000..71c56cbe1 --- /dev/null +++ b/cm/cm0200.h @@ -0,0 +1,25 @@ +// campi del form cm0100a.frm + +#define FR_ESERCIZIO 11 +#define FR_DATAINI 12 +#define FR_DATAFIN 13 +#define FR_DACDC 14 +#define FR_DAFSC 15 +#define FR_ACDC 16 +#define FR_AFSC 17 + +#define FR_CMS 21 +#define FR_D_CMS 22 +#define FR_FSC 23 +#define FR_D_FSC 24 +#define FR_GRUPPOCONTO 25 +#define FR_D_GRUPPOCONTO 26 +#define FR_PROGPREC 27 + + +#define FR_DATAREG 31 +#define FR_NUMREG 32 +#define FR_DESCRMOV 33 +#define FR_CODCAUS 34 +#define FR_DARE 35 +#define FR_AVERE 36 diff --git a/cm/cm0200a.frm b/cm/cm0200a.frm new file mode 100755 index 000000000..51518e849 --- /dev/null +++ b/cm/cm0200a.frm @@ -0,0 +1,226 @@ +#include "cm0200.h" +GENERAL +BEGIN + OFFSET 0 0 + FONT "Courier New" + SIZE 12 + GRID "" +END + +SECTION HEADER FIRST 7 + +STRINGA 1 40 1 +BEGIN + KEY "nome ditta" + PROMPT 1 1 "Ditta " + MESSAGE _DITTA, !RAGSOC +END + +STRINGA 2 10 +BEGIN + KEY "Data" + PROMPT 100 1 "Data " + MESSAGE _TODAY +END + +NUMERO 3 7 +BEGIN + KEY "Nr. pagina" + PROMPT 120 1 "Pagina " + MESSAGE _PAGENO +END + +STRINGA -1 22 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 2 "Conti per CDC/Commessa" +END + +NUMERO FR_ESERCIZIO 16 +BEGIN + KEY "Parametri stampa: codice esercizio" + PROMPT 1 3 "Esercizio: " +END + +DATA FR_DATAINI +BEGIN + KEY "Parametri stampa: data iniziale" + PROMPT 1 4 "Movimenti dal " +END + +DATA FR_DATAFIN +BEGIN + KEY "Parametri stampa: data finale" + PROMPT 40 4 "al " +END + +STRINGA FR_DACDC 20 +BEGIN + KEY "Parametri stampa: da commessa" + PROMPT 1 5 "Da CDC/commessa: " +END + +STRINGA FR_DAFSC 10 +BEGIN + KEY "Parametri stampa: da fase" + PROMPT 40 5 "Da fase: " +END + +STRINGA FR_ACDC 20 +BEGIN + KEY "Parametri stampa: a commessa" + PROMPT 1 6 "a CDC/commessa: " +END + +STRINGA FR_AFSC 10 +BEGIN + KEY "Parametri stampa: a fase" + PROMPT 40 6 "a fase: " +END + +END // section header first + +SECTION HEADER ODD 1 + +STRINGA FR_CMS 20 +BEGIN + KEY "Intestazione commessa" + PROMPT 1 1 "CDC/Commessa " +END + +STRINGA FR_D_CMS 50 +BEGIN + KEY "Intestazione commessa" + PROMPT 35 1 "" +END + +END // section header odd + +SECTION HEADER LAST 4 + +STRINGA FR_FSC 20 +BEGIN + KEY "Intestazione fase" + PROMPT 1 1 "Fase " +END + +STRINGA FR_D_FSC 50 +BEGIN + KEY "Intestazione fase" + PROMPT 35 1 "" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 2 "------------------------------------------------------------------------------------------------------------------------------------" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 3 "Gr./Co./Sot." +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 14 3 "Data reg." +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 25 3 "N. reg." +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 33 3 "Descrizione movimento" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 100 3 "Dare" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 115 3 "Avere" +END + +STRINGA -1 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 4 "------------------------------------------------------------------------------------------------------------------------------------" +END + +END // section header last + +SECTION HEADER EVEN 2 + +STRINGA FR_GRUPPOCONTO 12 +BEGIN + KEY "Intestazione stampa" + PROMPT 1 1 "" +END + +STRINGA FR_D_GRUPPOCONTO 50 +BEGIN + KEY "Intestazione stampa" + PROMPT 14 1 "" +END + +END // section header even + +SECTION BODY FIRST 1 + +NUMERO FR_PROGPREC 14 2 +BEGIN + KEY "Progressivo precedente" + PROMPT 14 1 "Prog. prec. " + PICTURE "###.###.###,##" +END + +END // section header last + +SECTION BODY ODD 1 + +DATA FR_DATAREG +BEGIN + PROMPT 14 1 "" +END + +NUMERO FR_NUMREG 7 +BEGIN + PROMPT 25 1 "" +END + +STRINGA FR_DESCRMOV 30 2 +BEGIN + PROMPT 33 1 "" +END + +STRINGA FR_CODCAUS 3 +BEGIN + PROMPT 71 1 "" +END + +NUMERO FR_DARE 14 2 +BEGIN + PROMPT 100 1 "" + PICTURE "###.###.###,##" +END + +NUMERO FR_AVERE 14 2 +BEGIN + PROMPT 115 1 "" + PICTURE "###.###.###,##" +END + +END // section body + +END // form diff --git a/cm/cm0200a.h b/cm/cm0200a.h new file mode 100755 index 000000000..569a099fe --- /dev/null +++ b/cm/cm0200a.h @@ -0,0 +1,20 @@ +// campi per la maschera cm0200a + +#define F_CODDITTA 101 +#define F_RAGSOC 102 +#define F_ANNO 103 +#define F_DATAINI 104 +#define F_DATAFIN 105 +#define F_DACDC 106 +#define F_ACDC 107 +#define F_DAFSC 108 +#define F_AFSC 109 +#define F_GRUPPOINI 110 +#define F_CONTOINI 111 +#define F_SOTTOCINI 112 +#define F_DESCRINI 113 +#define F_GRUPPOFIN 114 +#define F_CONTOFIN 115 +#define F_SOTTOCFIN 116 +#define F_DESCRFIN 117 +#define F_SALTOPAGINA 118 diff --git a/cm/cm0200a.uml b/cm/cm0200a.uml new file mode 100755 index 000000000..2567cca4f --- /dev/null +++ b/cm/cm0200a.uml @@ -0,0 +1,224 @@ +#include "cm0200a.h" + +TOOLBAR "" 0 -2 0 2 + +BUTTON DLG_PRINT 10 2 +BEGIN + PROMPT -12 -11 "~Stampa" + MESSAGE EXIT,K_ENTER +END + +BUTTON DLG_QUIT 10 2 +BEGIN + PROMPT -22 -11 "" +END + +ENDPAGE + +PAGE "Scheda CDC/Commessa" -1 -1 76 20 + +NUMBER F_CODDITTA 5 +BEGIN + PROMPT 2 1 "Ditta " + FLAGS "FRD" + USE LF_NDITTE KEY 1 + CHECKTYPE REQUIRED + INPUT CODDITTA F_CODDITTA + DISPLAY "Codice" CODDITTA + DISPLAY "Ragione sociale@50" RAGSOC + OUTPUT F_CODDITTA CODDITTA + OUTPUT F_RAGSOC RAGSOC +END + +STRING F_RAGSOC 50 +BEGIN + PROMPT 2 2 "Ragione sociale " + FLAGS "D" +END + +NUMBER F_ANNO 4 +BEGIN + PROMPT 2 4 "Codice esercizio " + HELP "Codice esercizio per cui si vuole la lista" + USE ESC + CHECKTYPE NORMAL + INPUT CODTAB F_ANNO + DISPLAY "Codice" CODTAB + DISPLAY "Data inizio esercizio" D0 + DISPLAY "Data fine esercizio" D1 + OUTPUT F_ANNO CODTAB + FLAGS "RZ" + ADD RUN cg0 -5 esc +END + +DATE F_DATAINI +BEGIN + PROMPT 2 5 "Dalla data " +END + +DATE F_DATAFIN +BEGIN + PROMPT 50 5 "alla data " +END + +STRING F_DACDC 20 +BEGIN + PROMPT 2 7 "Da CDC/Commessa " + FLAGS "UZ" + USE CMS + INPUT CODTAB F_DACDC + DISPLAY "Codice@20" CODTAB + DISPLAY "Descrizione@70" S0 + OUTPUT F_DACDC CODTAB + CHECKTYPE SEARCH +END + +STRING F_DAFSC 10 +BEGIN + PROMPT 50 7 "Da fase " + FLAGS "UZ" + USE FSC + INPUT CODTAB F_DAFSC + DISPLAY "Codice@20" CODTAB + DISPLAY "Descrizione@70" S0 + OUTPUT F_DAFSC CODTAB + CHECKTYPE SEARCH +END + +STRING F_ACDC 20 +BEGIN + PROMPT 2 8 "A CDC/Commessa " + FLAGS "UZ" + COPY USE F_DACDC + INPUT CODTAB F_ACDC + COPY DISPLAY F_DACDC + OUTPUT F_ACDC CODTAB + CHECKTYPE SEARCH +END + +STRING F_AFSC 10 +BEGIN + PROMPT 50 8 "A fase " + FLAGS "UZ" + COPY USE F_DAFSC + INPUT CODTAB F_AFSC + COPY DISPLAY F_DAFSC + OUTPUT F_AFSC CODTAB + CHECKTYPE SEARCH +END + +NUMBER F_GRUPPOINI 3 +BEGIN + PROMPT 2 10 "Da Gruppo - Conto - Sottoconto " +END + +NUMBER F_CONTOINI 3 +BEGIN + PROMPT 39 10 "" + USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="") + INPUT GRUPPO F_GRUPPOINI + INPUT CONTO F_CONTOINI + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Descrizione@50" DESCR + DISPLAY "Tipo" TMCF + OUTPUT F_GRUPPOINI GRUPPO + OUTPUT F_CONTOINI CONTO + CHECKTYPE NORMAL + WARNING "Conto inesistente o mancante" + VALIDATE REQIF_FUNC 1 F_SOTTOCINI +END + +NUMBER F_SOTTOCINI 6 +BEGIN + PROMPT 46 10 "" + USE LF_PCON SELECT SOTTOCONTO!="" + INPUT GRUPPO F_GRUPPOINI + INPUT CONTO F_CONTOINI + INPUT SOTTOCONTO F_SOTTOCINI + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + DISPLAY "Descrizione@50" DESCR + OUTPUT F_GRUPPOINI GRUPPO + OUTPUT F_CONTOINI CONTO + OUTPUT F_SOTTOCINI SOTTOCONTO + OUTPUT F_DESCRINI DESCR + CHECKTYPE NORMAL +END + +STRING F_DESCRINI 50 +BEGIN + PROMPT 2 11 "Descrizione " + USE LF_PCON KEY 2 + CHECKTYPE NORMAL + INPUT DESCR F_DESCRINI + DISPLAY "Descrizione@50" DESCR + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + COPY OUTPUT F_SOTTOCINI +END + +NUMBER F_GRUPPOFIN 3 +BEGIN + PROMPT 2 12 "A Gruppo - Conto - Sottoconto " +END + +NUMBER F_CONTOFIN 3 +BEGIN + PROMPT 39 12 "" + USE LF_PCON SELECT (CONTO!="")&&(SOTTOCONTO="") + INPUT GRUPPO F_GRUPPOFIN + INPUT CONTO F_CONTOFIN + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Descrizione@50" DESCR + DISPLAY "Tipo" TMCF + OUTPUT F_GRUPPOFIN GRUPPO + OUTPUT F_CONTOFIN CONTO + CHECKTYPE NORMAL + VALIDATE REQIF_FUNC 1 F_SOTTOCFIN + WARNING "Conto inesistente o mancante" +END + +NUMBER F_SOTTOCFIN 6 +BEGIN + PROMPT 46 12 "" + USE LF_PCON SELECT SOTTOCONTO!="" + INPUT GRUPPO F_GRUPPOFIN + INPUT CONTO F_CONTOFIN + INPUT SOTTOCONTO F_SOTTOCFIN + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + DISPLAY "Descrizione@50" DESCR + OUTPUT F_GRUPPOFIN GRUPPO + OUTPUT F_CONTOFIN CONTO + OUTPUT F_SOTTOCFIN SOTTOCONTO + OUTPUT F_DESCRFIN DESCR + CHECKTYPE NORMAL + WARNING "Sottoconto inesistente o mancante" +END + +STRING F_DESCRFIN 50 +BEGIN + PROMPT 2 13 "Descrizione " + USE LF_PCON KEY 2 + CHECKTYPE NORMAL + INPUT DESCR F_DESCRFIN + DISPLAY "Descrizione@50" DESCR + DISPLAY "Gruppo" GRUPPO + DISPLAY "Conto" CONTO + DISPLAY "Sottoconto" SOTTOCONTO + COPY OUTPUT F_SOTTOCFIN +END + +BOOLEAN F_SALTOPAGINA +BEGIN + PROMPT 2 15 "Salto pagina a fine commessa" +END + +ENDPAGE + +ENDMASK