diff --git a/ps/pe0001100.cpp b/ps/pe0001100.cpp index 5a6ba2763..9da63fede 100755 --- a/ps/pe0001100.cpp +++ b/ps/pe0001100.cpp @@ -18,19 +18,20 @@ #include #include -class TErogazioni_wincard : public TAS400_recordset +class TImporta_mov_recset : public TAS400_recordset { const TVariant& get_field(const TAS400_column_info& fi) const; public: - TErogazioni_wincard(const char* query = ""); - virtual ~TErogazioni_wincard() { } + TImporta_mov_recset(const char* query = ""); + virtual ~TImporta_mov_recset() { } }; - -TErogazioni_wincard::TErogazioni_wincard(const char* query) +TImporta_mov_recset::TImporta_mov_recset(const char* query) : TAS400_recordset(TString("AS400(269,0,0)\n") << query) { + + // questi sono i campi dell'applicazione originaria servono solo di esempio!!! create_field("Impianto", 0, 8); create_field("Cliente", 8, 3); create_field("Filler01", 11, 14); @@ -59,9 +60,66 @@ TErogazioni_wincard::TErogazioni_wincard(const char* query) create_field("Densità", 229, 15, _realfld); create_field("Fatt54b", 244, 15, _realfld); create_field("Data", 259, 8, _datefld); + + // questi sono i campi per Sicuri + create_field("AT01CM" 1 1 1 Record attivo/sospeso/annullato DIZSMAS - ATTI + create_field("DT01CM" P 2 6 5 8 0 Data stampa per G.Gen.le DIZSMAS - DATS + create_field("NR01CM" P 7 11 5 9 0 Numero azione di aggiornamento DIZSMAS - NRAZ + create_field("TPMVCM" A 12 12 1 Flag IVA I=IVA =no IVA DIZSMAS - TPMV + create_field("CDDTCM" A 13 14 2 Codice Ditta DIZSMAS - CDDT + create_field("AAPRCM" A 15 15 1 Anno Operazione DIZSMAS - AAPR + create_field("ANNPCM" S 16 19 4 4 0 Anno Reg.DA GESTIRE DIZSMAS - ANNP + create_field("TPGICM" A 20 20 1 Giornale IVA TB=GI DIZSMAS - TPGI + create_field("DTOPCM" P 21 25 5 8 0 Data operazione DIZSMAS - DATS + create_field("NONPCM" S 26 32 7 7 0 Nr. Operaz./Nr. Prot. DIZSMAS - NONP + create_field("NRRGCM" S 33 37 5 5 0 Numero Riga 2 DIZSMAS - NRR2 + create_field("NRGICM" P 38 41 4 7 0 Nr Riga Giornale DIZSMAS - NRGI + create_field("CONTCM" A 42 51 10 Gr. Conto Sottoconto DIZSMAS - CONT + create_field("DIVICM" A 52 52 1 Divisione TB=DI DIZSMAS - DIVI + create_field("NPARCM" S 53 59 7 7 0 Nr Partita DIZSMAS - NPAR + create_field("AAOPCM" S 60 63 4 4 0 Anno partita DIZSMAS - ANNO + create_field("DTRGCM" P 64 68 5 8 0 Data registrazione DIZSMAS - DATS + create_field("CAUSCM" A 69 70 2 Causale TB=CA DIZSMAS - CAUS + create_field("DSUPCM" A 71 95 25 Descrizione Supplementare DIZSMAS - DSUP + create_field("IMPOCM" P 96 102 7 13 2 Importo "-"=Avere DIZSMAS - IMPO + create_field("CDVACM" A 103 104 2 Codice Valuta TB=VA DIZSMAS - CDVA + create_field("CAMBCM" P 105 111 7 13 6 Cambio DIZSMAS - CAMB + create_field("IMVACM" P 112 118 7 13 2 Importo Valuta DIZSMAS - IMVA + create_field("CDPGCM" A 119 121 3 Codice di Pagamento TB=CP DIZSMAS - CDPG + create_field("DT1SCM" P 122 126 5 8 0 Data I^ scadenza DIZSMAS - DATS + create_field("DTDOCM" P 127 131 5 8 0 Data documento DIZSMAS - DATS + create_field("NRDOCM" P 132 135 4 7 0 N° Documento DIZSMAS - NUDO + create_field("CCTPCM" A 136 138 3 Centri Costo Tipico TB=CC DIZSMAS - CCTP + create_field("NCOMCM" A 139 143 5 Numero Commessa DIZSMAS - NCOM + create_field("CDSCCM" A 144 158 15 Codice Sottocommessa DIZSMAS - CDSC + create_field("INDECM" P 159 160 2 3 0 Indetraibilità % DIZSMAS - INDE + create_field("CDIVCM" A 161 162 2 Codice IVA DIZSMAS - CDIV + create_field("IMPSCM" P 163 169 7 13 2 Imposta DIZSMAS - IMPS + create_field("CDAGCM" A 170 172 3 Codice Agente DIZSMAS - CDAG + create_field("DTVBCM" P 173 177 5 8 0 Data Liquidazione Iva Sospesa DIZSMAS - DATS + create_field("FLSBCM" A 178 178 1 Flag *=Stampato Bollato DIZSMAS - FLSB + create_field("FSBICM" A 179 179 1 Flag *=Stampato Boll.IVA DIZSMAS - FSBI + create_field("FLVZCM" A 180 180 1 V=Var.S=Storno P=Liq.prec. E=Esig.Sosp. DIZSMAS - FLVZ + create_field("FLIICM" A 181 181 1 Flag IVA Irrecup. " "=I irr. DIZSMAS - FLII + create_field("FLTSCM" A 182 182 1 Flag Tipo Sollecito DIZSMAS - FLTS + create_field("FLEPCM" A 183 183 1 *=Est.EP Non è più usato DIZSMAS - FLEP + create_field("DPERCM" A 184 193 10 Dati Personalizzabili DIZSMAS - DPER + create_field("CONSCM" A 194 203 10 Gr.Co.Sottoc.Sostitutivo DIZSMAS - CONS + create_field("DTSTCM" S 204 210 7 7 0 Nr.progr. rateo/risconto - + create_field("USERCM" A 211 220 10 Utente DIZSMAS - NOMU + create_field("DTUMCM" P 221 225 5 8 0 Data ultima manutenzione DIZSMAS - DATS + create_field("TPUMCM" A 226 226 1 Tipo ultima manutenzione DIZSMAS - FLAG + create_field("FL01CM" A 227 227 1 Flag Generico DIZSMAS - FLAG + create_field("FL02CM" A 228 228 1 Flag Generico DIZSMAS - FLAG + create_field("FL03CM" A 229 229 1 Flag Generico DIZSMAS - FLAG + create_field("FL04CM" A 230 230 1 Flag Generico DIZSMAS - FLAG + create_field("FL05CM" A 231 231 1 Flag Generico DIZSMAS - FLAG + create_field("CMBECM" P 232 238 7 13 6 Cambio EURO DIZSMAS - CAME + create_field("IMVACM2" P 239 245 7 13 2 Importo Val 2 DIZSMAS - IMPO + create_field("IMPSCM2" P 246 252 7 13 2 Imposta 2 DIZSMAS - IMPS } -const TVariant& TErogazioni_wincard::get_field(const TAS400_column_info& ci) const +const TVariant& TImporta_mov_recset::get_field(const TAS400_column_info& ci) const { if (ci._type == _datefld) { @@ -101,20 +159,20 @@ const TVariant& TErogazioni_wincard::get_field(const TAS400_column_info& ci) con // TAutomask /////////////////////////////////////////////////////////// -class TImportaFat_mask : public TAutomask +class TImporta_mov_mask : public TAutomask { protected: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); public: - TImportaFat_mask(); + TImporta_mov_mask(); }; -TImportaFat_mask::TImportaFat_mask() :TAutomask ("pe0001100a") +TImporta_mov_mask::TImporta_mov_mask() :TAutomask ("pe0001100a") { } -bool TImportaFat_mask::on_field_event(TOperable_field& f, TField_event e, long jolly) +bool TImporta_mov_mask::on_field_event(TOperable_field& f, TField_event e, long jolly) { switch (f.dlg()) { @@ -145,36 +203,16 @@ bool TImportaFat_mask::on_field_event(TOperable_field& f, TField_event e, long j return true; } - /////////////////////////////////////////////// - //// CLASSI DERIVATE PER IMPORTAZIONE DATI //// - /////////////////////////////////////////////// - -///////////////////////////////////////////////////////////// -// Recordset specifici per i dati da trasferire -///////////////////////////////////////////////////////////// - -//Piano dei conti -class TImporta_fatt_recordset : public TCSV_recordset -{ - public: - TImporta_fatt_recordset(const char * fileName); -}; - -TImporta_fatt_recordset::TImporta_fatt_recordset(const char * fileName) - : TCSV_recordset("CSV(\",\")") -{ - load_file(fileName); -} /////////////////////////////////////// // TSkeleton_application /////////////////////////////////////// -class TFattCSV : public TSkeleton_application +class TImporta_mov : public TSkeleton_application { virtual bool check_autorization() const {return false;} virtual const char * extra_modules() const {return "ve";} - TImportaFat_mask* _msk; + TImporta_mov_mask* _msk; TConfig* _configfile; @@ -187,14 +225,14 @@ public: virtual void main_loop(); bool transfer(const TFilename& file); - TFattCSV() {}; + TImporta_mov() {}; }; -bool TFattCSV::transfer(const TFilename& file) +bool TImporta_mov::transfer(const TFilename& file) { - TImporta_fatt_recordset s(file); + TImporta_mov_recset s(file); - TProgind pi(s.items(),"Importazione fatture in corso ...",true,true); + TProgind pi(s.items(),"Importazione movimenti in corso ...",true,true); _configfile->set_paragraph("Transaction"); //setto il paragrafo [Transaction] del file ini @@ -238,24 +276,24 @@ bool TFattCSV::transfer(const TFilename& file) const char* nomeini = "pe0001100fatt.ini"; -bool TFattCSV::create() +bool TImporta_mov::create() { xvt_fsys_removefile(nomeini); _configfile = new TConfig(nomeini); - _msk = new TImportaFat_mask(); + _msk = new TImporta_mov_mask(); return TSkeleton_application::create(); } -bool TFattCSV::destroy() +bool TImporta_mov::destroy() { delete _msk; delete _configfile; return TApplication::destroy(); } -void TFattCSV::main_loop() +void TImporta_mov::main_loop() { KEY tasto; tasto = _msk->run(); @@ -273,18 +311,18 @@ void TFattCSV::main_loop() TExternal_app primanota(app); primanota.run(); - message_box(TR("Importazione fatture completata")); + message_box(TR("Importazione movimenti completata")); } } } -TFattCSV& app() { return (TFattCSV&) main_app(); } +TImporta_mov& app() { return (TImporta_mov&) main_app(); } int pe0001100 (int argc, char* argv[]) { - TFattCSV main_app; - main_app.run(argc, argv, TR("Importazione Fatture")); + TImporta_mov main_app; + main_app.run(argc, argv, TR("Importazione movimenti di contab.")); return true; } \ No newline at end of file