Patch level : 12.0 990

Files correlati     : cg0.exe cg0200a.msk cg0800a.msk cg0800a.rep cg4.exe cg4b00a.msk cg4b00a.rep
Commento            :

Aggiunti campi PADESTIM e PARIFAMM agli indirizzi di spedizione

Aggiunta  selezione per codice attività nei  riepiloghi IVA
This commit is contained in:
Alessandro Bonazzi 2020-08-31 19:19:42 +02:00
parent 6f38f6cf94
commit 99944989e9
19 changed files with 464 additions and 454 deletions

View File

@ -941,14 +941,21 @@ int TClifo_application::read(TMask& m)
riga.add(rec.get(IND_TEL));
riga.add(rec.get(IND_PFAX));
riga.add(rec.get(IND_FAX));
riga.add(rec.get(IND_IVARID));
TString8 key;
riga.add(rec.get(IND_IVARID));
TString8 key;
key << rec.get(IND_STATO);
key << '|' << rec.get(IND_COM);
const TRectype& com = cache().get(LF_COMUNI, key);
const TRectype & com = cache().get(LF_COMUNI, key);
riga.add(com.get(COM_DENCOM));
riga.add(rec.get(IND_INDIR2));
riga.add(rec.get(IND_CODIND));
riga.add(rec.get(IND_PADESTIN));
riga.add(rec.get(IND_PARIFAMM));
riga.add(rec.get(IND_CODIND));
indsp_sheet().row(i)=riga;
@ -1364,8 +1371,10 @@ void TClifo_application::common_f(const TMask& m)
rec.put(IND_FAX,row.get());
rec.put(IND_IVARID,row.get());
row.get();
rec.put(IND_INDIR2,row.get());
rec.put(IND_CODIND,i+1);
rec.put(IND_INDIR2, row.get());
rec.put(IND_PADESTIN, row.get());
rec.put(IND_PARIFAMM, row.get());
rec.put(IND_CODIND,i+1);
}
TToken_string data;

View File

@ -234,5 +234,8 @@
#define F_IVARIDI 112
#define F_DENCOMI 113
#define F_INDIR2 114
#define F_PADESTINI 115
#define F_PARIFAMMI 116
#endif // __CG0200_H

View File

@ -1329,6 +1329,8 @@ BEGIN
ITEM "Iva Rid."
ITEM "Comune@50"
ITEM "Indirizzo aggiuntivo@35"
ITEM "Destinatario"
ITEM "Riferimento amministrazione"
END
GROUPBOX DLG_NULL 76 3

View File

@ -1,6 +1,6 @@
#include "cg0200.h"
PAGE "" -1 -1 76 16
PAGE "" -1 -1 76 20
STRING F_RAGSOCI 50
BEGIN
@ -135,6 +135,22 @@ HELP "Indicare se e' soggetto a riduzione IVA"
GROUP 1
END
STRING F_PADESTINI 7
BEGIN
PROMPT 2 15 "Destinatario "
FLAGS ""
MODULES PA,FP
HELP "Codice ufficio dell destinatario della fattura elettronica"
END
STRING F_PARIFAMMI 20
BEGIN
PROMPT 2 17 "Riferimento amministrazione "
FLAGS "U"
MODULES PA,FP
HELP "Codice del cedente presso l'amministrazione"
END
ENDPAGE
TOOLBAR "bottombar" 0 0 0 2

View File

