Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00
This commit is contained in:
commit
419782f765
5
cd/test/fp0726.txt
Normal file
5
cd/test/fp0726.txt
Normal file
@ -0,0 +1,5 @@
|
||||
fp0.exe
|
||||
|
||||
- Ottimizzazione generale esportazione
|
||||
- Aggiunta scrittura CONAI
|
||||
- Escluso plafond da note credito
|
19
cd/test/fp0726a.ini
Normal file
19
cd/test/fp0726a.ini
Normal file
@ -0,0 +1,19 @@
|
||||
[Main]
|
||||
Demo=0
|
||||
|
||||
[fp1]
|
||||
File(0) = fp0.exe|X
|
||||
Patch = 726
|
||||
Versione = 21511200
|
||||
|
||||
[fp]
|
||||
Data = 11-03-2019
|
||||
Descrizione = Fattura Elettronica
|
||||
Dischi = 1
|
||||
Moduli = cg,ve
|
||||
OEM =
|
||||
Patch = 726
|
||||
PostProcess =
|
||||
PreProcess =
|
||||
Versione = 21511200
|
||||
|
BIN
cd/test/fp0726a1.zip
Normal file
BIN
cd/test/fp0726a1.zip
Normal file
Binary file not shown.
2
cd/test/tf0726.txt
Normal file
2
cd/test/tf0726.txt
Normal file
@ -0,0 +1,2 @@
|
||||
tf0.exe
|
||||
tf0100a.msk
|
20
cd/test/tf0726a.ini
Normal file
20
cd/test/tf0726a.ini
Normal file
@ -0,0 +1,20 @@
|
||||
[Main]
|
||||
Demo=0
|
||||
|
||||
[tf1]
|
||||
File(0) = tf0.exe|X
|
||||
File(1) = tf0100a.msk|X
|
||||
Patch = 0726
|
||||
Versione = 21511200
|
||||
|
||||
[tf]
|
||||
Data = 11-03-2019
|
||||
Descrizione = Trasferimento fatture
|
||||
Dischi = 1
|
||||
Moduli = cg
|
||||
OEM =
|
||||
Patch = 726
|
||||
PostProcess =
|
||||
PreProcess =
|
||||
Versione = 21511200
|
||||
|
BIN
cd/test/tf0726a1.zip
Normal file
BIN
cd/test/tf0726a1.zip
Normal file
Binary file not shown.
@ -66,6 +66,8 @@ public:
|
||||
void set(const char* fld, bool var);
|
||||
const TString sq_get(const char* fld) const;
|
||||
bool is_full() const { return _fields.items() > _key.items(); }
|
||||
const TString& get_table() const { return _table; }
|
||||
|
||||
|
||||
TString& insert_string();
|
||||
bool insert();
|
||||
@ -94,6 +96,7 @@ class TPaf_container : public TObject
|
||||
public:
|
||||
TPaf_record& get_paf(const char * paf);
|
||||
bool clean_and_erase_paf(const TString& hfatt, const TString& bfatt);
|
||||
static void set_keys_paf(TPaf_record& paf, const TString& hfatt, const TString& bfatt, const bool reset = true);
|
||||
TPaf_container();
|
||||
};
|
||||
|
||||
@ -127,7 +130,8 @@ private:
|
||||
bool _is_pa;
|
||||
bool _has_bolla;
|
||||
TString _codivadefault;
|
||||
long _index_cassa_previdenziale;
|
||||
long _idx_cassa_previdenziale;
|
||||
long _idx_adg_doc_row; // Indice per la tabella altri dati gestionali della riga
|
||||
int _num_linea;
|
||||
int _counter;
|
||||
TPaf_container _paf_container;
|
||||
@ -158,6 +162,7 @@ private:
|
||||
int find_ancestors(const TRiga_documento& rdoc, TArray& ancestors) const;
|
||||
bool insert(TPaf_record& p);
|
||||
bool remove(TPaf_record& p);
|
||||
void reset(TPaf_record& p) const { TPaf_container::set_keys_paf(p, _hfatt, _bfatt); }
|
||||
bool save_paf();
|
||||
|
||||
|
||||
@ -182,8 +187,8 @@ protected:
|
||||
const TRectype& cco(const TRectype& doc) const; // Contratto/Convenzione/Offerta
|
||||
|
||||
void log(int severity, const char* msg);
|
||||
const char* natura(const TString& codiva) const;
|
||||
const char* get_esigibilita_iva(const TDocumentoEsteso& doc);
|
||||
static const char* natura(const TString& codiva);
|
||||
static const char* get_esigibilita_iva(const TDocumentoEsteso& doc);
|
||||
void set_IVA(TString codiva, TPaf_record& paf) const;
|
||||
void set_IVA(const TRiga_documento& rdoc, TPaf_record& paf) const;
|
||||
bool add_row_art(long& riga_art, const TString& codice_tipo, const TString& codice_valore, TPaf_record& paf);
|
||||
@ -203,11 +208,6 @@ protected:
|
||||
//void set_rec_clifo(char tipocf, long codcf);
|
||||
|
||||
public:
|
||||
// Set Altri Dati Gestionali
|
||||
void set_adg(int r);
|
||||
// Get Altri Dati Gestionali
|
||||
void get_adg();
|
||||
void set_paf2100f(int r, TRiga_documento* rdoc);
|
||||
bool doc_to_paf(TDocumentoEsteso& doc);
|
||||
bool doc_to_paf(const TRectype& rec);
|
||||
bool doc_to_paf(const TDoc_key& key);
|
||||
|
@ -474,20 +474,22 @@ bool TPaf_container::clean_and_erase_paf(const TString& hfatt, const TString& bf
|
||||
bool ok = true;
|
||||
for (auto i = _pafs.begin(); i != _pafs.end() && ok; ++i)
|
||||
{
|
||||
if (i->second.is_full())
|
||||
{
|
||||
if (strcmp(i->first, "PAF0200F") != 0)
|
||||
i->second.reset();
|
||||
}
|
||||
const char * prefix = paf_to_prefix(i->first);
|
||||
|
||||
i->second.set(TString(prefix) << "_KEYHEADERFATT", hfatt);
|
||||
i->second.set(TString(prefix) << "_KEYBODYFATT", bfatt);
|
||||
set_keys_paf(i->second, hfatt, bfatt, strcmp(i->first, "PAF0200F") != 0);
|
||||
ok = i->second.remove();
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
void TPaf_container::set_keys_paf(TPaf_record& paf, const TString& hfatt, const TString& bfatt, const bool reset)
|
||||
{
|
||||
if (reset)
|
||||
paf.reset();
|
||||
|
||||
const char * prefix = paf_to_prefix(paf.get_table());
|
||||
paf.set(TString(prefix) << "_KEYHEADERFATT", hfatt);
|
||||
paf.set(TString(prefix) << "_KEYBODYFATT", bfatt);
|
||||
}
|
||||
|
||||
const char* TPaf_container::paf_to_prefix(const char * paf)
|
||||
{
|
||||
static TString paf_name;
|
||||
@ -994,7 +996,7 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||
}
|
||||
|
||||
// Azzero indici
|
||||
_index_cassa_previdenziale = 1;
|
||||
_idx_cassa_previdenziale = 1;
|
||||
|
||||
if(check_initial(doc) || fp_settings().get_check_not_block())
|
||||
{
|
||||
@ -1085,7 +1087,7 @@ const int TDoc_fp::force_commit()
|
||||
return commit();
|
||||
}
|
||||
|
||||
const char* TDoc_fp::natura(const TString& codiva) const
|
||||
const char* TDoc_fp::natura(const TString& codiva)
|
||||
{
|
||||
return cache().get("%IVA", codiva, "S12");
|
||||
}
|
||||
@ -1262,9 +1264,7 @@ void TDoc_fp::add_ritenuta(const TDocumentoEsteso& doc, const TSpesa_prest& sp,
|
||||
bool TDoc_fp::add_riepilogo_iva(TPaf_record& paf2200f, const TCodiceIVA& cod_iva, const char* eiva, const real& imponibile,
|
||||
const real& imposta)
|
||||
{
|
||||
paf2200f.reset();
|
||||
paf2200f.set("PL_KEYHEADERFATT", _hfatt);
|
||||
paf2200f.set("PL_KEYBODYFATT", _bfatt);
|
||||
reset(paf2200f);
|
||||
|
||||
const real aliquota = cod_iva.percentuale();
|
||||
const TString& cod_aliquota = cod_iva.codice();
|
||||
@ -1302,17 +1302,8 @@ bool TDoc_fp::add_riepilogo_iva(TPaf_record& paf2200f, const TCodiceIVA& cod_iva
|
||||
bool TDoc_fp::add_cassa_previdenziale(TRiga_documento& rdoc)
|
||||
{
|
||||
TPaf_record& paf0800f = _paf_container.get_paf("PAF0800F");
|
||||
paf0800f.reset();
|
||||
if (_index_cassa_previdenziale == 1)
|
||||
{
|
||||
paf0800f.set("P8_KEYHEADERFATT", _hfatt);
|
||||
paf0800f.set("P8_KEYBODYFATT", _bfatt);
|
||||
remove(paf0800f);
|
||||
}
|
||||
// Chiavi
|
||||
paf0800f.set("P8_KEYHEADERFATT", _hfatt);
|
||||
paf0800f.set("P8_KEYBODYFATT", _bfatt);
|
||||
paf0800f.set("P8_RIFNUMLINEA", _index_cassa_previdenziale++);
|
||||
reset(paf0800f);
|
||||
paf0800f.set("P8_RIFNUMLINEA", _idx_cassa_previdenziale++);
|
||||
|
||||
// Resto
|
||||
const TSpesa_prest& sp = rdoc.spesa();
|
||||
@ -1379,25 +1370,6 @@ bool TDoc_fp::export_paf3200f()
|
||||
return true;
|
||||
}
|
||||
|
||||
void TDoc_fp::set_adg(int r)
|
||||
{
|
||||
_num_linea = r;
|
||||
_counter = 0;
|
||||
|
||||
}
|
||||
|
||||
void TDoc_fp::get_adg()
|
||||
{
|
||||
//static TPaf_record paf2000f;
|
||||
}
|
||||
|
||||
void TDoc_fp::set_paf2100f(int r, TRiga_documento* rdoc)
|
||||
{
|
||||
|
||||
|
||||
|
||||
_count_r_conai++;
|
||||
}
|
||||
|
||||
bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
{
|
||||
@ -1652,41 +1624,42 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
if (check_row(*rdoc) && !fp_settings().get_check_not_block())
|
||||
return false;
|
||||
|
||||
|
||||
_idx_adg_doc_row = 1L;
|
||||
|
||||
bool skip_riga = false;
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
|
||||
reset(paf1800f);
|
||||
paf1800f.set("PI_NUMEROLINEA", riga);
|
||||
const TString& descrizione_riga = descrizione(*rdoc);
|
||||
if (descrizione_riga.empty())
|
||||
continue;
|
||||
paf3000f.reset();
|
||||
paf3000f.set("PT_KEYHEADERFATT", _hfatt);
|
||||
paf3000f.set("PT_KEYBODYFATT", _bfatt);
|
||||
|
||||
|
||||
reset(paf3000f);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf3000f.set("PT_COMMENTO", descrizione_riga);
|
||||
// <CodiceArticolo>
|
||||
if (rdoc->is_articolo())
|
||||
{
|
||||
TString codartmag = rdoc->get(RDOC_CODARTMAG);
|
||||
TString codart = rdoc->get(RDOC_CODART);
|
||||
|
||||
const TString& codartmag = rdoc->get(RDOC_CODARTMAG);
|
||||
const TString& codart = rdoc->get(RDOC_CODART);
|
||||
long riga_art = 0;
|
||||
if (codart.full())
|
||||
{
|
||||
if (codartmag.full())
|
||||
{
|
||||
paf1900f.reset();
|
||||
paf1900f.set("PY_KEYHEADERFATT", _hfatt);
|
||||
paf1900f.set("PY_KEYBODYFATT", _bfatt);
|
||||
|
||||
reset(paf1900f);
|
||||
paf1900f.set("PY_KEYNLINEA", riga);
|
||||
ok &= add_row_art(riga_art, "Codice articolo interno", codartmag, paf1900f);
|
||||
}
|
||||
// Se il codice articolo del magazzino è diverso quello è del cliente
|
||||
if (codart.full() && codart != codartmag)
|
||||
{
|
||||
paf1900f.reset();
|
||||
paf1900f.set("PY_KEYHEADERFATT", _hfatt);
|
||||
paf1900f.set("PY_KEYBODYFATT", _bfatt);
|
||||
|
||||
reset(paf1900f);
|
||||
paf1900f.set("PY_KEYNLINEA", riga);
|
||||
ok &= add_row_art(riga_art, "Codice articolo cliente", codart, paf1900f);
|
||||
}
|
||||
@ -1696,8 +1669,16 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
const TString conai_fld(conai_peso_name(cc, LF_RIGHEDOC));
|
||||
if(rdoc->get(conai_fld).full())
|
||||
{
|
||||
rdoc->get(conai_fld);
|
||||
reset(paf2100f);
|
||||
paf2100f.set("PK_KEYNLINEA", static_cast<long>(r));
|
||||
paf2100f.set("PK_KEYNLINAR", _idx_adg_doc_row++);
|
||||
static TString msg_conai;
|
||||
msg_conai.cut(0) << "Contributo CONAI " << conai_material(cc) << " (KG)";
|
||||
paf2100f.set("PK_TIPODATO", "CONAI");
|
||||
paf2100f.set("PK_RIFDATO", msg_conai);
|
||||
paf2100f.set("PK_RIFNUMERO", rdoc->get_real(conai_fld).string());
|
||||
|
||||
ok &= insert(paf2100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1739,14 +1720,12 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
for (int i = ancestors.last(); i > 0; i = ancestors.pred(i))
|
||||
{
|
||||
_has_bolla |= true;
|
||||
const TAncestor& a = (const TAncestor&)ancestors[i];
|
||||
const TAncestor& a = dynamic_cast<const TAncestor&>(ancestors[i]);
|
||||
if (i == 1)
|
||||
{
|
||||
// <DatiDDT>
|
||||
paf1600f.reset();
|
||||
paf1600f.set("PF_KEYHEADERFATT", _hfatt);
|
||||
paf1600f.set("PF_KEYBODYFATT", _bfatt);
|
||||
paf1600f.set("PF_RIFNUMLINEA", (long)r);
|
||||
reset(paf1600f);
|
||||
paf1600f.set("PF_RIFNUMLINEA", static_cast<long>(r));
|
||||
paf1600f.set("PF_NUMDDDT", a._numdoc);
|
||||
paf1600f.set("PF_DATADDT", a._datadoc);
|
||||
paf1600f.set("PF_GESTIONE", "D");
|
||||
@ -1758,7 +1737,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
// <DatiOrdineAcquisto>
|
||||
paf1000f.set("P0_KEYHEADERFATT", _hfatt);
|
||||
paf1000f.set("P0_KEYBODYFATT", _bfatt);
|
||||
paf1000f.set("P0_RIFNUMLINEA", (long)r);
|
||||
paf1000f.set("P0_RIFNUMLINEA", static_cast<long>(r));
|
||||
paf1000f.set("P0_IDDOC", a._numdoc);
|
||||
paf1000f.set("P0_DATADOC", a._datadoc);
|
||||
paf1000f.set("P0_COMMESSACONV", com);
|
||||
@ -1855,8 +1834,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
set_qta_prezzo(paf1800f, rdoc);
|
||||
set_IVA(*rdoc, paf1800f);
|
||||
|
||||
reset(paf2100f);
|
||||
paf2100f.set("PK_KEYNLINEA", static_cast<long>(r));
|
||||
paf2100f.set("PK_KEYNLINAR", 1L);
|
||||
paf2100f.set("PK_KEYNLINAR", _idx_adg_doc_row++);
|
||||
paf2100f.set("PK_TIPODATO", "AswTRiga");
|
||||
|
||||
|
||||
@ -1937,19 +1917,15 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
}
|
||||
// Controllo plafond
|
||||
// Riga esenzione?
|
||||
if (doc.is_fattura())
|
||||
if (doc.is_fattura() && !doc.is_nota_credito())
|
||||
{
|
||||
doc.set_riga_esenzione();
|
||||
if(doc.ha_riga_esenzione())
|
||||
{
|
||||
const TRiga_documento& riga_es = doc.get_riga_esenzione();
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
reset(paf1800f);
|
||||
paf1800f.set("PI_NUMEROLINEA", riga);
|
||||
paf3000f.reset();
|
||||
paf3000f.set("PT_KEYHEADERFATT", _hfatt);
|
||||
paf3000f.set("PT_KEYBODYFATT", _bfatt);
|
||||
reset(paf3000f);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf3000f.set("PT_COMMENTO", descrizione(riga_es));
|
||||
paf1800f.set("PI_QUANTITA", UNO);
|
||||
@ -1957,18 +1933,15 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf1800f.set("PI_PRZTOTALE", ZERO);
|
||||
set_IVA(_codivadefault, paf1800f);
|
||||
ok &= insert(paf1800f) && insert(paf3000f);
|
||||
riga++;
|
||||
}
|
||||
}
|
||||
// Se il bollo va fatto pagare bisogna aggiungere una riga!
|
||||
if(doc.get_bool("ADDBOLLI") && doc.get_real("BOLLI") > ZERO)
|
||||
{
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
reset(paf1800f);
|
||||
paf1800f.set("PI_NUMEROLINEA", riga);
|
||||
paf3000f.reset();
|
||||
paf3000f.set("PT_KEYHEADERFATT", _hfatt);
|
||||
paf3000f.set("PT_KEYBODYFATT", _bfatt);
|
||||
reset(paf3000f);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf3000f.set("PT_COMMENTO", "Imposta di bollo assolta virtualmente ai sensi dell'art. 6 D.M. 17.6.2014");
|
||||
paf1800f.set("PI_QUANTITA", UNO);
|
||||
@ -1976,18 +1949,15 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf1800f.set("PI_PRZTOTALE", converti_prezzo(doc.get_real("BOLLI")));
|
||||
set_IVA(doc.codiva_bolli(), paf1800f);
|
||||
ok &= insert(paf1800f) && insert(paf3000f);
|
||||
riga++;
|
||||
}
|
||||
// OMAGGI????
|
||||
// Aggiungo le spese incasso
|
||||
if(doc.get_real("SPESINC") > ZERO)
|
||||
{
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
reset(paf1800f);
|
||||
paf1800f.set("PI_NUMEROLINEA", riga);
|
||||
paf3000f.reset();
|
||||
paf3000f.set("PT_KEYHEADERFATT", _hfatt);
|
||||
paf3000f.set("PT_KEYBODYFATT", _bfatt);
|
||||
reset(paf3000f);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf3000f.set("PT_COMMENTO", "Spese incasso");
|
||||
paf1800f.set("PI_QUANTITA", UNO);
|
||||
@ -1997,17 +1967,14 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
||||
set_IVA(ini_get_string(CONFIG_DITTA, "ve", "SPINCODIVA"), paf1800f);
|
||||
ok &= insert(paf1800f) && insert(paf3000f);
|
||||
riga++;
|
||||
}
|
||||
// Conai assolto
|
||||
if(doc.clifor().vendite().get_bool("CONAIASS"))
|
||||
{
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
reset(paf1800f);
|
||||
paf1800f.set("PI_NUMEROLINEA", riga);
|
||||
paf3000f.reset();
|
||||
paf3000f.set("PT_KEYHEADERFATT", _hfatt);
|
||||
paf3000f.set("PT_KEYBODYFATT", _bfatt);
|
||||
reset(paf3000f);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf3000f.set("PT_COMMENTO", _conai_str);
|
||||
paf1800f.set("PI_QUANTITA", UNO);
|
||||
@ -2015,6 +1982,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf1800f.set("PI_PRZTOTALE", ZERO);
|
||||
set_IVA(_codivadefault, paf1800f);
|
||||
ok &= insert(paf1800f) && insert(paf3000f);
|
||||
riga++;
|
||||
}
|
||||
|
||||
// Riga sconto di testata
|
||||
@ -2026,13 +1994,9 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
{
|
||||
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
|
||||
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
reset(paf1800f);
|
||||
paf1800f.set("PI_NUMEROLINEA", riga);
|
||||
paf3000f.reset();
|
||||
paf3000f.set("PT_KEYHEADERFATT", _hfatt);
|
||||
paf3000f.set("PT_KEYBODYFATT", _bfatt);
|
||||
reset(paf3000f);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf1800f.set("PI_TIPOCESSPREST", "AB");
|
||||
TString msg = "Riga sconto merci in testata ";
|
||||
@ -2046,6 +2010,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf1800f.set("PI_PRZTOTALE", -abs(riva.sconto_perc()));
|
||||
set_IVA(riva.cod_iva().codice(), paf1800f);
|
||||
ok &= insert(paf1800f) && insert(paf3000f);
|
||||
riga++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2091,7 +2056,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
const char* eiva = get_esigibilita_iva(doc);
|
||||
long num_riep = 0;
|
||||
TAssoc_array& tiva = doc.tabella_iva(false);
|
||||
FOR_EACH_ASSOC_OBJECT(tiva, obj, key, itm)
|
||||
for(TObject* itm = tiva.first_item(); itm != nullptr; itm = tiva.succ_item())
|
||||
{
|
||||
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
|
||||
|
||||
|
@ -41,13 +41,13 @@ enum return_code
|
||||
// Su DB: X o ''->Da inviare, F->Forzato, I->Inviato, N->Non inviare
|
||||
enum filter_fatt
|
||||
{
|
||||
to_send, // "", "X", "F", "E"
|
||||
sent, // "I"
|
||||
untouched, // "", "X"
|
||||
forced, // "F"
|
||||
disabled, // "N"
|
||||
err, // "E"
|
||||
all // Nessun controllo
|
||||
to_send = 0, // "", "X", "F", "E"
|
||||
sent = 1, // "I"
|
||||
untouched = 2, // "", "X"
|
||||
forced = 3, // "F"
|
||||
disabled = 5, // "N"
|
||||
err = 4, // "E"
|
||||
all = 6 // Nessun controllo
|
||||
};
|
||||
|
||||
#define SHEET_GAP 101
|
||||
@ -227,6 +227,8 @@ protected:
|
||||
void next_page(int p) override;
|
||||
static TRecnotype nuovo_progr();
|
||||
void change_invio(const TString& tipocf, const TString& codcf, const TString& numdoc, const TString& invio) const;
|
||||
void update_stato(const TString& da_stato, const TString& a_stato);
|
||||
|
||||
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||
void open_java();
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "tf0100b.h"
|
||||
#include <utility.h>
|
||||
#include "urldefid.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
// TTrFa_mask
|
||||
@ -55,8 +56,15 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||
break;
|
||||
case DLG_PDF:
|
||||
{
|
||||
TMask cs_mask("Cambiamento stato movimenti", 1, 20, 10);
|
||||
|
||||
TMask cs_mask("Cambiamento stato movimenti", 1, 30, 5);
|
||||
cs_mask.add_button_tool(DLG_OK, "~Conferma", TOOL_OK);
|
||||
cs_mask.add_button_tool(DLG_CANCEL, "Annulla", TOOL_CANCEL);
|
||||
cs_mask.add_list(101, 0, "Da stato", 0, 0, 15, "", "X|I|N|F|E", "Da Inviare|Inviato|Disabilitato|Forzato|Errato");
|
||||
cs_mask.add_list(102, 0, "A stato", 0, 2, 15, "", "X|I|N|F|E", "Da Inviare|Inviato|Disabilitato|Forzato|Errato");
|
||||
if (cs_mask.run() == K_ENTER)
|
||||
{
|
||||
update_stato(cs_mask.get(101), cs_mask.get(102));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case F_RIGHE:
|
||||
@ -626,6 +634,19 @@ void TTrFa_mask::change_invio(const TString& tipocf, const TString& codcf, const
|
||||
}
|
||||
}
|
||||
|
||||
void TTrFa_mask::update_stato(const TString& da_stato, const TString& a_stato)
|
||||
{
|
||||
TSheet_field& sf = sfield(F_RIGHE);
|
||||
sf.hide();
|
||||
FOR_EACH_SHEET_ROW(sf, r, row)
|
||||
{
|
||||
if (*row->get(sf.cid2index(A_INVIO)) == *da_stato)
|
||||
row->add(a_stato, sf.cid2index(A_INVIO));
|
||||
}
|
||||
sf.force_update();
|
||||
sf.show();
|
||||
}
|
||||
|
||||
void TTrFa_mask::load_sheet()
|
||||
{
|
||||
const char tipo = get(F_TIPOCF)[0];
|
||||
|
@ -80,6 +80,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
|
||||
tipo_doc == -1 || !msk().get_bool(tipo_doc))
|
||||
{
|
||||
static TString codiva;
|
||||
TString n_simo;
|
||||
do
|
||||
{
|
||||
// Se ritorna false ho finito i records
|
||||
@ -91,7 +92,9 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
|
||||
else
|
||||
{
|
||||
// Controllo se ho cambiato movimento
|
||||
_new_mov = num_mov != _c_rmoviva->get("23.NUMREG").as_string();
|
||||
_new_mov = num_mov != (n_simo = _c_rmoviva->get("23.NUMREG").as_string());
|
||||
if (n_simo == "44583")
|
||||
bool simo = true;
|
||||
codiva.cut(0) << _c_rmoviva->get("25.CODIVA").as_string();
|
||||
}
|
||||
} // Ciclo finchè non trovo un nuovo movimento o trovo cod IVA già presi da cust
|
||||
@ -114,7 +117,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
|
||||
bool tolla = true;
|
||||
#endif
|
||||
|
||||
// Controllo dell'esistenza di un record custom in tasfatt
|
||||
// Controllo dell'esistenza di un record custom in trasfatt
|
||||
ret_rec = getTrasFatt(_c_rmoviva->get("23.NUMREG").as_string(), _c_rmoviva->get("25.CODIVA").as_string());
|
||||
if(ret_rec.empty())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user