Patch level : 12.00 1370

Files correlati     : cg0.exe cg0800a.msk cg0900a.msk cg0800a.rep cg0900a.rep cg4.exe cg4b00a.msk cg4c00a.msk cg4b00a.rep cg4c00a.rep cgmenu.men
Bug                 :

Commento:
Progressivi IVA per attività (registrazione e competenza)
This commit is contained in:
Alessandro Bonazzi 2025-02-06 23:48:43 +01:00
parent 9755381faf
commit 3c1425f34b
23 changed files with 1197 additions and 314 deletions

View File

@ -13,7 +13,8 @@ int main(int argc, char** argv)
case 4: cg0500(argc,argv); break; // Causali contabili
case 5: cg0600(argc,argv); break; // Tabelle contabili
case 6: cg0700(argc, argv); break; // Clienti/Fornitori occasionali
case 7: cg0800(argc, argv); break; // Stampa progressivi IVA avanzata
case 7: cg0800(argc, argv); break; // Stampa progressivi IVA avanzata
case 8: cg0900(argc, argv); break; // Stampa progressivi IVA avanzata per attività
default: cg0100(argc,argv); break; // Piano dei conti
}
return 0;

View File

@ -9,6 +9,7 @@ int cg0500(int argc, char* argv[]);
int cg0600(int argc, char* argv[]);
int cg0700(int argc, char* argv[]);
int cg0800(int argc, char* argv[]);
int cg0900(int argc, char* argv[]);
#endif // __CG0_H
@ -24,4 +25,3 @@ int cg0800(int argc, char* argv[]);

View File

@ -62,7 +62,7 @@ void TRiepilogoIVA_app::main_loop()
while (m.run() != K_QUIT)
{
TRiepilogoIVA_report rep;
TFilename repname = m.get(F_REPORT);
TFilename repname = m.get(DLG_REPORT);
TRiepilogoIVA_recordset * recset = new TRiepilogoIVA_recordset;
if (repname.blank())
@ -95,10 +95,6 @@ void TRiepilogoIVA_app::main_loop()
a.set_end_month();
recset->set_from(da);
recset->set_to(a);
const TString & codatt = m.get(F_CODATT);
recset->set_codatt(codatt);
rep.set_recordset(recset);
rep.print_or_preview();
}

View File

@ -3,6 +3,3 @@
#define F_ANNO 103
#define F_DAMESE 104
#define F_AMESE 105
#define F_CODATT 106
#define F_REPORT 200

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="" page_merge="" save_printer="" name="cg0800a" use_printer_font="" orientation="2" page_split="" lpi="6" command="cg0 -7" class="cg0800">
<report libraries="" page_merge="" save_printer="" name="cg0800a" use_printer_font="" orientation="2" page_split="" lpi="6" command="cg0 -7" class="cg0800a">
<description>Riepilogo progressivi IVA</description>
<font face="Arial" size="7" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1">
@ -9,7 +9,7 @@
<field x="48.5" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Ditta">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="54.5" deactivated="" type="Stringa" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="50" codval="" id="" pattern="1" hide_zero="" text="">
<field x="51.5" deactivated="" type="Stringa" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="50" codval="" id="" pattern="1" hide_zero="" text="">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="154" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Pag.">
@ -63,13 +63,6 @@
<li Value="" Code="13" />
</list>
</field>
<field x="103.5" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="28" codval="" id="" pattern="1" hide_zero="" text="Codice attivit&#E0;">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="126" y="1" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="8" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#CODATT</source>
</field>
<field x="63.5" y="2.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="10" codval="" id="" pattern="1" hide_zero="" text="Vendite">
<font face="Arial" size="10" />
</field>
@ -94,7 +87,7 @@
<field x="138.5" y="3" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="25" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field border="2" x="4" y="4.75" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="160" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field border="2" y="4.75" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="" hidden="" page_break="" can_break="" pattern="1" />
@ -125,22 +118,22 @@
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.105 +!</postscript>
</field>
<field x="109.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="109" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.106 +!</postscript>
</field>
<field x="123" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="122.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.107 +!</postscript>
</field>
<field x="137" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="136" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.108 +!</postscript>
</field>
<field x="150.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="149.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.109 +!</postscript>
@ -148,17 +141,17 @@
</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="" page_break="" can_break="" pattern="1">
<field border="2" x="4" y="0.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="160" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field border="2" y="0.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="9" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" height="2" id="101" pattern="1" hide_zero="" text="Totale">
<source>DESC</source>
</field>
<field x="54.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="68" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="55" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="68.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="82" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="95.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="109.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="123" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="137.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="151" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="109" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="122.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="149.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
</report>

View File

@ -1,27 +1,15 @@
#include "cg0800a.h"
#define ALL_EXPORT
#define REPORT
#define CLASS_NAME "cg0800a"
TOOLBAR "topbar" 0 0 0 2
#include <aprintbar.h>
ENDPAGE
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT 1 1 "Stampa"
PICTURE BMP_PRINT
END
BUTTON DLG_SETPRINT 2 2
BEGIN
PROMPT 1 1 "Imposta"
PICTURE BMP_SETPRINT
END
BUTTON DLG_EDIT 2 2
BEGIN
PROMPT 1 1 "~Edit"
PICTURE BMP_EDIT
END
#include <helpbar.h>
TOOLBAR "bottombar" 0 -3 0 1
#include <bprintbar.h>
ENDPAGE
PAGE "Stampa Riepilogo IVA" -1 -1 62 5
@ -71,33 +59,6 @@ BEGIN
VALIDATE F_DAMESE<=F_AMESE
END
STRING F_CODATT 5
BEGIN
PROMPT 2 7 "Codice Attivita'"
FLAGS "UZ"
USE LF_ATTIV KEY 1
INPUT CODDITTA F_CODDITTA SELECT
INPUT CODATT F_CODATT
DISPLAY "Attivita'" CODATT
DISPLAY "Prevalente" ATTPREV
DISPLAY " @48" DESCR
OUTPUT F_CODATT CODATT
WARNING "Attivita' assente"
CHECKTYPE NORMAL
END
STRING F_REPORT 256 50
BEGIN
PROMPT 2 -3 "Tipo di stampa "
RSELECT "cg0800"
CHECKTYPE NORMAL
END
STRING DLG_PROFILE 256 50
BEGIN
PROMPT 2 -1 "Profilo "
PSELECT
END
ENDPAGE
ENDMASK

126
src/cg/cg0900.cpp Normal file
View File

