diff --git a/cd/test/sc1375.txt b/cd/test/sc1375.txt new file mode 100644 index 000000000..2d6332747 --- /dev/null +++ b/cd/test/sc1375.txt @@ -0,0 +1 @@ +sc2.exe diff --git a/cd/test/sc1375a.ini b/cd/test/sc1375a.ini new file mode 100644 index 000000000..f23d1c9aa --- /dev/null +++ b/cd/test/sc1375a.ini @@ -0,0 +1,20 @@ +[Main] +Demo=0 +[sc2] +File(27) = sc2.exe|X +Patch = 1375 +Versione = 21511200 + +[sc] +Data = 28-11-2024 +Descrizione = Saldaconto +Dischi = 1 +Moduli = ba,cg +OEM = +Patch = 1375 +PostProcess = +PreProcess = +Prezzo(1) = +Prezzo(2) = +Versione = 21511200 + diff --git a/cd/test/sc1375a1.zip b/cd/test/sc1375a1.zip new file mode 100644 index 000000000..007c5b9f8 Binary files /dev/null and b/cd/test/sc1375a1.zip differ diff --git a/src/include/form.h b/src/include/form.h index 26b59d087..f2eaa078c 100755 --- a/src/include/form.h +++ b/src/include/form.h @@ -348,11 +348,12 @@ public: // @cmember Ritorna la relazione corrente virtual TRelation* relation() const { return _relation; } - // @cmember Ritorna la corrente - virtual TCursor* cursor() const - { return _cursor; } // @cmember Ritorna la corrente - virtual TSorted_cursor* sorted_cursor() const { return _sorted_cursor ? (TSorted_cursor *) _cursor : NULL; } + virtual TCursor* cursor() const { return _cursor; } + // @cmember Ritorna la corrente + virtual TCursor* set_cursor(TCursor * c) { safe_delete(_cursor); _cursor = c; return _cursor; } + // @cmember Ritorna la corrente + virtual TSorted_cursor* sorted_cursor() const { return _sorted_cursor ? (TSorted_cursor *) _cursor : nullptr; } // @cmember Ritorna la corrente TRelation_description& rel_desc() const; // @cmember Effettua operazioni personalizzate dall'applicazione sul diff --git a/src/sc/sc2101.cpp b/src/sc/sc2101.cpp index fb190ce82..a5d0ac84d 100755 --- a/src/sc/sc2101.cpp +++ b/src/sc/sc2101.cpp @@ -590,11 +590,14 @@ int TEC_mask::print_one(const char * tipo, const long codice) _form->azzera_totali(); // Azzera totali di fine pagina // Filtra solo le partite del cliente selezionato - TRectype & fcrec = _form->cursor()->curr(); + TCursor * c = _form->cursor(); + TRectype & fcrec = c->curr(); TRelation rel(LF_PARTITE); TRectype filter(rel.curr()); + long savepos = c->pos(); + long savekey = c->key(); - + c->setkey(1); fcrec.zero(); fcrec.put(CLI_TIPOCF, who()); fcrec.put(CLI_CODCF, codice); @@ -703,6 +706,8 @@ int TEC_mask::print_one(const char * tipo, const long codice) // f.recordset().new_rec(); } } + *c = savepos; + c->setkey(savekey); } xvtil_statbar_set(nullptr); return printed; diff --git a/src/sc/sc2402.cpp b/src/sc/sc2402.cpp index d34bb2ea7..4903c4c8d 100755 --- a/src/sc/sc2402.cpp +++ b/src/sc/sc2402.cpp @@ -230,7 +230,7 @@ bool TSol_mask::some_to_print(const char * tipo, const long codice) int TSol_mask::print_one(const char * tipo, const long codice) { - TSol_form& f = (TSol_form&)form(); + TSol_form & f = (TSol_form&)form(); // preparazione variabili per controllo lingua ; @@ -253,6 +253,17 @@ int TSol_mask::print_one(const char * tipo, const long codice) partite.put(PART_TIPOCF, tipo); partite.put(PART_SOTTOCONTO, codice); + TCursor * cur = f.cursor(); + TRectype & fcrec = cur->curr(); + long savepos = cur->pos(); + long savekey = cur->key(); + + fcrec.zero(); + fcrec.put(CLI_TIPOCF, who()); + fcrec.put(CLI_CODCF, codice); + cur->setkey(1); + cur->read(); + const TRectype& parkur = partite.curr(); const TRectype filter(parkur); bool one_printed = false; // booleano di controllo di riuscita della stampa @@ -360,6 +371,8 @@ int TSol_mask::print_one(const char * tipo, const long codice) printer().formfeed(); } } + *cur = savepos; + cur->setkey(savekey); return one_printed ? 1 : 0; }