Merge branch 'R_10_00' of http://10.65.20.33/sirio/CAMPO/campo into R_10_00
This commit is contained in:
commit
63b4bd19bb
3
cd/test/fp0990.txt
Normal file
3
cd/test/fp0990.txt
Normal file
@ -0,0 +1,3 @@
|
||||
fp0.exe
|
||||
|
||||
Aggiunta gestione codici SDI per indirizzi di spedizione
|
19
cd/test/fp0990a.ini
Normal file
19
cd/test/fp0990a.ini
Normal file
@ -0,0 +1,19 @@
|
||||
[Main]
|
||||
Demo=0
|
||||
|
||||
[fp0]
|
||||
File(0) = fp0.exe|X
|
||||
Patch = 990
|
||||
Versione = 21511200
|
||||
|
||||
[fp]
|
||||
Data = 27-08-2020
|
||||
Descrizione = Fattura Elettronica
|
||||
Dischi = 1
|
||||
Moduli = cg,ve
|
||||
OEM =
|
||||
Patch = 0990
|
||||
PostProcess =
|
||||
PreProcess =
|
||||
Versione = 21511200
|
||||
|
BIN
cd/test/fp0990a1.zip
Normal file
BIN
cd/test/fp0990a1.zip
Normal file
Binary file not shown.
@ -9,80 +9,6 @@
|
||||
#include <textset.h>
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TAnagrafica
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
class TAnagrafica : public TObject
|
||||
{
|
||||
char _tipo; // F o G
|
||||
char _sociounico;
|
||||
TString4 _stato_paiv;
|
||||
TString _cofi, _paiv, _cofiest;
|
||||
TString80 _ragsoc;
|
||||
TString4 _com_nasc, _com_res;
|
||||
TString80 _loc_res, _ind_res, _via_res;
|
||||
TString16 _civ_res, _cap_res;
|
||||
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();
|
||||
|
||||
public:
|
||||
virtual bool ok() const { return _tipo=='F' || _tipo == 'G'; }
|
||||
bool fisica() const { return _tipo == 'F'; }
|
||||
bool giuridica() const { return _tipo == 'G'; }
|
||||
|
||||
const TString& codice_fiscale() const { return _cofi; }
|
||||
const TString& codice_fiscale_estero() const { return _cofiest; }
|
||||
const TString& partita_IVA() const { return _paiv; }
|
||||
const TString& stato_partita_IVA() const;
|
||||
|
||||
const TString& ragione_sociale() const;
|
||||
const TString& cognome() const;
|
||||
const TString& nome() const;
|
||||
char sesso() const { CHECK(fisica(), "Solo sesso fisico!"); return (_cofi[9] >= '4') ? 'F' : 'M'; }
|
||||
const TDate& data_nascita() const { return _data_nasc; }
|
||||
bool italiano() const;
|
||||
bool estero() const { return !italiano(); }
|
||||
bool estero_CEE() const;
|
||||
bool estero_non_CEE() const { return estero() && !estero_CEE(); }
|
||||
const TString& stato_estero_UNICO() const;
|
||||
int inserimento_in_allegato() const { return _allegato; }
|
||||
char is_black_list(const TDate& datareg) const;
|
||||
const char sociounico() const { return _sociounico; }
|
||||
|
||||
const TString& comune_nascita() const;
|
||||
const TString& provincia_nascita() const;
|
||||
const TString& codice_comune_residenza() const { return estero() ? EMPTY_STRING : _com_res; }
|
||||
const TString& comune_residenza() const;
|
||||
const TString& provincia_residenza() const;
|
||||
const TString& stato_residenza_ISO() const;
|
||||
const TString& localita_residenza() const { return _loc_res; }
|
||||
const TString& indirizzo_residenza() const { return _ind_res; }
|
||||
const TString& via_residenza() const { return _via_res; }
|
||||
const TString& civico_residenza() const { return _civ_res; }
|
||||
const TString& CAP_residenza() const { return _cap_res; }
|
||||
|
||||
bool init(const TRectype& rec);
|
||||
bool init(int num, const TString& codice);
|
||||
bool init(int num, long codice);
|
||||
bool init(int num, char tipo, long codice);
|
||||
bool init(char tipocf, long codice, const TString& ocfpi);
|
||||
|
||||
TAnagrafica() : _tipo('\0') {}
|
||||
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(const TRectype& rec) { init(rec); }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TSpesometro_set
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -230,7 +230,8 @@ void TPA_mask::fill()
|
||||
row.add(rec.get(CFV_CODCF).as_int());
|
||||
row.add(rec.get("20." CLI_RAGSOC).as_string());
|
||||
|
||||
TString rif = get_dest_sdi(rec.get(CFV_TIPOCF).as_string()[0], rec.get(CFV_CODCF).as_int());
|
||||
TString cod_ind_sped = rec.get(DOC_CODINDSP).as_string();
|
||||
TString rif = get_dest_sdi(rec.get(CFV_TIPOCF).as_string()[0], rec.get(CFV_CODCF).as_int(), cod_ind_sped);
|
||||
// Se è ancora vuoto potrebbe essere estero
|
||||
if(rif.empty())
|
||||
{
|
||||
|
@ -36,9 +36,9 @@ TString& complete_num_fp(const TCodice_numerazione& codnum, const int numdoc);
|
||||
bool chiave_paf(const TDocumento& doc, TString& hfatt, TString& bfatt);
|
||||
bool chiave_paf(const TRectype& doc, TString& hfatt, TString& bfatt);
|
||||
// Ritorna cod sdi, pec o vuoto. Chiama get_coddest()
|
||||
TString get_dest_sdi(const char tipocf, const long codcf);
|
||||
TString get_dest_sdi(char tipocf, long codcf, const TString& cod_ind_sped);
|
||||
// Valorizza codice sdi e pec in base alle configurazioni del monitor
|
||||
bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString& pec);
|
||||
bool get_coddest(char tipocf, long codcf, TString& coddest, TString& pec, const TString& cod_ind_sped);
|
||||
const TString& tipo_doc_sdi(const TDocumento& doc);
|
||||
|
||||
// Controlli comuni
|
||||
|
@ -198,17 +198,31 @@ bool chiave_paf(const TRectype& doc, TString& hfatt, TString& bfatt)
|
||||
chiave_paf(d, hfatt, bfatt);
|
||||
return hfatt.full();
|
||||
}
|
||||
TString get_dest_sdi(const char tipocf, const long codcf)
|
||||
TString get_dest_sdi(const char tipocf, const long codcf, const TString& cod_ind_sped)
|
||||
{
|
||||
TString codsdi, pec;
|
||||
get_coddest(tipocf, codcf, codsdi, pec);
|
||||
get_coddest(tipocf, codcf, codsdi, pec, cod_ind_sped);
|
||||
return pec.full() ? pec : codsdi;
|
||||
}
|
||||
bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString& pec)
|
||||
bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString& pec, const TString& cod_ind_sped)
|
||||
{
|
||||
const TCli_for clifo(tipocf, codcf);
|
||||
coddest = clifo.vendite().get("PADESTIN");
|
||||
pec = clifo.get("PEC");
|
||||
coddest.cut(0);
|
||||
pec.cut(0);
|
||||
const TCli_for clifo(tipocf, codcf);
|
||||
pec = clifo.get("PEC");
|
||||
|
||||
if(!cod_ind_sped.empty())
|
||||
{
|
||||
TLocalisamfile indsp(LF_INDSP);
|
||||
indsp.put(IND_TIPOCF, tipocf);
|
||||
indsp.put(IND_CODCF, codcf);
|
||||
indsp.put(IND_CODIND, cod_ind_sped);
|
||||
indsp.read();
|
||||
coddest = indsp.get(IND_CODDEST);
|
||||
}
|
||||
if(coddest.empty())
|
||||
coddest = clifo.vendite().get("PADESTIN");
|
||||
|
||||
const TAnagrafica anag(LF_CLIFO, tipocf, codcf);
|
||||
if (coddest.empty())
|
||||
{
|
||||
@ -1019,13 +1033,13 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||
// Controllo se il documento è almeno in stato di stampa
|
||||
if (doc.stato() < doc.tipo().stato_finale_stampa())
|
||||
{
|
||||
log(3, "Il documento non è stato ancora stampato, verrà saltato");
|
||||
log(3, "Il documento non e' stato ancora stampato, verra' saltato");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#ifndef DBG
|
||||
_is_pa = doc.clifor().get_int("ALLEG") == 7;
|
||||
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec))
|
||||
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec, doc.get(DOC_CODINDSP)))
|
||||
{
|
||||
log(1, "Impossibile trovare il codice destinatario per la fattura");
|
||||
return false;
|
||||
@ -1544,7 +1558,16 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
||||
TString rifamm = cco(doc).get("S4");
|
||||
if (rifamm.blank())
|
||||
rifamm = doc.clifor().vendite().get(CFV_PARIFAMM);
|
||||
{
|
||||
TLocalisamfile indsp(LF_INDSP);
|
||||
indsp.put(IND_TIPOCF, doc.get(DOC_TIPOCF));
|
||||
indsp.put(IND_CODCF, doc.get(DOC_CODCF));
|
||||
indsp.put(IND_CODIND, doc.get(DOC_CODINDSP));
|
||||
indsp.read();
|
||||
rifamm = indsp.get(IND_RIFAMM);
|
||||
if(rifamm.blank())
|
||||
rifamm = doc.clifor().vendite().get(CFV_PARIFAMM);
|
||||
}
|
||||
paf0200f.set("P2_RIFAMMINISTR", rifamm);
|
||||
paf0200f.set("P2_ISCRREASOCIOU", _ditta.sociounico() == 'S' ? "SU" : "SM");
|
||||
TISAM_recordset unloc("USE UNLOC\nJOIN COMUNI INTO COM==COMCCIAA\nFROM CODDITTA=#DITTA\nTO CODDITTA=#DITTA");
|
||||
|
@ -1,21 +1,24 @@
|
||||
#ifndef __INDSP_H
|
||||
#define __INDSP_H
|
||||
|
||||
#define IND_TIPOCF "TIPOCF"
|
||||
#define IND_CODCF "CODCF"
|
||||
#define IND_CODIND "CODIND"
|
||||
#define IND_RAGSOC "RAGSOC"
|
||||
#define IND_INDIR "INDIR"
|
||||
#define IND_CIV "CIV"
|
||||
#define IND_LOCALITA "LOCALITA"
|
||||
#define IND_CAP "CAP"
|
||||
#define IND_STATO "STATO"
|
||||
#define IND_COM "COM"
|
||||
#define IND_PTEL "PTEL"
|
||||
#define IND_TEL "TEL"
|
||||
#define IND_PFAX "PFAX"
|
||||
#define IND_FAX "FAX"
|
||||
#define IND_IVARID "IVARID"
|
||||
#define IND_INDIR2 "INDIR2"
|
||||
#define IND_TIPOCF "TIPOCF"
|
||||
#define IND_CODCF "CODCF"
|
||||
#define IND_CODIND "CODIND"
|
||||
#define IND_RAGSOC "RAGSOC"
|
||||
#define IND_INDIR "INDIR"
|
||||
#define IND_CIV "CIV"
|
||||
#define IND_LOCALITA "LOCALITA"
|
||||
#define IND_CAP "CAP"
|
||||
#define IND_STATO "STATO"
|
||||
#define IND_COM "COM"
|
||||
#define IND_PTEL "PTEL"
|
||||
#define IND_TEL "TEL"
|
||||
#define IND_PFAX "PFAX"
|
||||
#define IND_FAX "FAX"
|
||||
#define IND_IVARID "IVARID"
|
||||
#define IND_INDIR2 "INDIR2"
|
||||
#define IND_CODDEST "CODDEST"
|
||||
#define IND_RIFAMM "RIFAMM"
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user