@ -0,0 +1,126 @@
#include <applicat.h>
#include <automask.h>
#include <reprint.h>
#include <variant.h>
#include "cglib.h"
#include "cg0900a.h"
///////////////////////////////////////////////////////////
// TRiepilogoIVAatt_mask
///////////////////////////////////////////////////////////
class TRiepilogoIVAatt_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TRiepilogoIVAatt_mask() : TAutomask("cg0900a") { }
};
bool TRiepilogoIVAatt_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
TRiepilogoIVAatt_mask & m = (TRiepilogoIVAatt_mask &) o.mask();
switch (o.dlg())
{
case F_DAMESE:
if (e == fe_modify || e == fe_close)
{
if (atoi(o.get()) > m.get_int(F_AMESE))
m.set(F_AMESE, o.get());
}
break;
case F_AMESE:
if (e == fe_modify || e == fe_close)
{
if (atoi(o.get()) < m.get_int(F_DAMESE))
o.set(m.get(F_DAMESE));
}
break;
default:
break;
}
return true;
}
///////////////////////////////////////////////////////////
// TRiepilogoIVAatt_app
///////////////////////////////////////////////////////////
class TRiepilogoIVAatt_app : public TSkeleton_application
{
protected:
virtual void main_loop();
};
void TRiepilogoIVAatt_app::main_loop()
{
TRiepilogoIVAatt_mask m;
while (m.run() != K_QUIT)
{
TRiepilogoIVA_report rep;
TFilename repname = m.get(DLG_REPORT);
TRiepilogoIVAatt_recordset * recset = new TRiepilogoIVAatt_recordset;
if (repname.blank())
repname = "cg0900a";
rep.load(repname);
if (recset != NULL)
{
int anno = m.get_int(F_ANNO);
int damese = m.get_int(F_DAMESE);
int amese = m.get_int(F_AMESE);
recset->freeze();
recset->set_anno(anno);
if (damese == 13)
{
damese = 1;
amese = 12;
recset->set_annual(true);
}
recset->set_da_mese(damese);
recset->set_a_mese(amese);
const TDate da(1, damese, anno);
TDate a(1, amese, anno);
if (m.get_long(F_DAMESE) == 13)
a.addyear();
a.set_end_month();
recset->set_from(da);
recset->set_to(a);
const TString & codatt = m.get(F_CODATT);
recset->set_codatt(codatt);
rep.set_recordset(recset);
if (codatt.full())
{
TReport_section * f1 = rep.find_section('F', 1);
if (f1 != nullptr)
{
const int fields = f1->items();
for (int i = 0; i < fields; i++)
f1->field(i).hide();
}
}
rep.print_or_preview();
}
}
}
int cg0900(int argc, char* argv[])
{
TRiepilogoIVAatt_app app;
app.run(argc, argv, TR("Stampa progressivi IVA avanzata per attività"));
return 0;
}

7
src/cg/cg0900a.h Normal file
View File

@ -0,0 +1,7 @@
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_ANNO 103
#define F_DAMESE 104
#define F_AMESE 105
#define F_CODATT 106
#define F_DESATT 107

214
src/cg/cg0900a.rep Normal file
View File

@ -0,0 +1,214 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="" page_merge="" save_printer="" name="cg0900a" use_printer_font="" orientation="2" page_split="1" lpi="6" command="cg0 -8" class="cg0900a">
<description>Riepilogo progressivi IVA per attivita'</description>
<font face="Arial" size="7" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1">
<field x="4" deactivated="" type="Data" hidden="" link="" dynamic_height="" shade_offset="" width="10" codval="" id="" pattern="1" hide_zero="" text="">
<source>#SYSTEM.DATE</source>
</field>
<field x="48.5" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Ditta">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="54.5" deactivated="" type="Stringa" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="50" codval="" id="" pattern="1" hide_zero="" text="">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="154" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Pag.">
<source>#PAGE</source>
</field>
<field x="158.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="5" codval="" id="" pattern="1" hide_zero="" text="">
<source>#PAGE</source>
</field>
<field x="33.5" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="25" codval="" id="" pattern="1" hide_zero="" text="Progressivi IVA per registro">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="59.5" y="1" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="6" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#ANNO</source>
</field>
<field x="69.5" y="1" deactivated="" type="Array" hidden="" link="" dynamic_height="" shade_offset="" width="16" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#DAMESE</source>
<list>
<li Value="da gennaio" Code="1" />
<li Value="da febbraio" Code="2" />
<li Value="da marzo" Code="3" />
<li Value="da aprile" Code="4" />
<li Value="da maggio" Code="5" />
<li Value="da giugno" Code="6" />
<li Value="da luglio" Code="7" />
<li Value="da agosto" Code="8" />
<li Value="da settembre" Code="9" />
<li Value="da ottobre" Code="10" />
<li Value="da novembre" Code="11" />
<li Value="da dicembre" Code="12" />
<li Value="annuale" Code="13" />
</list>
</field>
<field x="86.5" y="1" deactivated="" type="Array" hidden="" link="" dynamic_height="" shade_offset="" width="16" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#AMESE</source>
<list>
<li Value="a gennaio" Code="1" />
<li Value="a febbraio" Code="2" />
<li Value="a marzo" Code="3" />
<li Value="ad aprile" Code="4" />
<li Value="a maggio" Code="5" />
<li Value="a giugno" Code="6" />
<li Value="a luglio" Code="7" />
<li Value="ad agosto" Code="8" />
<li Value="a settembre" Code="9" />
<li Value="a ottobre" Code="10" />
<li Value="a novembre" Code="11" />
<li Value="a dicembre" Code="12" />
<li Value="" Code="13" />
</list>
</field>
<field x="105" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="28" codval="" id="" pattern="1" hide_zero="" text="per attivit&#E0;">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="63.5" y="2.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="10" codval="" id="" pattern="1" hide_zero="" text="Vendite">
<font face="Arial" size="10" />
</field>
<field x="87.5" y="2.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="18" codval="" id="" pattern="1" hide_zero="" text="Corrispettivi">
<font face="Arial" size="10" />
</field>
<field x="119.5" y="2.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="12" codval="" id="" pattern="1" hide_zero="" text="Acquisti">
<font face="Courier New" size="10" />
</field>
<field x="141.5" y="2.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="Acquisti indetraibili">
<font face="Arial" size="10" />
</field>
<field x="53.5" y="3" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field x="81.5" y="3" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field x="110" y="3" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field x="138.5" y="3" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="25" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field border="2" y="4.75" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="2" hidden="" page_break="" can_break="" pattern="1">
<groupby>COD[1,5]</groupby>
<field deactivated="" type="Numero" hidden="1" align="right" link="" dynamic_height="" shade_offset="" width="6" codval="" id="99" pattern="1" hide_zero="" text="">
<source>#SYSTEM.FIRM</source>
</field>
<field x="14" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="100" pattern="1" hide_zero="" text="">
<source>COD[1,5]</source>
<postscript description="H2.100 POSTSCRIPT">MESSAGE COPY,F2.100</postscript>
</field>
<field x="21" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="50" codval="" id="101" pattern="1" hide_zero="" text="">
<prescript description="H2.101 PRESCRIPT">MESSAGE ISAMREAD,10,CODDITTA=#99!CODATT=#100,DESCR</prescript>
<postscript description="H2.101 POSTSCRIPT">MESSAGE COPY,F2.101</postscript>
</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="4" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="">
<source>COD[6,9]</source>
</field>
<field x="9" deactivated="" type="Stringa" hidden="" link="" dynamic_height="1" shade_offset="" width="45" codval="" height="2" id="" pattern="1" hide_zero="" text="">
<source>DESC</source>
</field>
<field x="55" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPVEN</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.102 +!</postscript>
</field>
<field x="68.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAVEN</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.103 +!</postscript>
</field>
<field x="82" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPCORR</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.104 +!</postscript>
</field>
<field x="95.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVACORR</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.105 +!</postscript>
</field>
<field x="109.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.106 +!</postscript>
</field>
<field x="123" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.107 +!</postscript>
</field>
<field x="137" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.108 +!</postscript>
</field>
<field x="150.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.109 +!</postscript>
</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="" page_break="" can_break="" pattern="1">
<field border="2" y="0.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="9" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" height="2" id="101" pattern="1" hide_zero="" text="Totale">
<source>DESC</source>
</field>
<field x="55" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="68.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="82.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="96" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="110" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="123.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="137" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="151.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="2" hidden="" height="4" page_break="" can_break="" pattern="1">
<field border="2" y="0.25" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="14" y="0.75" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="100" pattern="1" hide_zero="" text="" />
<field x="9" y="0.75" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="101" pattern="1" hide_zero="" text="Totale">
<source>DESC</source>
</field>
<field x="21" y="0.75" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="33" codval="" height="2" id="101" pattern="1" hide_zero="" text="" />
<field x="55" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.102 POSTSCRIPT">#THIS @
#F1.102 +!</postscript>
</field>
<field x="68.5" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.103 POSTSCRIPT">#THIS @
#F1.103 +!</postscript>
</field>
<field x="82.5" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.104 POSTSCRIPT">#THIS @
#F1.104 +!</postscript>
</field>
<field x="96" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.105 POSTSCRIPT">#THIS @
#F1.105 +!</postscript>
</field>
<field x="110" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.106 POSTSCRIPT">#THIS @
#F1.106 +!</postscript>
</field>
<field x="123.5" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.107 POSTSCRIPT">#THIS @
#F1.107 +!</postscript>
</field>
<field x="137" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.108 POSTSCRIPT">#THIS @
#F1.108 +!</postscript>
</field>
<field x="151.5" y="0.75" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.109 POSTSCRIPT">#THIS @
#F1.109 +!</postscript>
</field>
</section>
</report>

