From a8c4b15523f6352db23811fa53a5e0d9da4da98e Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 27 Aug 2008 13:08:36 +0000 Subject: [PATCH] Patch level : 10.0 109 Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 1208 git-svn-id: svn://10.65.10.50/trunk@17110 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ps/pd0300.cpp | 15 ++ ps/pd0300.h | 6 + ps/pd0300100.cpp | 435 ++++++++++++++++++++++++++++++++++++++++++++++ ps/pd0300100a.h | 12 ++ ps/pd0300100a.uml | 145 ++++++++++++++++ ps/pg0001200.cpp | 23 +-- ps/pg0214.cpp | 2 +- ps/pg0214100.cpp | 104 +++++++---- ps/pg0214100a.rep | 96 ++++++---- ps/pg0214100a.uml | 11 +- ps/ps0430200a.h | 2 + ps/ps0430200a.uml | 23 +++ ps/ps0920300.cpp | 126 +++++++++++--- ps/pt0003.cpp | 16 ++ ps/pt0003.h | 1 + ps/pt0003100.cpp | 266 ++++++++++++++++++++++++++++ ps/pt0003100a.h | 14 ++ ps/pt0003100a.uml | 162 +++++++++++++++++ tc/tc0701.cpp | 15 +- tp/tp0900.cpp | 2 + tp/tp0900ac.rep | 33 ++-- tp/tp0900al.rep | 33 ++-- tp/tp0900ca.rep | 33 ++-- tp/tp0900le.rep | 27 +-- tp/tp0900pl.rep | 45 ++--- tp/tp0900ve.rep | 24 +-- 26 files changed, 1425 insertions(+), 246 deletions(-) create mode 100755 ps/pd0300.cpp create mode 100755 ps/pd0300.h create mode 100755 ps/pd0300100.cpp create mode 100755 ps/pd0300100a.h create mode 100755 ps/pd0300100a.uml create mode 100755 ps/pt0003.cpp create mode 100755 ps/pt0003.h create mode 100755 ps/pt0003100.cpp create mode 100755 ps/pt0003100a.h create mode 100755 ps/pt0003100a.uml diff --git a/ps/pd0300.cpp b/ps/pd0300.cpp new file mode 100755 index 000000000..fa623bd8d --- /dev/null +++ b/ps/pd0300.cpp @@ -0,0 +1,15 @@ +#include + +#include "pd0300.h" + +int main(int argc, char** argv) +{ + int n = argc > 1 ? (argv[1][1]-'0') : 0; + switch(n) + { + case 0 : pd0300100(argc, argv); + default: break; + } + exit(0); + return 0; +} diff --git a/ps/pd0300.h b/ps/pd0300.h new file mode 100755 index 000000000..7aa3e938f --- /dev/null +++ b/ps/pd0300.h @@ -0,0 +1,6 @@ +#ifndef __DB2_H +#define __DB2_H + +int pd0300100(int argc, char* argv[]); + +#endif diff --git a/ps/pd0300100.cpp b/ps/pd0300100.cpp new file mode 100755 index 000000000..6e57ae079 --- /dev/null +++ b/ps/pd0300100.cpp @@ -0,0 +1,435 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pd0300.h" +#include "../db/dblib.h" +#include "../mg/mglib.h" + +#include "pd0300100a.h" + +/////////////////////////////////////////////////////////// +// TValorizzazione_mask +/////////////////////////////////////////////////////////// + +class TValorizzazione_mask : public TAutomask +{ + TAssoc_array _valori; + TAssoc_array _risultati; + + TDistinta_tree _tree; + TString4 _annoes ; + TString8 _codmag; + TDate _data; + +protected: + virtual bool on_field_event(TOperable_field& f, TField_event e, long jolly); + +public: + real valore(const TCodice_articolo& dis, const char* liv = NULL); + void elabora(); + void salva(); + + TValorizzazione_mask(); + virtual ~TValorizzazione_mask() { } +}; + +real TValorizzazione_mask::valore(const TCodice_articolo& dis, const char* liv) +{ + real total; + + if (dis.not_empty()) + { + TString80 cod = dis; + bool explode = true; + + if (liv && *liv) + cod << ',' << liv; + + TString8 codmagdep; + add_magcode(codmagdep, get(F_CODMAG)); + add_depcode(codmagdep, get(F_CODDEP)); + _tree.set_global("_MAGDEP", codmagdep); + const char tipo = _tree.get_type(dis); + + if (explode &&_tree.set_root(dis)) + { + TArray boom; + TLocalisamfile rd(LF_RDIST); + real peso; + real val_mat; + real val_lav; + real prz_val; + + + rd.setkey(2); + // Esplosione ai materiali di base + // raggruppati alla unita' di misura di riferimento + _tree.explode(boom, false, RAGGR_EXP_BASE, 1); + for (int r = boom.last(); r >= 0; r--) + { + const TRiga_esplosione& esp = (const TRiga_esplosione&)boom[r]; + const TCodice_articolo & comp = esp.componente(); + const TCodice_articolo & dist = esp.distinta(); + + rd.put("CODCOMP", comp); + rd.put("CODDIST", dist); + + if (rd.read() == NOERR) + { + const TRectype & rec = rd.curr(); + const TString4 tipo = rec.get("TIPO"); + if (tipo == "A") + { + TArticolo compd(comp); + const TString8 um(rec.get("UM")); + real qta = rec.get_real("EXPR"); + real calo(compd.get(ANAMAG_USER1)); + + if (calo == ZERO) calo = UNO; + + const real prezzo = compd.get_real(ANAMAG_ULTCOS1) * calo; + val_mat += prezzo * qta; + if (um.starts_with("GR")) + peso += qta; + } + else + if (tipo == "L") + { + TLavorazione lav(comp); + const TString8 um(lav.um()); + + if (um.starts_with("GR")) + prz_val += lav.prezzo(); + else + { + real qta = rec.get_real("EXPR"); + + val_lav += lav.prezzo() * qta; + + } + } + } + } + total = val_mat + (val_lav + prz_val * peso) * (CENTO - get_real(F_SCONTO))/CENTO; + if (!total.is_zero()) + _risultati.add(cod, total); + } + } + + return total; +} + +void TValorizzazione_mask::elabora() +{ + TRectype rec_from(LF_DIST), rec_to(LF_DIST); + rec_from.put("CODDIST", get(F_DIST_FROM)); + rec_to.put ("CODDIST", get(F_DIST_TO)); + + _annoes = get(F_ANNOES); + _data = get_date(F_DATA); + + + TRelation rel(LF_DIST); + TCursor cur(&rel); + cur.setregion(rec_from, rec_to, 0x2); + + const long items = cur.items(); + TProgind pi(items, TR("Valorizzazione in corso..."), TRUE, TRUE); + + TBrowsefile_field& bf = (TBrowsefile_field&)field(F_PREVIEW); + TViswin& vw = bf.vis_win(); + + vw.destroy_lines(); + _valori.destroy(); + _risultati.destroy(); + + TString line, num; + const int dest = get_int(F_VALORIZZA); + +// 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + line = FR("@b Valorizzazione al "); + line << TR("Ultimo Costo"); + line << TR(" - ricalcola "); + switch (dest) + { + case 1: line << TR("l' Ultimo Costo"); break; + case 2: line << TR("il Prezzo di Listino"); break; + default: line << TR("il Costo Standard"); break; + } + line << " " << get(F_DATA); + bf.add_line(line); + line = FR("@bCodice distinta Descrizione Attuale Precedente"); + bf.add_line(line); + + TString80 descr; + + cur.freeze(TRUE); + for (cur = 0; cur.pos() < items; ++cur) + { + pi.addstatus(1); + if (pi.iscancelled()) + break; + + const TCodice_articolo art = cur.curr().get("CODDIST"); + const char tipo = _tree.get_type(art); + if (tipo != 'A') + continue; + + const TPrice value(valore(art)); + line.cut(0) << "$[r,w]" << art << "$[n,w]"; + + line.left_just(33); + + TArticolo_giacenza articolo(art); + + descr = articolo.get(ANAMAG_DESCR); + descr.left_just(50); + line << descr; + + if (dest == 2) + { + const real perc = articolo.get_real(ANAMAG_PERCRIC); + const TPrice pric(value.get_num() * (100.0 + perc) / 100.0); + num = pric.string(TRUE); + } + else + num = value.string(TRUE); + num.right_just(16); + line << num; + + TPrice total; + + switch (dest) + { + case 1: total = articolo.ultimo_costo(_annoes); break; + case 2: total = articolo.prezzo_listino(_annoes, "", ""); break; + default: total = articolo.costo_standard(_annoes); break; + } + num = total.string(TRUE); + num.right_just(16); + line << num; + + bf.add_line(line); + } + enable(DLG_SAVEREC); + vw.goto_top(); +} + +void TValorizzazione_mask::salva() +{ + const TDate oggi = get_date(F_DATA); + const int dest = get_int(F_VALORIZZA); + + TProgind pi(_risultati.items(), TR("Registrazione in corso..."), TRUE, TRUE); + + TLocalisamfile dis(LF_DIST); + TTable lav("LAV"); + + FOR_EACH_ASSOC_OBJECT(_risultati, obj, key, item) + { + pi.addstatus(1); + if (pi.iscancelled()) + break; + + const real& val = (const real&)*item; + if (!val.is_zero()) + { + const TPrice prezzo(val); + const real& price = prezzo.get_num(); // val arrotondato ai decimali dei prezzi + switch(_tree.get_type(key)) + { + case 'A': + { + TArticolo_giacenza art(key); + switch (dest) + { + case 1: + art.put_ultimo_costo(price, oggi); + break; + case 2: + { + const real perc = art.get_real(ANAMAG_PERCRIC); + const TPrice pric(price * (100.0 + perc) / 100.0); + + art.set_prezzo_vendita(pric.get_num()); + } + break; + default: + art.put_costo_standard(price); + break; + } + art.rewrite(); + } + break; + case 'L': + lav.put("CODTAB", key); + if (lav.read(_isequal, _lock) == NOERR) + { + lav.put("R10", price); // Was R0 + lav.rewrite(); + } + break; + case 'G': + case 'V': + dis.put("CODDIST", key); + if (dis.read(_isequal, _lock) == NOERR) + { + dis.put("PREZZO", price); + dis.rewrite(); + } + break; + default :break; + } + } + } + + _valori.destroy(); + _risultati.destroy(); + disable(DLG_SAVEREC); +} + +bool TValorizzazione_mask::on_field_event(TOperable_field& f, TField_event e, long jolly) +{ + switch (f.dlg()) + { + case DLG_ELABORA: + if (e == fe_button) + { + elabora(); + enable(-4); + } + break; + case DLG_SAVEREC: + if (e == fe_button) + salva(); + break; + case DLG_PRINT: + if (e == fe_button) + { + TBrowsefile_field& b = (TBrowsefile_field&)field(F_PREVIEW); + TViswin& w = b.vis_win(); + TTextfile& f = w.text(); + const long rows = f.lines(); + if (rows > 2) + { + TPrinter& p = printer(); + TPrintrow row; + + TString line = f.line_formatted(0); // Legge la prima riga dal line + row.put(line); + p.setheaderline(0, row); // La imposta come testata + line = f.line_formatted(1); // Legge la prima riga dal line + row.reset(); + row.put(line); + p.setheaderline(1, row); // La imposta come testata + + p.headerlen(3); // Imposta altezza testata + + const TPrtype old_prtype = p.printtype(); + p.set_printtype(winprinter); // Forza la stampa su carta + p.open(); + for (long l = 2; l < rows; l++) + { + line = f.line_formatted(l); + row.reset(); + row.put(line, 0); + p.print(row); + } + p.close(); + p.set_printtype(old_prtype); + } + } + break; + case DLG_QUIT: + if (e == fe_button) + { + if (_risultati.items() > 0) + return yesno_box(TR("I risultati dell'ultima elaborazione\n" + "non sono stati registrati:\n" + "Si desidera uscire ugualmente?")); + } + break; + default: + break; + } + return TRUE; +} + +static const char* link_handler(TMask&, int id, const char* str, bool) +{ + const char* app = NULL; + switch(id) + { + case 0: app = "ve2 -3"; break; + case 1: app = "ba3 -0 LAV"; break; + case 2: app = "db0 -4"; break; + default: break; + } + + if (app) + { + TString ss = "1|"; ss << str; + TMessage fs(app, MSG_LN, ss); + fs.send(); + + TExternal_app prg(app); + prg.run(); + } + return ""; +} + +TValorizzazione_mask::TValorizzazione_mask() + : TAutomask("pd0300100a") +{ + TBrowsefile_field& bf = (TBrowsefile_field&)field(F_PREVIEW); + bf.enable_link("Articolo ", 'r'); + bf.enable_link("Lavorazione ", 'v'); + bf.enable_link("Distinta ", 'b'); + bf.set_link_handler(link_handler); + + disable(DLG_SAVEREC); +} + + +/////////////////////////////////////////////////////////// +// TValorizzazione +/////////////////////////////////////////////////////////// + +class TValorizzazione : public TSkeleton_application +{ +protected: + virtual bool create(); + virtual const char * extra_modules() const {return "ba";} + +public: + virtual void main_loop(); +}; + +bool TValorizzazione::create() +{ + open_files(LF_MAG,LF_STOMAG,0); + return TSkeleton_application::create(); +} + +void TValorizzazione::main_loop() +{ + TValorizzazione_mask m; + + m.run(); +} + +int pd0300100(int argc, char* argv[]) +{ + TValorizzazione app; + app.run(argc, argv, TR("Valorizzazione Dassi")); + return 0; +} + diff --git a/ps/pd0300100a.h b/ps/pd0300100a.h new file mode 100755 index 000000000..b455514a5 --- /dev/null +++ b/ps/pd0300100a.h @@ -0,0 +1,12 @@ +#define F_DIST_FROM 101 +#define F_DIST_TO 102 + +#define F_ANNOES 104 +#define F_VALORIZZA 105 +#define F_DATA 106 +#define F_CODMAG 107 +#define F_CODDEP 108 +#define F_SCONTO 109 + +#define F_PREVIEW 111 +#define F_DETTAGLIATA 112 diff --git a/ps/pd0300100a.uml b/ps/pd0300100a.uml new file mode 100755 index 000000000..95f3e352b --- /dev/null +++ b/ps/pd0300100a.uml @@ -0,0 +1,145 @@ +#include "pd0300100a.h" + +TOOLBAR "" 0 -2 0 2 + +BUTTON DLG_ELABORA 10 2 +BEGIN + PROMPT -14 -11 "~Elabora" + PICTURE BMP_ELABORA +END + +BUTTON DLG_SAVEREC 10 2 +BEGIN + PROMPT -24 -11 "~Registra" + PICTURE BMP_SAVEREC + PICTURE BMP_SAVERECDN +END + +BUTTON DLG_PRINT 10 2 +BEGIN + PROMPT -34 -11 "" + FLAGS "D" + GROUP 4 +END + +BUTTON DLG_QUIT 10 2 +BEGIN + PROMPT -44 -11 "~Fine" + MESSAGE EXIT,K_ENTER + PICTURE BMP_QUIT + PICTURE BMP_QUITDN +END + +ENDPAGE + +PAGE "Valorizzazione" 0 0 80 19 + +GROUPBOX DLG_NULL 74 4 +BEGIN + PROMPT 1 1 "@bSelezione" +END + +STRING F_DIST_FROM 20 +BEGIN + PROMPT 2 2 "Da codice " + FLAGS "U" + USE LF_DIST + JOIN LF_ANAMAG INTO CODART==CODDIST + INPUT CODDIST F_DIST_FROM + DISPLAY "Codice@20" CODDIST + DISPLAY "Descrizione@50" LF_ANAMAG->DESCR + OUTPUT F_DIST_FROM CODDIST + CHECKTYPE SEARCH + ADD RUN DB0 -4 +END + +STRING F_DIST_TO 20 +BEGIN + PROMPT 2 3 "A codice " + FLAGS "U" + USE LF_DIST + JOIN LF_ANAMAG INTO CODART==CODDIST + INPUT CODDIST F_DIST_TO + DISPLAY "Codice@20" CODDIST + DISPLAY "Descrizione@50" LF_ANAMAG->DESCR + OUTPUT F_DIST_TO CODDIST + CHECKTYPE SEARCH + ADD RUN DB0 -4 +END + +STRING F_CODMAG 3 +BEGIN + FLAGS "U" + PROMPT 38 2 "Magazzino " + USE MAG SELECT CODTAB[4,5]="" + INPUT CODTAB F_CODMAG + DISPLAY "Magazzino" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_CODMAG CODTAB + CHECKTYPE NORMAL +END + +STRING F_CODDEP 2 +BEGIN + FLAGS "U" + PROMPT 38 3 "Deposito " + USE MAG + INPUT CODTAB[1,3] F_CODMAG + INPUT CODTAB[4,5] F_CODDEP + DISPLAY "Magazzino" CODTAB[1,3] + DISPLAY "Deposito" CODTAB[4,5] + DISPLAY "Descrizione@50" S0 + OUTPUT F_CODMAG CODTAB[1,3] + OUTPUT F_CODDEP CODTAB[4,5] + CHECKTYPE NORMAL +END + +GROUPBOX DLG_NULL 34 4 +BEGIN + PROMPT 1 5 "@bParametri in ingresso" +END + +NUMBER F_ANNOES 4 +BEGIN + PROMPT 2 6 "Anno esercizio " + FLAGS "ZA" + USE ESC + INPUT CODTAB F_ANNOES + DISPLAY "Codice esercizio" CODTAB + DISPLAY "Inizio esercizio" D0 + DISPLAY "Fine esercizio" D1 + OUTPUT F_ANNOES CODTAB + CHECKTYPE NORMAL +END + +NUMBER F_SCONTO 6 3 +BEGIN + PROMPT 2 7 "Sconto " + WARNING "Indicare lo sconto " +END + +GROUPBOX DLG_NULL 34 4 +BEGIN + PROMPT 41 5 "@bParametri in uscita" +END + +LIST F_VALORIZZA 1 16 +BEGIN + PROMPT 42 6 "Valorizza " + ITEM "0|Costo standard" + ITEM "1|Ultimo costo" + ITEM "2|Prezzo vendita" +END + +DATE F_DATA +BEGIN + PROMPT 42 7 "Data elaborazione " + FLAGS "A" +END + +BROWSEFILE F_PREVIEW 0 -1 +BEGIN + PROMPT 0 8 "" +END + +ENDMASK diff --git a/ps/pg0001200.cpp b/ps/pg0001200.cpp index 022008bae..ec9ad4180 100755 --- a/ps/pg0001200.cpp +++ b/ps/pg0001200.cpp @@ -470,17 +470,17 @@ TIVA_recset::TIVA_recset(TMov_recset & mov) add_field(RMI_NUMREG, 1, n, 7); add_field(RMI_NUMRIG, 8, n, 3); - add_field(RMI_CODIVA, 11, n, 3); - add_field(RMI_IMPONIBILE, 14, n, 15); // 18 - add_field(RMI_IMPOSTA, 29, n, 15); // 18 - add_field(RMI_TIPODET, 44, n, 1); - add_field(RMI_TIPOCR, 45, n, 1); - add_field(RMI_INTRA, 46, a, 1); - add_field(RMI_TIPOATT, 47, n, 1); - add_field(RMI_TIPOC, 48, a, 1); - add_field(RMI_GRUPPO, 49, n, 3); - add_field(RMI_CONTO, 52, n, 3); // 18 - add_field(RMI_SOTTOCONTO, 55, n, 6); + add_field(RMI_CODIVA, 11, n, 4); + add_field(RMI_IMPONIBILE, 15, n, 15); // 18 + add_field(RMI_IMPOSTA, 30, n, 15); // 18 + add_field(RMI_TIPODET, 45, n, 1); + add_field(RMI_TIPOCR, 46, n, 1); + add_field(RMI_INTRA, 47, a, 1); + add_field(RMI_TIPOATT, 48, n, 1); + add_field(RMI_TIPOC, 49, a, 1); + add_field(RMI_GRUPPO, 50, n, 3); + add_field(RMI_CONTO, 53, n, 3); // 18 + add_field(RMI_SOTTOCONTO, 56, n, 6); TString4 fgr, fco, fso; for (bool ok = mov.move_first(); ok; ok = mov.move_next()) @@ -493,6 +493,7 @@ TIVA_recset::TIVA_recset(TMov_recset & mov) int ccaus = mov.get(MOV_CODCAUS).as_int(); const bool indetraibile = mov.indetraibile(); + civa += ccaus * 100; if (civa == 0) civa = 310; else diff --git a/ps/pg0214.cpp b/ps/pg0214.cpp index 6828a6030..0362bf057 100755 --- a/ps/pg0214.cpp +++ b/ps/pg0214.cpp @@ -14,4 +14,4 @@ int main(int argc, char** argv) } exit(0); return 0; -} \ No newline at end of file +} diff --git a/ps/pg0214100.cpp b/ps/pg0214100.cpp index 1e498ee08..c0c4b14a1 100755 --- a/ps/pg0214100.cpp +++ b/ps/pg0214100.cpp @@ -2,10 +2,8 @@ #include #include -#include #include #include -#include #include #include #include @@ -67,15 +65,42 @@ public: class TCertificazioni_csv_recordset : public TCSV_recordset { protected: + virtual const TVariant& get(const char* name) const; + public: TCertificazioni_csv_recordset(); }; -TCertificazioni_csv_recordset::TCertificazioni_csv_recordset() -: TCSV_recordset("CSV(,)\n") +const TVariant& TCertificazioni_csv_recordset::get(const char* name) const { + if (*name != '#') + { + const TFixed_string fname(name); + const int dot = fname.find('.'); + if (dot > 0) + { + const int logicnum = table2logic(fname.left(dot)); + TString8 c; + switch (logicnum) + { + case LF_CLIFO : c << "F|" << TCSV_recordset::get(0L).as_int(); break; + case LF_COMUNI: c << " |" << get("CLIFO.COMCF"); break; + default: break; + } + if (c.full()) + { + const TString& fld = fname.mid(dot+1); + return get_tmp_var() = cache().get(logicnum, c, fld); + } + } + } + return TRecordset::get(name); } +TCertificazioni_csv_recordset::TCertificazioni_csv_recordset() + : TCSV_recordset("CSV(,)\n") +{ } + /////////////////////////////////////////////////////////// // APPLICAZIONE @@ -89,7 +114,8 @@ class TCertificazioni : public TSkeleton_application protected: void elabora(const TMask& mask) const; - void scrivi_csv(const TRectype& prima_riga, TCertificazioni_csv_recordset& csv, const int gruppo, const int conto, const long sottoconto) const; + void scrivi_csv(const TRectype& prima_riga, + TCertificazioni_csv_recordset& csv) const; public: virtual bool create(); @@ -98,9 +124,12 @@ public: }; // scorre le righe di movimento e fa i calcoli per stampare la riga di report -void TCertificazioni::scrivi_csv(const TRectype& prima_riga, TCertificazioni_csv_recordset& csv, const int gruppo, const int conto, const long sottoconto) const +// scorre le righe di movimento e fa i calcoli per stampare la riga di report +void TCertificazioni::scrivi_csv(const TRectype& prima_riga, + TCertificazioni_csv_recordset& csv) const { - long numreg = prima_riga.get_long(RMV_NUMREG); + const long numreg = prima_riga.get_long(RMV_NUMREG); + const TBill rit_gcs(prima_riga); TMovimentoPN movpn; movpn.lfile().setkey(1); @@ -108,31 +137,47 @@ void TCertificazioni::scrivi_csv(const TRectype& prima_riga, TCertificazioni_csv mov.put(MOV_NUMREG, numreg); if (movpn.read() == NOERR) { - csv.new_rec(""); - real importo = ZERO; - for (int i=0; i 0) + { + csv.new_rec(""); + + csv.set(0, TVariant(fornitore)); + const TString& causale = cache().get(LF_CAUSALI, mov.get(MOV_CODCAUS), CAU_DESCR); + csv.set(1, TVariant(causale)); + csv.set(2, TVariant(lordo)); // compenso lordo + csv.set(3, TVariant(ZERO)); // somme non soggette + csv.set(4, TVariant(ZERO)); // imponibile + csv.set(5, TVariant(ritenute)); // ritenute + csv.set(6, TVariant(netto)); // netto } - if (importo != ZERO) - csv.set(0, (TVariant)importo); // compenso lordo } } - //metodo di base per la ricerca delle righe movimento che soddisfano le condizioni void TCertificazioni::elabora(const TMask& mask) const { @@ -150,6 +195,8 @@ void TCertificazioni::elabora(const TMask& mask) const query << "USE RMOV KEY 2\n"; query << "SELECT (NUM(ANSI(23.DATACOMP))>=NUM(ANSI(#DADATA)))&&(NUM(ANSI(23.DATACOMP))<=NUM(ANSI(#ADATA)))\n"; query << "JOIN MOV INTO NUMREG==NUMREG\n"; + query << "JOIN CLIFO TO MOV INTO TIPOCF==TIPO CODCF==CODCF\n"; + query << "JOIN COMUNI TO CLIFO INTO STATO==STATOCF COM==COMCF\n"; query << "FROM GRUPPO=#GRUPPO CONTO=#CONTO SOTTOCONTO=#SOTTOCONTO\n"; query << "TO GRUPPO=#GRUPPO CONTO=#CONTO SOTTOCONTO=#SOTTOCONTO\n"; query << "BY MOV.CODCF\n"; @@ -163,9 +210,6 @@ void TCertificazioni::elabora(const TMask& mask) const //creazione del csv recordset che verra' riempito dalla elaborazione TCertificazioni_csv_recordset* csv = new TCertificazioni_csv_recordset; - //quante righe dello sheet processa? - const long tot_items = sf.items(); - //Visto che e' possibile avere una secchiata di conti, gli tocca fare un giro per ogni conto // in realta' secondo me si potrebbe avere un conto solo (quello delle ritenute) FOR_EACH_SHEET_ROW(sf, r, row) @@ -179,7 +223,7 @@ void TCertificazioni::elabora(const TMask& mask) const const long items = rmov.items(); //E crea pure la progind.. - TProgind pi(tot_items, TR("Generazione righe..."), true, true); + TProgind pi(items, TR("Generazione righe ritenute..."), true, true); long last_nmov = 0; @@ -204,12 +248,16 @@ void TCertificazioni::elabora(const TMask& mask) const } //FOR_EACH... +#ifdef DBG + csv->save_as_text("c:/tmp/admin/bonomo.txt"); +#endif + //creazione del report di stampa TCertificazioni_report rep; bool ok = rep.load("pg0214100a"); //setta il recordset... //deve settare almeno un campo manualmente perche' funzioni la mask2report - csv->set_var("#EMAIL", TVariant("Manca la email"), true); + csv->set_var("#EMAIL", TVariant(TR("Manca la e-mail")), true); rep.set_recordset(csv); //..e poi carica i valori sulla maschera nel report!!!! rep.mask2report(mask); @@ -228,9 +276,7 @@ void TCertificazioni::main_loop() TCertificazioni_mask mask; mask.field(F_CODDITTA).check(RUNNING_CHECK); while (mask.run() == K_ENTER) - { elabora(mask); - } } bool TCertificazioni::create() diff --git a/ps/pg0214100a.rep b/ps/pg0214100a.rep index 6d490671a..9330851a0 100755 --- a/ps/pg0214100a.rep +++ b/ps/pg0214100a.rep @@ -1,67 +1,87 @@ - Stampa certificazioni + Stampa certificazioni professionisti -
+
+
+
+ A + - + - - - #SYSTEM.RAGSOC + + + + + + - - - - - + + + #DADATA - - - - - + + + #ADATA + + + + CLIFO.RAGSOC + + + + CLIFO.COFI + + + + CLIFO.INDCF + ", " + CLIFO.CIVCF + " " + CLIFO.LOCALITACF + + + COMUNI.DENCOM + " (" + COMUNI.PROVCOM + ")" + + - - - - - - - - - - + + + + + + + + + +
-
-
+
- - A - - + B - + C - + D - + E - + + F*100 F; IF(E,E,1) + + F - - H + + G
+
\ No newline at end of file diff --git a/ps/pg0214100a.uml b/ps/pg0214100a.uml index 6307dadf6..f3299d521 100755 --- a/ps/pg0214100a.uml +++ b/ps/pg0214100a.uml @@ -1,8 +1,8 @@ #include "pg0214100a.h" -TOOLBAR "" 0 -5 0 4 +TOOLBAR "" 0 -3 0 3 -BUTTON DLG_OK 10 2 +BUTTON DLG_PRINT 10 2 BEGIN PROMPT -12 -11 "" END @@ -12,6 +12,13 @@ BEGIN PROMPT -22 -11 "" END +STRING DLG_PROFILE 50 +BEGIN + PROMPT 9 0 "Profilo " + PSELECT + FLAGS "H" +END + ENDPAGE PAGE "Stampa certificazioni" -1 -1 78 10 diff --git a/ps/ps0430200a.h b/ps/ps0430200a.h index 70fb4faff..ea07f9723 100755 --- a/ps/ps0430200a.h +++ b/ps/ps0430200a.h @@ -19,4 +19,6 @@ #define F_PREZZO 117 #define F_CDCT 118 #define F_FSCT 119 +#define F_DASTATO 120 +#define F_ASTATO 121 diff --git a/ps/ps0430200a.uml b/ps/ps0430200a.uml index faa7a71f0..f6100ca9c 100755 --- a/ps/ps0430200a.uml +++ b/ps/ps0430200a.uml @@ -220,6 +220,29 @@ BEGIN CHECKTYPE SEARCH END +STRING F_DASTATO 1 +BEGIN + PROMPT 2 18 "Dallo stato " + USE %STD + INPUT CODTAB F_DASTATO + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_DASTATO CODTAB + CHECKTYPE NORMAL + FIELD OR14_DASTATO +END + +STRING F_ASTATO 1 +BEGIN + PROMPT 29 18 "Allo stato " + COPY USE F_DASTATO + INPUT CODTAB F_ASTATO + COPY DISPLAY F_DASTATO + OUTPUT F_ASTATO CODTAB + CHECKTYPE NORMAL + FIELD OR14_ASTATO +END + ENDPAGE ENDMASK diff --git a/ps/ps0920300.cpp b/ps/ps0920300.cpp index a8aa482de..ec8bb5095 100755 --- a/ps/ps0920300.cpp +++ b/ps/ps0920300.cpp @@ -80,8 +80,9 @@ public: void TPianifica_impianti::delete_old_docs() { - const TDate dadata = _mask->get_date(F_DADATA); - const TDate adata = _mask->get_date(F_ADATA); + TDate dadata = _mask->get_date(F_DADATA); + TDate adata = _mask->get_date(F_ADATA); + const int lastday = adata - dadata; const int anno = dadata.year(); const TString& codnum = _mask->get(F_ANUM); //accoppa i documenti con numerazione di destinazione.. const TString& impianto = _mask->get(F_DAIMP); //..e con l'impianto sorgente! (rompe la supersimmetria) @@ -89,15 +90,15 @@ void TPianifica_impianti::delete_old_docs() TRelation rel_doc(LF_DOC); TRectype darec(LF_DOC), arec(LF_DOC); + TDate from(1, 1, anno - 1); + TDate to(31, 12, anno); - TDate dadata_doc = dadata; //solitamente la datadoc precede la datacons di 2 settimane - dadata_doc -= 60; - darec.put(DOC_DATADOC, dadata_doc); + darec.put(DOC_DATADOC, from); darec.put(DOC_PROVV, "D"); darec.put(DOC_ANNO, anno); darec.put(DOC_CODNUM, codnum); - arec.put(DOC_DATADOC, adata); + arec.put(DOC_DATADOC, to); arec.put(DOC_PROVV, "D"); arec.put(DOC_ANNO, anno); arec.put(DOC_CODNUM, codnum); @@ -110,20 +111,27 @@ void TPianifica_impianti::delete_old_docs() cur_doc.freeze(); TProgind progind(items, "Eliminazione vecchi documenti in corso...", false, true); - for (cur_doc = 0; cur_doc.pos() < items; ++cur_doc) + dadata += _delays[0]; + adata += _delays[lastday ]; + for (cur_doc = 0; cur_doc.pos() < items; ++cur_doc) { progind.addstatus(1); TDocumento doc(cur_doc.curr()); //trovato un documento che soddisfa il darec/arec deve eliminarlo se la prima riga ha impianto.. //..uguale a quello nel campo F_AIMP sulla maschera - bool imp_ok =false, datacons_ok = false; + const TDate h_datacons = doc.get_date(DOC_DATACONS); + bool imp_ok =false, datacons_ok = false; + for (int i = 1; i <= doc.physical_rows(); i++) { const TRiga_documento& rigadoc = doc[i]; if (rigadoc.get(RDOC_IMPIANTO) == impianto) imp_ok = true; - if (rigadoc.get_date(RDOC_DATACONS) >= dadata) - datacons_ok = true; + const TDate datacons = rigadoc.get_date(RDOC_DATACONS); + if (datacons.ok()) + datacons_ok = (datacons >= dadata) && (datacons <= adata); + else + datacons_ok = (h_datacons >= dadata) && (h_datacons <= adata); if (imp_ok && datacons_ok) { doc.remove(); @@ -185,15 +193,18 @@ void TPianifica_impianti::create_new_docs(TLog_report& log) TRelation rel_doc(LF_DOC); TRectype darec(LF_DOC), arec(LF_DOC); - - TDate dadata_doc = dadata; //solitamente la datadoc precede la datacons di 2 settimane - dadata_doc -= 60; - darec.put(DOC_DATADOC, dadata_doc); + TLocalisamfile db(LF_RDIST); + TDate from(1, 1, anno - 1); + TDate to(31, 12, anno); + + db.setkey(2); + darec.put(DOC_DATADOC, from); + darec.put(DOC_PROVV, "D"); darec.put(DOC_ANNO, anno); darec.put(DOC_CODNUM, da_codnum); - arec.put(DOC_DATADOC, adata); + arec.put(DOC_DATADOC, to); arec.put(DOC_PROVV, "D"); arec.put(DOC_ANNO, anno); arec.put(DOC_CODNUM, da_codnum); @@ -221,25 +232,38 @@ void TPianifica_impianti::create_new_docs(TLog_report& log) TDate datadoc = nuovo_doc.get(DOC_DATADOC); TDate h_datacons = nuovo_doc.get(DOC_DATACONS); + + if (h_datacons < dadata || h_datacons > adata) + continue; + TDate datacons = h_datacons; - if (datacons - dadata > 366) - continue; const int ndays = datacons - dadata; + if (ndays > 365) + continue; + datacons += _delays[ndays]; nuovo_doc.put(DOC_DATACONS, datacons); for (int i = 1; i <= doc.rows(); i++) { const TRiga_documento& source_row = doc[i]; //riga del documento sorgente - //il casino va fatto solo se la riga non e' gia' evasa, l'impianto e' quello selezionato e la riga e' riga articolo - if (!source_row.is_evasa() && source_row.get(RDOC_IMPIANTO) == da_impianto && source_row.is_articolo()) + const TString80 codice(source_row.get(RDOC_CODARTMAG)); + + if (codice == "008BTN008033MP01") + int i = 1; + + //il casino va fatto solo se la riga non e' gia' evasa, l'impianto e' quello selezionato e la riga e' riga articolo + if (source_row.get(RDOC_IMPIANTO) == da_impianto && source_row.is_articolo()) { - const TCodice_articolo father_codartmag = source_row.get(RDOC_CODARTMAG); - albero.set_root(father_codartmag); - if (albero.goto_firstson()) + + db.zero(); + db.put("CODCOMP", codice); + const int err = db.read(_isgteq); + + if (err == NOERR && codice == db.get("CODCOMP")) { TCodice_articolo son_codartmag; albero.curr_code(son_codartmag); //e' risalito al codice dell'articolo figlio @@ -273,9 +297,36 @@ void TPianifica_impianti::create_new_docs(TLog_report& log) errore.format("Errore %d nella scrittura del documento %ld", err, nuovo_doc.get_long(DOC_NDOC)); log.log(2, errore); } + if (!datacons.ok()) + datacons = h_datacons; + const int ndays = datacons - dadata; + datacons += _delays[ndays]; + if (datacons < dadata || datacons > adata) + continue; + //..e la sua riga vuota + TRiga_documento& nuova_rigadoc = nuovo_doc.new_row(source_row.get(RDOC_TIPORIGA)); + //riempie la nuova riga - } //if (find_my_sister - } //if(albero.goto... + nuovo_doc.copy_data(nuova_rigadoc, source_row); + nuova_rigadoc.put(RDOC_CODART, dest_codart); + nuova_rigadoc.put(RDOC_CODARTMAG, dest_codart); + nuova_rigadoc.put(RDOC_PRIORITY, priority); + nuova_rigadoc.zero(nuova_rigadoc.field_qtaevasa()); + nuova_rigadoc.zero(RDOC_RIGAEVASA); + datacons = source_row.get_date(RDOC_DATACONS); + if (datacons.ok()) + { + datacons += _delays[ndays]; + nuova_rigadoc.put(RDOC_DATACONS, datacons); + } + nuova_rigadoc.put(RDOC_IMPIANTO, a_impianto); + const TString &linea = lav->cod_linea(0); + nuova_rigadoc.put(RDOC_LINEA, linea); + found = true; + } + + } + } } //if(source_row.get... } //for(int i... } //for(cur_doc... @@ -285,8 +336,30 @@ void TPianifica_impianti::main_loop() { while (_mask->run() == K_ENTER) { - //intanto accoppa i vecchi documenti di tipo destinazione - delete_old_docs(); + TDate dadata = _mask->get_date(F_DADATA); + TDate adata = _mask->get_date(F_ADATA); + TDate data; + int ndays = adata - dadata + 1; + const int ritardo = _mask->get_int(F_RITARDO); + _delays[0] = ritardo; + + for (int i = 1; i < 366; i++) + { + data = dadata; + data += i; + const TDate workdate = data; + if (!data.is_holiday() && data.wday() != 6) + { + TDate end_date = data; + end_date += _delays[i - 1]; + while (end_date.is_holiday() || end_date.wday() == 6) + ++end_date; + _delays[i] = end_date - workdate; + } + else + _delays[i] = _delays [i - 1]; + } + delete_old_docs(); //intanto accoppa i vecchi documenti di tipo destinazione //poi crea i nuovi documenti di produzione TLog_report log("Errori generazione documenti pianificazione"); @@ -296,7 +369,6 @@ void TPianifica_impianti::main_loop() buc.add(log); buc.preview(); } -} bool TPianifica_impianti::create() { diff --git a/ps/pt0003.cpp b/ps/pt0003.cpp new file mode 100755 index 000000000..c59bec07e --- /dev/null +++ b/ps/pt0003.cpp @@ -0,0 +1,16 @@ +#include + +#include "pt0003.h" + +int main(int argc, char** argv) +{ + int n = argc > 1 ? atoi(argv[1]+1) : 0; + switch(n) + { + case 0: + default: + pt0003100(argc, argv); break; // Incasso fatture + } + exit(0); + return 0; +} \ No newline at end of file diff --git a/ps/pt0003.h b/ps/pt0003.h new file mode 100755 index 000000000..4aa003858 --- /dev/null +++ b/ps/pt0003.h @@ -0,0 +1 @@ +int pt0003100(int argc, char* argv[]); diff --git a/ps/pt0003100.cpp b/ps/pt0003100.cpp new file mode 100755 index 000000000..0bc0a5e7d --- /dev/null +++ b/ps/pt0003100.cpp @@ -0,0 +1,266 @@ +#include +#include +#include +#include +#include +#include +#include "../ve/velib.h" + +#include + +#include "pt0003.h" +#include "pt0003100a.h" + +#include + +class TMaskPt00031 : public TAutomask +{ + TCursor * _cur; + +protected: + virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); + bool on_sheet_event(TOperable_field& o, TField_event e, long jolly); + void update_sheet(); + void update_pagato(real & totale); + void update_total(); + +public: + TCursor & cursor() const { return *_cur;} + TMaskPt00031(); + virtual ~TMaskPt00031(); +}; + +TMaskPt00031::TMaskPt00031() + : TAutomask("pt0003100a") +{ + TRelation * r = new TRelation(LF_DOC); + r->file().set_curr(new TDocumento); + _cur = new TCursor(r, "", 2); + ((TButton_field&) field(DLG_SAVEREC)).set_exit_key(K_ENTER); +} + +TMaskPt00031::~TMaskPt00031() +{ + delete _cur; +} + +bool TMaskPt00031::on_field_event(TOperable_field& o, TField_event e, long jolly) +{ + const int id = o.dlg(); + switch (id) + { + case F_TOTPAGATO: + if (e == fe_modify ) + { + real totpagato = o.mask().get_real(F_TOTPAGATO); + + update_pagato(totpagato); + } + break; + case F_NUM: + if (e == fe_modify || e == fe_init) + update_sheet(); + break; + case F_ANNO: + case F_CODCLI: + if (e == fe_modify) + update_sheet(); + break; + case F_SHEET: + return on_sheet_event(o, e, jolly); + break; + default: + if (jolly > 0) + return on_sheet_event(o, e, jolly); + break; + } + return true; +} + + +void TMaskPt00031::update_total() +{ + real tot; + TSheet_field& s = sfield(F_SHEET); + const int postot = s.cid2index(F_PAGATO); + FOR_EACH_SHEET_ROW_BACK(s, r, row) + tot += real(row->get(postot)); + set(F_TOTPAGATO, tot); +} + +bool TMaskPt00031::on_sheet_event(TOperable_field& o, TField_event e, long jolly) +{ + TMask& m = o.mask(); + switch (o.dlg()) + { + case F_PAGATO: + if (e == fe_modify) + update_total(); + break; + case F_PAGA: + if (e == fe_button) + { + TMask& m = o.mask(); + if (m.get_real(F_PAGATO).is_zero()) + m.set(F_PAGATO, m.get(F_DAPAGARE)); + else + m.reset(F_PAGATO); + TSheet_field & s = *m.get_sheet(); + + const int r = s.selected(); + + s.row(r).add(m.get(F_PAGATO), 0); + s.force_update(r); + + update_total(); + } + break; + case F_SHEET: + switch(e) + { + case se_query_add: + return false; + case se_notify_modify: + update_total(); + break; + default: + break; + } + + default: + break; + } + return true; +} + +void TMaskPt00031::update_sheet() +{ + TSheet_field& sheet = sfield(F_SHEET); + const int olditems = sheet.items(); + + sheet.destroy(); + reset(F_TOTPAGATO); + TRectype from(_cur->relation()->curr()); + const long codcli = get_long(F_CODCLI); + + from.put(DOC_TIPOCF, "C"); + from.put(DOC_CODCF, codcli); + from.put(DOC_ANNO, get(F_ANNO)); + from.put(DOC_PROVV, "D"); + + TRectype to(from); + TString filter; + filter << "(CODNUM==\"" << get(F_NUM) << "\")&&(G1:TOTDOC>IMPPAGATO)"; + _cur->setfilter(filter); + _cur->setregion(from, to); + TDocumento & doc = (TDocumento &)_cur->curr(); + + const long items = _cur->items(); + TProgind pi(items, "Caricamento fatture", true, true); + + for ((*_cur) = 0L; _cur->pos() < items; ++(*_cur)) + { + if (pi.iscancelled()) + break; + if (sheet.items() > 900) // Anche troppe righe + break; + + TToken_string & row = sheet.row(-1); + const real totdoc = doc.totale_doc(); + const real acconto = doc.get_real(DOC_IMPPAGATO); + const real da_pagare = totdoc - acconto; + + row.cut(0); + row.add(""); + row.add(da_pagare.string()); + row.add(totdoc.string()); + row.add(doc.get(DOC_NDOC)); + row.add(doc.get(DOC_DATADOC)); + pi.addstatus(1); + } + if (olditems == 0 && sheet.items == 0) + return; + sheet.force_update(); +} + +void TMaskPt00031::update_pagato(real & totpagato) +{ + TSheet_field& sheet = sfield(F_SHEET); + const long items = sheet.items(); + int pospagato = sheet.cid2index(F_PAGATO); + int posda_pagare = sheet.cid2index(F_DAPAGARE); + + for (int r = 0; r < items; r++) + { + TToken_string & row = sheet.row(r); + const real da_pagare(row.get(posda_pagare)); + real pagato; + + if (totpagato > ZERO) + { + if (totpagato > da_pagare) + pagato = da_pagare; + else + pagato = totpagato; + totpagato -= pagato; + } + const TString s(pagato.string()); + + row.add(s, pospagato); + } + sheet.force_update(); +} + +class TIncassoFatture0003 : public TSkeleton_application +{ + virtual bool check_autorization() const { return false; } + virtual const char * extra_modules() const {return "ve";} + + +protected: + virtual void main_loop(); + +public: + virtual ~TIncassoFatture0003() {} +}; + +void TIncassoFatture0003::main_loop() +{ + TMaskPt00031 m; + + while (m.run() == K_ENTER) + { + TSheet_field & s = m.sfield(F_SHEET); + TCursor & c = m.cursor(); + + const long items = c.items(); + int pospagato = s.cid2index(F_PAGATO); + + for (long pos = 0L; pos < items; pos++) + { + TToken_string row = s.row(pos); + real val(row.get(pospagato)); + + if (val != ZERO) + { + c = pos; + TDocumento doc((TDocumento &)c.curr()); + real pagato = doc.get(DOC_IMPPAGATO); + real val(row.get(pospagato)); + + pagato += val; + doc.put(DOC_IMPPAGATO, pagato); + doc.rewrite(); + } + } + } +} + +TIncassoFatture0003 & app() { return (TIncassoFatture0003&) main_app();} + +int pt0003100(int argc, char* argv[]) +{ + TIncassoFatture0003 a; + a.run(argc, argv, "Stampa ordini di produzione"); + return 0; +} diff --git a/ps/pt0003100a.h b/ps/pt0003100a.h new file mode 100755 index 000000000..3ca23126f --- /dev/null +++ b/ps/pt0003100a.h @@ -0,0 +1,14 @@ +#define F_ANNO 201 +#define F_NUM 202 +#define F_CODCLI 203 +#define F_RAGSOC 204 +#define F_TOTPAGATO 205 +#define F_SHEET 206 + + +#define F_PAGA 100 +#define F_PAGATO 101 +#define F_DAPAGARE 102 +#define F_TOTDOC 103 +#define F_NDOC 104 +#define F_DATADOC 105 diff --git a/ps/pt0003100a.uml b/ps/pt0003100a.uml new file mode 100755 index 000000000..24e460171 --- /dev/null +++ b/ps/pt0003100a.uml @@ -0,0 +1,162 @@ +#include "pt0003100a.h" + +TOOLBAR "Toolbar" 0 -3 0 3 + +STRING DLG_PROFILE 70 50 +BEGIN + PROMPT 8 0 "Profilo " + PSELECT +END + +BUTTON DLG_SAVEREC 10 2 +BEGIN + PROMPT -12 -1 "~Registra" + PICTURE BMP_SAVEREC + PICTURE BMP_SAVERECDN +END + + +BUTTON DLG_QUIT 10 2 +BEGIN + PROMPT -22 -1 "" +END + +ENDPAGE + +PAGE "Incasso fatture" 0 0 0 -3 + +GROUPBOX -1 78 5 + BEGIN + PROMPT 2 1 "Selezione Documenti" + FLAGS "" +END + +NUMBER F_ANNO 4 +BEGIN + PROMPT 4 2 "Anno " + FIELD S_ANNO + KEY 1 + 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" +END + +STRING F_NUM 4 +BEGIN + PROMPT 21 2 "Num. " + FIELDS S_NUM + HELP "Codice numerazione" + USE %NUM + INPUT CODTAB F_NUM + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_NUM CODTAB + CHECKTYPE REQUIRED + FLAG "UPA" + WARNING "Numerazione assente" +END + +STRING F_CODCLI 6 +BEGIN + PROMPT 4 3 "Cliente " + WARNING "Cliente assente" + FLAGS "R" + FIELD CODCLI + USE LF_CLIFO + INPUT TIPOCF "C" + INPUT CODCF F_CODCLI + DISPLAY "Codice" CODCF + DISPLAY "Ragione Sociale@50" RAGSOC + OUTPUT F_CODCLI CODCF + OUTPUT F_RAGSOC RAGSOC + CHECKTYPE REQUIRED +END + +STRING F_RAGSOC 50 +BEGIN + WARNING "Cliente assente" + PROMPT 26 3 "" + 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 + OUTPUT F_CODCLI CODCF + OUTPUT F_RAGSOC RAGSOC + CHECKTYPE REQUIRED +END + +CURRENCY F_TOTPAGATO +BEGIN + PROMPT 4 4 "Pagato " +END + +SPREADSHEET F_SHEET +BEGIN + PROMPT 0 6 "" + ITEM "Pagato@18" + ITEM "Da pagare@18" + ITEM "Totale doc.@18" + ITEM "N.ro Fattura" + ITEM "Data@10" +END + +ENDPAGE + +ENDMASK + +PAGE "Rate" -1 -1 60 14 + +CURRENCY F_PAGATO +BEGIN + PROMPT 4 1 "Pagato " +END + +CURRENCY F_DAPAGARE +BEGIN + PROMPT 4 3 "Da Pagare " + FLAGS "D" +END + +CURRENCY F_TOTDOC +BEGIN + PROMPT 4 5 "Totale fattura " + FLAGS "D" +END + +NUMBER F_NDOC 6 +BEGIN + PROMPT 4 7 "Numero fattura " + FLAGS "D" +END + +DATE F_DATADOC +BEGIN + PROMPT 4 9 "Data fattura " + FLAGS "D" +END + +BUTTON DLG_OK 10 2 +BEGIN + PROMPT -13 -1 "" +END + +BUTTON DLG_CANCEL 10 2 +BEGIN + PROMPT -23 -1 "" +END + +BUTTON F_PAGA 10 2 +BEGIN + PROMPT -33 -1 "~Paga" +END + +ENDPAGE + +ENDMASK diff --git a/tc/tc0701.cpp b/tc/tc0701.cpp index 2ad7890e8..2d4d78b7a 100755 --- a/tc/tc0701.cpp +++ b/tc/tc0701.cpp @@ -283,8 +283,7 @@ TTS_textset::TTS_textset(const char* query) TString80 field; // dati iva - int i; - for (i=0; i<8; i++) + for (int i=0; i<8; i++) { field.format("TRF-IMPONIB_%d", i); add_field("0", field, 12, n, 475+(31*i)); // imponibile @@ -302,7 +301,7 @@ TTS_textset::TTS_textset(const char* query) add_field("0", "TRF-TOT-FATT", 12, n, 723); // totale fattura // conti di ricavo/costo - for (i = 0; i < 8; i++) + for (i=0; i<8; i++) { field.format("TRF-CONTORIC_%d", i); add_field("0", field, 7, n, 735+(19*i)); // codice conto di ricavo/costo @@ -317,7 +316,7 @@ TTS_textset::TTS_textset(const char* query) add_field("0", "TRF-CAU-AGG-2-PAGAM", 34, an, 939); // ulteriore descrizione aggiuntiva // altri movimenti - for (i = 0; i < 80; i++) + for (i=0; i<80; i++) { field.format("TRF-CONTO_%d", i); add_field("0", field, 7, n, 973+(64*i)); // codice conto @@ -336,7 +335,7 @@ TTS_textset::TTS_textset(const char* query) } // ratei e risconti - for (i = 0; i < 10; i++) + for (i=0; i<10; i++) { field.format("TRF-RIFER-TAB_%d", i); add_field("0", field, 1, an, 6093+(19*i)); // tabella di riferimento @@ -356,7 +355,7 @@ TTS_textset::TTS_textset(const char* query) add_field("0", "TRF-AN-TIPO-SOGG", 1, n, 6290); // tipo soggetto ritenuta di acconto // ulteriori dati ev. pagamento o movimenti diversi - for (i = 0; i < 80; i++) + for (i=0; i<80; i++) { field.format("TRF-EC-PARTITA-SEZ-PAG_%d", i); add_field("0", field, 2, n, 6291+(2*i)); // numero sezionale partita estratto conto @@ -372,13 +371,13 @@ TTS_textset::TTS_textset(const char* query) add_field("0", "TRF-RIT-4", 12, n, 6526); // 4 // ulteriori dati per unita' produttive ricavi - for (i = 0; i < 8; i++) + for (i=0; i<8; i++) { field.format("TRF-UNITA-RICAVI_%d", i); add_field("0", field, 2, n, 6538+(2*i)); // } // ulteriori dati per unita' produttive pagamenti - for (i = 0; i < 80; i++) + for (i=0; i<80; i++) { field.format("TRF-UNITA-PAGAM_%d", i); add_field("0", field, 2, n, 6554+(2*i)); // diff --git a/tp/tp0900.cpp b/tp/tp0900.cpp index e0d848329..547a69be9 100755 --- a/tp/tp0900.cpp +++ b/tp/tp0900.cpp @@ -389,6 +389,8 @@ void TDichiarazione_CONAI::scrivi_csv(const TRectype& prima_riga, TDichiarazione } } + if (anno == 2008 && codnum == "NAC" && (numdoc == 74 || numdoc == 75)) + int cazzone = 1; if (n_riga_generata > 0) scrivi_csv_doc_con_riga_generata(doc, n_riga_generata, csv, conai_specie); else diff --git a/tp/tp0900ac.rep b/tp/tp0900ac.rep index c0e2b61ab..6f969a4f6 100755 --- a/tp/tp0900ac.rep +++ b/tp/tp0900ac.rep @@ -349,74 +349,64 @@