This commit is contained in:
Men Simone 2022-01-05 18:33:39 +01:00
parent e6143a2409
commit c0ff323827
4 changed files with 242 additions and 5 deletions

View File

@ -28,6 +28,7 @@ protected:
void set_pronto();
void connect_keys();
void export_paf();
void print_reg();
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
void next_page(int p) override;
bool on_key(KEY key) override;
@ -129,9 +130,10 @@ void TPAR_mask::fill()
const bool definitivo = get_bool(F_DEFINITIVO);
enable(DLG_OK, filter_selected.empty() || filter_selected == "E" || filter_selected == "X");
enable(DLG_PRINT, true);
enable(DLG_SAVEREC, (is_f8() && (filter_selected == "X") || filter_selected == "D"));
enable(DLG_FINDREC, filter_selected == "D");
enable(DLG_PRINT, _enable_chiave_fixer && filter_selected.empty());
enable(DLG_KEY, _enable_chiave_fixer && filter_selected.empty());
regs.enable_column(S_ONLYGEN, !definitivo); // che regola si usa ??
@ -183,7 +185,8 @@ void TPAR_mask::fill()
if (chiave_paf_mov(mov, tipodocsdi, hfatt, bfatt))
{
if (paf0100f.search(nullptr, hfatt, bfatt) && paf0100f.sq_get("P1_GESTIONE") != "" && paf0100f.sq_get("P1_ERRINT") != "*")
if (paf0100f.search(nullptr, hfatt, bfatt) && paf0100f.sq_get("P1_GESTIONE") != " " &&
paf0100f.sq_get("P1_GESTIONE") != "0" && paf0100f.sq_get("P1_ERRINT") != "*")
{
if (paf0100f.sq_get("P1_GESTIONE") != filter_selected)
continue;
@ -406,7 +409,9 @@ void TPAR_mask::export_paf()
int ndocs = 0;
TSheet_field& sht = sfield(F_REGS);
const TString &tipo_doc_sdi = get(F_TIPO_SDI);
TReg_fp elab(tipo_doc_sdi, get_bool(F_DEFINITIVO));
const bool definitivo = get_bool(F_DEFINITIVO);
TReg_fp elab(tipo_doc_sdi,definitivo);
TReport_book book;
//elab.set_cache_insert(true);
if (!sht.empty())
@ -437,6 +442,14 @@ void TPAR_mask::export_paf()
if (!yesno_box(msg))
break;
}
if (!definitivo)
{
TReport mov_rep;
mov_rep.load("fp0700a");
mov_rep.set_var("#NUM", nreg);
book.add(mov_rep);
}
}
}
@ -450,6 +463,40 @@ void TPAR_mask::export_paf()
}
}
elab.show_log();
if (!definitivo)
book.preview();
}
}
void TPAR_mask::print_reg()
{
TSheet_field& sht = sfield(F_REGS);
const TString &tipo_doc_sdi = get(F_TIPO_SDI);
TReport_book book;
//elab.set_cache_insert(true);
if (!sht.empty())
{
{
TProgress_monitor pi(sht.items(), "Stampa Regolarizzazioni");
FOR_EACH_SHEET_ROW_LOOP(sht, r)
{
if (!pi.add_status())
break;
if (sht.get_bool_row_cell(r, S_SELECTED))
{
const long nreg = sht.get_long_row_cell(r, S_NUMREG);
TProgram_report mov_rep("fp0700a");
TISAM_recordset * recset = (TISAM_recordset *)mov_rep.recordset();
recset->set_var("#NUM", nreg);
recset->set_var("#TIPODOCSDI", tipo_doc_sdi);
book.add(mov_rep);
}
}
}
book.print_or_preview();
}
}
@ -478,6 +525,10 @@ bool TPAR_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
if (e == fe_button)
export_paf();
break;
case DLG_PRINT:
if (e == fe_button)
print_reg();
break;
case DLG_USER:
if (e == fe_button && jolly > 0)
{
@ -519,7 +570,7 @@ bool TPAR_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
set_pronto();
}
break;
case DLG_PRINT:
case DLG_KEY:
{
if (e == fe_button)
connect_keys();
@ -663,6 +714,7 @@ void TPAR_mask::set_err_paf()
TPAR_mask::TPAR_mask() : TAutomask("fp0700a"), _filter_changed(true), _enable_chiave_fixer(false)
{
disable(DLG_OK);
disable(DLG_PRINT);
disable(DLG_SAVEREC);
disable(DLG_FINDREC);
load_all_fields();

View File

@ -8,6 +8,7 @@
#define START_MASK F_DATAINI
#define END_MASK F_DEFINITIVO
#define DLG_KEY 501
#define S_COD_CAUS 101
#define S_DESCR 102
@ -15,6 +16,7 @@
#define S_SELECTED 101
#define S_ANNO 102
#define S_NUMREG 103

166
src/fp/fp0700a.rep Normal file
View File

@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="" page_merge="" save_printer="" name="fp0700a" use_printer_font="" orientation="" page_split="" lpi="6" command="" class="">
<font face="Arial" size="8" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1">
<field x="1" y="1" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Fattura n. " + 100@.NUMREG</source>
</field>
<field x="23" y="1" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="">
<source>"del " + 100@.DATAREG</source>
</field>
<field x="50" y="1" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="1" codval="" id="" pattern="1" hide_zero="" text="">
<source>100@.TIPO</source>
</field>
<field x="52" y="1" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="6" codval="" id="" pattern="1" hide_zero="" text="">
<source>100@.CODICE</source>
</field>
<field x="1" y="3" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Tipo Documento " + #TIPODOCSDI</source>
</field>
<field x="50" y="3" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="50" codval="" id="" pattern="1" hide_zero="" text="">
<source>20.RAGSOC</source>
</field>
<field x="1" y="5" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Data Ricezione " + 100@.DATAREG</source>
</field>
<field x="50" y="5" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="50" codval="" id="" pattern="1" hide_zero="" text="">
<source>20.INDCF + " n. " + 20.CIVCF</source>
</field>
<field x="50" y="6" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="5" codval="" id="" pattern="1" hide_zero="" text="">
<source>20.CAPCF</source>
</field>
<field x="57" y="6" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="40" codval="" id="" pattern="1" hide_zero="" text="">
<source>13.DENCOM + " " + 20.PROVCF</source>
</field>
<field x="1" y="8" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="16" codval="" id="" pattern="1" hide_zero="" text="Totale Documento" />
<field x="18" y="8" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="16" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>TOTDOC</source>
</field>
<field x="50" y="8" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Partita IVA " + 20.STATOPAIV + 20.PAIV</source>
</field>
<field x="1" y="10" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Protocollo Debito " + PROTIVA</source>
</field>
<field x="22" y="10" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="">
<source>"del " + DATAREG</source>
</field>
<field x="50" y="10" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="">
<source>REG</source>
</field>
<field x="1" y="12" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Protocollo Credito " + 100@.PROTIVA</source>
</field>
<field x="22" y="12" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="">
<source>"del " + 100@.DATAREG</source>
</field>
<field x="50" y="12" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="">
<source>100@.REG</source>
</field>
<field x="1" y="14" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="">
<source>"Protocollo Credito " + 100@.NUMDOC</source>
</field>
<field x="22" y="14" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="">
<source>"del " + 100@.DATADOC</source>
</field>
<field x="17" y="16" deactivated="" type="Testo" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="Imponibile" />
<field x="33" y="16" deactivated="" type="Testo" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="Totale" />
<field x="49" y="16" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Cod." />
<field x="54" y="16" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Nat." />
<field x="59" y="16" deactivated="" type="Testo" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="Imposta" />
<field x="75" y="16" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="Conto" />
<field border="2" y="17" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="120" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" height="4" page_break="" can_break="" pattern="1">
<field deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="90" codval="" height="2" id="" pattern="1" hide_zero="" text="PROSPETTO INTEGRAZIONE ACQUISTO CEE">
<font face="Arial" bold="1" size="20" />
</field>
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="1" hidden="" page_break="" can_break="" pattern="1">
<field x="49" deactivated="" type="Stringa" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="">
<source>25-&#3E;CODIVA</source>
</field>
<field x="54" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="">
<source>201@-&#3E;S12</source>
</field>
<field x="90" deactivated="" type="Stringa" hidden="" link="" dynamic_height="1" shade_offset="" width="30" codval="" height="2" id="" pattern="1" hide_zero="" text="">
<source>19-&#3E;DESCR</source>
</field>
<field x="33" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="100" pattern="1" hide_zero="" text="###.###.###,@@">
<source>25-&#3E;IMPONIBILE</source>
<postscript description="B1.100 POSTSCRIPT">#THIS @
#F1.100 +!</postscript>
</field>
<field x="59" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="101" pattern="1" hide_zero="" text="###.###.###,@@">
<source>25-&#3E;IMPOSTA</source>
<postscript description="B1.101 POSTSCRIPT">#THIS @
#F1.101 +!</postscript>
</field>
<field x="17" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="102" pattern="1" hide_zero="" text="###.###.###,@@">
<source>#100+#101</source>
</field>
<field x="75" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="3" codval="" id="103" pattern="1" hide_zero="" text="">
<source>25-&#3E;GRUPPO</source>
</field>
<field x="79" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="3" codval="" id="104" pattern="1" hide_zero="" text="">
<source>25-&#3E;CONTO</source>
</field>
<field x="83" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="105" pattern="1" hide_zero="" text="">
<source>25-&#3E;SOTTOCONTO</source>
</field>
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="1" hidden="" height="3" page_break="" can_break="" pattern="1">
<field border="1" y="0.25" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="120" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="1" y="0.5" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="Totale Movimento" />
<field x="33" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="100" pattern="1" hide_zero="" text="###.###.###,@@">
<prescript description="F1.100 PRESCRIPT">#THIS @
0
&#3C;
IF
#THIS @
-1
*
#THIS !
THEN</prescript>
</field>
<field x="75" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="101" pattern="1" hide_zero="" text="###.###.###,@@">
<prescript description="F1.101 PRESCRIPT">#THIS @
0
&#3C;
IF
"A" #100 !
#THIS @
-1
*
#THIS !
ELSE
"D" #100 !
THEN
</prescript>
</field>
<field x="17" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="15" codval="" id="102" pattern="1" hide_zero="" text="###.###.###,@@">
<source>#100+#101</source>
<prescript description="F1.102 PRESCRIPT">#THIS @
0
&#3C;
IF
#THIS @
-1
*
#THIS !
THEN
</prescript>
</field>
</section>
<sql>USE MOV
JOIN RMOVIVA INTO NUMREG==NUMREG
JOIN MOV ALIAS 100 INTO NUMREG==MOVCOLL
JOIN CLIFO TO 100@ INTO TIPOCF==TIPO CODCF==CODCF
JOIN COMUNI TO CLIFO INTO STATO==STATOCF COM==COMCF
JOIN PCON TO RMOVIVA INTO GRUPPO==GRUPPO CONTO==CONTO SOTTOCONTO==SOTTOCONTO
JOIN %IVA TO RMOVIVA ALIAS 201 INTO CODTAB==CODIVA
FROM NUMREG=#NUM
TO NUMREG=#NUM</sql>
</report>

View File

@ -15,6 +15,13 @@ BEGIN
FLAGS "D"
END
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT 1 1 "Stampa"
PICTURE BMP_PRINT
FLAGS "D"
END
BUTTON DLG_NULL 2 2
BEGIN
PROMPT -1 1 ""
@ -35,7 +42,7 @@ BEGIN
FLAGS "D"
END
BUTTON DLG_PRINT 2 2
BUTTON DLG_KEY 2 2
BEGIN
PROMPT 1 1 "Correggi chiavi"
PICTURE TOOL_SMILE
@ -179,6 +186,11 @@ BEGIN
PROMPT 1 1 ""
END
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT 1 1 ""
END
BUTTON DLG_DELREC 2 2
BEGIN
PROMPT 1 1 ""
@ -276,6 +288,11 @@ BEGIN
PROMPT 1 1 ""
END
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT 1 1 ""
END
BUTTON DLG_USER 2 2
BEGIN
PROMPT 1 1 "Collega"