93
src/cg/cg0900a.uml Normal file
View File

@ -0,0 +1,93 @@
#include "cg0900a.h"
#define ALL_EXPORT
#define REPORT
#define CLASS_NAME "cg0900a"
TOOLBAR "topbar" 0 0 0 2
#include <aprintbar.h>
ENDPAGE
TOOLBAR "bottombar" 0 -3 0 1
#include <bprintbar.h>
ENDPAGE
PAGE "Stampa Riepilogo IVA per attività" -1 -1 62 5
GROUPBOX DLG_NULL 74 3
BEGIN
PROMPT 1 0 ""
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Ditta "
FLAGS "FRD"
USE LF_NDITTE KEY 1
INPUT CODDITTA F_CODDITTA
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE REQUIRED
END
STRING F_RAGSOC 50
BEGIN
PROMPT 15 1 "Ragione "
FLAGS "D"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 2 3 "Anno "
FLAGS "AP"
CHECKTYPE REQUIRED
END
LIST F_DAMESE 20
BEGIN
PROMPT 2 5 "Da mese "
ITEM "13|13a liquid."
FLAGS "MP"
MESSAGE COPY,F_AMESE
END
LIST F_AMESE 20
BEGIN
PROMPT 35 5 " A mese "
ITEM "13|13a liquid."
FLAGS "MP"
WARINIG "Il mese di inizio non può essere successico al mese di fine"
VALIDATE F_DAMESE<=F_AMESE
END
STRING F_CODATT 5
BEGIN
PROMPT 2 7 "Codice Attivita'"
FLAGS "UZ"
USE LF_ATTIV KEY 1
INPUT CODDITTA F_CODDITTA SELECT
INPUT CODATT F_CODATT
DISPLAY "Attivita'" CODATT
DISPLAY "Prevalente" ATTPREV
DISPLAY " @50" DESCR
OUTPUT F_CODATT CODATT
OUTPUT F_DESATT DESCR
WARNING "Attivita' assente"
CHECKTYPE NORMAL
END
STRING F_DESATT 50
BEGIN
PROMPT 2 9 "Codice Attivita'"
FLAGS "UZ"
USE LF_ATTIV KEY 2
INPUT CODDITTA F_CODDITTA SELECT
INPUT DESCR F_DESATT
DISPLAY " @50" DESCR
DISPLAY "Attivita'" CODATT
DISPLAY "Prevalente" ATTPREV
COPY OUTPUT F_CODATT
WARNING "Attivita' assente"
CHECKTYPE NORMAL
END
ENDMASK

View File

@ -17,6 +17,7 @@ int main(int argc,char** argv)
case 8: cg4900(argc,argv); break; // Visualizzazione liquidazione acconti
case 9: cg4a00(argc, argv); break; // Gestione Autotrasportatori
case 10: cg4b00(argc, argv); break; // Stampa progressivi IVA per competenza
case 11: cg4c00(argc, argv); break; // Stampa progressivi IVA per attività/competenza
default: cg4100(argc,argv); break; // Ricalcolo saldi
}
return 0;

View File

@ -12,6 +12,7 @@ int cg4800(int argc, char* argv[]);
int cg4900(int argc, char* argv[]);
int cg4a00(int argc, char* argv[]);
int cg4b00(int argc, char* argv[]);
int cg4c00(int argc, char* argv[]);
#endif // __CG4_H

View File

@ -98,7 +98,7 @@ void TRiepilogoIVA_app::main_loop()
while (m.run() != K_QUIT)
{
TRiepilogoIVA_report rep;
TFilename repname = m.get(F_REPORT);
TFilename repname = m.get(DLG_REPORT);
TRiepilogoIVAcompetenza_recordset *recset = new TRiepilogoIVAcompetenza_recordset;
if (repname.blank())
@ -122,10 +122,6 @@ void TRiepilogoIVA_app::main_loop()
recset->set_a_mese(amese);
recset->set_from(m.get_date(F_DADATA));
recset->set_to(m.get_date(F_ADATA));
const TString & codatt = m.get(F_CODATT);
recset->set_codatt(codatt);
rep.set_recordset(recset);
rep.print_or_preview();
}

View File