@ -36,6 +36,7 @@ TRectype& TClifoVI::indirizzo(int i)
TRectype& TClifoVI::contatto(int i)
{
TRectype* r= (TRectype*)_contatti.objptr(i);
if (r == NULL)
{
r = new TRectype(LF_MULTIREL);
@ -52,6 +53,7 @@ int TClifoVI::read_indirizzi()
if (_gesven)
{
const TRectype& rind = curr(LF_INDSP);
for (bool ok=is_first_match(LF_INDSP); ok; ok=next_match(LF_INDSP))
{
const int nriga = rind.get_int(IND_CODIND) -1;
@ -64,6 +66,7 @@ int TClifoVI::read_indirizzi()
const char tipocf = curr().get_char(CLI_TIPOCF);
const long codcf = curr().get_long(CLI_CODCF);
TString8 first; first.format("%C%06ld", tipocf, codcf);
cont.put("COD", "BACON");
cont.put("FIRST", first);
for (int err = cont.read(_isgteq);
@ -82,6 +85,7 @@ int TClifoVI::write_contatti()
const char tipocf = curr().get_char(CLI_TIPOCF);
const long codcf = curr().get_long(CLI_CODCF);
TString8 first; first.format("%C%06ld", tipocf, codcf);
cont.put("COD", "BACON");
cont.put("FIRST", first);
for (int err = cont.read(_isgteq);
@ -95,6 +99,7 @@ int TClifoVI::write_contatti()
for (int i = _contatti.last(); i >= 0 && !trovato; i--)
{
const TRectype& c = (const TRectype&)_contatti[i];
trovato = c.get_long("SECOND") == atol(k);
}
if (!trovato)
@ -110,6 +115,7 @@ int TClifoVI::write_contatti()
FOR_EACH_ARRAY_ITEM(_contatti, i, obj)
{
TRectype& rec = *(TRectype*)obj;
if (rec.get("DATA").full())
{
TString8 second;
@ -127,6 +133,7 @@ int TClifoVI::write_contatti()
int TClifoVI::read(TIsamop op, TReclock lockop)
{
const int err = file().read(op,lockop);
position_rels();
if (err == NOERR)
@ -139,7 +146,8 @@ int TClifoVI::write_rec(bool re, const TRectype& rec, TLocalisamfile& f)
{
if (re)
{
const bool scrivi= f.rewrite(rec)!=NOERR;
const bool scrivi= f.rewrite(rec) != NOERR;
if (scrivi) f.write(rec);
}
else
@ -167,64 +175,68 @@ int TClifoVI::cancella(TLocalisamfile& f, int da, int a)
int TClifoVI::registra(bool re, bool force)
{
TLocalisamfile& c=lfile(LF_CLIFO);
int err=write_rec(re,c.curr(),c);
if (err!=NOERR) return err;
int err = write_rec(re,c.curr(),c);
if (err == NOERR)
{
TLocalisamfile& v = lfile(LF_CFVEN);
TLocalisamfile& v = lfile(LF_CFVEN);
err = write_rec(TRUE,v.curr(),v);
if (err!=NOERR) return err;
err = write_rec(TRUE, v.curr(), v);
if (err == NOERR)
{
TLocalisamfile& p = lfile(LF_CFPRI);
p.put("TIPOCF", c.get(CLI_TIPOCF)[0]);
p.put("CODCF", c.get_long(CLI_CODCF));
err = write_rec(TRUE, p.curr(), p);
if (err != NOERR) return err;
TLocalisamfile& p = lfile(LF_CFPRI);
// Put here gest_vend() discrimination
if (_gesven)
{
TLocalisamfile& rind=lfile(LF_INDSP);
const char tipocf=c.get(CLI_TIPOCF)[0];
const long codcf=c.get_long(CLI_CODCF);
int i;
p.put("TIPOCF", c.get(CLI_TIPOCF)[0]);
p.put("CODCF", c.get_long(CLI_CODCF));
err = write_rec(TRUE, p.curr(), p);
if (err == NOERR)
{
// Put here gest_vend() discrimination
if (_gesven)
{
TLocalisamfile& rind = lfile(LF_INDSP);
const char tipocf = c.get(CLI_TIPOCF)[0];
const long codcf = c.get_long(CLI_CODCF);
int i = 0;
for (i=0; i<indirizzi(); i++)
{
if (!re)
{
indirizzo(i).put(IND_TIPOCF,tipocf);
indirizzo(i).put(IND_CODCF,codcf);
}
err=write_rec(TRUE,indirizzo(i),rind);
}
if (i<_oldindirizzi)
cancella(rind,i+1,_oldindirizzi);
_oldindirizzi=indirizzi();
for (i = 0; i < indirizzi(); i++)
{
if (!re)
{
indirizzo(i).put(IND_TIPOCF, tipocf);
indirizzo(i).put(IND_CODCF, codcf);
}
err = write_rec(TRUE, indirizzo(i), rind);
}
if (i < _oldindirizzi)
cancella(rind, i + 1, _oldindirizzi);
_oldindirizzi = indirizzi();
write_contatti();
}
if (_geslv)
{
TLocalisamfile& lv = lfile(-LVAUT);
const char tipocf=c.get(CLI_TIPOCF)[0];
const long codcf=c.get_long(CLI_CODCF);
TString8 codtab; codtab << tipocf << codcf;
TRectype& rec = lv.curr();
rec.put("CODTAB", codtab);
err = write_rec(TRUE, rec, lv);
if (err!=NOERR) return err;
}
write_contatti();
}
if (_geslv)
{
TLocalisamfile& lv = lfile(-LVAUT);
const char tipocf = c.get(CLI_TIPOCF)[0];
const long codcf = c.get_long(CLI_CODCF);
TString8 codtab; codtab << tipocf << codcf;
TRectype& rec = lv.curr();
rec.put("CODTAB", codtab);
err = write_rec(TRUE, rec, lv);
}
}
}
}
// END of gest_vend() discrimination
return err;
}
int TClifoVI::write(bool force)
{
_oldindirizzi=0;
_oldindirizzi = 0;
return registra(FALSE,force);
}
@ -245,12 +257,11 @@ int TClifoVI::remove()
lfile(LF_CFVEN).remove();
TLocalisamfile& rind = lfile(LF_INDSP);
cancella(rind, 1, _oldindirizzi);
_contatti.destroy();
write_contatti();
}
_oldindirizzi=0;
_oldindirizzi = 0;
return err;
}

View File

@ -3,7 +3,7 @@
#include <reprint.h>
#include <variant.h>
#include "cglib05.h"
#include "cglib.h"
#include "cg0800a.h"
///////////////////////////////////////////////////////////
@ -76,17 +76,8 @@ void TRiepilogoIVA_app::main_loop()
int amese = m.get_int(F_AMESE);
recset->freeze();
recset->set_da_mese_var(damese);
recset->set_a_mese_var(amese);
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);
if (damese == 13)
{
damese = 1;
@ -95,7 +86,7 @@ void TRiepilogoIVA_app::main_loop()
}
recset->set_da_mese(damese);
recset->set_a_mese(amese);
const TDate da(1, damese, anno);
TDate a(1, amese, anno);
@ -104,9 +95,11 @@ void TRiepilogoIVA_app::main_loop()
a.set_end_month();
recset->set_from(da);
recset->set_to(a);
recset->unfreeze();
rep.set_recordset(recset);
const TString & codatt = m.get(F_CODATT);
recset->set_codatt(codatt);
rep.set_recordset(recset);
rep.print_or_preview();
}
}

View File

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

View File

@ -1,31 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report name="cg0800a" orientation="2" 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="cg0800">
<description>Riepilogo progressivi IVA</description>
<font face="Arial" size="7" />
<section type="Head" pattern="1">
<field x="4" type="Data" width="10" pattern="1">
<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" type="Testo" align="center" width="4" pattern="1" text="Ditta">
<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" type="Stringa" align="center" width="50" pattern="1">
<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" type="Testo" width="4" pattern="1" text="Pag.">
<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" type="Numero" align="right" width="5" pattern="1">
<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="47.5" y="1" type="Testo" width="25" pattern="1" text="Progressivi IVA">
<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">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="73.5" y="1" type="Numero" align="right" width="6" pattern="1">
<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="83.5" y="1" type="Array" width="16" pattern="1">
<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>
@ -44,7 +44,7 @@
<li Value="annuale" Code="13" />
</list>
</field>
<field x="100.5" y="1" type="Array" width="16" pattern="1">
<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>
@ -60,99 +60,105 @@
<li Value="a ottobre" Code="10" />
<li Value="a novembre" Code="11" />
<li Value="a dicembre" Code="12" />
<li Code="13" />
<li Value="" Code="13" />
</list>
</field>
<field x="63.5" y="2.25" type="Testo" align="center" width="10" pattern="1" text="Vendite">
<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>
<field x="87.5" y="2.25" type="Testo" align="center" width="18" pattern="1" text="Corrispettivi">
<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" type="Testo" align="center" width="12" pattern="1" text="Acquisti">
<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" type="Testo" align="center" width="20" pattern="1" text="Acquisti indetraibili">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Testo" align="center" width="25" pattern="1" text=" Imponibile Imposta">
<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" type="Linea" width="160" height="0" pattern="1" />
<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="" />
</section>
<section type="Head" level="1" pattern="1" />
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<field x="4" type="Stringa" width="4" pattern="1">
<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" />
<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</source>
</field>
<field x="9" type="Stringa" dynamic_height="1" width="45" height="2" pattern="1">
<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" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.102 +!</postscript>
</field>
<field x="68.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.103 +!</postscript>
</field>
<field x="82" type="Valuta" align="right" width="13" 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="95.5" type="Valuta" align="right" width="13" 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="109.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.106 +!</postscript>
</field>
<field x="123" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.107 +!</postscript>
</field>
<field x="137" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.108 +!</postscript>
</field>
<field x="150.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.109 +!</postscript>
</field>
</section>
<section type="Foot" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="2" x="4" y="0.5" type="Linea" width="160" height="0" pattern="1" />
<field x="9" y="1" type="Testo" width="20" height="2" id="101" pattern="1" text="Totale">
<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 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" type="Valuta" align="right" width="13" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="68" y="1" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="82" y="1" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="95.5" y="1" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="109.5" y="1" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="123" y="1" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="137.5" y="1" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="151" y="1" type="Valuta" align="right" width="13" id="109" pattern="1" hide_zero="1" text="###.###.###,@@" />
<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="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="###.###.###,@@" />
</section>
<sql>USE 25 KEY 1 SELECT BETWEEN(23.DATAREG;#FROMDATE;#TODATE) \nJOIN 23 INTO NUMREG==NUMREG";</sql>
</report>

View File

@ -70,6 +70,21 @@ 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 "

View File

@ -111,8 +111,6 @@ void TRiepilogoIVA_app::main_loop()
int amese = m.get_int(F_AMESE);
recset->freeze();
recset->set_da_mese_var(damese);
recset->set_a_mese_var(amese);
if (damese == 13)
{
damese = 1;
@ -124,7 +122,10 @@ 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));
recset->unfreeze();
const TString & codatt = m.get(F_CODATT);
recset->set_codatt(codatt);
rep.set_recordset(recset);
rep.print_or_preview();
}

View File

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

View File

@ -1,31 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<report name="cg4b00a" orientation="2" 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="cg4b00">
<description>Riepilogo progressivi IVA per competenza</description>
<font face="Arial" size="7" />
<section type="Head" pattern="1">
<field x="4" type="Data" width="10" pattern="1">
<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" type="Testo" align="center" width="4" pattern="1" text="Ditta">
<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" type="Stringa" align="center" width="50" pattern="1">
<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" type="Testo" width="4" pattern="1" text="Pag.">
<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" type="Numero" align="right" width="5" pattern="1">
<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="42.5" y="1.25" type="Testo" width="45" pattern="1" text="Progressivi IVA per competenza">
<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 competenza">
<font face="Courier New" bold="1" size="10" />
</field>
<field x="86.5" y="1.25" type="Numero" align="right" width="6" pattern="1">
<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="94.5" y="1.25" type="Array" width="16" pattern="1">
<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>
@ -44,7 +44,7 @@
<li Value="annuale" Code="13" />
</list>
</field>
<field x="112.5" y="1.25" type="Array" width="16" pattern="1">
<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>
@ -60,113 +60,119 @@
<li Value="a ottobre" Code="10" />
<li Value="a novembre" Code="11" />
<li Value="a dicembre" Code="12" />
<li Code="13" />
<li Value="" Code="13" />
</list>
</field>
<field x="42.5" y="2.25" type="Testo" width="35" pattern="1" text="Da data di registrazione">
<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="78" y="2.25" type="Data" width="14" pattern="1">
<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>
<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" type="Testo" width="2" pattern="1" text="a">
<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" type="Data" width="14" pattern="1">
<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" type="Testo" align="center" width="10" pattern="1" text="Vendite">
<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" type="Testo" align="center" width="15" pattern="1" text="Corrispettivi">
<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" type="Testo" width="12" pattern="1" text="Acquisti">
<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" type="Testo" align="center" width="20" pattern="1" text="Acquisti indetraibili">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Testo" align="center" width="30" pattern="1" text=" Imponibile Imposta">
<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" type="Linea" width="160" height="0" pattern="1" />
<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="" />
</section>
<section type="Head" level="1" pattern="1" />
<section type="Body" pattern="1" />
<section type="Body" level="1" pattern="1">
<field x="4" type="Stringa" width="4" pattern="1">
<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" />
<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</source>
</field>
<field x="9" type="Stringa" dynamic_height="1" width="45" height="2" pattern="1">
<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" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.102 +!</postscript>
</field>
<field x="68.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.103 +!</postscript>
</field>
<field x="82.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.104 +!</postscript>
</field>
<field x="96" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.105 +!</postscript>
</field>
<field x="110" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.106 +!</postscript>
</field>
<field x="123.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.107 +!</postscript>
</field>
<field x="137.5" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.108 +!</postscript>
</field>
<field x="151" type="Valuta" align="right" width="13" pattern="1" hide_zero="1" text="###.###.###,@@">
<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 @
#F1.109 +!</postscript>
</field>
</section>
<section type="Foot" pattern="1" />
<section type="Foot" level="1" pattern="1">
<field border="2" x="4" y="0.5" type="Linea" width="160" height="0" pattern="1" />
<field x="9" y="1" type="Testo" width="20" height="2" id="101" pattern="1" text="Totale">
<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 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" type="Valuta" align="right" width="13" id="102" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="69" y="1" type="Valuta" align="right" width="13" id="103" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="82.5" y="1" type="Valuta" align="right" width="13" id="104" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="96.5" y="1" type="Valuta" align="right" width="13" id="105" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="110" y="1" type="Valuta" align="right" width="13" id="106" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="123.5" y="1" type="Valuta" align="right" width="13" id="107" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="137" y="1" type="Valuta" align="right" width="13" id="108" pattern="1" hide_zero="1" text="###.###.###,@@" />
<field x="150.5" y="1" type="Valuta" align="right" width="13" id="109" 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="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="###.###.###,@@" />
</section>
<sql>USE 25 KEY 1 SELECT BETWEEN(23.DATAREG;#FROMDATE;#TODATE) \nJOIN 23 INTO NUMREG==NUMREG";</sql>
</report>

View File

@ -83,6 +83,22 @@ BEGIN
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 "

View File

@ -29,6 +29,10 @@
#include <varrec.h>
#endif
#ifndef __PROGIND_H
class TProgind;
#endif
#include "../ba/ba8500.h"
#include <mov.h>
@ -74,11 +78,6 @@
#define RIGA_DIFFCAM 13
#define RIGA_PAG_RITSOC 14
#ifndef __PROGIND_H
class TProgind;
#endif
#define PROVV "P"
#define PROVV_NON_CANC "N"
#define PROVV_BIL "B"
@ -153,6 +152,9 @@ inline bool check_mov(const int tipomovprovv, const TString & provvis)
((tipomovprovv & 0x8) && (provvis == PROVV_CESP));
}
// utility
bool decode_cofi(const TString& cofi, char& sex_nasc, TDate& dt_nasc, TString& com_nasc);
// Gestione esercizi contabili, registri e libro giornale
class TEsercizio : public TSortable
{
@ -404,10 +406,6 @@ public: // TObject
virtual ~TCodiceIVA() {}
};
#ifndef __MASK_H
class TMask;
#endif
class TBill : public TSortable
{
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
@ -884,12 +882,6 @@ class TRiepilogoIVA_recordset : public TRecordset
TArray _rows;
TArray _info;
long _pos;
TDate _from_date;
TDate _to_date;
int _anno;
int _da_mese;
int _a_mese;
bool _freezed;
bool _annuale;
protected:
@ -904,25 +896,26 @@ public:
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]; }
void freeze(bool on = true) { _freezed = on; }
void unfreeze() { freeze(false); }
// const TString& col2name(unsigned int column) const;
virtual const TVariant& get(unsigned int column) const;
TDate set_from(const TDate& from) { set_var("#FROMDATE", from, true); return _from_date = from; }
TDate set_to(const TDate& to) { set_var("#TODATE", to, true); return _to_date = to; }
int set_anno(const int anno) { set_var("#ANNO", (long)anno, true); return _anno = anno; };
void set_da_mese_var(const int mese) { set_var("#DAMESE", (long)mese, true); }
void set_a_mese_var(const int mese) { set_var("#AMESE", (long)mese, true); }
int set_da_mese(const int mese) { return _da_mese = mese; }
int set_a_mese(const int mese) { return _a_mese = mese; }
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); }
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(); }
bool set_annual(bool on) { return _annuale = on; }
bool annuale() const { return _annuale; }
virtual bool is_competenza() const { return false; }
int anno() const { return _anno; }
int da_mese() { return _da_mese; }
int a_mese() { return _a_mese; }
TRiepilogoIVA_recordset();
virtual ~TRiepilogoIVA_recordset() { }
@ -939,7 +932,7 @@ protected:
virtual bool use_mask() { return false; }
public:
virtual bool set_recordset(TRecordset * set) { return TReport::set_recordset(set); }
virtual bool set_recordset(TRecordset * set);
};
@ -1375,9 +1368,6 @@ public:
virtual ~TMovimentoPN() {}
};
// utility
bool fe_decode_cofi(const TString& cofi, char& sex_nasc, TDate& dt_nasc, TString& com_nasc);
///////////////////////////////////////////////////////////
// TAnagrafica
///////////////////////////////////////////////////////////
@ -1395,9 +1385,6 @@ class TAnagrafica : public TObject
TDate _data_nasc;
int _allegato, _stato_estero, _stato_nasc;
TAnagrafica& operator =(const TAnagrafica&) { CHECK(false, "Can't copy TAnagrafica"); }
TAnagrafica(const TAnagrafica&) { CHECK(false, "Can't copy TAnagrafica"); }
protected:
void build_ind_res(const TRectype& rec, const char* ind, const char* civ);
void split_ragsoc();
@ -1448,7 +1435,7 @@ public:
TAnagrafica(int lognum, const TString& codice) { init(lognum, codice); }
TAnagrafica(int lognum, long codice) { init(lognum, codice); }
TAnagrafica(int lognum, char tipo, long codice) { init(lognum, tipo, codice); }
TAnagrafica(char tipo, long codice, const TString& ocfpi) { init(tipo, codice, ocfpi); }
TAnagrafica(char tipo, long codice, const TString& ocfpi){ init(tipo, codice, ocfpi); }
TAnagrafica(const TRectype& rec) { init(rec); }
};
@ -1456,6 +1443,9 @@ class TOccasionale : public TRectype
{
public:
const TString& codice() const { return get(OCC_CFPI); }
const TAnagrafica * anagrafica_occasionale(const TString& ocfpi = EMPTY_STRING) {return new TAnagrafica(*this); }
TRectype& operator = (const TRectype& r);
TOccasionale& operator = (const TOccasionale& r);
@ -1473,14 +1463,19 @@ class TCli_for : public TMultiple_rectype
bool _use_lettere;
bool _extended;
bool _lettera_found;
TAnagrafica _anagr;
TRectype _occasionale;
protected:
virtual int write_rewrite(TBaseisamfile& f, bool re = FALSE) const;
virtual int write_rewrite(TBaseisamfile& f, bool re = false) const;
void init();
const TAnagrafica & anagr();
const TOccasionale * occasionale() const{ return new TOccasionale(_occasionale); }
public:
public:
bool read_lettera(const TDate & data, bool extended = false);
bool occasionale() const { return get_bool(CLI_OCCAS); }
bool is_occasionale() const { return get_bool(CLI_OCCAS); }
TRectype& vendite() const;
bool use_lettere() const { return _use_lettere; }
const TRectype & lettera() const { return _letint; }
@ -1499,10 +1494,15 @@ public:
const TString & get_iban();
TToken_string & get_ban_pres(int nprog = 1);
const TRectype & occasionale(const TString& ocfpi) { return _occasionale = cache().get(LF_OCCAS, ocfpi); }
const TAnagrafica & anagrafica_cliente(const char * ocfpi = "") { _anagr.init(tipo(), codice(), ocfpi); return _anagr; }
TCli_for(char tipo = ' ', long codice = 0L);
TCli_for(const TRectype & rec);
TCli_for(const TCli_for & c);
virtual ~TCli_for();
};
const TCli_for & cached_clifor(const char tipo, const long codice);
#endif

