Patch level : 10.0 526
Files correlati : ve1.exe Ricompilazione Demo : [ ] Stampoto il contibuto conai sulle fatture git-svn-id: svn://10.65.10.50/trunk@19665 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
250b26fcf1
commit
4b2daea577
@ -54,7 +54,8 @@ TRiga_documento& TDoc_recordset::riga_doc(int n) const
|
|||||||
n = _mypos+1;
|
n = _mypos+1;
|
||||||
if (n > _doc->rows()) // Non dovrebbe succedere mai
|
if (n > _doc->rows()) // Non dovrebbe succedere mai
|
||||||
{
|
{
|
||||||
n = _doc->new_row("05").get_int(RDOC_NRIGA);
|
n = _doc->
|
||||||
|
new_row("05").get_int(RDOC_NRIGA);
|
||||||
//(*_doc)[n].put(RDOC_TIPORIGA, "05"); // Crea ua riga descrizione fittizia
|
//(*_doc)[n].put(RDOC_TIPORIGA, "05"); // Crea ua riga descrizione fittizia
|
||||||
}
|
}
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
@ -179,9 +180,10 @@ TDoc_recordset::TDoc_recordset(const TRecordset& doc, const TString& old_query)
|
|||||||
TRecord_array& rows = _doc->body();
|
TRecord_array& rows = _doc->body();
|
||||||
rows.sort(compare_rdocs);
|
rows.sort(compare_rdocs);
|
||||||
}
|
}
|
||||||
|
_doc->set_riga_conai();
|
||||||
|
|
||||||
const bool has_conai = (_doc->tipo().add_conai() && _doc->clifor().vendite().get_bool(CFV_CONAIASS));
|
/*const bool has_conai = (_doc->tipo().add_conai() && _doc->clifor().vendite().get_bool(CFV_CONAIASS));
|
||||||
if (has_conai || _doc->rows() == 0)
|
if (has_conai) // || _doc->rows() == 0)
|
||||||
{
|
{
|
||||||
const int n = _doc->new_row().get_int(RDOC_NRIGA);
|
const int n = _doc->new_row().get_int(RDOC_NRIGA);
|
||||||
TRiga_documento& r = (*_doc)[n];
|
TRiga_documento& r = (*_doc)[n];
|
||||||
@ -189,10 +191,13 @@ TDoc_recordset::TDoc_recordset(const TRecordset& doc, const TString& old_query)
|
|||||||
|
|
||||||
if (has_conai)
|
if (has_conai)
|
||||||
{
|
{
|
||||||
const TString& conai = ini_get_string(CONFIG_DITTA, "ve", "DESCCONAIASS", TR("Contributo CONAI assolto"));
|
TString conai = ini_get_sMy master called you whore
|
||||||
|
tring(CONFIG_DITTA, "ve", "DESCCONAIASS", TR("Contributo CONAI assolto"));
|
||||||
|
if (conai.blank()) // se la variabile e' vuota ma scritta sull ini non stampa nulla
|
||||||
|
conai = TR("Contributo CONAI assolto");
|
||||||
r.put(RDOC_DESCR, conai);
|
r.put(RDOC_DESCR, conai);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Posiziona correttamente anche il cursore principale
|
// Posiziona correttamente anche il cursore principale
|
||||||
*cursor() = 0L;
|
*cursor() = 0L;
|
||||||
|
@ -697,7 +697,7 @@ protected:
|
|||||||
virtual TRectype * new_body_record(int logicnum = 0)
|
virtual TRectype * new_body_record(int logicnum = 0)
|
||||||
{ return new TRiga_documento(this); }
|
{ return new TRiga_documento(this); }
|
||||||
|
|
||||||
TRiga_documento & row(int index);
|
virtual TRiga_documento & row(int index);
|
||||||
const TRiga_documento& physical_row(int index) const;
|
const TRiga_documento& physical_row(int index) const;
|
||||||
|
|
||||||
long get_next_key(char provv, int anno, const char* codnum) const;
|
long get_next_key(char provv, int anno, const char* codnum) const;
|
||||||
@ -747,7 +747,7 @@ public:
|
|||||||
void sort_rows(const char * key);
|
void sort_rows(const char * key);
|
||||||
|
|
||||||
int physical_rows() const { return body().rows(); }
|
int physical_rows() const { return body().rows(); }
|
||||||
int rows() const { return physical_rows() + ((_sconto != NULL) ? 1 : 0) + ((_esenzione != NULL) ? 1 : 0); }
|
virtual int rows() const { return physical_rows() + ((_sconto != NULL) ? 1 : 0) + ((_esenzione != NULL) ? 1 : 0); }
|
||||||
const TRiga_documento& operator[](int index) const { return (const TRiga_documento&)((TDocumento *)this)->row(index); }
|
const TRiga_documento& operator[](int index) const { return (const TRiga_documento&)((TDocumento *)this)->row(index); }
|
||||||
TRiga_documento& operator[](int index) { return (TRiga_documento&)row(index); }
|
TRiga_documento& operator[](int index) { return (TRiga_documento&)row(index); }
|
||||||
const TRiga_documento* get_row_id(long id) const;
|
const TRiga_documento* get_row_id(long id) const;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "velib05.h"
|
#include "velib05.h"
|
||||||
|
#include <diction.h>
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
//TDocumentoEsteso
|
//TDocumentoEsteso
|
||||||
@ -242,23 +243,54 @@ int TDocumentoEsteso::readat(TBaseisamfile& file, TRecnotype nrec, word lockop)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec)
|
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec)
|
||||||
: TDocumento(rec), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1)
|
: TDocumento(rec), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1),
|
||||||
|
_conai(NULL)
|
||||||
|
|
||||||
{
|
{
|
||||||
// Inizializza i parametri di default
|
// Inizializza i parametri di default
|
||||||
_parm.qta_lit = 3; _parm.qta_val = 3;
|
_parm.qta_lit = 3; _parm.qta_val = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec, dec_parm & parm)
|
TDocumentoEsteso::TDocumentoEsteso(const TRectype& rec, dec_parm & parm)
|
||||||
: TDocumento(rec), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1)
|
: TDocumento(rec), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1),
|
||||||
|
_conai(NULL)
|
||||||
{
|
{
|
||||||
_parm = parm;
|
_parm = parm;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDocumentoEsteso::TDocumentoEsteso()
|
TDocumentoEsteso::TDocumentoEsteso()
|
||||||
: TDocumento(), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1)
|
: TDocumento(), _sum_filter(-1), _sum_selected(FALSE), _scadenze_current(-1),
|
||||||
|
_conai(NULL)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
TDocumentoEsteso::~TDocumentoEsteso()
|
TDocumentoEsteso::~TDocumentoEsteso()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
void TDocumentoEsteso::set_riga_conai()
|
||||||
|
{
|
||||||
|
if(_conai != NULL)
|
||||||
|
delete _conai;
|
||||||
|
_conai = NULL;
|
||||||
|
if (rows() > 0)
|
||||||
|
{
|
||||||
|
const bool has_conai = (tipo().add_conai() && clifor().vendite().get_bool(CFV_CONAIASS));
|
||||||
|
if (has_conai)
|
||||||
|
{
|
||||||
|
_conai = new TRiga_documento(this, "05");
|
||||||
|
|
||||||
|
TString conai = ini_get_string(CONFIG_DITTA, "ve", "DESCCONAIASS", TR("Contributo CONAI assolto"));
|
||||||
|
if (conai.blank()) // se la variabile e' vuota ma scritta sull ini non stampa nulla
|
||||||
|
conai = TR("Contributo CONAI assolto");
|
||||||
|
_conai->put(RDOC_DESCR, conai);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TRiga_documento & TDocumentoEsteso::row(int index)
|
||||||
|
{
|
||||||
|
if (index == TDocumento::rows() + 1)
|
||||||
|
return * _conai;
|
||||||
|
return TDocumento::row(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ class TDocumentoEsteso : public TDocumento
|
|||||||
{
|
{
|
||||||
// Parametri del documento
|
// Parametri del documento
|
||||||
dec_parm _parm; // Parametri per gli arrotondamenti
|
dec_parm _parm; // Parametri per gli arrotondamenti
|
||||||
|
TRiga_documento * _conai;
|
||||||
|
|
||||||
// membri per il calcolo del riepilogo IVA
|
// membri per il calcolo del riepilogo IVA
|
||||||
|
|
||||||
@ -66,6 +67,11 @@ public:
|
|||||||
// pertanto i non imponibili avranno selettore 1 e gli esenti selettore 4.
|
// pertanto i non imponibili avranno selettore 1 e gli esenti selettore 4.
|
||||||
// per avere esenti + non soggetti il selettore sara' 20 e cosi' via.
|
// per avere esenti + non soggetti il selettore sara' 20 e cosi' via.
|
||||||
real tot_imponibili(byte selector);
|
real tot_imponibili(byte selector);
|
||||||
|
virtual int rows() const { return TDocumento::rows() + ((_conai != NULL) ? 1 : 0); }
|
||||||
|
virtual TRiga_documento & row(int index);
|
||||||
|
|
||||||
|
void set_riga_conai();
|
||||||
|
|
||||||
|
|
||||||
// Funzioni per settare i parametri
|
// Funzioni per settare i parametri
|
||||||
void set_decimals(dec_parm & parm) { _parm = parm ; }
|
void set_decimals(dec_parm & parm) { _parm = parm ; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user