diff --git a/src/fp/fp0700.cpp b/src/fp/fp0700.cpp index 5714ea3c2..cc6b9ec9c 100644 --- a/src/fp/fp0700.cpp +++ b/src/fp/fp0700.cpp @@ -485,15 +485,6 @@ void TPAR_mask::export_paf() if (!yesno_box(msg)) break; } - if (diagn) - { - TProgram_report mov_rep; - - mov_rep.load("fp0700a"); - mov_rep.recordset()->set_var("#NUM", nreg); - - book.add(mov_rep); - } } } @@ -508,7 +499,9 @@ void TPAR_mask::export_paf() } elab.show_log(); if (diagn) - book.preview(); + { + print_reg(); + } } } @@ -532,13 +525,27 @@ void TPAR_mask::print_reg() { const long nreg = sht.get_long_row_cell(r, S_NUMREG); TProgram_report mov_rep("fp0700a"); - TISAM_recordset * recset = (TISAM_recordset *)mov_rep.recordset(); + TISAM_recordset * recset = (TISAM_recordset *)mov_rep.recordset(); + const TRectype & mov = cache().get(LF_MOV, nreg); recset->set_var("#NUM", nreg, true); recset->set_var("#TIPODOCSDI", tipo_doc_sdi, true); - //const TString n = "ACABBONE"; - //recset->set_var("#NUMPREFIX", n, true); + const TCausale & caus = cached_causale(mov.get(MOV_CODCAUS), mov.get_int(MOV_ANNOES)); + + const TString & prefix = caus.reg().prefisso(); + if (prefix.full()) + { + TString num_prefix; + num_prefix.insert("/"); + num_prefix.insert(prefix); + recset->set_var("#NUMPREFIX", num_prefix, true); + } + else + { + recset->set_var("#NUMPREFIX", EMPTY_STRING, true); + } + book.add(mov_rep); } } diff --git a/src/fp/fp0700a.rep b/src/fp/fp0700a.rep index 36d5f6624..878f0774e 100644 --- a/src/fp/fp0700a.rep +++ b/src/fp/fp0700a.rep @@ -55,7 +55,7 @@ "Registro " + 23.REG