View File

@ -3593,7 +3593,7 @@ bool TTransfer_file::fcopytemp_PC(const char* orig, const char* dest)
while (ok)
{
const word letti = fread(buffer.get_buffer(size), 1, size, i);
const size_t letti = fread(buffer.get_buffer(size), 1, size, i);
const TString4 trec = buffer.left(2);

View File

@ -1,4 +1,5 @@
#include "cglib05.h"
#include "cglib.h"
#include "causali.h"
#include <utility.h>
enum tiporeg {
@ -11,6 +12,23 @@ enum tiporeg {
cespiti = 7
};
///////////////////////////////////////////////////////////
// TRiepilogoIVA_report
///////////////////////////////////////////////////////////
bool TRiepilogoIVA_report::set_recordset(TRecordset * set)
{
const bool ok = TReport::set_recordset(set);
if (set != nullptr)
{
set->unfreeze();
set->requery();
set->freeze();
}
return ok;
}
///////////////////////////////////////////////////////////
// TRiepilogoIVA_recordset
///////////////////////////////////////////////////////////
@ -51,122 +69,114 @@ TRiepilogoIVA_record & TRiepilogoIVA_record::copy(const TRiepilogoIVA_record & r
real & TRiepilogoIVA_record::get_val(int index)
{
real * val = (real *)_values.objptr(index);
if (val == NULL)
if (val == nullptr)
_values.add(val = new real, index);
return *val;
}
void TRiepilogoIVA_recordset::requery()
{
if (_freezed)
return;
TString wrk = query_text();
TString query;
TAssoc_array work_array;
TString16 reg_fieldname; reg_fieldname << LF_MOV << "." << MOV_REG;
TString16 datareg_fieldname; datareg_fieldname << LF_MOV << "." << MOV_DATAREG;
TString16 datadoc_fieldname; datadoc_fieldname << LF_MOV << "." << MOV_DATADOC;
TString16 meseliq_fieldname; meseliq_fieldname << LF_MOV << "." << MOV_MESELIQ;
int p = wrk.find("FROMDATE");
if (p > 0)
query << wrk.sleft(p) << _from_date.string();
wrk.ltrim(p + 8);
p = wrk.find("TODATE");
if (p > 0)
query << wrk.sleft(p) << _to_date.string()<< wrk.smid(p + 6);
TISAM_recordset recset(query);
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
if (not_frozen())
{
TString cod = recset.get(RMI_CODIVA).as_string();
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();
TAssoc_array work_array;
TISAM_recordset recset(query_text());
TRegistro reg(recset.get(reg_fieldname).as_string());
TipoIVA t = reg.iva();
TDate data = recset.get(datareg_fieldname).as_date();
const int meseliq = recset.get(meseliq_fieldname).as_int();
const TDate datadoc = recset.get(datadoc_fieldname).as_date();
const TipoIVA tipo = reg.iva(); // 1=Vendite; 2=Acquisti
const bool fatt_rit_2018 = recset.get(TOSTRING(LF_MOV) "." MOV_DATAREG).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);
if (is_competenza())
recset.set_var("#FROMDATE", from(), true);
recset.set_var("#TODATE", to(), true);
recset.set_var("#ANNO", (long)anno(), true);
if (codatt().full())
recset.set_var("#CODATT", codatt(), true);
recset.set_var("#DAMESE", (long)da_mese(), true);
recset.set_var("#AMESE", (long)a_mese(), true);
for (bool ok = recset.move_first(); ok; ok = recset.move_next())
{
if (meseliq != 0)
TString cod = recset.get(RMI_CODIVA).as_string();
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();
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);
if (is_competenza())
{
if (meseliq > data.month())
data.addyear(-1);
data.set_month(meseliq);
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 (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 == NULL)
work_array.add(cod, rec = new TRiepilogoIVA_record(cod));
if (t == iva_acquisti)
{
if (indetr == 0)
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)
{
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())
if (indetr == 0)
{
real & r = rec->impcorr();
real & r = rec->impacq();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivacorr();
real & r1 = rec->ivaacq();
r1 += recset.get(RMI_IMPOSTA).as_real();
}
else
{
real & r = rec->impven();
real & r = rec->impacqind();
r += recset.get(RMI_IMPONIBILE).as_real();
real & r1 = rec->ivaven();
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;
TString_array keys;
work_array.get_keys(keys);
_rows.destroy();
FOR_EACH_ARRAY_ITEM(keys, i, obj)
{
TString & key = (TString &) *obj;
TRiepilogoIVA_record & row = (TRiepilogoIVA_record &) work_array.find(key);
work_array.get_keys(keys);
_rows.destroy();
FOR_EACH_ARRAY_ITEM(keys, i, obj)
{
TString & key = (TString &)*obj;
TRiepilogoIVA_record & row = (TRiepilogoIVA_record &)work_array.find(key);
_rows.add(row);
_rows.add(row);
}
}
}
@ -187,7 +197,17 @@ const TString& TRiepilogoIVA_recordset::query_text() const
{
TString & query = get_tmp_string();
query << "USE " << LF_RMOVIVA << " KEY 1 SELECT BETWEEN(" << LF_MOV << "." << MOV_DATAREG << ";" << '"' << "FROMDATE" << '"' << ";" << '"' << "TODATE" << '"' << ") \nJOIN " << LF_MOV << " INTO NUMREG==NUMREG";
// query << "USE " << LF_RMOVIVA << " KEY 1 SELECT BETWEEN(" << FIELD_NAME(LF_MOV, MOV_DATAREG) << ";" << '"' << "FROMDATE" << '"' << ";" << '"' << "TODATE" << '"' << ")";
query << "USE " << LF_RMOVIVA << " KEY 1 SELECT BETWEEN(" << FIELD_NAME(LF_MOV, MOV_DATAREG) << "; #FROMDATE; #TODATE)";
if (codatt().full())
{
// query << "&&(" << FIELD_NAME(REG, "S8") << "==\"" << _codatt << "\")";
query << "&&(" << FIELD_NAME(REG, "S8") << "=#CODATT)";
query << "\nJOIN " << LF_MOV << " INTO " << MOV_NUMREG << "==" << RMI_NUMREG;
query << "\nJOIN REG TO " << LF_MOV << " INTO CODTAB==" << MAIN_SUB_FIELD_NAME(MOV_DATAREG, 7, 10) << "+" << MOV_REG;
}
else
query << "\nJOIN " << LF_MOV << " INTO " << MOV_NUMREG << "==" << RMI_NUMREG;
// query << "USE " << LF_RMOVIVA << " KEY 1 SELECT BETWEEN(" << LF_MOV << "." << MOV_DATAREG << ";FROMDATE;TODATE) \nJOIN " << LF_MOV << " INTO NUMREG==NUMREG";
return query;
}
@ -294,9 +314,7 @@ const TVariant& TRiepilogoIVA_recordset::get(unsigned int column) const
return v;
}
TRiepilogoIVA_recordset::TRiepilogoIVA_recordset() : TRecordset(), _pos(0), _from_date(botime), _to_date(eotime),
_freezed(false), _annuale(false), _anno(0), _da_mese(1), _a_mese(12)
TRiepilogoIVA_recordset::TRiepilogoIVA_recordset() : TRecordset(), _pos(0), _annuale(false)
{
add_field(_alfafld, 101, 4, COD);
add_field(_alfafld, 102, 50, DESC);

View File

@ -16,7 +16,7 @@
#
#include <nditte.h>
bool fe_decode_cofi(const TString& cofi, char& sex_nasc, TDate& dt_nasc, TString& com_nasc)
bool decode_cofi(const TString& cofi, char& sex_nasc, TDate& dt_nasc, TString& com_nasc)
{
if (cofi.len() != 16 || !cf_check("", cofi))
return false;
@ -49,7 +49,7 @@ static bool is_stato_estero(const TString& codcom)
return codcom.full() && codcom.match("Z[0-9][0-9][0-9]");
}
static const TString& comune_di(const TString& codcom, int stato)
static const TString& comune(const TString& codcom, int stato)
{
if (codcom.blank() || codcom.len() != 4)
return EMPTY_STRING;
@ -61,7 +61,7 @@ static const TString& comune_di(const TString& codcom, int stato)
return cache().get(LF_COMUNI, key, COM_DENCOM);
}
static const TString& provincia_di(const TString& codcom)
static const TString& provincia(const TString& codcom)
{
if (codcom.blank() || codcom.len() != 4)
return EMPTY_STRING;
@ -81,7 +81,7 @@ const TString& TAnagrafica::comune_nascita() const
{
if (is_stato_estero(_com_nasc))
{
const TString& c = comune_di(_com_nasc, 0);
const TString& c = comune(_com_nasc, 0);
if (c.full())
return c;
}
@ -92,19 +92,19 @@ const TString& TAnagrafica::comune_nascita() const
if (s.full())
return s;
}
return comune_di(_com_nasc, _stato_nasc);
return comune(_com_nasc, _stato_nasc);
}
const TString& TAnagrafica::provincia_nascita() const
{
if (_stato_nasc > 0 || is_stato_estero(_com_nasc))
return get_tmp_string() = "EE";
return provincia_di(_com_nasc);
return provincia(_com_nasc);
}
const TString& TAnagrafica::comune_residenza() const
{
const TString& cr = comune_di(_com_res, _stato_estero);
const TString& cr = comune(_com_res, _stato_estero);
if (cr.full())
return cr;
return _loc_res;
@ -114,7 +114,7 @@ const TString& TAnagrafica::provincia_residenza() const
{
if (estero())
return get_tmp_string() = "EE";
return provincia_di(_com_res);
return provincia(_com_res);
}
const TString& TAnagrafica::stato_residenza_ISO() const
@ -156,7 +156,7 @@ void TAnagrafica::build_ind_res(const TRectype& rec, const char* ind, const char
// Sistema persone senza codice stato, ma residenti in comune estero
if (_stato_estero <= 0 && is_stato_estero(_com_res))
{
const TString80 naz = comune_di(_com_res, 0);
const TString80 naz = comune(_com_res, 0);
TString query; query.format("USE %%STA KEY 2\nFROM S0=%c\nTO S0=%c", naz[0], naz[0]);
TISAM_recordset sta(query);
double dBest = 0;
@ -320,7 +320,7 @@ bool TAnagrafica::init(const TRectype& rec)
if (_cofi.full() && (!_data_nasc.ok()) || _com_nasc.blank())
{
char sex = 'X';
fe_decode_cofi(_cofi, sex, _data_nasc, _com_nasc);
decode_cofi(_cofi, sex, _data_nasc, _com_nasc);
}
}
else
@ -359,7 +359,7 @@ bool TAnagrafica::init(const TRectype& rec)
if ((!_data_nasc.ok() || _com_nasc.blank()) && cf_check("", _cofi))
{
char sex = 'X';
fe_decode_cofi(_cofi, sex, _data_nasc, _com_nasc);
decode_cofi(_cofi, sex, _data_nasc, _com_nasc);
}
}
}
@ -422,7 +422,7 @@ bool TAnagrafica::init(const TRectype& rec)
if (!_data_nasc.ok() && has_cofi)
{
char sex = 'X';
fe_decode_cofi(cli_cofi, sex, _data_nasc, _com_nasc);
decode_cofi(cli_cofi, sex, _data_nasc, _com_nasc);
}
if (_com_nasc.blank())
@ -431,7 +431,7 @@ bool TAnagrafica::init(const TRectype& rec)
if (_com_nasc.blank() && has_cofi)
{
char sex = 'X';
fe_decode_cofi(cli_cofi, sex, _data_nasc, _com_nasc);
decode_cofi(cli_cofi, sex, _data_nasc, _com_nasc);
}
}
if (_stato_nasc <= 0)
@ -565,6 +565,45 @@ bool TAnagrafica::init(char tipocf, long codice, const TString& ocfpi)
return done;
}
///////////////////////////////////////////////////////////
// TCache_causali
///////////////////////////////////////////////////////////
class TCache_clifor : public TCache
{
protected:
virtual TObject* key2obj(const char* key);
public:
const TCli_for & clifor(const char tipo, const long codice);
TCache_clifor() : TCache() { }
virtual ~TCache_clifor() { }
};
TObject* TCache_clifor::key2obj(const char* key)
{
TToken_string k(key);
TString4 tipo;
long codice;
k.get(0, tipo);
k.get(1, codice);
return new TCli_for(tipo[0], codice);
}
const TCli_for & TCache_clifor::clifor(const char tipo, const long codice)
{
TToken_string k; k << tipo;
k.add(codice);
return (const TCli_for &)*objptr(k);
}
const TCli_for & cached_clifor(const char tipo, long codice)
{
HIDDEN TCache_clifor __cache_clifor;
return __cache_clifor.clifor(tipo, codice);
}
TOccasionale::TOccasionale() : TRectype(LF_OCCAS)
{ }
@ -743,10 +782,6 @@ int TCli_for::remove(TBaseisamfile& f) const
void TCli_for::init()
{
// _tipo = new TRecfield(*this, CLI_TIPOCF);
// _codice = new TRecfield(*this, CLI_CODCF);
// _ven_tipo = new TRecfield(_ven_rec, CFV_TIPOCF);
// _ven_codice = new TRecfield(_ven_rec, CFV_CODCF);
_use_lettere = main_app().has_module(LIAUT, CHK_DONGLE);
}
@ -779,134 +814,8 @@ const TString& TCli_for::find_listino_al(const TDate& datadoc) const
return get_tmp_string() = listino;
}
/*void TCli_for::cli2doc(TDocumento& doc)
{
const TRectype& v = vendite();
doc.put(DOC_CODVAL, get(CLI_CODVAL));
doc.put(DOC_CODLIN, get(CLI_CODLIN));
doc.put(DOC_CODPAG, get(CLI_CODPAG));
TToken_string key;
key.add(get(CLI_TIPOCF));
key.add(get(CLI_CODCF));
key.add("V");
key.add("1");
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (cfban.empty())
{
doc.put(DOC_CODABIA, get(CLI_CODABI));
doc.put(DOC_CODCABA, get(CLI_CODCAB));
doc.put(DOC_IBAN, get(CLI_IBAN));
}
else
{
doc.put(DOC_CODABIA, cfban.get(CFBAN_ABI));
doc.put(DOC_CODCABA, cfban.get(CFBAN_CAB));
doc.put(DOC_IBAN, cfban.get(CFBAN_IBAN));
}
// Trasforma chiave da Vostra a Nostra banca
key.add("N", 2);
const TRectype& cfbanpr = cache().get(LF_CFBAN, key);
// Setta i campi che appartengono al file LF_CFVEN
if (cfbanpr.empty())
{
doc.put(DOC_CODABIP, v.get(CFV_CODABIPR));
doc.put(DOC_CODCABP, v.get(CFV_CODCABPR));
}
else
{
doc.put(DOC_CODABIP, cfbanpr.get(CFBAN_ABI));
doc.put(DOC_CODCABP, cfbanpr.get(CFBAN_CAB));
doc.put(DOC_PROGBNP, cfbanpr.get(CFBAN_PROGPR));
}
doc.put(DOC_RAGGR, v.get(CFV_RAGGDOC));
doc.put(DOC_RAGGREFF, v.get(CFV_RAGGEFF));
doc.put(DOC_CODINDSP, v.get(CFV_CODINDSP));
doc.put(DOC_CODAG, v.get(CFV_CODAG));
doc.put(DOC_CODAGVIS, v.get(CFV_CODAG1));
doc.put(DOC_CODSPMEZZO, v.get(CFV_CODSPMEZZO));
doc.put(DOC_CODPORTO, v.get(CFV_CODPORTO));
doc.put(DOC_CODNOTESP1, v.get(CFV_CODNOTESP1));
doc.put(DOC_CODNOTESP2, v.get(CFV_CODNOTESP2));
doc.put(DOC_CODNOTE, v.get(CFV_CODNOTE));
doc.put(DOC_CODVETT1, v.get(CFV_CODVETT1));
doc.put(DOC_CODVETT2, v.get(CFV_CODVETT2));
doc.put(DOC_CODVETT3, v.get(CFV_CODVETT3));
doc.put(DOC_PERCSPINC, v.get(CFV_PERCSPINC));
doc.put(DOC_ADDBOLLI, v.get(CFV_ADDBOLLI));
doc.put(DOC_CATVEN, v.get(CFV_CATVEN));
const int alleg = get_int(CLI_ALLEG);
const bool split_payment = doc.get_date(DOC_DATADOC).year() >= 2015 && get_bool(CLI_SPLITPAY);
doc.put(DOC_LIQDIFF, !split_payment && alleg == 7 && ini_get_bool(CONFIG_DITTA, "cg", "GesLiqDiff") ? "X" : "");
//listino: deve essere attiva la gestione listini nella ditta
const bool gest_listini = ini_get_bool(CONFIG_DITTA, "ve", "GES", false, 1);
if (gest_listini)
{
const TDate datadoc = doc.get_date(DOC_DATADOC);
const TString& listino = find_listino_al(datadoc);
doc.put(DOC_CODLIST, listino);
}
doc.put(DOC_ZONA, v.get(CFV_CODZONA));
doc.put(DOC_RAGGR, v.get(CFV_RAGGDOC));
//aggiungere gestione spese e bolli???
doc.put(DOC_CODPORTO, v.get(CFV_CODPORTO));
}
const TString& TCli_for::get_iban()
{
TString & iban = get_tmp_string(30);
TToken_string key;
key.add(tipo());
key.add(codice());
key.add("V");
key.add(1);
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (!cfban.empty())
{
const TString& abi_cf = cfban.get(CFBAN_ABI);
const TString& cab_cf = cfban.get(CFBAN_CAB);
iban = cfban.get(CFBAN_IBAN);
}
return iban;
}
TToken_string& TCli_for::get_ban_pres(int nprog)
{
TToken_string & ban = get_tmp_string(30);
TToken_string key;
key.add(tipo());
key.add(codice());
key.add("N");
key.add(nprog);
const TRectype& cfban = cache().get(LF_CFBAN, key);
if (!cfban.empty())
{
ban.add(cfban.get(CFBAN_ABI));
ban.add(cfban.get(CFBAN_CAB));
ban.add(cfban.get(CFBAN_PROGPR));
}
return ban;
}*/
TCli_for::TCli_for(char tipo, long codice) : TMultiple_rectype( LF_CLIFO ), _ven_rec(LF_CFVEN),
_letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false)
_letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false), _occasionale(LF_OCCAS)
{
init();
add_file(LF_INDSP, IND_CODIND);
@ -915,7 +824,7 @@ TCli_for::TCli_for(char tipo, long codice) : TMultiple_rectype( LF_CLIFO ), _ven
}
TCli_for::TCli_for(const TRectype & rec) : TMultiple_rectype(rec), _ven_rec(LF_CFVEN),
_letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false)
_letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false), _occasionale(LF_OCCAS)
{
init();
add_file(LF_INDSP, IND_CODIND);
@ -923,7 +832,7 @@ TCli_for::TCli_for(const TRectype & rec) : TMultiple_rectype(rec), _ven_rec(LF_C
}
TCli_for::TCli_for(const TCli_for & c) : TMultiple_rectype(c), _ven_rec(c._ven_rec),
_letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false)
_letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false), _occasionale(LF_OCCAS)
{ init(); }
TCli_for::~TCli_for()

View File

@ -1,3 +1,3 @@
16
0
$indsped|0|0|269|0|Indirizzi di spedizione|NCF||
$indsped|0|0|296|0|Indirizzi di spedizione|NCF||

View File

@ -1,5 +1,5 @@
16
16
18
TIPOCF|1|1|0|Tipo <C>liente o <F>ornitore
CODCF|3|6|0|Codice cliente o fornitore
CODIND|2|3|0|Codice progressivo indirizzo
@ -16,5 +16,7 @@ TEL|1|30|0|Numero di telefono
PFAX|1|10|0|Prefisso del numero di FAX
FAX|1|30|0|Numero di FAX
IVARID|8|1|0|Iva ridotta per questa destinazione
PADESTIN|1|7|0|Codice ufficio amministrazione
PARIFAMM|1|20|0|Codice riferimento amministrativo
1
TIPOCF+CODCF+CODIND|