diff --git a/ba/ba0100.cpp b/ba/ba0100.cpp index 7df821bc0..427087726 100755 --- a/ba/ba0100.cpp +++ b/ba/ba0100.cpp @@ -269,8 +269,7 @@ TPicture_mask::TPicture_mask(const char* name, int dx, int dy, { logoname = "logo"; logoname << '.' << ext[i]; - logoname.custom_path(); - if (logoname.exist()) + if (logoname.custom_path()) break; } TImage logo(logoname); @@ -864,7 +863,7 @@ bool TMenu_application::check_user() TMask m("ba0100a"); char hostname[256]; xvt_sys_get_host_name(hostname, sizeof(hostname)); - if (strcmp(hostname, "BATMOBILE") == 0 || strcmp(hostname, "ETABETA") == 0 || + if (strcmp(hostname, "BATMOBILE") == 0 || strcmp(hostname, "ARCHIMEDE") == 0 || strcmp(hostname, "KIRK") == 0 || strcmp(hostname, "SPOCK") == 0 || strcmp(hostname, "UHURA") == 0) { @@ -1887,7 +1886,7 @@ int ba0100(int argc, char** argv) TFilename menu = (argc < 2) ? MEN_FILE : argv[1]; - if (menu.exist()) + if (menu.custom_path()) { TMenu_application *ma = new TMenu_application(menu); ma->run(argc, argv, TR("Menu Principale")); diff --git a/ba/ba0101.cpp b/ba/ba0101.cpp index fbc57c33d..89bd8f5dd 100755 --- a/ba/ba0101.cpp +++ b/ba/ba0101.cpp @@ -168,8 +168,8 @@ void TMenuitem::create(const char* t) { if (_action.find('.') < 0) _action << ".men"; - TFilename n = _action; n.custom_path(); - if (n.exist()) + TFilename n = _action; + if (n.custom_path()) menu().read(_action, _action); else _action.cut(0); @@ -208,14 +208,15 @@ bool TMenuitem::enabled() const { if (menu().is_dangerous(_action)) { - yes = FALSE; + yes = false; } else { const int endname = _action.find(' '); - TFilename name(endname > 0 ? _action.left(endname) : _action); - if (name.exist()) - yes = TRUE; + const TFilename name(endname > 0 ? _action.left(endname) : _action); + TFilename n = name; + if (n.custom_path()) + yes = true; else { const char* ext[] = { "exe", "pif", "com", "bat", NULL }; @@ -223,8 +224,8 @@ bool TMenuitem::enabled() const for (e = 0; ext[e]; e++) { - name.ext(ext[e]); - if (name.exist()) + n = name; n.ext(ext[e]); + if (n.custom_path()) break; } yes = ext[e] != NULL; diff --git a/ba/ba0102.cpp b/ba/ba0102.cpp index a3762d3ba..a20ce94dd 100755 --- a/ba/ba0102.cpp +++ b/ba/ba0102.cpp @@ -354,8 +354,7 @@ TObject* TMenulist_images::key2obj(const char* key) { name = key; name << '.' << ext[i]; - name.custom_path(); - if (name.exist()) + if (name.custom_path()) break; } diff --git a/ba/ba8300.cpp b/ba/ba8300.cpp index b148d358b..0a3dcb8c7 100755 --- a/ba/ba8300.cpp +++ b/ba/ba8300.cpp @@ -191,6 +191,8 @@ TReport_base_mask::TReport_base_mask(const char* name, TReport& rep) class TReport_field_mask : public TReport_base_mask { + TReport_field& _rf; + protected: void vedo_non_vedo(); virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); @@ -319,10 +321,12 @@ bool TReport_field_mask::on_field_event(TOperable_field& o, TField_event e, long case DLG_FINDREC: if (e == fe_button) { - TRecordset* rex = _report.recordset(); + TRecordset* rex = _rf.section().recordset(); + if (rex == NULL) + rex = _report.recordset(); if (rex != NULL && rex->columns() > 0) { - TArray_sheet sheet(-1, -1, -1, 20, "Colonne Query", "Nome@16|Tipo@8|Dimensoni@R"); + TArray_sheet sheet(-1, -1, -1, 20, TR("Colonne Query"), HR("Nome@16|Tipo@8|Dimensoni@R")); TToken_string row; for (size_t i = 0; i < rex->columns(); i++) { @@ -343,6 +347,19 @@ bool TReport_field_mask::on_field_event(TOperable_field& o, TField_event e, long { row = sheet.row(-1); set(F_SOURCE, row.get(0)); + + char tipo = row.get_char(1); + int width = row.get_int(2); + switch (tipo) + { + case 'D':width = 10; break; + case 'L':tipo = 'S'; break; + case 'M':tipo = 'S'; width = 50; break; + default: break; + } + const char str[2] = { tipo, '\0' }; + set(F_TYPE, str); + set(F_DX, width); } } else @@ -441,7 +458,7 @@ void TReport_field_mask::get_field(TReport_field& rf) const } TReport_field_mask::TReport_field_mask(TReport_field& rf) - : TReport_base_mask("ba8300b", rf.section().report()) + : TReport_base_mask("ba8300b", rf.section().report()), _rf(rf) { set_field(rf); } diff --git a/ba/ba8500.cpp b/ba/ba8500.cpp index 10684bfc7..9d1fc57f2 100755 --- a/ba/ba8500.cpp +++ b/ba/ba8500.cpp @@ -172,40 +172,55 @@ void TKlarkKent_app::main_loop() if (arr.items() == 0) arr.add(EMPTY_STRING); - TReport_book book; - FOR_EACH_ARRAY_ROW(arr, r, row) - { - TFilename report_name = *row; - report_name.ext("rep"); - if (report_name.empty() || !report_name.custom_path()) - { - TKlarkKent_mask m; - m.set(F_REPORT, report_name); - if (m.run() == K_ENTER) + bool can_repeat = false; + do + { + TReport_book book; + FOR_EACH_ARRAY_ROW(arr, r, row) + { + TFilename report_name = *row; + report_name.ext("rep"); + if (report_name.empty() || !report_name.custom_path()) { - report_name = m.get(F_REPORT); - report_name.custom_path(); + TKlarkKent_mask m; + m.set(F_REPORT, report_name); + if (m.run() == K_ENTER) + { + report_name = m.get(F_REPORT); + report_name.ext("rep"); + report_name.custom_path(); + *row = report_name; + } + } + + TString appname, desc; + rep2app(report_name, appname, desc); + if (appname.not_empty()) + { + appname << ' ' << report_name; + TExternal_app app(appname); + app.run(true); + } + else + { + TReport rep; + if (rep.load(report_name)) + { + const bool ok = book.add(rep); + if (ok && arr.items() == 1) // Controlla se e' pensabile ripetere la stampa + { + TFilename msk = report_name; + msk.ext("msk"); + can_repeat = msk.exist(); // Posso ripetere se ho una maschera collegata + } + else + can_repeat = false; + } } } - - TString appname, desc; - rep2app(report_name, appname, desc); - if (appname.not_empty()) - { - appname << ' ' << report_name; - TExternal_app app(appname); - app.run(true); - } - else - { - TReport rep; - if (rep.load(report_name)) - book.add(rep); - } - } - - if (book.pages() > 0) - book.print_or_preview(); + if (book.pages() > 0) + book.print_or_preview(); + } while (can_repeat); } int ba8500(int argc, char* argv[]) diff --git a/cg/cg5800b.uml b/cg/cg5800b.uml index 78c622d29..ab08decbf 100755 --- a/cg/cg5800b.uml +++ b/cg/cg5800b.uml @@ -64,7 +64,7 @@ END CURRENCY F_TOTPRIMP 18 BEGIN - PROMPT 1 5 " Totale Op.verso cons.finali " + PROMPT 1 5 "Totale Op.verso cons.finali " MESSAGE COPY,6@ FLAGS "DG" END @@ -92,126 +92,133 @@ END TEXT DLG_NULL BEGIN - PROMPT 2 7 "______________________________________________________________________________" + PROMPT 33 7 "@bOp.Imponibili" + FLAGS "D" +END + +TEXT DLG_NULL +BEGIN + PROMPT 72 7 "@bImposte" + FLAGS "D" END CURRENCY FM_REGIMP(00) 18 BEGIN - PROMPT 1 8 "Non assegnati Op.Imponibili " + PROMPT 1 8 "Non assegnati " FLAGS "D" END CURRENCY FM_REGIVA(00) 18 BEGIN - PROMPT 51 8 "Imposte " + PROMPT 51 8 " " FLAGS "D" END CURRENCY FM_REGIMP(01) 18 BEGIN - PROMPT 1 9 "VT2 Abruzzo Op.Imponibili " + PROMPT 1 9 "VT2 Abruzzo " FLAGS "D" END CURRENCY FM_REGIVA(01) 18 BEGIN - PROMPT 51 9 "Imposte " + PROMPT 51 9 " " FLAGS "D" END CURRENCY FM_REGIMP(02) 18 BEGIN - PROMPT 1 10 "VT3 Basilicata Op.Imponibili " + PROMPT 1 10 "VT3 Basilicata " FLAGS "D" END CURRENCY FM_REGIVA(02) 18 BEGIN - PROMPT 51 10 "Imposte " + PROMPT 51 10 " " FLAGS "D" END CURRENCY FM_REGIMP(03) 18 BEGIN - PROMPT 1 11 "VT4 Bolzano Op.Imponibili " + PROMPT 1 11 "VT4 Bolzano " FLAGS "D" END CURRENCY FM_REGIVA(03) 18 BEGIN - PROMPT 51 11 "Imposte " + PROMPT 51 11 " " FLAGS "D" END CURRENCY FM_REGIMP(04) 18 BEGIN - PROMPT 1 12 "VT5 Calabria Op.Imponibili " + PROMPT 1 12 "VT5 Calabria " FLAGS "D" END CURRENCY FM_REGIVA(04) 18 BEGIN - PROMPT 51 12 "Imposte " + PROMPT 51 12 " " FLAGS "D" END CURRENCY FM_REGIMP(05) 18 BEGIN - PROMPT 1 13 "VT6 Campania Op.Imponibili " + PROMPT 1 13 "VT6 Campania " FLAGS "D" END CURRENCY FM_REGIVA(05) 18 BEGIN - PROMPT 51 13 "Imposte " + PROMPT 51 13 " " FLAGS "D" END CURRENCY FM_REGIMP(06) 18 BEGIN - PROMPT 1 14 "VT7 Emilia Rom.Op.Imponibili " + PROMPT 1 14 "VT7 Emilia Rom. " FLAGS "D" END CURRENCY FM_REGIVA(06) 18 BEGIN - PROMPT 51 14 "Imposte " + PROMPT 51 14 " " FLAGS "D" END CURRENCY FM_REGIMP(07) 18 BEGIN - PROMPT 1 15 "VT8 Friuli Op.Imponibili " + PROMPT 1 15 "VT8 Friuli " FLAGS "D" END CURRENCY FM_REGIVA(07) 18 BEGIN - PROMPT 51 15 "Imposte " + PROMPT 51 15 " " FLAGS "D" END CURRENCY FM_REGIMP(08) 18 BEGIN - PROMPT 1 16 "VT9 Lazio Op.Imponibili " + PROMPT 1 16 "VT9 Lazio " FLAGS "D" END CURRENCY FM_REGIVA(08) 18 BEGIN - PROMPT 51 16 "Imposte " + PROMPT 51 16 " " FLAGS "D" END CURRENCY FM_REGIMP(09) 18 BEGIN - PROMPT 1 17 "VT10 Liguria Op.Imponibili " + PROMPT 1 17 "VT10 Liguria " FLAGS "D" END CURRENCY FM_REGIVA(09) 18 BEGIN - PROMPT 51 17 "Imposte " + PROMPT 51 17 " " FLAGS "D" END @@ -261,7 +268,7 @@ END CURRENCY DLG_NULL 18 BEGIN - PROMPT 1 5 " Totale op.verso cons.finali " + PROMPT 1 5 "Totale op.verso cons.finali " FLAGS "D" GROUP 6 END @@ -289,126 +296,134 @@ END TEXT DLG_NULL BEGIN - PROMPT 2 7 "______________________________________________________________________________" + PROMPT 33 7 "@bOp.Imponibili" + FLAGS "D" +END + +TEXT DLG_NULL +BEGIN + PROMPT 72 7 "@bImposte" + FLAGS "D" END CURRENCY FM_REGIMP(10) 18 BEGIN - PROMPT 1 8 "VT11 Lombardia Op.Imponibili " + PROMPT 1 8 "VT11 Lombardia " FLAGS "D" END CURRENCY FM_REGIVA(10) 18 BEGIN - PROMPT 51 8 "Imposte " + PROMPT 51 8 " " FLAGS "D" END CURRENCY FM_REGIMP(11) 18 BEGIN - PROMPT 1 9 "VT12 Marche Op.Imponibili " + PROMPT 1 9 "VT12 Marche " FLAGS "D" END CURRENCY FM_REGIVA(11) 18 BEGIN - PROMPT 51 9 "Imposte " + PROMPT 51 9 " " FLAGS "D" END CURRENCY FM_REGIMP(12) 18 BEGIN - PROMPT 1 10 "VT13 Molise Op.Imponibili " + PROMPT 1 10 "VT13 Molise " FLAGS "D" END CURRENCY FM_REGIVA(12) 18 BEGIN - PROMPT 51 10 "Imposte " + PROMPT 51 10 " " FLAGS "D" END CURRENCY FM_REGIMP(13) 18 BEGIN - PROMPT 1 11 "VT14 Piemonte Op.Imponibili " + PROMPT 1 11 "VT14 Piemonte " FLAGS "D" END CURRENCY FM_REGIVA(13) 18 BEGIN - PROMPT 51 11 "Imposte " + PROMPT 51 11 " " FLAGS "D" END CURRENCY FM_REGIMP(14) 18 BEGIN - PROMPT 1 12 "VT15 Puglia Op.Imponibili " + PROMPT 1 12 "VT15 Puglia " FLAGS "D" END CURRENCY FM_REGIVA(14) 18 BEGIN - PROMPT 51 12 "Imposte " + PROMPT 51 12 " " FLAGS "D" END CURRENCY FM_REGIMP(15) 18 BEGIN - PROMPT 1 13 "VT16 Sardegna Op.Imponibili " + PROMPT 1 13 "VT16 Sardegna " FLAGS "D" END CURRENCY FM_REGIVA(15) 18 BEGIN - PROMPT 51 13 "Imposte " + PROMPT 51 13 " " FLAGS "D" END CURRENCY FM_REGIMP(16) 18 BEGIN - PROMPT 1 14 "VT17 Sicilia Op.Imponibili " + PROMPT 1 14 "VT17 Sicilia " FLAGS "D" END CURRENCY FM_REGIVA(16) 18 BEGIN - PROMPT 51 14 "Imposte " + PROMPT 51 14 " " + FLAGS "D" END CURRENCY FM_REGIMP(17) 18 BEGIN - PROMPT 1 15 "VT18 Toscana Op.Imponibili " + PROMPT 1 15 "VT18 Toscana " FLAGS "D" END CURRENCY FM_REGIVA(17) 18 BEGIN - PROMPT 51 15 "Imposte " + PROMPT 51 15 " " FLAGS "D" END CURRENCY FM_REGIMP(18) 18 BEGIN - PROMPT 1 16 "VT19 Trento Op.Imponibili " + PROMPT 1 16 "VT19 Trento " FLAGS "D" END CURRENCY FM_REGIVA(18) 18 BEGIN - PROMPT 51 16 "Imposte " + PROMPT 51 16 " " FLAGS "D" END CURRENCY FM_REGIMP(19) 18 BEGIN - PROMPT 1 17 "VT20 Umbria Op.Imponibili " + PROMPT 1 17 "VT20 Umbria " FLAGS "D" END CURRENCY FM_REGIVA(19) 18 BEGIN - PROMPT 51 17 "Imposte " + PROMPT 51 17 " " FLAGS "D" END @@ -420,22 +435,22 @@ END CURRENCY FM_REGIVA(20) 18 BEGIN - PROMPT 51 18 "Imposte " + PROMPT 51 18 " " FLAGS "D" END CURRENCY FM_REGIMP(21) 18 BEGIN - PROMPT 1 19 "VT21 Veneto Op.Imponibili " + PROMPT 1 19 "VT21 Veneto " FLAGS "D" END CURRENCY FM_REGIVA(21) 18 BEGIN - PROMPT 51 19 "Imposte " + PROMPT 51 19 " " FLAGS "D" END ENDPAGE -ENDMASK +ENDMASK \ No newline at end of file diff --git a/cg/cg5800ra.rep b/cg/cg5800ra.rep index 700114b58..acd406f09 100755 --- a/cg/cg5800ra.rep +++ b/cg/cg5800ra.rep @@ -1,17 +1,13 @@ - + Lista privati per regione per quadro VT -
- - +
+ + "Lista clienti privati per quadro IVA VT anno " + #ANNO - - - - - +
@@ -32,7 +28,7 @@
-
+
23.CODCF 0 "F3.101" ! 0 "F3.102" ! @@ -48,10 +44,14 @@ 20.RAGSOC + + + +
- + RMOVIVA.NUMREG @@ -61,16 +61,18 @@ RMOVIVA.CODIVA - + RMOVIVA.IMPOSTA MESSAGE ADD,F3.102
+ + - + MESSAGE ADD,F1.302
@@ -79,8 +81,8 @@ MESSAGE ADD,F1.301 - - MESSAGE ADD,F1.202 + + MESSAGE ADD,F1.302
@@ -88,7 +90,7 @@ MESSAGE ADD,F2.201 - + MESSAGE ADD,F2.202
diff --git a/cg/proforma.ini b/cg/proforma.ini index 288d2baaa..8f2635a6a 100755 --- a/cg/proforma.ini +++ b/cg/proforma.ini @@ -1,8 +1,8 @@ [MAIN] DECSEP = , FIELDSEP = -RECORDSEP = \n -RECORDSIZE = 0 +RECORDSEP = +RECORDSIZE = 250 SKIPLINES = 0 TYPEFIELD = -1 TYPELEN = -1 @@ -388,7 +388,6 @@ POSITION(3) = 15 LENGTH(3) = 80 FIELD(3)=19->DESCR - [OPZIONI] PERCORSO = C:\TEMP\ diff --git a/include/recset.cpp b/include/recset.cpp index 317d500f7..0cb9dc391 100755 --- a/include/recset.cpp +++ b/include/recset.cpp @@ -258,7 +258,8 @@ bool TRecordset::save_as_silk(const char* path) for (unsigned int c = 0; c < columns(); c++) { const TRecordset_column_info& ci = column_info(c); - const bool is_alpha = ci._type == _alfafld || ci._type == _charfld || ci._type == _memofld; + const bool is_alpha = ci._type == _alfafld || ci._type == _charfld || + ci._type == _memofld || ci._type == _datefld; out << "C;Y" << (n+2) << ";X" << (c+1) << ";K"; if (is_alpha) out << '"'; @@ -423,8 +424,9 @@ const TVariant& TRecordset::get(const char* column_name) const const TVariant& TRecordset::get_var(const char* name) const { - if (_parentset != NULL && strncmp(name, "#PARENT.", 8) == 0) - return _parentset->get(name+8); + // Se mi accorgo che posso e voglio accedere ad un campo del recordset padre + if (_parentset != NULL && strncmp(name, "#PARENT.", 8) == 0) + return _parentset->get(name+8); // Attenzione! E' giusto usare get() e non get_var() const TVariant* var = (const TVariant*)_var.objptr(name); return var != NULL ? *var : NULL_VARIANT; diff --git a/include/reprint.cpp b/include/reprint.cpp index 457432d10..1344241fd 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -1807,9 +1807,7 @@ bool TReport_book::add(TReport& rep, bool progind) column_delta = dx; last_body_height = dy; } - - print_subsections(b); - + if (column_delta > 0) _delta.x += column_delta; else @@ -1818,6 +1816,9 @@ bool TReport_book::add(TReport& rep, bool progind) _delta.y += dy; last_body_height = 0; // Non servirebbe strettamente } + + // Stampa eventuali sottosezioni + print_subsections(b); } } diff --git a/include/sheet.cpp b/include/sheet.cpp index 757a4e603..62288e9a0 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -1571,6 +1571,8 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields, TEditable_field* e = NULL; short y = 0; + bool first = true; + for (const char* i = ids.get(0); i; i = ids.get()) { if (*i != '"' && strchr(i, '@') == NULL) @@ -1632,8 +1634,11 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields, { e->set_handler(browse_field_handler); e->set(c.get()); - if (e->dlg() == f->dlg()) + if (e->dlg() == f->dlg() || first) + { first_focus(e->dlg()); + first = false; + } } } } diff --git a/mr/mr2100.cpp b/mr/mr2100.cpp index 9ed2e9d8a..9688dd595 100755 --- a/mr/mr2100.cpp +++ b/mr/mr2100.cpp @@ -1991,9 +1991,7 @@ bool TMatResPlanning::load_gross_requirements() const TCodice_um um = riga.get(RDOC_UMQTA); // GUY was Here, but it's Koki fault! - long codcli = 0; - if (is_production_article(art)) - codcli = doc.get_long(DOC_CODCF); + const long codcli = is_production_article(art) ? doc.get_long(DOC_CODCF) : 0; TPrice prz(riga.prezzo(TRUE,TRUE)); TQuantita q(art, um, qta); @@ -2003,7 +2001,7 @@ bool TMatResPlanning::load_gross_requirements() if (line == NULL) { // nuova linea - line = _articles.find(art, liv, mag, "", imp, lin, codcli, TRUE); + line = _articles.find(art, liv, mag, "", imp, lin, codcli, true); line->set_description(riga.get(RDOC_DESCR)); line->set_final_product(); } @@ -2087,12 +2085,12 @@ bool TMatResPlanning::explode_articles() const TRiga_esplosione& riga = (const TRiga_esplosione&)boom[i]; const TCodice_articolo& art = riga.articolo(); const TRectype& articolo=cache().get(LF_ANAMAG,art); - bool add=TRUE; + bool add=true; if (!articolo.get(ANAMAG_CODART).blank()) { const char reorder_type=articolo.get_char(ANAMAG_RIORDINO); if (reorder_type!='F' && reorder_type!=' ' && reorder_type!='\0') // e' a riordino - add=FALSE; + add=false; } if (add) { @@ -2100,23 +2098,22 @@ bool TMatResPlanning::explode_articles() TString8 mag = line.codmagdep(); TString8 imp = line.codimp(); TString8 lin = line.codlin(); + _artinfo.art2magimpline(art, mag, imp, lin); // GUY was here with Koki - long codcli = 0; - if (is_production_article(art)) - codcli = line.codclifor(); + const long codcli = is_production_article(art) ? line.codclifor() : 0L; - _artinfo.art2magimpline(art, mag, imp, lin); - TMRP_line* son = _articles.find(art, riga.giacenza(),mag, "", imp, lin, codcli); + TMRP_line* son = _articles.find(art, riga.giacenza(),mag, EMPTY_STRING, imp, lin, codcli); if (son == NULL) { - son = _articles.find(art, riga.giacenza(), mag, "", imp, lin, codcli, TRUE); + son = _articles.find(art, riga.giacenza(), mag, EMPTY_STRING, imp, lin, codcli, true); son->set_description(distinta.describe(art)); } - line.add_son(riga.val(), son); - if (riga.livello() > line.explosion_depth()) - line.set_explosion_depth(riga.livello()); + const int son_depth = line.explosion_depth()+1; + if (son_depth > son->explosion_depth()) + son->set_explosion_depth(son_depth); + line.add_son(riga.val(), son); distinta.describe(art); } } @@ -2223,11 +2220,14 @@ bool TMatResPlanning::load_planned_orders() const TString8 mag = riga.get(RDOC_CODMAG); const TString8 imp = riga.get(RDOC_IMPIANTO); const TString8 lin = riga.get(RDOC_LINEA); - const long clifor = doc.get_long(DOC_CODCF); - TMRP_line* line = _articles.find(art, liv, mag, "", imp, lin, 0L); + + // GUY was Here, but it's Koki fault! + const long codcli = is_production_article(art) ? doc.get_long(DOC_CODCF) : 0; + + TMRP_line* line = _articles.find(art, liv, mag, "", imp, lin, codcli); if (line == NULL) { - line = _articles.find(art, liv, mag, "", imp, lin, 0L, TRUE); + line = _articles.find(art, liv, mag, "", imp, lin, codcli, TRUE); line->set_description(riga.get(RDOC_DESCR)); } TPrice prz(riga.prezzo(TRUE,TRUE)); @@ -2298,9 +2298,6 @@ bool TMatResPlanning::gross2net_logic(TMRP_line &curr_article, int bucket, bool // Verifico se esiste gia' un fabbisogno netto real sm,tmpreal = -curr_article.net_requirement(bucket); -#ifdef DBG - TString80 s; -#endif if (tmpreal >= ZERO) // Devo calcolare il fabbisogno netto { tmpreal = curr_article.on_hand(bucket); @@ -2715,7 +2712,7 @@ bool TMatResPlanning::print_risalita(const TMRP_line & line, const TDate &date, TPrinter& pr = printer(); TDate todate(date); TDate fromdate = todate; - const bool isbuck0 = (round_date(fromdate) == 0); + const bool isbuck0 = round_date(fromdate) == 0; round_date(todate,TRUE); int rows=0; //int extraleadtime = _mask->get_int(F_XTRA_LDTIME); @@ -2876,7 +2873,9 @@ int TMatResPlanning::print_internal_ref(const TMRP_internalref &iref, int backle int TMatResPlanning::print_gross_ref(const TMRP_line& line, int bucket) { -return 0; + return 0; + + // Guy: a cosa serve ???????????????????????????????????????????????? TPrinter& pr = printer(); TToken_string dockey; @@ -2886,7 +2885,7 @@ return 0; TMRP_time doc_time; line.lead_time(bucket,doc_time, TRUE); TPrintrow r; - //const TString & codnum = docref->codnumdoc(); + TMRP_docref * docref = NULL; TMRP_docrefs * gr_refs= line.record(bucket).requirements_refs(); int grref = gr_refs ? gr_refs->items() : 0; @@ -2986,10 +2985,22 @@ const TRectype* TMatResPlanning::irefs2rdoc(const TMRP_internalrefs& irefs) cons } if (refs != NULL && refs->items() > 0) { - const TMRP_docref& docref = *refs->get_ref_ptr(0); - rdoc = &docref.get_rdoc(); + for (int j = refs->last(); j >= 0; j--) + { + const TMRP_docref& docref = *refs->get_ref_ptr(j); + if (docref.numrig() > 0) + rdoc = &docref.get_rdoc(); + } } } + + // Quin comincia la magia, perche' differente dalla risalita standard + if (rdoc == NULL) + { + const TMRP_internalrefs* inter = rec.internal_refs(); + if (inter != NULL && inter->items() > 0) + rdoc = irefs2rdoc(*inter); + } } return rdoc; } @@ -3169,6 +3180,10 @@ bool TMatResPlanning::emit_orders() TMRP_line* line = find_risalita_line(riga); // ... cerco la riga di risalita if (line != NULL) { + const int depth = line->explosion_depth()+1; // Profondita' esplosione (+1 per non avere zeri) + rdoc.put(RDOC_QTAGG5, depth); // Per ora memorizziamo in QTAGG5, scelto a caso + + // Cerco la riga di risalita for (int bucket = line->last_bucket(); bucket >= 0; bucket--) { const TRectype* dardoc = NULL; @@ -3186,8 +3201,7 @@ bool TMatResPlanning::emit_orders() } if (dardoc != NULL) { - rdoc.set_original_rdoc_key(*dardoc); // Imposto DAPROVV, DAANNO, DACODNUM, DANDOC, DAIDRIGA - rdoc.put(RDOC_QTAGG5, line->explosion_depth()); // Memorizzo la profondita' di esplosione + rdoc.set_original_rdoc_key(*dardoc); // Imposto DAPROVV, DAANNO, DACODNUM, DANDOC, DAIDRIGA break; } } diff --git a/projects/ps.dsw b/projects/ps.dsw index 46e282f4f..d4f7b40d7 100755 --- a/projects/ps.dsw +++ b/projects/ps.dsw @@ -78,6 +78,21 @@ Package=<4> ############################################################################### +Project: "ps0920"=.\ps0920.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name AgaLib + End Project Dependency +}}} + +############################################################################### + Global: Package=<5> diff --git a/projects/ps0872.dsp b/projects/ps0872.dsp index 9cb292f5f..7ae2ad55c 100755 --- a/projects/ps0872.dsp +++ b/projects/ps0872.dsp @@ -147,10 +147,20 @@ SOURCE=..\ps\ps0872200a.uml !IF "$(CFG)" == "ps0872 - Win32 Release" +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=D:\Release\Campo21 +InputPath=..\ps\ps0872200a.uml +InputName=ps0872200a + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + !ELSEIF "$(CFG)" == "ps0872 - Win32 Debug" -# Begin Custom Build - Compiling mask $(InputPath) -TargetDir=\u\D_02_01\exed +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\U\Luca\D_02_01\exed InputPath=..\ps\ps0872200a.uml InputName=ps0872200a diff --git a/projects/ps0920.dsp b/projects/ps0920.dsp new file mode 100755 index 000000000..9e2e7fa33 --- /dev/null +++ b/projects/ps0920.dsp @@ -0,0 +1,171 @@ +# Microsoft Developer Studio Project File - Name="ps0920" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=ps0920 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ps0920.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ps0920.mak" CFG="ps0920 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ps0920 - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "ps0920 - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ps0920 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\release" +# PROP Intermediate_Dir "..\release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /O2 /I "..\include" /I "..\xvaga" /I "..\xi" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XVT" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /i "..\..\wx240\include" /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 version.lib wsock32.lib kernel32.lib gdi32.lib user32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib comctl32.lib rpcrt4.lib winspool.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /out:"D:\Release\Campo21/ps0920.exe" +# SUBTRACT LINK32 /map /debug /nodefaultlib + +!ELSEIF "$(CFG)" == "ps0920 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\debug" +# PROP Intermediate_Dir "..\debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "..\include" /I "..\xvaga" /I "..\xi" /D "_DEBUG" /D "WIN32" /D "DBG" /D "_WINDOWS" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /i "..\..\wx240\include" /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 version.lib wsock32.lib kernel32.lib gdi32.lib user32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib comctl32.lib rpcrt4.lib winspool.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\exed\ps0920.exe" /pdbtype:sept +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "ps0920 - Win32 Release" +# Name "ps0920 - Win32 Debug" +# Begin Group "Sources" + +# PROP Default_Filter "cpp" +# Begin Source File + +SOURCE=..\ps\ps0920.cpp +# End Source File +# Begin Source File + +SOURCE=..\ps\ps0920100.cpp +# End Source File +# End Group +# Begin Group "Masks" + +# PROP Default_Filter "uml" +# Begin Source File + +SOURCE=..\ps\ps0920100a.uml + +!IF "$(CFG)" == "ps0920 - Win32 Release" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=D:\Release\Campo21 +InputPath=..\ps\ps0920100a.uml +InputName=ps0920100a + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ELSEIF "$(CFG)" == "ps0920 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\u\D_02_01\exed +InputPath=..\ps\ps0920100a.uml +InputName=ps0920100a + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + +# End Source File +# End Group +# Begin Group "Headers" + +# PROP Default_Filter "h" +# Begin Source File + +SOURCE=..\ps\ps0920.h +# End Source File +# Begin Source File + +SOURCE=..\ps\ps0920100a.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\ps0920.rc + +!IF "$(CFG)" == "ps0920 - Win32 Release" + +# ADD BASE RSC /l 0x410 +# ADD RSC /l 0x410 + +!ELSEIF "$(CFG)" == "ps0920 - Win32 Debug" + +# ADD BASE RSC /l 0x410 +# ADD RSC /l 0x410 /fo"..\Debug/ps0920.res" + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/projects/ps0920.rc b/projects/ps0920.rc new file mode 100755 index 000000000..898d4e0c0 --- /dev/null +++ b/projects/ps0920.rc @@ -0,0 +1,4 @@ +"9012" ICON DISCARDABLE "../exed/res/exe.ico" + +rcinclude ../../wx240/include/wx/msw/wx.rc + diff --git a/ve/ve1100.cpp b/ve/ve1100.cpp index 61b80aefc..474c8a5c5 100755 --- a/ve/ve1100.cpp +++ b/ve/ve1100.cpp @@ -1937,8 +1937,8 @@ bool TStampaDoc_application::create() _firmrel= new TRelation(LF_NDITTE); // istanziamento e impostazione della relazione di gestione della ditta corrente _firmrel->add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR"); _firmrel->add(LF_UNLOC,"CODDITTA=CODDITTA"); // si posiziona sulla prima unita' locale della ditta - _firmrel->add(LF_COMUNI, "COM=STATORES+COMRES", 1, LF_ANAG, 100+LF_COMUNI); - _firmrel->add(LF_COMUNI, "COM=STATORES+COMRF", 1, LF_ANAG, 200+LF_COMUNI); + _firmrel->add(LF_COMUNI, "STATO=STATORES|COM=COMRES", 1, LF_ANAG, 100+LF_COMUNI); + _firmrel->add(LF_COMUNI, "STATO=STATORES|COM=COMRF", 1, LF_ANAG, 200+LF_COMUNI); open_files(LF_TABCOM, LF_TAB, LF_OCCAS, LF_CLIFO, LF_INDSP, LF_CFVEN, LF_MOVMAG, LF_RMOVMAG, LF_CONDV, LF_ANAMAG , LF_SVRIEP, LF_AGENTI, LF_PERCPROV, LF_CAUSALI, 0); const int argc = TApplication::argc(); diff --git a/ve/ve1300.cpp b/ve/ve1300.cpp index a9bc48bc1..021610c29 100755 --- a/ve/ve1300.cpp +++ b/ve/ve1300.cpp @@ -721,8 +721,8 @@ TReport_doc::TReport_doc(const char* name) // istanziamento e impostazione della relazione di gestione della ditta corrente _firmrel.add(LF_ANAG, "TIPOA=TIPOA|CODANAGR=CODANAGR"); _firmrel.add(LF_UNLOC,"CODDITTA=CODDITTA"); // si posiziona sulla prima unita' locale della ditta - _firmrel.add(LF_COMUNI, "COM=STATORES+COMRES", 1, LF_ANAG, 100+LF_COMUNI); - _firmrel.add(LF_COMUNI, "COM=STATORES+COMRF", 1, LF_ANAG, 200+LF_COMUNI); + _firmrel.add(LF_COMUNI, "STATO=STATORES|COM=COMRES", 1, LF_ANAG, 100+LF_COMUNI); + _firmrel.add(LF_COMUNI, "STATO=STATORES|COM=COMRF", 1, LF_ANAG, 200+LF_COMUNI); _firmrel.curr().put(NDT_CODDITTA, prefix().get_codditta()); _firmrel.read(); diff --git a/ve/ve7600.cpp b/ve/ve7600.cpp index add876d4c..c1ab5dd47 100755 --- a/ve/ve7600.cpp +++ b/ve/ve7600.cpp @@ -173,55 +173,62 @@ void TRDoc2JBI::transfer() tipo = 'O'; if (tipo != ' ') { - filerdoc.zero(); - filerdoc.put("CODDITTA", get_firm()); // ditta - filerdoc.put("TIPO", tipo); // tipologia documento - filerdoc.put("DATADOC", cur.curr(LF_DOC).get(DOC_DATADOC)); // data doc. - // record anamag - const TRectype& rec_anamag = cache().get(LF_ANAMAG, cur.curr().get(RDOC_CODARTMAG)); - // record clifo e cfven - TToken_string key; - key.add(cur.curr(LF_DOC).get(DOC_TIPOCF)); - key.add(cur.curr(LF_DOC).get(DOC_CODCF)); - const TRectype& rec_cfven = cache().get(LF_CFVEN, key); - const TRectype& rec_clifo = cache().get(LF_CLIFO, key); - // record comuni - key = ""; - key.add(rec_clifo.get(CLI_STATOCF)); - key.add(rec_clifo.get(CLI_COMCF)); - const TRectype& rec_comuni = cache().get(LF_COMUNI, key); - TString16 tmp = cur.curr().get(RDOC_CODMAG); - filerdoc.put("CODDEP", tmp); // codice deposito - tmp = tmp.left(3); - filerdoc.put("CODMAG", tmp); // codice magazzino - tmp = rec_anamag.get(ANAMAG_GRMERC); - filerdoc.put("SOTTOGR", tmp); // sottogruppo merceologico - tmp = tmp.left(3); - filerdoc.put("GRUPPO", tmp); //gruppo merceologico - tmp = cur.curr(LF_DOC).get(DOC_ZONA); - if (tmp.empty()) - tmp = rec_cfven.get(CFV_CODZONA); - filerdoc.put("ZONA", tmp); // zona - filerdoc.put("REGIONE", rec_comuni.get(COM_UFFREG)); // regione - filerdoc.put("PROV", rec_comuni.get(COM_PROVCOM)); // provincia - tmp = cur.curr(LF_DOC).get(DOC_CATVEN); - if (tmp.empty()) - tmp = rec_cfven.get(CFV_CATVEN); - filerdoc.put("CATMERCLI", tmp); // cat. merceologica - filerdoc.put("CODCLI", cur.curr(LF_DOC).get(DOC_CODCF)); // codice cliente - tmp = cur.curr(LF_DOC).get(DOC_CODAG); - if (tmp.empty()) - tmp = rec_cfven.get(CFV_CODAG); - filerdoc.put("CODAG", tmp); // codice agente - filerdoc.put("CODART", cur.curr().get(RDOC_CODARTMAG)); // codice articolo - filerdoc.put("TIPODOC", cur.curr(LF_DOC).get(DOC_TIPODOC)); // tipo documento - filerdoc.put("QTA", cur.curr().get(RDOC_QTA)); // quantita - filerdoc.put("IMPORTO", ""); - filerdoc.put("SCONTATO", ""); - - update_tab(filetab, filerdoc.curr()); + const int nriga = cur.curr().get_int(RDOC_NRIGA); + TRiga_documento& rigadoc = (*doc)[nriga]; + const real qta = cur.curr().get_real(RDOC_QTA); + real importo = rigadoc.importo(FALSE, FALSE); + if (!qta.is_zero() || !importo.is_zero()) + { + filerdoc.zero(); + filerdoc.put("CODDITTA", get_firm()); // ditta + filerdoc.put("TIPO", tipo); // tipologia documento + TDate data = cur.curr(LF_DOC).get(DOC_DATADOC); + filerdoc.put("DATADOC", data.string()); // data doc. + // record anamag + const TRectype& rec_anamag = cache().get(LF_ANAMAG, cur.curr().get(RDOC_CODARTMAG)); + // record clifo e cfven + TToken_string key; + key.add(cur.curr(LF_DOC).get(DOC_TIPOCF)); + key.add(cur.curr(LF_DOC).get(DOC_CODCF)); + const TRectype& rec_cfven = cache().get(LF_CFVEN, key); + const TRectype& rec_clifo = cache().get(LF_CLIFO, key); + // record comuni + key = ""; + key.add(rec_clifo.get(CLI_STATOCF)); + key.add(rec_clifo.get(CLI_COMCF)); + const TRectype& rec_comuni = cache().get(LF_COMUNI, key); + TString16 tmp = cur.curr().get(RDOC_CODMAG); + filerdoc.put("CODDEP", tmp); // codice deposito + tmp = tmp.left(3); + filerdoc.put("CODMAG", tmp); // codice magazzino + tmp = rec_anamag.get(ANAMAG_GRMERC); + filerdoc.put("SOTTOGR", tmp); // sottogruppo merceologico + tmp = tmp.left(3); + filerdoc.put("GRUPPO", tmp); //gruppo merceologico + tmp = cur.curr(LF_DOC).get(DOC_ZONA); + if (tmp.empty()) + tmp = rec_cfven.get(CFV_CODZONA); + filerdoc.put("ZONA", tmp); // zona + filerdoc.put("REGIONE", rec_comuni.get("CODREG")); // regione + filerdoc.put("PROV", rec_comuni.get(COM_PROVCOM)); // provincia + tmp = cur.curr(LF_DOC).get(DOC_CATVEN); + if (tmp.empty()) + tmp = rec_cfven.get(CFV_CATVEN); + filerdoc.put("CATMERCLI", tmp); // cat. merceologica + filerdoc.put("CODCLI", cur.curr(LF_DOC).get(DOC_CODCF)); // codice cliente + tmp = cur.curr(LF_DOC).get(DOC_CODAG); + if (tmp.empty()) + tmp = rec_cfven.get(CFV_CODAG); + filerdoc.put("CODAG", tmp); // codice agente + filerdoc.put("CODART", cur.curr().get(RDOC_CODARTMAG)); // codice articolo + filerdoc.put("TIPODOC", cur.curr(LF_DOC).get(DOC_TIPODOC)); // tipo documento + filerdoc.put("QTA", cur.curr().get(RDOC_QTA)); // quantita + filerdoc.put("IMPORTO", importo); + importo = rigadoc.importo(TRUE, FALSE); + filerdoc.put("SCONTATO", importo); + update_tab(filetab, filerdoc.curr()); + err = filerdoc.write(); - err = filerdoc.write(); } if (err != NOERR) error_box("Errore %d in scrittura file dbf. Elaborazione non terminata.", err); @@ -270,4 +277,4 @@ int ve7600(int argc, char** argv) TRDoc2JBI app; app.run(argc, argv, "Trasferimento JBI"); return 0; -} +} \ No newline at end of file diff --git a/ve/velib.h b/ve/velib.h index 5c61c70ef..a244e4916 100755 --- a/ve/velib.h +++ b/ve/velib.h @@ -1134,11 +1134,8 @@ protected: TImporto get_cg_imp(int n); // Setta l'importo della riga n void set_cg_imp(int n, const TImporto& imp); - // verifica se il movimento e' quadrato oppure ha qualche maledetto sbilancio - // ritorna TRUE, ovviamente, se everything's alright. + public: - // ricalcola le righe di contabilita' dalle righe iva presenti - // e verifica la quadratura del movimento. Ritorna TRUE se il movimento e' scrivibile void set_caus(TCausale * c) { _caus = c;} bool movement_ok() ; void add_row_re(int i); @@ -1187,7 +1184,6 @@ class TContabilizzazione : public TElaborazione // velib04b *_rfa, // tabella raggruppamenti fiscali *_cve, // tabella categorie di vendita *_val, // tabella valute estere - *_tri, // tabella tipi di riga *_prs, // tabella prestazioni *_spp, // tabella spese *_caa, // tabella categorie acquisto articoli @@ -1261,6 +1257,8 @@ protected: bool sc_enabled() const ; // Ritorna TRUE se il modulo INTRA e' abilitato (verifica anche la causale del documento corrente) bool in_enabled() const ; + // Controlla se il tipo riga esiste + bool valid_row_type(const char* rt) const; public: // Cambia lo stato del documento error_type change_doc_status(TDocumento&); diff --git a/ve/velib02.cpp b/ve/velib02.cpp index 3455262ca..48349612d 100755 --- a/ve/velib02.cpp +++ b/ve/velib02.cpp @@ -248,8 +248,8 @@ const TSpesa_prest & TRiga_documento::spesa() const test_firm(); - const TString16 codice(get("CODART")); - TString16 index; index << tipor << codice; + const TString80 codice(get("CODART")); + TString80 index; index << tipor << codice; TSpesa_prest * s = (TSpesa_prest *) _spese.objptr(index); if (s == NULL) diff --git a/ve/velib04b.cpp b/ve/velib04b.cpp index e7d134e14..ec395c74b 100755 --- a/ve/velib04b.cpp +++ b/ve/velib04b.cpp @@ -903,7 +903,6 @@ TContabilizzazione::TContabilizzazione(const char* cod) _saldi = new TLocalisamfile(LF_SALDI); _cpg = new TTable("%CPG"); - _tri = new TTable("%TRI"); _val = new TTable("%VAL"); _prs = new TTable("PRS"); _spp = new TTable("SPP"); @@ -942,7 +941,6 @@ TContabilizzazione::TContabilizzazione(const TRectype& rec) _saldi = new TLocalisamfile(LF_SALDI); _cpg = new TTable("%CPG"); - _tri = new TTable("%TRI"); _val = new TTable("%VAL"); _prs = new TTable("PRS"); _spp = new TTable("SPP"); @@ -968,7 +966,6 @@ TContabilizzazione::~TContabilizzazione() { delete _clifo; delete _cpg; - delete _tri; delete _val; delete _gmc; delete _rfa; @@ -1374,6 +1371,10 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc) mov_rec.put(MOV_TIPO,tipocf); mov_rec.put(MOV_CODCF,codcf); mov_rec.put(MOV_OCFPI,occas); + + TString4 codvali; + real cambioi; + if (_caus->iva() == iva_acquisti) { const TString16 tdoc_cont(doc.tipo().totale_doc_cont()); @@ -1388,8 +1389,8 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc) imposta.change_to_firm_val(); mov_rec.put(MOV_RITFIS, imposta.get_num()); - TString4 codvali(_clifo->curr().get("VALINTRA")); - real cambioi = cambio; + codvali = _clifo->curr().get("VALINTRA"); + cambioi = cambio; if (codvali.not_empty() && codvali != codval) { mov_rec.put(MOV_CODVALI,codvali); @@ -1399,25 +1400,37 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc) } else { + codvali = codval; + cambioi = cambio; + if (_caus->valintra() && codvali.empty()) + { + codvali = TCurrency::get_firm_val(); + + if (codvali.empty()) + codvali = TCurrency::get_euro_val(); + cambioi = 1.00; + } + mov_rec.put(MOV_CODVALI,codval); - mov_rec.put(MOV_CAMBIOI,cambio); + mov_rec.put(MOV_CAMBIOI,cambioi); codvali = codval; } TCurrency corrval(totdocval); TCurrency corrlire(corrval); corrval.change_value(codvali, cambioi); corrlire.change_to_firm_val(); - if (::is_true_value(codvali)) - { - mov_rec.put(MOV_CORRLIRE,corrlire.get_num()); + mov_rec.put(MOV_CORRLIRE,corrlire.get_num()); + if (_caus->valintra()) mov_rec.put(MOV_CORRVALUTA,corrval.get_num()); - } - else - mov_rec.put(MOV_CORRLIRE,corrval.get_num()); TDate dataintra = data_reg; + if (doc.tipo().nota_credito()) - dataintra = doc.get_date(DOC_DATADOCRIF); + { + TDate d = doc.get_date(DOC_DATADOCRIF); + if (d.ok()) + dataintra = d; + } mov_rec.put(MOV_DATACOMPI, dataintra); } } @@ -1428,20 +1441,32 @@ error_type TContabilizzazione::compile_head_mov(TDocumento& doc) TCurrency corrval(totdocval); TCurrency corrlire(corrval); - mov_rec.put(MOV_CODVALI,codval); - mov_rec.put(MOV_CAMBIOI,cambio); - corrlire.change_to_firm_val(); - if (::is_true_value(codval)) + codvali = codval; + cambioi = cambio; + if (_caus->valintra() && codvali.empty()) { - mov_rec.put(MOV_CORRLIRE,corrlire.get_num()); - mov_rec.put(MOV_CORRVALUTA,corrval.get_num()); + codvali = TCurrency::get_firm_val(); + + if (codvali.empty()) + codvali = TCurrency::get_euro_val(); + cambioi = 1.00; } - else - mov_rec.put(MOV_CORRLIRE,corrval.get_num()); + + mov_rec.put(MOV_CODVALI,codvali); + mov_rec.put(MOV_CAMBIOI,cambioi); + corrlire.change_to_firm_val(); + mov_rec.put(MOV_CORRLIRE,corrlire.get_num()); + if (_caus->valintra()) + mov_rec.put(MOV_CORRVALUTA,corrval.get_num()); TDate dataintra = data_reg; + if (doc.tipo().nota_credito()) - dataintra = doc.get_date(DOC_DATADOCRIF); + { + TDate d = doc.get_date(DOC_DATADOCRIF); + if (d.ok()) + dataintra = d; + } mov_rec.put(MOV_DATACOMPI, dataintra); } } @@ -2192,6 +2217,12 @@ error_type TContabilizzazione::create_total_doc_row(TDocumento& doc) return _error; } +bool TContabilizzazione::valid_row_type(const char* rt) const +{ + const TRectype& tri = cache().get("%TRI", rt); + return !tri.empty(); +} + error_type TContabilizzazione::compile_rows_mov(TDocumento& doc) // Compila le righe { @@ -2218,10 +2249,9 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc) _totali_lordi.destroy();// resetta l'assoc_array dei totali lordi for (int i=1; good() && i<=rows; i++) // browse all this fucked document rows { - TRiga_documento & r = doc[i]; + TRiga_documento& r = doc[i]; tiporiga = r.get(RDOC_TIPORIGA); - _tri->put("CODTAB",tiporiga); - if (_tri->read() == NOERR) // controlla l'esistenza della riga + if (valid_row_type(tiporiga)) // controlla l'esistenza della riga { TBill conto; const char tipo = r.tipo().tipo(); @@ -2232,6 +2262,9 @@ error_type TContabilizzazione::compile_rows_mov(TDocumento& doc) const bool spesa = r.tipo().tipo() == RIGA_SPESEDOC; char tipo_rit = '\0'; + if (!riga_omaggio && r.imponibile().is_zero()) + continue; + if (spesa) tipo_rit = r.spesa().tipo_ritenuta(); @@ -2380,8 +2413,7 @@ error_type TContabilizzazione::compile_rows_mov_re(TDocumento& doc) { TRiga_documento & r = doc[i]; tiporiga = r.get(RDOC_TIPORIGA); - _tri->put("CODTAB",tiporiga); - if (_tri->read() == NOERR) // controlla l'esistenza della riga + if (valid_row_type(tiporiga)) // controlla l'esistenza della riga { TBill conto; const char tipo = r.tipo().tipo(); @@ -3315,6 +3347,9 @@ error_type TContabilizzazione::write_intra(TDocumento& doc) if (freq.compare_periodo(data_intra, data_reg, tipo_intra) < 0) { _error = intra_rett_error; + display_error(doc); + _error = no_error; + return _error; // Non posso fare movimenti ma devo fare rettifiche } } @@ -3498,6 +3533,7 @@ error_type TContabilizzazione::write_intra(TDocumento& doc) } else intra.put("CODVAL", codvali); + intra.put("CAMBIO", cambioi); if (intra.write() == _isreinsert) // Succede con le ricontabilizzazioni intra.rewrite(); // si effettua una riscrittura @@ -3678,8 +3714,8 @@ void TContabilizzazione::display_error(TDocumento& doc) "Verificare la consistenza dei files relativi ai movimenti intracomunitari.",(const char*)numerazione,numero); break; case intra_rett_error: - msg.format("Si è verificato un errore nella scrittura del movimento intracomunitario relativamente al documento %s/%ld." - "La data di competenza INTRA appartiene ad un periodo il cui riepilogo che deve essere rettificato manualmente",(const char*)numerazione,numero); + msg.format("La data di competenza INTRA del movimento intracomunitario relativo al documento %s/%ld" + "appartiene ad un periodo il cui riepilogo deve essere rettificato manualmente",(const char*)numerazione,numero); break; case cont_seq_error: msg.format("Il documento precedente al %s/%ld non e' stato contabilizzato." diff --git a/xi/xitext.c b/xi/xitext.c index 7d4f9493e..0f468a46a 100755 --- a/xi/xitext.c +++ b/xi/xitext.c @@ -1672,6 +1672,8 @@ key_left( XI_TEXT * text, XinEvent * ep ) { if ( text->ip1 >= 1 ) text->selection_start_ip = text->ip1 = --text->ip2; + else + ep->v.character.ch = XI_KEY_BTAB; // AGA was here } } else if ( text->ip1 == text->selection_start_ip ) @@ -1694,6 +1696,8 @@ key_left( XI_TEXT * text, XinEvent * ep ) if ( text->ip1 >= 1 ) new_ip = text->ip1 - 1; + else + ep->v.character.ch = XI_KEY_BTAB; // AGA was here text->selection_start_ip = text->ip1 = text->ip2 = new_ip; } } @@ -1715,6 +1719,8 @@ key_right( XI_TEXT * text, XinEvent * ep ) { if ( text->ip2 < ( int ) strlen( text->string ) ) text->selection_start_ip = text->ip1 = ++text->ip2; + else + ep->v.character.ch = '\t'; // AGA was here } } else if ( text->ip2 == text->selection_start_ip ) @@ -1737,6 +1743,9 @@ key_right( XI_TEXT * text, XinEvent * ep ) if ( text->ip2 < ( int ) strlen( text->string ) ) new_ip = text->ip2 + 1; + else + ep->v.character.ch = '\t'; // AGA was here + text->selection_start_ip = text->ip1 = text->ip2 = new_ip; } } diff --git a/xvaga/oswin32.cpp b/xvaga/oswin32.cpp index 74e2a699c..7ffa55905 100755 --- a/xvaga/oswin32.cpp +++ b/xvaga/oswin32.cpp @@ -211,7 +211,8 @@ HBITMAP OsWin32_CreateBitmap(const wxImage& img, wxDC& dc) HDC hDC = (HDC)dc.GetHDC(); int nDepth = dc.GetDepth(); - if (nDepth == 1) // Altrimenti le stampanti in B/N perdono i toni di grigio + // Altrimenti le stampanti in B/N perdono i toni di grigio + if (nDepth == 1 && !OsWin32_IsWindowsServer()) { hDC = NULL; nDepth = 24; diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index 642f251d2..82e7fb872 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -2721,30 +2721,16 @@ BOOLEAN xvt_fsys_convert_dir_to_str(DIRECTORY *dirp, char *path, int sz_path) BOOLEAN xvt_fsys_convert_str_to_dir(const char *path, DIRECTORY *dirp) { - strcpy(dirp->path, path); - return TRUE; + if (dirp != NULL) + strcpy(dirp->path, path); + return dirp != NULL; } void xvt_fsys_get_default_dir(DIRECTORY *dirp) { if (_startup_dir == NULL) - { - _startup_dir = new wxString; - wxFileName::SplitPath(wxTheApp->argv[0], _startup_dir, NULL, NULL); -#ifdef LINUX - if (*_startup_dir == ".") - *_startup_dir = ""; -#endif - if (_startup_dir->IsEmpty()) - { - char exedir[_MAX_PATH]; - xvt_fsys_get_dir(dirp); - xvt_fsys_convert_dir_to_str(dirp, exedir, sizeof(exedir)); - *_startup_dir = exedir; - } - } - if (dirp != NULL) - xvt_fsys_convert_str_to_dir(*_startup_dir, dirp); + _startup_dir = new wxString(::wxGetCwd()); + xvt_fsys_convert_str_to_dir(*_startup_dir, dirp); } BOOLEAN xvt_fsys_get_dir(DIRECTORY *dirp)