Patch level : 12.0 704
Files correlati : fp Commento : - Aggiunto piccolo controllo preventivo durante l'esportazione degli XML - Aggiunto flag per non rendere il controllo bloccante - Sistemata banca di appoggio - Aggiunta gestione casse professionali
This commit is contained in:
parent
c3ffdadf02
commit
9ecb4550b5
@ -44,6 +44,7 @@ void TParametri_mask::save_all() const
|
||||
fp_settings().set_gest_alleg(get_bool(F_ESPORTAALLEG));
|
||||
fp_settings().set_allega_fat(get_bool(F_ESPORTADOC));
|
||||
fp_settings().set_f8(get_bool(F_F8));
|
||||
fp_settings().set_check_not_block(get_bool(F_CHECK_NOT_BLOCK));
|
||||
TFP_righe_custom().save_sheet(sfield(F_FORMPERS));
|
||||
}
|
||||
|
||||
@ -59,6 +60,7 @@ void TParametri_mask::load_all()
|
||||
set(F_ESPORTAALLEG, fp_settings().get_gest_alleg());
|
||||
set(F_ESPORTADOC, fp_settings().get_allega_fat());
|
||||
set(F_F8, fp_settings().is_f8());
|
||||
set(F_CHECK_NOT_BLOCK, fp_settings().get_check_not_block());
|
||||
TFP_righe_custom().load_sheet(sfield(F_FORMPERS));
|
||||
}
|
||||
|
||||
|
@ -1,24 +1,25 @@
|
||||
#define F_INDIRIZZO 201
|
||||
#define F_DATABASE 202
|
||||
#define F_USER 203
|
||||
#define F_PASSWORD 204
|
||||
#define F_FLDDEST 205
|
||||
#define F_FLDUSRDEST 206
|
||||
#define F_COFI 207
|
||||
#define F_ESPORTAALLEG 208
|
||||
#define F_ESPORTADOC 209
|
||||
#define F_F8 210
|
||||
#define F_INDIRIZZO 201
|
||||
#define F_DATABASE 202
|
||||
#define F_USER 203
|
||||
#define F_PASSWORD 204
|
||||
#define F_FLDDEST 205
|
||||
#define F_FLDUSRDEST 206
|
||||
#define F_COFI 207
|
||||
#define F_ESPORTAALLEG 208
|
||||
#define F_ESPORTADOC 209
|
||||
#define F_F8 210
|
||||
#define F_CHECK_NOT_BLOCK 211
|
||||
|
||||
#define F_SETPATCH 301
|
||||
#define F_ENPTYTABLE 302
|
||||
#define F_DROPTABLE 303
|
||||
#define F_REBORNDB 304
|
||||
#define F_SETPATCH 301
|
||||
#define F_ENPTYTABLE 302
|
||||
#define F_DROPTABLE 303
|
||||
#define F_REBORNDB 304
|
||||
|
||||
|
||||
#define F_FORMPERS 401
|
||||
#define F_FORMPERS 401
|
||||
|
||||
#define S_TIPODOC 101
|
||||
#define S_TIPORIGA 102
|
||||
#define S_QTA 103
|
||||
#define S_PREZZO 104
|
||||
#define S_IMPONIBILE 105
|
||||
#define S_TIPODOC 101
|
||||
#define S_TIPORIGA 102
|
||||
#define S_QTA 103
|
||||
#define S_PREZZO 104
|
||||
#define S_IMPONIBILE 105
|
@ -89,6 +89,32 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Configurazione (2) " 0 2 0 0
|
||||
|
||||
SPREADSHEET F_FORMPERS 60 6
|
||||
BEGIN
|
||||
PROMPT 1 1 "Personalizzazioni calcolo tipi righe "
|
||||
ITEM "Tipo\nDoc@4"
|
||||
ITEM "Tipo\nRiga@4"
|
||||
ITEM "Qta"
|
||||
ITEM "Prezzo"
|
||||
ITEM "Imponibile"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 78 2
|
||||
BEGIN
|
||||
PROMPT 1 8 "@BControlli preventivi"
|
||||
END
|
||||
|
||||
BOOLEAN F_CHECK_NOT_BLOCK
|
||||
BEGIN
|
||||
PROMPT 2 11 "Rendi controlli XML non bloccanti"
|
||||
END
|
||||
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Assistenza FP" 0 2 0 0
|
||||
|
||||
@ -118,19 +144,6 @@ END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Formule Pers " 0 2 0 0
|
||||
|
||||
SPREADSHEET F_FORMPERS 60 6
|
||||
BEGIN
|
||||
PROMPT 1 1 "Personalizzazioni calcolo tipi righe "
|
||||
ITEM "Tipo\nDoc@4"
|
||||
ITEM "Tipo\nRiga@4"
|
||||
ITEM "Qta"
|
||||
ITEM "Prezzo"
|
||||
ITEM "Imponibile"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
PAGE "Elementi spredsheet" 0 2 0 0
|
||||
@ -185,7 +198,6 @@ BEGIN
|
||||
OUTPUT S_IMPONIBILE CODTAB
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "Riga" 0 0 0 2
|
||||
|
@ -147,15 +147,28 @@ private:
|
||||
|
||||
|
||||
protected:
|
||||
bool initialize(const TDocumentoEsteso& doc);
|
||||
|
||||
/**< Funzioni di controllo */
|
||||
/**< Controlli di testata, non è const per il calcolo della codizione di pagamento */
|
||||
bool check_initial(TDocumentoEsteso& doc);
|
||||
/**< Controllo di riga */
|
||||
bool check_row(const TRiga_documento& rdoc);
|
||||
/**< Controllo riepilogo IVA */
|
||||
bool check_riepilogo(const TDocumentoEsteso& doc, const TRiepilogo_iva& riva);
|
||||
|
||||
|
||||
bool initialize(TDocumentoEsteso& doc);
|
||||
bool parse_sconto(const TString& formula, TToken_string& sconti) const;
|
||||
static bool get_bnp_iban(const TString& abi, const TString& cab, int prg, TString& iban);
|
||||
bool get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
bool get_bank(TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
bool get_bank_presentazione(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
bool get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const;
|
||||
const TString& descrizione(const TRiga_documento& rdoc);
|
||||
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);
|
||||
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);
|
||||
@ -211,6 +224,7 @@ public:
|
||||
const bool get_esp_est() const;
|
||||
const TString& get_esp_est_cod() const;
|
||||
const bool is_f8() const;
|
||||
const bool get_check_not_block() const;
|
||||
|
||||
// Setters
|
||||
void set_db_indirizzo(const TString& ind) const;
|
||||
@ -226,6 +240,7 @@ public:
|
||||
void set_esp_est(bool esp_est) const;
|
||||
void set_esp_est_cod(const TString& esp_est_cod) const;
|
||||
void set_f8(bool f8) const;
|
||||
void set_check_not_block(bool not_block) const;
|
||||
};
|
||||
|
||||
inline TFP_settings& fp_settings()
|
||||
|
@ -190,7 +190,7 @@ bool get_coddest(const char tipocf, const long codcf, TString& coddest, TString&
|
||||
}
|
||||
else
|
||||
pec = "";
|
||||
// Dopo la versione 1.2 torna sempre true
|
||||
|
||||
return coddest.full();
|
||||
}
|
||||
inline const TString& no_special(char a)
|
||||
@ -529,47 +529,74 @@ bool TDoc_fp::get_bnp_iban(const TString& abi, const TString& cab, int nprog, TS
|
||||
iban = bnp.get("S3");
|
||||
return err == NOERR;
|
||||
}
|
||||
bool TDoc_fp::get_bank(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
|
||||
bool TDoc_fp::get_bank(TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
|
||||
{
|
||||
bool found = false;
|
||||
abi = doc.get(DOC_CODABIP);
|
||||
cab = doc.get(DOC_CODCABP);
|
||||
int prg = doc.get_int(DOC_PROGBNP);
|
||||
bool found = false;
|
||||
if(doc.pagamento().tipo_rata(0) == TTipo_pag::_bonfico)
|
||||
{
|
||||
found = get_bank_presentazione(doc, iban, abi, cab, istituto);
|
||||
}
|
||||
else if(doc.pagamento().tipo_rata(0) == TTipo_pag::_ric_ban || doc.pagamento().tipo_rata(0) == TTipo_pag::_rid)
|
||||
{
|
||||
found = get_bank_appoggio(doc, iban, abi, cab, istituto);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
bool TDoc_fp::get_bank_presentazione(const TDocumento& doc, TString& iban, TString& abi, TString& cab, TString& istituto) const
|
||||
{
|
||||
bool found = false;
|
||||
abi = doc.get(DOC_CODABIP);
|
||||
cab = doc.get(DOC_CODCABP);
|
||||
int prg = doc.get_int(DOC_PROGBNP);
|
||||
found = abi.full() && cab.full();
|
||||
if (found)
|
||||
get_bnp_iban(abi, cab, prg, iban);
|
||||
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
|
||||
{
|
||||
const TRectype& cfven = doc.clifor().vendite();
|
||||
abi = cfven.get(CFV_CODABIPR);
|
||||
cab = cfven.get(CFV_CODCABPR);
|
||||
found = abi.full() && cab.full();
|
||||
if (found)
|
||||
get_bnp_iban(abi, cab, prg, iban);
|
||||
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN
|
||||
{
|
||||
TToken_string key;
|
||||
key.add("C");
|
||||
key.add(doc.codcf());
|
||||
key.add("N");
|
||||
key.add(1);
|
||||
const TRectype& cfban = cache().get(LF_CFBAN, key);
|
||||
if (!cfban.empty())
|
||||
{
|
||||
abi = cfban.get(CFBAN_ABI);
|
||||
cab = cfban.get(CFBAN_CAB);
|
||||
prg = cfban.get_int(CFBAN_PROGPR);
|
||||
found = abi.full() && cab.full();
|
||||
iban = cfban.get(CFBAN_IBAN);
|
||||
if (found && iban.blank())
|
||||
get_bnp_iban(abi, cab, prg, iban);
|
||||
}
|
||||
}
|
||||
if (!found) // Se non trovo banca su CFBAN la cerco su CFVEN
|
||||
{
|
||||
const TRectype& cfven = doc.clifor().vendite();
|
||||
abi = cfven.get(CFV_CODABIPR);
|
||||
cab = cfven.get(CFV_CODCABPR);
|
||||
found = abi.full() && cab.full();
|
||||
if (found)
|
||||
get_bnp_iban(abi, cab, 0, iban);
|
||||
}
|
||||
if (found)
|
||||
istituto = cache().get("%BAN", abi, "S0");
|
||||
return found;
|
||||
get_bnp_iban(abi, cab, 0, iban);
|
||||
}
|
||||
if (found)
|
||||
istituto = cache().get("%BAN", abi, "S0");
|
||||
return found;
|
||||
}
|
||||
|
||||
bool TDoc_fp::get_bank_appoggio(const TDocumento& doc, TString& iban, TString& abi, TString& cab,
|
||||
TString& istituto) const
|
||||
{
|
||||
bool found = false;
|
||||
abi = doc.get(DOC_CODABIA);
|
||||
cab = doc.get(DOC_CODCABA);
|
||||
iban = doc.get(DOC_IBAN);
|
||||
found = iban.full();
|
||||
if (!found) // Se non trovo banca sul DOC la cerco su CFBAN
|
||||
{
|
||||
TToken_string key;
|
||||
key.add("C");
|
||||
key.add(doc.codcf());
|
||||
key.add("N");
|
||||
key.add(1);
|
||||
const TRectype& cfban = cache().get(LF_CFBAN, key);
|
||||
if (!cfban.empty())
|
||||
{
|
||||
abi = cfban.get(CFBAN_ABI);
|
||||
cab = cfban.get(CFBAN_CAB);
|
||||
found = abi.full() && cab.full();
|
||||
iban = cfban.get(CFBAN_IBAN);
|
||||
if (found && iban.blank())
|
||||
get_bnp_iban(abi, cab, -1, iban);
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
istituto = cache().get("%BAN", abi, "S0");
|
||||
return found;
|
||||
}
|
||||
|
||||
const TString& TDoc_fp::descrizione(const TRiga_documento& rdoc)
|
||||
{
|
||||
if (rdoc.get_bool(RDOC_DESCLUNGA))
|
||||
@ -687,7 +714,91 @@ bool TDoc_fp::save_paf()
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
|
||||
bool TDoc_fp::check_initial(TDocumentoEsteso& doc)
|
||||
{
|
||||
bool ok = true;
|
||||
static TString msg;
|
||||
|
||||
if (_coddest.len() != 6 && _coddest.len() != 7)
|
||||
{
|
||||
log(1, "Il codice destinatario ha una lunghezza non conforme.");
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (_rec_clifo.get(CLI_PAIV).empty() && _rec_clifo.get(CLI_COFI).empty())
|
||||
{
|
||||
log(1, "Sia la partita IVA che il codice fiscale del cessionario committente sono vuoti, almeno uno dei due deve essere valorizzato.");
|
||||
ok = false;
|
||||
}
|
||||
|
||||
TPagamento& pag = doc.pagamento();
|
||||
if(pag.cond_pag_sdi().empty())
|
||||
{
|
||||
|
||||
msg.cut(0) << "Non è valorizzata la condizione di pagamento SDI (TP01, TP02, TP03) per la condizione di pagamento " << pag.code();
|
||||
log(1, msg);
|
||||
ok = false;
|
||||
}
|
||||
|
||||
for (int nr = 0; nr < doc.scadenze().items(); nr++)
|
||||
{
|
||||
const int rp = nr < pag.n_rate() ? nr : 0;
|
||||
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
||||
|
||||
if(cache().get("%CLR", key_class, "S12").empty())
|
||||
{
|
||||
msg.cut(0) << "Non è valorizzata la tipologia di pagamento SDI (MPXX) per la condizione di pagamento " << pag.code();
|
||||
log(1, msg);
|
||||
ok = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TDoc_fp::check_row(const TRiga_documento& rdoc)
|
||||
{
|
||||
bool ok = false;
|
||||
static TString msg;
|
||||
|
||||
if(rdoc.is_spese())
|
||||
{
|
||||
const TSpesa_prest& spesa = rdoc.spesa();
|
||||
if(spesa.perc().is_zero())
|
||||
{
|
||||
msg.cut(0) << "É corretto che per la spesa " << spesa.codice() << " la percentuale sia zero?";
|
||||
log(1, msg);
|
||||
}
|
||||
}
|
||||
|
||||
const TCodiceIVA& codice_iva = rdoc.iva();
|
||||
if (codice_iva.codice().full() && codice_iva.percentuale() == ZERO && codice_iva.natura().empty())
|
||||
{
|
||||
msg.cut(0) << "Impossibile avere la natura non valorizzata a fronte di una aliquota con percentuale zero. Codice IVA: "; msg << codice_iva.codice();
|
||||
log(1, msg);
|
||||
ok = false;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TDoc_fp::check_riepilogo(const TDocumentoEsteso& doc, const TRiepilogo_iva& riva)
|
||||
{
|
||||
bool ok = true;
|
||||
static TString msg;
|
||||
|
||||
if(*get_esigibilita_iva(doc) == 'S' && riva.cod_iva().natura() == "N6")
|
||||
{
|
||||
msg.cut(0) << "Impossibile avere un documento con scissione dei pagamenti e natura iva N6, codice: " << riva.cod_iva().codice();
|
||||
log(1, msg);
|
||||
ok = false;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TDoc_fp::initialize(TDocumentoEsteso& doc)
|
||||
{
|
||||
// Azzero
|
||||
_hfatt.cut(0);
|
||||
@ -723,7 +834,10 @@ bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
|
||||
#ifndef DBG
|
||||
_is_pa = doc.clifor().get_int("ALLEG") == 7;
|
||||
if (!get_coddest(doc.clifor().tipo(), doc.clifor().codice(), _coddest, _pec))
|
||||
{
|
||||
log(1, "Impossibile trovare il codice destinatario per la fattura");
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
_is_pa = true;
|
||||
_coddest = "WSUHKZ";
|
||||
@ -747,7 +861,7 @@ bool TDoc_fp::initialize(const TDocumentoEsteso& doc)
|
||||
// Azzero indici
|
||||
_index_cassa_previdenziale = 1;
|
||||
|
||||
return true;
|
||||
return check_initial(doc) || fp_settings().get_check_not_block();
|
||||
}
|
||||
|
||||
const TRectype& TDoc_fp::cco(const TRectype& doc) const
|
||||
@ -835,6 +949,18 @@ const char* TDoc_fp::natura(const TString& codiva) const
|
||||
return cache().get("%IVA", codiva, "S12");
|
||||
}
|
||||
|
||||
const char* TDoc_fp::get_esigibilita_iva(const TDocumentoEsteso& doc)
|
||||
{
|
||||
// Esigibilità IVA: Immediata, Differita, Split payment
|
||||
const char* eiva = "I";
|
||||
if (doc.is_split_payment())
|
||||
eiva = "S";
|
||||
else if (doc.get_bool(DOC_LIQDIFF) || doc.get_bool(DOC_IVAXCASSA))
|
||||
eiva = "D";
|
||||
|
||||
return eiva;
|
||||
}
|
||||
|
||||
void TDoc_fp::set_IVA(TString codiva, TPaf_record& paf) const
|
||||
{
|
||||
if (codiva.empty())
|
||||
@ -1097,6 +1223,7 @@ bool TDoc_fp::export_paf0100f()
|
||||
paf0100f.set("P1_TELEFONO", tel);
|
||||
paf0100f.set("P1_MAIL", get_firm().get(NDT_MAIL));
|
||||
paf0100f.set("P1_GESTIONE", "D");
|
||||
paf0100f.set("P1_ERRINT", "");
|
||||
// </DatiTrassmissione>
|
||||
return insert(paf0100f);
|
||||
}
|
||||
@ -1402,46 +1529,50 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
|
||||
FOR_EACH_PHYSICAL_RDOC(doc, r, rdoc)
|
||||
{
|
||||
// Controllo la riga
|
||||
if (check_row(*rdoc) && !fp_settings().get_check_not_block())
|
||||
return false;
|
||||
|
||||
bool skip_riga = false;
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
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);
|
||||
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);
|
||||
long riga_art = 0;
|
||||
if (codart.full())
|
||||
paf1800f.reset();
|
||||
paf1800f.set("PI_KEYHEADERFATT", _hfatt);
|
||||
paf1800f.set("PI_KEYBODYFATT", _bfatt);
|
||||
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);
|
||||
paf3000f.set("PT_RIFNUMLINEA", riga);
|
||||
paf3000f.set("PT_COMMENTO", descrizione_riga);
|
||||
// <CodiceArticolo>
|
||||
if (rdoc->is_articolo())
|
||||
{
|
||||
if (codartmag.full())
|
||||
TString codartmag = rdoc->get(RDOC_CODARTMAG);
|
||||
TString codart = rdoc->get(RDOC_CODART);
|
||||
long riga_art = 0;
|
||||
if (codart.full())
|
||||
{
|
||||
paf1900f.reset();
|
||||
paf1900f.set("PY_KEYHEADERFATT", _hfatt);
|
||||
paf1900f.set("PY_KEYBODYFATT", _bfatt);
|
||||
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);
|
||||
paf1900f.set("PY_KEYNLINEA", riga);
|
||||
ok &= add_row_art(riga_art, "Codice articolo cliente", codart, paf1900f);
|
||||
if (codartmag.full())
|
||||
{
|
||||
paf1900f.reset();
|
||||
paf1900f.set("PY_KEYHEADERFATT", _hfatt);
|
||||
paf1900f.set("PY_KEYBODYFATT", _bfatt);
|
||||
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);
|
||||
paf1900f.set("PY_KEYNLINEA", riga);
|
||||
ok &= add_row_art(riga_art, "Codice articolo cliente", codart, paf1900f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// </CodiceArticolo>
|
||||
if(rdoc->is_descrizione())
|
||||
{
|
||||
@ -1561,6 +1692,7 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
// Controllo se è una ritenuta fiscale
|
||||
if (sp.tipo_ritenuta() == 'F')
|
||||
{
|
||||
paf1800f.set("PI_RITENUTA", "SI");
|
||||
add_ritenuta(doc, rdoc->spesa(), paf0700f);
|
||||
}
|
||||
}
|
||||
@ -1833,17 +1965,16 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
paf2200f.set("PL_KEYHEADERFATT", _hfatt);
|
||||
paf2200f.set("PL_KEYBODYFATT", _bfatt);
|
||||
remove(paf2200f); // Cancella tutte le righe di riepilogo IVA
|
||||
const char* eiva = "I"; // Esigibilità IVA: Immediata, Differita, Split payment
|
||||
if (doc.is_split_payment())
|
||||
eiva = "S";
|
||||
else if (doc.get_bool(DOC_LIQDIFF) || doc.get_bool(DOC_IVAXCASSA))
|
||||
eiva = "D";
|
||||
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)
|
||||
{
|
||||
const TRiepilogo_iva& riva = *dynamic_cast<const TRiepilogo_iva*>(itm);
|
||||
|
||||
|
||||
if (!check_riepilogo(doc, riva) && !fp_settings().get_check_not_block())
|
||||
return false;
|
||||
|
||||
add_riepilogo_iva(paf2200f, riva.cod_iva(), eiva, riva.imponibile(), riva.imposta());
|
||||
}
|
||||
|
||||
@ -1886,10 +2017,10 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
TString8 abi, cab;
|
||||
if (get_bank(doc, iban, abi, cab, istituto))
|
||||
{
|
||||
paf2500f.set("PO_ISTFINANZ", istituto);
|
||||
paf2500f.set("PO_IBAN", iban);
|
||||
paf2500f.set("PO_ABI", abi);
|
||||
paf2500f.set("PO_CAB", cab);
|
||||
paf2500f.set("PO_ISTFINANZ", istituto);
|
||||
paf2500f.set("PO_IBAN", iban);
|
||||
paf2500f.set("PO_ABI", abi);
|
||||
paf2500f.set("PO_CAB", cab);
|
||||
}
|
||||
if (tipo_pag == 3 && cab.blank()) // Ricevuta bancaria
|
||||
log(2, TR("Non sono presenti ABI, CAB, IBAN per il pagamento"));
|
||||
@ -1899,15 +2030,15 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc)
|
||||
}
|
||||
for (int nr = 0; nr < nrate; nr++)
|
||||
{
|
||||
paf2500f.set("PO_RIGA", long(nr + 1)); // Numero rata
|
||||
int rp = nr < pag.n_rate() ? nr : 0;
|
||||
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
||||
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
|
||||
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
|
||||
paf2500f.set("PO_DATASCADENZA", TDate(riga_scadenze.get(0))); // Data scadenza
|
||||
paf2500f.set("PO_IMPORTO", converti_prezzo(real(riga_scadenze.get()))); // Importo rata
|
||||
paf2500f.set("PO_GESTIONE", "D");
|
||||
ok &= insert(paf2500f);
|
||||
paf2500f.set("PO_RIGA", long(nr + 1)); // Numero rata
|
||||
const int rp = nr < pag.n_rate() ? nr : 0;
|
||||
static TString key_class; key_class.cut(0) << pag.tipo_rata(rp) << pag.ulc_rata(rp);
|
||||
paf2500f.set("PO_MODALITAPAGAM", cache().get("%CLR", key_class, "S12")); // Si assicura che il numero riga sia accettabile
|
||||
TToken_string& riga_scadenze = scad.row(nr); // Data|Importo
|
||||
paf2500f.set("PO_DATASCADENZA", TDate(riga_scadenze.get(0))); // Data scadenza
|
||||
paf2500f.set("PO_IMPORTO", converti_prezzo(real(riga_scadenze.get()))); // Importo rata
|
||||
paf2500f.set("PO_GESTIONE", "D");
|
||||
ok &= insert(paf2500f);
|
||||
}
|
||||
// </DatiPagamento>
|
||||
if (_gestioneallegati)
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define FP_ESP_EST "espest"
|
||||
#define FP_ESP_EST_COD "espestcod"
|
||||
#define FP_F8 "f8"
|
||||
#define FP_CHECK_NOT_BLOCK "checknotblock"
|
||||
|
||||
// Sheet fp0300
|
||||
#define FP_SLD_COD "SLD"
|
||||
@ -112,6 +113,11 @@ const bool TFP_settings::is_f8() const
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_F8);
|
||||
}
|
||||
|
||||
const bool TFP_settings::get_check_not_block() const
|
||||
{
|
||||
return ini_get_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK);
|
||||
}
|
||||
|
||||
void TFP_settings::set_db_indirizzo(const TString& ind) const
|
||||
{
|
||||
ini_set_string(FILE_CONFIG, FILE_SECTION, FP_IP, ind);
|
||||
@ -177,6 +183,11 @@ void TFP_settings::set_f8(const bool f8) const
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_F8, f8);
|
||||
}
|
||||
|
||||
void TFP_settings::set_check_not_block(const bool not_block) const
|
||||
{
|
||||
ini_set_bool(FILE_CONFIG, FILE_SECTION, FP_CHECK_NOT_BLOCK, not_block);
|
||||
}
|
||||
|
||||
TRectype TFP_selected_docs::fill_rectype() const
|
||||
{
|
||||
TRectype r(LF_TABMOD);
|
||||
|
Loading…
x
Reference in New Issue
Block a user