@ -6,7 +6,3 @@
#define F_DADATA 106
#define F_ADATA 107
#define F_CODATT 108
#define F_REPORT 200
#define F_PROFILO 201

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="" page_merge="" save_printer="" name="cg4b00a" use_printer_font="" orientation="2" page_split="" lpi="6" command="cg4 -10" class="cg4b00">
<report libraries="" page_merge="" save_printer="" name="cg4b00a" use_printer_font="" orientation="2" page_split="" lpi="6" command="cg4 -10" class="cg4b00a">
<description>Riepilogo progressivi IVA per competenza</description>
<font face="Arial" size="7" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1">
@ -63,13 +63,6 @@
<li Value="" Code="13" />
</list>
</field>
<field x="103.5" y="1.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="28" codval="" id="" pattern="1" hide_zero="" text="Codice attivit&#E0;">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="126" y="1.25" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="8" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#CODATT</source>
</field>
<field x="41" y="2.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="35" codval="" id="" pattern="1" hide_zero="" text="Da data di registrazione">
<font face="Courier New" bold="1" size="10" />
</field>
@ -108,7 +101,7 @@
<field x="137" y="4.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field border="2" x="4" y="5.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="160" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field border="2" y="5.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Body" level="" hidden="" page_break="" can_break="" pattern="1" />
@ -129,32 +122,32 @@
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.103 +!</postscript>
</field>
<field x="82.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="82" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPCORR</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.104 +!</postscript>
</field>
<field x="96" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="95.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVACORR</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.105 +!</postscript>
</field>
<field x="110" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="109" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.106 +!</postscript>
</field>
<field x="123.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="122.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.107 +!</postscript>
</field>
<field x="137.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="136" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.108 +!</postscript>
</field>
<field x="151" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<field x="149.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F1.109 +!</postscript>
@ -162,17 +155,17 @@
</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="" page_break="" can_break="" pattern="1">
<field border="2" x="4" y="0.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="160" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field border="2" y="0.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="9" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" height="2" id="101" pattern="1" hide_zero="" text="Totale">
<source>DESC</source>
</field>
<field x="55" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="69" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="82.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="96.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="110" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="123.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="137" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="150.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="68.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="82" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="95.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="109" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="122.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="136" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="149.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
</report>

View File

@ -1,29 +1,19 @@
#include "cg4b00a.h"
#include "cg4c00a.h"
#define ALL_EXPORT
#define REPORT
#define CLASS_NAME "cg4b00a"
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_PRINT 2 2
BEGIN
PROMPT 1 1 "Stampa"
PICTURE BMP_PRINT
END
#include <aprintbar.h>
ENDPAGE
BUTTON DLG_SETPRINT 2 2
BEGIN
PROMPT 1 1 "Imposta"
PICTURE BMP_SETPRINT
END
BUTTON DLG_EDIT 2 2
BEGIN
PROMPT 1 1 "~Edit"
PICTURE BMP_EDIT
END
#include <helpbar.h>
TOOLBAR "bottombar" 0 -3 0 1
#include <bprintbar.h>
ENDPAGE
PAGE "Stampa" -1 -1 62 5
PAGE "Stampa Riepilogo IVA per competenza" -1 -1 62 5
GROUPBOX DLG_NULL 74 3
BEGIN
@ -70,7 +60,6 @@ BEGIN
VALIDATE F_DAMESE<=F_AMESE
END
DATE F_DADATA
BEGIN
PROMPT 2 7 "Da: data registrazione "
@ -79,37 +68,8 @@ END
DATE F_ADATA
BEGIN
PROMPT 2 9 " A: data registrazione "
WARINIG "La data di inizio non può essere successico alla data di fine"
VALIDATE DATE_CMP_FUNC >= F_>ADATA
END
STRING F_CODATT 5
BEGIN
PROMPT 2 11 "Codice Attivita'"
FLAGS "UZ"
USE LF_ATTIV KEY 1
INPUT CODDITTA F_CODDITTA SELECT
INPUT CODATT F_CODATT
DISPLAY "Attivita'" CODATT
DISPLAY "Prevalente" ATTPREV
DISPLAY " @48" DESCR
OUTPUT F_CODATT CODATT
WARNING "Attivita' assente"
CHECKTYPE NORMAL
END
STRING F_REPORT 256 50
BEGIN
PROMPT 2 -3 "Tipo di stampa "
RSELECT "cg4b00"
CHECKTYPE NORMAL
END
STRING DLG_PROFILE 256 50
BEGIN
PROMPT 2 -1 "Profilo "
PSELECT
WARINIG "La data di inizio non può essere successico alla data di fine"
VALIDATE DATE_CMP_FUNC >= F_>ADATA
END
ENDPAGE

152
src/cg/cg4c00.cpp Normal file
View File

@ -0,0 +1,152 @@
#include <applicat.h>
#include <automask.h>
#include <reprint.h>
#include <variant.h>
#include "cglib.h"
#include "cg4c00a.h"
///////////////////////////////////////////////////////////
// TRiepilogoIVAatt_mask
///////////////////////////////////////////////////////////
class TRiepilogoIVAatt_mask : public TAutomask
{
protected:
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TRiepilogoIVAatt_mask() : TAutomask("cg4c00a") { }
};
bool TRiepilogoIVAatt_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
TRiepilogoIVAatt_mask & m = (TRiepilogoIVAatt_mask &)o.mask();
switch (o.dlg())
{
case F_DAMESE:
if (e == fe_modify || e == fe_close)
{
if (atoi(o.get()) > m.get_int(F_AMESE))
m.set(F_AMESE, o.get());
if (e == fe_modify && (atoi(o.get()) == 13))
{
TDate d(1, 1, m.get_int(F_ANNO));
m.set(F_DADATA, d);
d.set_month(12);
d.set_end_month();
m.set(F_ADATA, d);
}
}
break;
case F_AMESE:
if (e == fe_modify || e == fe_close)
{
if (atoi(o.get()) < m.get_int(F_DAMESE))
o.set(m.get(F_DAMESE));
}
break;
case F_DADATA:
if (e == fe_modify || e == fe_close)
{
if (TDate(o.get()) > m.get_date(F_ADATA))
m.set(F_ADATA, o.get());
}
break;
case F_ADATA:
if (e == fe_modify || e == fe_close)
{
if (TDate(o.get()) < m.get_date(F_DADATA))
o.set(m.get(F_DADATA));
}
default:
break;
}
return true;
}
///////////////////////////////////////////////////////////
// TRiepilogoIVAattcompetenza_recordset
///////////////////////////////////////////////////////////
class TRiepilogoIVAattcompetenza_recordset : public TRiepilogoIVAatt_recordset
{
public:
virtual bool is_competenza() const { return true; }
TRiepilogoIVAattcompetenza_recordset() {}
virtual ~TRiepilogoIVAattcompetenza_recordset() { }
};
///////////////////////////////////////////////////////////
// TRiepilogoIVAatt_app
///////////////////////////////////////////////////////////
class TRiepilogoIVAatt_app : public TSkeleton_application
{
protected:
virtual void main_loop();
};
void TRiepilogoIVAatt_app::main_loop()
{
TRiepilogoIVAatt_mask m;
while (m.run() != K_QUIT)
{
TRiepilogoIVA_report rep;
TFilename repname = m.get(DLG_REPORT);
TRiepilogoIVAattcompetenza_recordset *recset = new TRiepilogoIVAattcompetenza_recordset;
if (repname.blank())
repname = "cg4c00a";
rep.load(repname);
if (recset != NULL)
{
int anno = m.get_int(F_ANNO);
int damese = m.get_int(F_DAMESE);
int amese = m.get_int(F_AMESE);
recset->freeze();
if (damese == 13)
{
damese = 1;
amese = 12;
recset->set_annual(true);
}
recset->set_anno(anno);
recset->set_da_mese(damese);
recset->set_a_mese(amese);
recset->set_from(m.get_date(F_DADATA));
recset->set_to(m.get_date(F_ADATA));
const TString & codatt = m.get(F_CODATT);
recset->set_codatt(codatt);
if (codatt.full())
{
TReport_section * f1 = rep.find_section('F', 1);
if (f1 != nullptr)
{
const int fields = f1->items();
for (int i = 0; i < fields; i++)
f1->field(i).hide();
}
}
rep.set_recordset(recset);
rep.print_or_preview();
}
}
}
int cg4c00(int argc, char* argv[])
{
TRiepilogoIVAatt_app app;
app.run(argc, argv, TR("Stampa progressivi IVA per attività/competenza"));
return 0;
}

