From d741c541f92e23831956ad02596ef3f6bb76ac15 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@c028cbd2-c16b-5b4b-a496-9718f37d4682> Date: Mon, 27 Sep 2010 14:29:29 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'R_10_00'. git-svn-id: svn://10.65.10.50/branches/R_10_00@20914 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ha/ha0400.cpp | 194 +++++++++++++++++++++++++++++++++++++++++++++++ ha/ha0400a.h | 17 +++++ ha/ha0400a.uml | 155 ++++++++++++++++++++++++++++++++++++++ ha/halib.cpp | 42 +++++++++++ lv/lvinv.rep | 200 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 608 insertions(+) create mode 100755 ha/ha0400.cpp create mode 100755 ha/ha0400a.h create mode 100755 ha/ha0400a.uml create mode 100755 ha/halib.cpp create mode 100755 lv/lvinv.rep diff --git a/ha/ha0400.cpp b/ha/ha0400.cpp new file mode 100755 index 000000000..a5858e4e7 --- /dev/null +++ b/ha/ha0400.cpp @@ -0,0 +1,194 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "halib.h" +#include "ha0.h" +#include "ha0400a.h" + +/////////////////////////////////////////////////////////// +// TAutomask +/////////////////////////////////////////////////////////// +class THardy_tied_mask : public TAutomask +{ +protected: + virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); + + long fill_recordset(const long codcf, TISAM_recordset& recset); + void fill_sheet(); + +public: + THardy_tied_mask(); + ~THardy_tied_mask(); +}; + + +long THardy_tied_mask::fill_recordset(const long codcf, TISAM_recordset& recset) +{ + TString query; + const char tipo_contratto = get(F_TIPO)[0]; + + query << "USE RDOC"; + query << "\nSELECT (DOC.STATO=5)&&(TIPORIGA=#TIPORIGA)&&(STR(" << RCA_2_ANTICIPATO << "<=" << RCA_2_RESO_STORICO << "))"; + //in base al tipo contratto cambia la query + if (tipo_contratto == 'T') + query << "&&((DOC.TIPODOC=#A_TIPODOC)||(DOC.TIPODOC=#R_TIPODOC))"; + else + query << "&&(DOC.TIPODOC=#TIPODOC)"; + + if (codcf > 0) + query << "&&(DOC.TIPOCF='C')&&(DOC.CODCF=#CODCF)"; + + query << "\nJOIN DOC INTO PROVV=PROVV ANNO=ANNO CODNUM=CODNUM NDOC=NDOC"; + + //setta la query al recordset, che inizialmente aveva una query vuota + recset.set(query); + + //settaggio delle variabili + //tipo riga + const TString4 tiporiga = HARDY_TIPORIGA_SOMMA; + recset.set_var("#TIPORIGA", tiporiga); + //numerazione + TConfig config(CONFIG_DITTA, "ha"); + const TString4 tipo_a = config.get("CoAntTip"); + const TString4 tipo_r = config.get("CoRifaTip"); + switch (tipo_contratto) + { + case 'A': recset.set_var("#TIPODOC", tipo_a); break; + case 'R': recset.set_var("#TIPODOC", tipo_r); break; + case 'T': recset.set_var("#A_TIPODOC", tipo_a); recset.set_var("#R_TIPODOC", tipo_r); break; + default: break; + } + + //clifo + if (codcf > 0) + recset.set_var("#CODCF", codcf); + + //e alla fine della fiera... + const long items = recset.items(); + return items; +} + + + +void THardy_tied_mask::fill_sheet() +{ + + TSheet_field& sf_righe = sfield(F_RIGHE); + sf_righe.destroy(); + + //query per raccattare i contratti pareggiati; in base al filtro sul cliente cambia la query + TString query; + long recset_items; + TISAM_recordset recset(query); + const long codcf = get_long(F_CODCF); + + recset_items = fill_recordset(codcf, recset); + + //riempie le righe dello sheet + TProgind progind(recset_items, "Ricerca contratti in corso...", false, true); + //record corrente + //const TRectype& rec = recset.cursor()->curr(); ****cazzone**** + //per ogni riga del recordset va ad aggiornare lo sheet sulla maschera (aggiunge la riga) + for (bool ok = recset.move_first(); ok; ok = recset.move_next()) + { + progind.addstatus(1); + + TToken_string& row = sf_righe.row(-1); //riga sheet da riempire + + row.add(""); + const TString& codcf = recset.get("DOC.CODCF").as_string(); + row.add(codcf); + TToken_string key; + key.add("C"); + key.add(codcf); + const TString& ragsoc = cache().get(LF_CLIFO, key, CLI_RAGSOC); + row.add(ragsoc); + const int anno = recset.get(RDOC_ANNO).as_int(); + row.add(anno); + const long ndoc = recset.get(RDOC_NDOC).as_int(); + row.add(ndoc); + const TString& tipo = recset.get("DOC.TIPODOC").as_string(); + row.add(tipo); + real importo = recset.get(RCA_2_ANTICIPATO).as_real(); + const TString& str_importo = importo.string(); + row.add(str_importo); + const TString& codpag = recset.get("DOC.CODPAG").as_string(); + row.add(codpag); + const TString& codag = recset.get("DOC.CODAG").as_string(); + row.add(codag); + + sf_righe.check_row(sf_righe.items()-1, 3); + } + + //mostra e aggiorna lo sheet + sf_righe.show(); + sf_righe.force_update(); +} + +THardy_tied_mask::THardy_tied_mask() : TAutomask ("ha0400a") +{ +} + +THardy_tied_mask::~THardy_tied_mask() +{ +} + +bool THardy_tied_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) +{ + switch (o.dlg()) + { + case F_TIPO: + if (e == fe_modify) + { + //riempie lo sheet con i contratti pareggiati + const TString& tipo = get(F_TIPO); + if (tipo.full()) + fill_sheet(); + } + default: + break; + break; + } + return true; +} + +/////////////////////////////////////// +// TSkeleton_application +/////////////////////////////////////// +class THardy_tied : public TSkeleton_application +{ +protected: +public: + virtual void main_loop(); + virtual bool create(); +}; + +void THardy_tied::main_loop() +{ + THardy_tied_mask mask; + while (mask.run() == K_ENTER) + { + //elabora(mask); + } +} + +bool THardy_tied::create() +{ + return TSkeleton_application::create(); +} + +int ha0400 (int argc, char* argv[]) +{ + THardy_tied tiedapp; + tiedapp.run(argc, argv, TR("Elaborazione contratti premio pareggiati")); + return 0; +} \ No newline at end of file diff --git a/ha/ha0400a.h b/ha/ha0400a.h new file mode 100755 index 000000000..1ef1602db --- /dev/null +++ b/ha/ha0400a.h @@ -0,0 +1,17 @@ +#define F_TIPOCF 201 +#define F_CODCF 202 +#define F_RAGSOC 203 +#define F_TIPO 204 +#define F_RIGHE 205 + + +//maschera riga sheet +#define S_CHECK 101 +#define S_CODCF 102 +#define S_RAGSOC 103 +#define S_ANNO 104 +#define S_NDOC 105 +#define S_TIPO 106 +#define S_IMPORTO 107 +#define S_CONDPAG 108 +#define S_CODAG 109 diff --git a/ha/ha0400a.uml b/ha/ha0400a.uml new file mode 100755 index 000000000..3ae10a5bd --- /dev/null +++ b/ha/ha0400a.uml @@ -0,0 +1,155 @@ +#include "ha0400a.h" + +TOOLBAR "" 0 0 0 2 + +#include + +ENDPAGE + +PAGE "Contratti premio pareggiati" -1 -1 78 23 + +LIST F_TIPOCF 9 +BEGIN + PROMPT 130 101 "" + FIELD TIPOCF + IT "C|Cliente" + FLAGS "D" +END + +NUMBER F_CODCF 6 +BEGIN + PROMPT 1 1 "Cliente " + WARNING "Cliente assente" + HELP "Codice del cliente del documento" + FLAGS "R" + FIELD CODCF + USE LF_CLIFO KEY 1 + INPUT TIPOCF "C" + INPUT CODCF F_CODCF + DISPLAY "Codice" CODCF + DISPLAY "Ragione Sociale@50" RAGSOC + DISPLAY "Partita IVA@12" PAIV + DISPLAY "Sospeso" SOSPESO + OUTPUT F_CODCF CODCF + OUTPUT F_RAGSOC RAGSOC + CHECKTYPE NORMAL + ADD RUN cg0 -1 C +END + +STRING F_RAGSOC 50 +BEGIN + WARNING "Cliente assente" + HELP "Ragione sociale del cliente del documento" + PROMPT 20 1 "" + USE LF_CLIFO KEY 2 + INPUT TIPOCF "C" + INPUT RAGSOC F_RAGSOC + DISPLAY "Ragione Sociale@50" RAGSOC + DISPLAY "Partita IVA@12" PAIV + DISPLAY "Codice" CODCF + COPY OUTPUT F_CODCF + CHECKTYPE NORMAL + ADD RUN cg0 -1 C +END + +LIST F_TIPO 1 14 +BEGIN + PROMPT 1 2 "Tipo " + ITEM " |Selezionare" + ITEM "A|Anticipo" + ITEM "R|Rifatturazione" + ITEM "T|Tutti" +END + +SPREADSHEET F_RIGHE +BEGIN + PROMPT 1 4 "" + ITEM "@1" + ITEM "Cliente" + ITEM "Ragione sociale@40" + ITEM "Anno" + ITEM "N.Contr." + ITEM "Tipo" + ITEM "Importo@12" + ITEM "Cod.Pag." + ITEM "Agente" + FLAGS "H" +END + +ENDPAGE +ENDMASK + +///////////////////////////////////////// +//maschera di riga +TOOLBAR "topbar" 0 0 0 2 + +BUTTON DLG_OK 2 2 +BEGIN + PROMPT 1 1 "" +END + +BUTTON DLG_DELREC 2 2 +BEGIN + PROMPT 2 1 "" +END + +BUTTON DLG_CANCEL 2 2 +BEGIN + PROMPT 3 1 "" +END + +ENDPAGE + +PAGE "Riga" -1 -1 76 12 + +BOOLEAN S_CHECK +BEGIN + PROMPT 1 1 "Elabora " +END + +NUMBER S_CODCF 6 +BEGIN + PROMPT 1 2 "Cliente " +END + +STRING S_RAGSOC 50 +BEGIN + PROMPT 20 2 "" +END + +NUMBER S_ANNO 4 +BEGIN + PROMPT 1 3 "Anno " +END + +NUMBER S_NDOC 7 +BEGIN + PROMPT 1 4 "N. doc. " +END + +LIST S_TIPO 18 +BEGIN + PROMPT 1 5 "Tipo " + ITEM "A|Anticipo" + ITEM "R|Rifatturazione" +END + +CURRENCY S_IMPORTO +BEGIN + PROMPT 1 6 "Importo " + FLAGS "U" +END + +STRING S_CONDPAG 4 +BEGIN + PROMPT 1 7 "Pagam. " +END + +STRING S_CODAG 5 +BEGIN + PROMPT 1 8 "Agente " +END + +ENDPAGE +ENDMASK + diff --git a/ha/halib.cpp b/ha/halib.cpp new file mode 100755 index 000000000..fa5ffb995 --- /dev/null +++ b/ha/halib.cpp @@ -0,0 +1,42 @@ + +#include "halib.h" + +TString4 TContratto_premi::_tipo_ant; +TString4 TContratto_premi::_tipo_post; +TString4 TContratto_premi::_tipo_rifa; + +//metodi della TContratto_premi +char TContratto_premi::tipo_contratto() const +{ + //i tipi contratto vengono caricati solo al primo accesso, in modo da non dover rileggere tutte le volte.. + //..il file di configurazione + if (_tipo_ant.blank()) + { + TConfig config(CONFIG_DITTA, "ha"); + _tipo_ant = config.get("CoAntTip"); + _tipo_post = config.get("CoPostTip"); + _tipo_rifa = config.get("CoRifaTip"); + } + + //ritorna il tipo contratto come carattere; se non lo trova -> tipo 'P'osticipo perchè.. + //..è il tipo meno pericoloso (comunque non dovrebbe mai accadere in quanto il tipo è.. + //..obbligatorio sia in immissione contratto che in configurazione modulo) + const TString& tipo_doc = get(DOC_TIPODOC); + if (tipo_doc == _tipo_ant) + return 'A'; + else + { + if (tipo_doc == _tipo_rifa) + return 'R'; + } + return 'P'; +} + + +TContratto_premi::TContratto_premi(char provv, int anno, const char* codnum, long ndoc) + : TDocumento(provv, anno, codnum, ndoc) +{} + +TContratto_premi::TContratto_premi(const TRectype& rec_doc) + : TDocumento(rec_doc) +{} diff --git a/lv/lvinv.rep b/lv/lvinv.rep new file mode 100755 index 000000000..6eb7c9758 --- /dev/null +++ b/lv/lvinv.rep @@ -0,0 +1,200 @@ + + + inventario + +
+ + + MESSAGE _PAGENO + + + + 33.DATADOC + + + + 33.NDOC + + + + + 210@.S0 + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ !((34.TIPORIGA='08')) + + + 34.QTA + + + 34.CODMAG[1,3] + + + 34.CODMAG[4,5] + + + + 34.CODART + + + 47.DESCR + +
+
+ + + + +
+
+ + 207@.S0 + + + CODSPMEZZO + +
  • +
  • +
  • +
  • + + + + + + + + + + + + + + + + 206@.S0 + + + + + + 33.NOTE + + +
  • + USE 33 +JOIN 34 INTO CODNUM==CODNUM ANNO==ANNO PROVV==PROVV NDOC==NDOC +JOIN 168 INTO CODCF==CODCF CODCONT==CODCONT +JOIN 17 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF +JOIN 20 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF +JOIN 16 TO 33 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDSP +JOIN 16 TO 17 ALIAS 116 INTO TIPOCF==TIPOCF CODCF==CODCF CODIND==CODINDSP +JOIN 13 TO 16 INTO STATO=STATO COM=COM +JOIN 47 TO 34 INTO CODART==CODART +JOIN 122 TO 33 INTO CODAGE==CODAG +JOIN %POR TO 33 ALIAS 203 INTO CODTAB==CODPORTO +JOIN %VET TO 33 ALIAS 205 INTO CODTAB==CODVETT1 +JOIN %ABE TO 33 ALIAS 206 INTO CODTAB==ASPBENI1 +JOIN %CTR TO 33 ALIAS 207 INTO CODTAB==CAUSTRASP +JOIN %BAN TO 33 ALIAS 208 INTO CODTAB==CODABIA +JOIN %VAL TO 33 ALIAS 209 INTO CODTAB==CODVAL +JOIN %TIP TO 33 ALIAS 210 INTO CODTAB==TIPODOC +JOIN %MSP TO 33 ALIAS 211 INTO CODTAB==CODSPMEZZO +JOIN GCA TO 34 ALIAS 212 INTO CODTAB==3+CODART[7,12] +JOIN GCA TO 34 ALIAS 213 INTO CODTAB==5+CODART[17,18] + + \ No newline at end of file