9
src/cg/cg4c00a.h Normal file
View File

@ -0,0 +1,9 @@
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_ANNO 103
#define F_DAMESE 104
#define F_AMESE 105
#define F_DADATA 106
#define F_ADATA 107
#define F_CODATT 108
#define F_DESATT 109

228
src/cg/cg4c00a.rep Normal file
View File

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report libraries="" page_merge="" save_printer="" name="cg4c00a" use_printer_font="" orientation="2" page_split="" lpi="6" command="cg4 -11" class="cg4c00a">
<description>Riepilogo progressivi IVA per attivita'&#2F;competenza</description>
<font face="Arial" size="7" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="" hidden="" page_break="" can_break="" pattern="1">
<field x="4" deactivated="" type="Data" hidden="" link="" dynamic_height="" shade_offset="" width="10" codval="" id="" pattern="1" hide_zero="" text="">
<source>#SYSTEM.DATE</source>
</field>
<field x="45.5" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Ditta">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="51.5" deactivated="" type="Stringa" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="50" codval="" id="" pattern="1" hide_zero="" text="">
<source>#SYSTEM.RAGSOC</source>
</field>
<field x="154" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="Pag.">
<source>#PAGE</source>
</field>
<field x="158.5" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="5" codval="" id="" pattern="1" hide_zero="" text="">
<source>#PAGE</source>
</field>
<field x="16" y="1.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="45" codval="" id="" pattern="1" hide_zero="" text="Progressivi IVA per registro&#2F;competenza">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="60" y="1.25" deactivated="" type="Numero" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="6" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#ANNO</source>
</field>
<field x="68" y="1.25" deactivated="" type="Array" hidden="" link="" dynamic_height="" shade_offset="" width="16" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#DAMESE</source>
<list>
<li Value="da gennaio" Code="1" />
<li Value="da febbraio" Code="2" />
<li Value="da marzo" Code="3" />
<li Value="da aprile" Code="4" />
<li Value="da maggio" Code="5" />
<li Value="da giugno" Code="6" />
<li Value="da luglio" Code="7" />
<li Value="da agosto" Code="8" />
<li Value="da settembre" Code="9" />
<li Value="da ottobre" Code="10" />
<li Value="da novembre" Code="11" />
<li Value="da dicembre" Code="12" />
<li Value="annuale" Code="13" />
</list>
</field>
<field x="86" y="1.25" deactivated="" type="Array" hidden="" link="" dynamic_height="" shade_offset="" width="16" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#AMESE</source>
<list>
<li Value="a gennaio" Code="1" />
<li Value="a febbraio" Code="2" />
<li Value="a marzo" Code="3" />
<li Value="ad aprile" Code="4" />
<li Value="a maggio" Code="5" />
<li Value="a giugno" Code="6" />
<li Value="a luglio" Code="7" />
<li Value="ad agosto" Code="8" />
<li Value="a settembre" Code="9" />
<li Value="a ottobre" Code="10" />
<li Value="a novembre" Code="11" />
<li Value="a dicembre" Code="12" />
<li Value="" Code="13" />
</list>
</field>
<field x="103.5" y="1.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="28" codval="" id="" pattern="1" hide_zero="" text="per attivit&#E0;">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="41" y="2.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="35" codval="" id="" pattern="1" hide_zero="" text="Da data di registrazione">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="78" y="2.25" deactivated="" type="Data" hidden="" link="" dynamic_height="" shade_offset="" width="14" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#FROMDATE</source>
</field>
<field x="94" y="2.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="2" codval="" id="" pattern="1" hide_zero="" text="a">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="97.5" y="2.25" deactivated="" type="Data" hidden="" link="" dynamic_height="" shade_offset="" width="14" codval="" id="" pattern="1" hide_zero="" text="">
<font face="Courier New" bold="1" size="10" />
<source>#TODATE</source>
</field>
<field x="64" y="3.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="10" codval="" id="" pattern="1" hide_zero="" text="Vendite">
<font face="Arial" size="10" />
</field>
<field x="90" y="3.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="15" codval="" id="" pattern="1" hide_zero="" text="Corrispettivi">
<font face="Arial" size="10" />
</field>
<field x="120.5" y="3.25" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="12" codval="" id="" pattern="1" hide_zero="" text="Acquisti">
<font face="Courier New" size="10" />
</field>
<field x="143" y="3.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="20" codval="" id="" pattern="1" hide_zero="" text="Acquisti indetraibili">
<font face="Arial" size="10" />
</field>
<field x="54.5" y="4.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field x="82" y="4.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field x="109.5" y="4.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field x="137" y="4.25" deactivated="" type="Testo" hidden="" align="center" link="" dynamic_height="" shade_offset="" width="30" codval="" id="" pattern="1" hide_zero="" text=" Imponibile Imposta">
<font face="Arial" size="10" />
</field>
<field border="2" y="5.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="1" hidden="" page_break="" can_break="" pattern="1" />
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Head" level="2" hidden="" page_break="" can_break="" pattern="1">
<groupby>COD[1,5]</groupby>
<field deactivated="" type="Numero" hidden="1" align="right" link="" dynamic_height="" shade_offset="" width="6" codval="" id="99" pattern="1" hide_zero="" text="">
<source>#SYSTEM.FIRM</source>
</field>
<field x="14" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="100" pattern="1" hide_zero="" text="">
<source>COD[1,5]</source>
<postscript description="H2.100 POSTSCRIPT">MESSAGE COPY,F2.100</postscript>
</field>
<field x="21" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="50" codval="" id="101" pattern="1" hide_zero="" text="">
<prescript description="H2.101 PRESCRIPT">MESSAGE ISAMREAD,10,CODDITTA=#99!CODATT=#100,DESCR</prescript>
<postscript description="H2.101 POSTSCRIPT">MESSAGE COPY,F2.101</postscript>
</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="4" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="4" codval="" id="" pattern="1" hide_zero="" text="">
<source>COD[6,9]</source>
</field>
<field x="9" deactivated="" type="Stringa" hidden="" link="" dynamic_height="1" shade_offset="" width="45" codval="" height="2" id="" pattern="1" hide_zero="" text="">
<source>DESC</source>
</field>
<field x="55" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPVEN</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.102 +!</postscript>
</field>
<field x="68.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAVEN</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.103 +!</postscript>
</field>
<field x="82.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPCORR</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.104 +!</postscript>
</field>
<field x="96" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVACORR</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.105 +!</postscript>
</field>
<field x="110" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.106 +!</postscript>
</field>
<field x="123.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQ</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.107 +!</postscript>
</field>
<field x="137.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IMPACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.108 +!</postscript>
</field>
<field x="151" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="" pattern="1" hide_zero="1" text="###.###.###,@@">
<source>IVAACQIND</source>
<postscript description="B1.0 POSTSCRIPT">#THIS @
#F2.109 +!</postscript>
</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="" page_break="" can_break="" pattern="1">
<field border="2" y="0.5" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="9" y="1" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="20" codval="" height="2" id="101" pattern="1" hide_zero="" text="Totale">
<source>DESC</source>
</field>
<field x="55.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="69.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="83" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="97" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="110.5" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="124" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="137" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="151" y="1" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
</section>
<section repeat="" keep_with_next="" deactivated="" hidden_if_needed="" type="Foot" level="2" hidden="" height="4" page_break="" can_break="" pattern="1">
<field border="2" deactivated="" type="Linea" hidden="" link="" dynamic_height="" shade_offset="" width="165" codval="" height="0" id="" pattern="1" hide_zero="" text="" />
<field x="14" y="0.5" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="100" pattern="1" hide_zero="" text="" />
<field x="9" y="0.5" deactivated="" type="Testo" hidden="" link="" dynamic_height="" shade_offset="" width="6" codval="" id="101" pattern="1" hide_zero="" text="Totale">
<source>DESC</source>
</field>
<field x="21" y="0.5" deactivated="" type="Stringa" hidden="" link="" dynamic_height="" shade_offset="" width="33" codval="" height="2" id="101" pattern="1" hide_zero="" text="" />
<field x="55" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="102" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.102 +!</postscript>
</field>
<field x="68.5" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="103" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.103 +!</postscript>
</field>
<field x="82.5" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="104" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.104 +!</postscript>
</field>
<field x="96" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="105" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.105 +!</postscript>
</field>
<field x="110" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="106" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.106 +!</postscript>
</field>
<field x="123.5" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="107" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.107 +!</postscript>
</field>
<field x="137" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="108" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="F2.108 POSTSCRIPT">#THIS @
#F1.108 +!</postscript>
</field>
<field x="151.5" y="0.5" deactivated="" type="Valuta" hidden="" align="right" link="" dynamic_height="" shade_offset="" width="13" codval="" id="109" pattern="1" hide_zero="1" text="###.###.###,@@">
<postscript description="">#THIS @
#F1.109 +!</postscript>
</field>
</section>
</report>

106
src/cg/cg4c00a.uml Normal file
View File

@ -0,0 +1,106 @@
#include "cg4c00a.h"
#define ALL_EXPORT
#define REPORT
#define CLASS_NAME "cg4c00a"
TOOLBAR "topbar" 0 0 0 2
#include <aprintbar.h>
ENDPAGE
TOOLBAR "bottombar" 0 -3 0 1
#include <bprintbar.h>
ENDPAGE
PAGE "Stampa Riepilogo IVA per attività/competenza" -1 -1 62 5
GROUPBOX DLG_NULL 74 3
BEGIN
PROMPT 1 0 ""
END
NUMBER F_CODDITTA 5
BEGIN
PROMPT 2 1 "Ditta "
FLAGS "FRD"
USE LF_NDITTE KEY 1
INPUT CODDITTA F_CODDITTA
OUTPUT F_RAGSOC RAGSOC
CHECKTYPE REQUIRED
END
STRING F_RAGSOC 50
BEGIN
PROMPT 15 1 "Ragione "
FLAGS "D"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 2 3 "Anno "
FLAGS "AP"
CHECKTYPE REQUIRED
END
LIST F_DAMESE 20
BEGIN
PROMPT 2 5 "Da mese "
ITEM "13|13a liquid."
FLAGS "MP"
MESSAGE COPY,F_AMESE
END
LIST F_AMESE 20
BEGIN
PROMPT 35 5 " A mese "
ITEM "13|13a liquid."
FLAGS "MP"
WARINIG "Il mese di inizio non può essere successico al mese di fine"
VALIDATE F_DAMESE<=F_AMESE
END
DATE F_DADATA
BEGIN
PROMPT 2 7 "Da: data registrazione "
END
DATE F_ADATA
BEGIN
PROMPT 2 9 " A: data registrazione "
WARINIG "La data di inizio non può essere successico alla data di fine"
VALIDATE DATE_CMP_FUNC >= F_>ADATA
END
STRING F_CODATT 5
BEGIN
PROMPT 2 11 "Codice Attivita'"
FLAGS "UZ"
USE LF_ATTIV KEY 1
INPUT CODDITTA F_CODDITTA SELECT
INPUT CODATT F_CODATT
DISPLAY "Attivita'" CODATT
DISPLAY "Prevalente" ATTPREV
DISPLAY " @48" DESCR
OUTPUT F_CODATT CODATT
WARNING "Attivita' assente"
CHECKTYPE NORMAL
END
STRING F_DESATT 50
BEGIN
PROMPT 2 13 "Codice Attivita'"
FLAGS "UZ"
USE LF_ATTIV KEY 2
INPUT CODDITTA F_CODDITTA SELECT
INPUT DESCR F_DESATT
DISPLAY " @50" DESCR
DISPLAY "Attivita'" CODATT
DISPLAY "Prevalente" ATTPREV
COPY OUTPUT F_CODATT
WARNING "Attivita' assente"
CHECKTYPE NORMAL
END
ENDPAGE
ENDMASK

View File

@ -13,14 +13,14 @@
#include <recarray.h>
#endif
#ifndef __REPUTILS_H
#include <reputils.h>
#endif
#ifndef __MULTIREC
#include <multirec.h>
#endif
#ifndef __REPUTILS_H
#include <reputils.h>
#endif
#ifndef __TABUTIL_H
#include <tabutil.h>
#endif
@ -38,7 +38,8 @@
#endif
#ifndef __PROGIND_H
#include <progind.h>
class TDocumento;
class TProgind;
#endif
#include "../ba/ba8500.h"
@ -914,51 +915,73 @@ bool is_IVAxCassa(const TRectype& mov);
// TRiepilogoIVA_recordset
///////////////////////////////////////////////////////////
class TRiepilogoIVA_recordset : public TRecordset
{
TArray _rows;
TArray _info;
long _pos;
bool _annuale;
TString8 _mov_codatt;
protected:
virtual const TVariant& get_field(int num, const char* field) const;
void TRiepilogoIVA_recordset::add_field(TFieldtypes tipo, short id, int width, const char* name);
void add_field(TFieldtypes tipo, short id, int width, const char* name);
public:
virtual TRecnotype items() const { return _rows.items(); }
virtual bool move_to(TRecnotype pos);
virtual TRecnotype current_row() const { return _pos; }
virtual void requery();
virtual const TString& query_text() const;
virtual unsigned int columns() const { return _info.items(); }
virtual const TRecordset_column_info& column_info(unsigned int column) const { return (const TRecordset_column_info&)_info[column]; }
virtual const TVariant& get(unsigned int column) const;
long pos() const { return _pos; }
const TArray & rows() const { return _rows; }
const TArray & info() const { return _info; }
virtual TRecnotype items() const override { return _rows.items(); }
virtual bool move_to(TRecnotype pos) override ;
virtual TRecnotype current_row() const override { return _pos; }
virtual const char * codice(const TRectype & rmi);
virtual void requery() override ;
virtual const TString& query_text() const override;
virtual unsigned int columns() const override { return _info.items(); }
virtual const TRecordset_column_info& column_info(unsigned int column) const override { return (const TRecordset_column_info&)_info[column]; }
virtual const TVariant& get(unsigned int column) const override;
const TVariant& get(const char * name) const;
void set_from(const TDate& from) { set_var("#FROMDATE", from, true); ; }
void set_from(const TDate& from) { set_var("#FROMDATE", from, true); }
void set_to(const TDate& to) { set_var("#TODATE", to, true); }
void set_anno(const int anno) { set_var("#ANNO", (long)anno, true); };
void set_codatt(const TString & codatt) { set_var("#CODATT", codatt, true); }
void set_da_mese(const int mese) { set_var("#DAMESE", (long) mese, true); }
void set_a_mese(const int mese) { set_var("#AMESE", (long) mese, true); }
void set_codatt(const char * codatt) { set_var("#CODATT", codatt, true); }
void set_tiporeg(int tiporeg) { set_var("#TIPOREG", (long) tiporeg, true); }
const TDate from() const { return get_var("#FROMDATE").as_date(); }
const TDate to() const { return get_var("#TODATE").as_date(); }
const int anno() const { return (int)get_var("#ANNO").as_int(); };
const TString & codatt() const { return get_var("#CODATT").as_string(); }
int da_mese() const { return (int)get_var("#DAMESE").as_int(); }
int a_mese() const { return (int)get_var("#AMESE").as_int(); }
const TString & codatt() const { return get_var("#CODATT").as_string(); }
int tiporeg() const { return (int)get_var("#TIPOREG").as_int(); }
const TString & mov_codatt() const { return _mov_codatt; }
bool set_annual(bool on) { return _annuale = on; }
bool annuale() const { return _annuale; }
virtual bool is_competenza() const { return false; }
virtual int is_intra() const { return false; }
virtual const char * remap_IVA(const char * codIVA, const TISAM_recordset & rmov) const { return codIVA; }
TRiepilogoIVA_recordset();
virtual ~TRiepilogoIVA_recordset() { }
virtual ~TRiepilogoIVA_recordset() = default;
};
///////////////////////////////////////////////////////////
// TRiepilogoIVAatt_recordset
///////////////////////////////////////////////////////////
class TRiepilogoIVAatt_recordset : public TRiepilogoIVA_recordset
{
protected:
virtual const char * codice(const TRectype & rmi) override;
public:
TRiepilogoIVAatt_recordset() : TRiepilogoIVA_recordset() {}
virtual ~TRiepilogoIVAatt_recordset() = default;
};
///////////////////////////////////////////////////////////
@ -969,12 +992,11 @@ class TRiepilogoIVA_report : public TReport
{
protected:
virtual bool use_mask() { return false; }
virtual bool get_usr_val(const TString& name, TVariant& var) const;
virtual bool use_mask() override { return false; }
virtual bool get_usr_val(const TString& name, TVariant& var) const override;
public:
virtual bool set_recordset(TRecordset * set);
virtual bool set_recordset(TRecordset * set) override;
};
char frequenza_versamenti(int year, long firm = -1); // Ritorna 'M'ensile o 'T'rimestrale

View File

@ -2,6 +2,9 @@
#include "causali.h"
#include <utility.h>
#define F_START 101
#define F_END 102
///////////////////////////////////////////////////////////
// TRiepilogoIVA_report
///////////////////////////////////////////////////////////
@ -10,7 +13,7 @@ bool TRiepilogoIVA_report::set_recordset(TRecordset * set)
{
const bool ok = TReport::set_recordset(set);
if (set != nullptr)
if (set != nullptr)
{
set->unfreeze();
set->requery();
@ -21,54 +24,54 @@ bool TRiepilogoIVA_report::set_recordset(TRecordset * set)
bool TRiepilogoIVA_report::get_usr_val(const TString& name, TVariant& var) const
{
TRiepilogoIVA_recordset * rs = (TRiepilogoIVA_recordset *)recordset();
TRiepilogoIVA_recordset * rs = (TRiepilogoIVA_recordset *)recordset();
if (name == "#FROMDATE")
{
var = rs->from();
return true;
}
else
{
if (name == "#TODATE")
{
var = rs->to();
return true;
}
else
{
if (name == "#ANNO")
{
var = rs->anno();
return true;
}
else
{
if (name == "#CODATT")
{
var = rs->codatt();
return true;
}
else
{
if (name == "#DAMESE")
{
var = (long)rs->da_mese();
return true;
}
else
{
if (name == "#AMESE")
{
var = (long)rs->a_mese();
return true;
}
}
}
}
}
}
return TReport::get_usr_val(name, var);
if (name == "#FROMDATE")
{
var = rs->from();
return true;
}
else
{
if (name == "#TODATE")
{
var = rs->to();
return true;
}
else
{
if (name == "#ANNO")
{
var = rs->anno();
return true;
}
else
{
if (name == "#CODATT")
{
var = rs->codatt();
return true;
}
else
{
if (name == "#DAMESE")
{
var = (long)rs->da_mese();
return true;
}
else
{
if (name == "#AMESE")
{
var = (long)rs->a_mese();
return true;
}
}
}
}
}
}
return TReport::get_usr_val(name, var);
}
///////////////////////////////////////////////////////////
@ -77,7 +80,7 @@ bool TRiepilogoIVA_report::get_usr_val(const TString& name, TVariant& var) const
class TRiepilogoIVA_record : public TObject
{
TString4 _cod;
TString16 _cod;
TArray _values;
real & get_val(int index);
@ -94,8 +97,8 @@ public:
real & ivaven() { return get_val(5); }
real & impacqind() { return get_val(6); }
real & ivaacqind() { return get_val(7); }
TRiepilogoIVA_record& operator= (const TRiepilogoIVA_record & rec) { return copy(rec);}
TRiepilogoIVA_record& operator= (const TRiepilogoIVA_record & rec) { return copy(rec);}
TRiepilogoIVA_record(const TRiepilogoIVA_record & rec) { copy(rec); }
TRiepilogoIVA_record(const char * cod) : _cod(cod) {}
@ -117,6 +120,14 @@ real & TRiepilogoIVA_record::get_val(int index)
return *val;
}
const char * TRiepilogoIVA_recordset::codice(const TRectype & rmi)
{
TString & cod = get_tmp_string(32);
cod = rmi.get(RMI_CODIVA);
return cod;
}
void TRiepilogoIVA_recordset::requery()
{
if (not_frozen())
@ -135,89 +146,93 @@ void TRiepilogoIVA_recordset::requery()
recset.set_var("#AMESE", (long)a_mese(), true);
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
{
TString cod = remap_IVA(recset.get(RMI_CODIVA).as_string(), recset);
const TRegistro & reg = cached_registro((const char *)recset.get(FIELD_NAME(LF_MOV, MOV_REG)).as_string(), anno());
TipoIVA t = reg.iva();
if (cod.full())
{
TRiepilogoIVA_record * rec = (TRiepilogoIVA_record *)work_array.objptr(cod);
long gruppo = recset.get(RMI_GRUPPO).as_int();
long conto = recset.get(RMI_CONTO).as_int();
long sottoconto = recset.get(RMI_SOTTOCONTO).as_int();
int indetr = recset.get(RMI_TIPODET).as_int();
_mov_codatt = reg.attivita();
TRegistro reg(recset.get(FIELD_NAME(LF_MOV, MOV_REG)).as_string());
TipoIVA t = reg.iva();
TDate data = recset.get(FIELD_NAME(LF_MOV, MOV_DATAREG)).as_date();
const int meseliq = recset.get(FIELD_NAME(LF_MOV, MOV_MESELIQ)).as_int();
const TDate datadoc = recset.get(FIELD_NAME(LF_MOV, MOV_DATADOC)).as_date();
const TipoIVA tipo = reg.iva(); // 1=Vendite; 2=Acquisti
const bool fatt_rit_2018 = recset.get(FIELD_NAME(LF_MOV, MOV_RITFATT)).as_bool() && (data.year() >= 2018);
const int year_diff = data.year() - datadoc.year();
const bool fattritind = ((tipo == iva_acquisti) && fatt_rit_2018) && ((year_diff > 2) || ((year_diff >= 1) && data.month() >= 5));
const bool fattrit = ((tipo == iva_acquisti) && !fattritind && fatt_rit_2018) && (year_diff >= 1);
TString16 cod = codice(recset.cursor()->curr());
if (is_competenza())
{
if (meseliq != 0)
{
if (meseliq > data.month())
data.addyear(-1);
data.set_month(meseliq);
data.set_end_month();
}
}
if (fattrit)
{
data.addyear(-1);
data.set_month(12);
data.set_end_month();
}
if (data.year() != anno() || (data.year() == anno() && (data.month() < da_mese() || data.month() > a_mese())))
continue;
if (rec == nullptr)
work_array.add(cod, rec = new TRiepilogoIVA_record(cod));
if (t == iva_acquisti)
{
if (indetr == 0)
{
real & r = rec->impacq();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaacq();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
else
{
real & r = rec->impacqind();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaacqind();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
}
else
if (t == iva_vendite)
{
if (reg.corrispettivi())
{
real & r = rec->impcorr();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivacorr();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
else
{
real & r = rec->impven();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaven();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
}
}
if (cod.full())
{
long gruppo = recset.get(RMI_GRUPPO).as_int();
long conto = recset.get(RMI_CONTO).as_int();
long sottoconto = recset.get(RMI_SOTTOCONTO).as_int();
int indetr = recset.get(RMI_TIPODET).as_int();
TDate data = recset.get(FIELD_NAME(LF_MOV, MOV_DATAREG)).as_date();
const int meseliq = recset.get(FIELD_NAME(LF_MOV, MOV_MESELIQ)).as_int();
const TDate datadoc = recset.get(FIELD_NAME(LF_MOV, MOV_DATADOC)).as_date();
const bool fatt_rit_2018 = recset.get(FIELD_NAME(LF_MOV, MOV_RITFATT)).as_bool() && (data.year() >= 2018);
const int year_diff = data.year() - datadoc.year();
const bool fattritind = ((t == iva_acquisti) && fatt_rit_2018) && ((year_diff > 2) || ((year_diff >= 1) && data.month() >= 5));
const bool fattrit = ((t == iva_acquisti) && !fattritind && fatt_rit_2018) && (year_diff >= 1);
if (is_competenza())
{
if (meseliq != 0)
{
if (meseliq > data.month())
data.addyear(-1);
data.set_month(meseliq);
data.set_end_month();
}
}
if (fattrit)
{
data.addyear(-1);
data.set_month(12);
data.set_end_month();
}
if (data.year() != anno() || (data.year() == anno() && (data.month() < da_mese() || data.month() > a_mese())))
continue;
TRiepilogoIVA_record * rec = (TRiepilogoIVA_record *)work_array.objptr(cod);
if (rec == nullptr)
work_array.add(cod, rec = new TRiepilogoIVA_record(cod));
if (t == iva_acquisti)
{
if (indetr == 0)
{
real & r = rec->impacq();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaacq();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
else
{
real & r = rec->impacqind();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaacqind();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
}
else
if (t == iva_vendite)
{
if (reg.corrispettivi())
{
real & r = rec->impcorr();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivacorr();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
else
{
real & r = rec->impven();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaven();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
}
}
}
TString_array keys;
work_array.get_keys(keys);
keys.sort();
_rows.destroy();
FOR_EACH_ARRAY_ITEM(keys, i, obj)
{
@ -242,6 +257,7 @@ bool TRiepilogoIVA_recordset::move_to(TRecnotype pos)
_pos = pos;
return ok;
}
const TString& TRiepilogoIVA_recordset::query_text() const
{
TString & query = get_tmp_string();
@ -286,7 +302,11 @@ const TVariant& TRiepilogoIVA_recordset::get_field(int num, const char* field) c
else
if (xvt_str_compare_ignoring_case(field, DESC) == 0)
{
TCodiceIVA c(row.cod());
TString codice = row.cod();
if (codice.len() > 4)
codice = codice.smid(5);
TCodiceIVA c(codice);
val = c.descrizione();
return val;
@ -395,7 +415,6 @@ const TVariant& TRiepilogoIVA_recordset::get(const char * name) const
return v;
}
const TVariant& TRiepilogoIVA_recordset::get(unsigned int column) const
{
TVariant & v = get_tmp_var();
@ -422,3 +441,13 @@ TRiepilogoIVA_recordset::TRiepilogoIVA_recordset() : TRecordset(), _pos(0), _ann
add_field(_realfld, 110, 18, IVAACQIND);
}
const char * TRiepilogoIVAatt_recordset::codice(const TRectype & rmi)
{
TString & cod = get_tmp_string(32);
TString att = mov_codatt();
att.rpad(5);
cod = att;
cod << rmi.get(RMI_CODIVA);
return cod;
}

View File

@ -115,7 +115,9 @@ Item_10 = "Operazioni annuali", [CGMENU_029]
Item_11 = "IVA per cassa / differita", <icmenu.men>
Item_12 = "Gestione autotrasportatori", "cg4 -9", "F"
Item_13 = "Stampa progressivi avanzata", "cg0 -7", "F"
Item_13 = "Stampa progressivi IVA per competenza", "cg4 -10", "F"
Item_14 = "Stampa progressivi avanzata per attività", "cg0 -8", "F"
Item_15 = "Stampa progressivi IVA per competenza", "cg4 -10", "F"
Item_16 = "Stampa progressivi IVA per attività/competenza", "cg4 -11", "F"
[CGMENU_011]
Caption = "Tabelle ministeriali"