Patch level : 12.0 no-patch
Files correlati : fp Commento : Inizio sviluppo personalizzazioni FP
This commit is contained in:
parent
835da3a45c
commit
d5e5fe0435
@ -11,6 +11,8 @@ int main(int argc, char** argv)
|
|||||||
case 1: rt = fp0200(argc, argv); break; // Inserimento massivo PEC e Cod Sdi clifo
|
case 1: rt = fp0200(argc, argv); break; // Inserimento massivo PEC e Cod Sdi clifo
|
||||||
case 2: rt = fp0300(argc, argv); break; // Gestione fatture attive (PAA, Ex Fattura PA)
|
case 2: rt = fp0300(argc, argv); break; // Gestione fatture attive (PAA, Ex Fattura PA)
|
||||||
case 3: rt = fp0400(argc, argv); break; // Monitor fatture passive
|
case 3: rt = fp0400(argc, argv); break; // Monitor fatture passive
|
||||||
|
case 4: rt = fp0500(argc, argv); break; // Customizzazioni FP per utente
|
||||||
|
case 5: rt = fp0600(argc, argv); break; // Customizzazioni FP per utente
|
||||||
default: rt = fp0100(argc, argv); break; // Configurazione
|
default: rt = fp0100(argc, argv); break; // Configurazione
|
||||||
}
|
}
|
||||||
return rt;
|
return rt;
|
||||||
|
@ -5,5 +5,7 @@ int fp0100(int argc, char* argv[]);
|
|||||||
int fp0200(int argc, char* argv[]);
|
int fp0200(int argc, char* argv[]);
|
||||||
int fp0300(int argc, char* argv[]);
|
int fp0300(int argc, char* argv[]);
|
||||||
int fp0400(int argc, char* argv[]);
|
int fp0400(int argc, char* argv[]);
|
||||||
|
int fp0500(int argc, char* argv[]);
|
||||||
|
int fp0600(int argc, char* argv[]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
148
src/fp/fp0500.cpp
Normal file
148
src/fp/fp0500.cpp
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
#include <automask.h>
|
||||||
|
#include <defmask.h>
|
||||||
|
#include <relapp.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
|
||||||
|
#include "fp0.h"
|
||||||
|
#include "fp0500a.h"
|
||||||
|
#include "fplib.h"
|
||||||
|
#include "fpccaus.h"
|
||||||
|
#include "fpcart.h"
|
||||||
|
#include "fpcadg.h"
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// MASCHERA (fp0500a)
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
class TFpcust_mask : public TAutomask
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
bool on_field_event(TOperable_field& o, TField_event e, long jolly) override;
|
||||||
|
public:
|
||||||
|
|
||||||
|
TFpcust_mask();
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TFpcust_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
switch (o.dlg())
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TFpcust_mask::TFpcust_mask() : TAutomask("fp0500a")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
// APPLICAZIONE
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
class TFpcust : public TRelation_application
|
||||||
|
{
|
||||||
|
TFpcust_mask* _mask{ nullptr };
|
||||||
|
TRelation* _rel{ nullptr };
|
||||||
|
TFP_custom* _fpcust{ nullptr };
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int read(TMask& m) override;
|
||||||
|
int write(const TMask& m) override;
|
||||||
|
int rewrite(const TMask& m) override;
|
||||||
|
|
||||||
|
void load_cust(const TMask& m) const;
|
||||||
|
|
||||||
|
bool user_create() override;
|
||||||
|
bool user_destroy() override;
|
||||||
|
TMask* get_mask(int mode) override { return _mask; }
|
||||||
|
bool changing_mask(int mode) override { return false; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
// @cmember Disabilita la verifica del modulo : essendo una anagrafica, va sempre abilitata
|
||||||
|
bool check_autorization() const override { return true; }
|
||||||
|
TRelation* get_relation() const override { return static_cast<TRelation*>(_rel); }
|
||||||
|
};
|
||||||
|
|
||||||
|
int TFpcust::read(TMask& m)
|
||||||
|
{
|
||||||
|
TRelation_application::read(m);
|
||||||
|
|
||||||
|
// Carico tutti gli sheet
|
||||||
|
TFP_custom& fp_custom = dynamic_cast<TFP_custom&>(get_relation()->lfile().curr());
|
||||||
|
|
||||||
|
TSheet_field& sheet_causali = m.sfield(F_CAUSALI);
|
||||||
|
sheet_causali.destroy();
|
||||||
|
FOR_EACH_FPCAUS_ROW(fp_custom, r, rcaus)
|
||||||
|
{
|
||||||
|
TToken_string& row = sheet_causali.row(-1);
|
||||||
|
row.add(rcaus->get(FPCCAUS_VALORE), xvtil_cid2index(S_CAUS_VALORE));
|
||||||
|
}
|
||||||
|
|
||||||
|
TSheet_field& sheet_articoli = m.sfield(F_ARTICOLI);
|
||||||
|
sheet_articoli.destroy();
|
||||||
|
FOR_EACH_FPART_ROW(fp_custom, r, rart)
|
||||||
|
{
|
||||||
|
TToken_string& row = sheet_articoli.row(-1);
|
||||||
|
row.add(rart->get(FPCART_TIPO), xvtil_cid2index(S_ART_TIPO));
|
||||||
|
row.add(rart->get(FPCART_VALORE), xvtil_cid2index(S_ART_VALORE));
|
||||||
|
}
|
||||||
|
|
||||||
|
TSheet_field& sheet_adg = m.sfield(F_ADG);
|
||||||
|
sheet_adg.destroy();
|
||||||
|
FOR_EACH_FPADG_ROW(fp_custom, r, radg)
|
||||||
|
{
|
||||||
|
TToken_string& row = sheet_adg.row(-1);
|
||||||
|
row.add(radg->get(FPCADG_TIPODATO), xvtil_cid2index(S_ADG_TIPODATO));
|
||||||
|
row.add(radg->get(FPCADG_RTESTO), xvtil_cid2index(S_ADG_RTESTO));
|
||||||
|
row.add(radg->get(FPCADG_RNUMERO), xvtil_cid2index(S_ADG_RNUMERO));
|
||||||
|
row.add(radg->get(FPCADG_RDATA), xvtil_cid2index(S_ADG_RDATA));
|
||||||
|
}
|
||||||
|
|
||||||
|
return NOERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TFpcust::write(const TMask& m)
|
||||||
|
{
|
||||||
|
load_cust(m);
|
||||||
|
return TRelation_application::write(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TFpcust::rewrite(const TMask& m)
|
||||||
|
{
|
||||||
|
load_cust(m);
|
||||||
|
return TRelation_application::rewrite(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TFpcust::load_cust(const TMask& m) const
|
||||||
|
{
|
||||||
|
_fpcust->set_codcust(m.get(F_CODICE), false);
|
||||||
|
_fpcust->autoload(m.sfield(F_CAUSALI), LF_FPCCAUS);
|
||||||
|
_fpcust->autoload(m.sfield(F_ARTICOLI), LF_FPCART);
|
||||||
|
_fpcust->autoload(m.sfield(F_ADG), LF_FPCADG);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool TFpcust::user_create()
|
||||||
|
{
|
||||||
|
_fpcust = new TFP_custom();
|
||||||
|
_rel = new TRelation(LF_FPCUST);
|
||||||
|
_rel->lfile().set_curr(_fpcust);
|
||||||
|
_mask = new TFpcust_mask;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TFpcust::user_destroy()
|
||||||
|
{
|
||||||
|
delete _mask;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int fp0500(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TFpcust a;
|
||||||
|
a.run(argc, argv, TR("Lettere d'intento"));
|
||||||
|
return 0;
|
||||||
|
}
|
23
src/fp/fp0500a.h
Normal file
23
src/fp/fp0500a.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// lettere d'intento
|
||||||
|
// definizione campi per maschera fp0500a
|
||||||
|
|
||||||
|
#define F_CODICE 201
|
||||||
|
#define F_DESCR 202
|
||||||
|
|
||||||
|
#define F_CAUSALI 301
|
||||||
|
#define F_ARTICOLI 401
|
||||||
|
#define F_ADG 501
|
||||||
|
|
||||||
|
|
||||||
|
// Causale
|
||||||
|
#define S_CAUS_VALORE 101
|
||||||
|
|
||||||
|
// Articoli
|
||||||
|
#define S_ART_TIPO 101
|
||||||
|
#define S_ART_VALORE 102
|
||||||
|
|
||||||
|
// Altri Dati Gestionali
|
||||||
|
#define S_ADG_TIPODATO 101
|
||||||
|
#define S_ADG_RTESTO 102
|
||||||
|
#define S_ADG_RNUMERO 103
|
||||||
|
#define S_ADG_RDATA 104
|
162
src/fp/fp0500a.uml
Normal file
162
src/fp/fp0500a.uml
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
#include "fp0500a.h"
|
||||||
|
|
||||||
|
TOOLBAR "Relapbar" 0 0 0 2
|
||||||
|
#include <relapbar.h>
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Pag. 1" -1 -1 78 20
|
||||||
|
|
||||||
|
STRING F_CODICE 10
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Codice "
|
||||||
|
FIELD CODICE
|
||||||
|
USE FPCUST
|
||||||
|
INPUT CODICE F_CODICE
|
||||||
|
DISPLAY "Codice" CODICE
|
||||||
|
DISPLAY "Descrizione" DESCR
|
||||||
|
OUTPUT F_CODICE CODICE
|
||||||
|
OUTPUT F_DESCR DESCR
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
KEY 1
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING F_DESCR 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 1 "Descrizione "
|
||||||
|
FIELD DESCR
|
||||||
|
USE FPCUST
|
||||||
|
INPUT DESCR F_CODICE
|
||||||
|
DISPLAY "Codice" CODICE
|
||||||
|
DISPLAY "Descrizione" DESCR
|
||||||
|
COPY OUTPUT F_CODICE
|
||||||
|
CHECKTYPE REQUIRED
|
||||||
|
KEY 2
|
||||||
|
END
|
||||||
|
|
||||||
|
SPREADSHEET F_CAUSALI 60 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Causale"
|
||||||
|
ITEM "Valore@50"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
PAGE "Pag. 2" 0 2 0 0
|
||||||
|
|
||||||
|
SPREADSHEET F_ARTICOLI 80 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Codice Articolo"
|
||||||
|
ITEM "Tipo@50"
|
||||||
|
ITEM "Valore@50"
|
||||||
|
END
|
||||||
|
|
||||||
|
SPREADSHEET F_ADG 0 6
|
||||||
|
BEGIN
|
||||||
|
PROMPT 0 10 "Altri dati gestionali"
|
||||||
|
ITEM "Tipo Dato@50"
|
||||||
|
ITEM "Rif Testo@50"
|
||||||
|
ITEM "Rif Numero@20"
|
||||||
|
ITEM "Rif Data@20"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
||||||
|
|
||||||
|
PAGE "Riga Causale" -1 -1 60 12
|
||||||
|
|
||||||
|
STRING S_CAUS_VALORE 250 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Valore "
|
||||||
|
HELP "Valore da inserire nella causale"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "Riga" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
||||||
|
|
||||||
|
PAGE "Riga Articolo" -1 -1 60 12
|
||||||
|
|
||||||
|
STRING S_ART_TIPO 90 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Tipo "
|
||||||
|
HELP "Tag TipoArticolo"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_ART_VALORE 90 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Valore "
|
||||||
|
HELP "Tag ValoreArticolo"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "Riga" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
||||||
|
|
||||||
|
PAGE "Riga Altri Dati Gestionali" -1 -1 60 12
|
||||||
|
|
||||||
|
STRING S_ADG_TIPODATO 90 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 "Tipo dato "
|
||||||
|
HELP "Tag 2.2.1.16.1 TipoDato"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_ADG_RTESTO 90 50
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 2 "Rif testo "
|
||||||
|
HELP "Tag 2.2.1.16.2 RiferimentoTesto"
|
||||||
|
END
|
||||||
|
|
||||||
|
NUMBER S_ADG_RNUMERO 18 5
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 3 "Rif numero "
|
||||||
|
HELP "Tag 2.2.1.16.3 RiferimentoNumero"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE S_ADG_RDATA
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 4 "Rif data "
|
||||||
|
HELP "Tag 2.2.1.16.4 RiferimentoData"
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
|
||||||
|
TOOLBAR "Riga" 0 0 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_OK 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 2 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 1 ""
|
||||||
|
END
|
||||||
|
|
||||||
|
ENDPAGE
|
||||||
|
ENDMASK
|
58
src/fp/fp0600.cpp
Normal file
58
src/fp/fp0600.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#include <automask.h>
|
||||||
|
#include <defmask.h>
|
||||||
|
#include <relapp.h>
|
||||||
|
#include <tabutil.h>
|
||||||
|
|
||||||
|
#include "fp0.h"
|
||||||
|
#include "fp0600a.h"
|
||||||
|
#include "fplib.h"
|
||||||
|
#include "fpccaus.h"
|
||||||
|
|
||||||
|
|
||||||
|
class TPop : public TSkeleton_application
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool create() override;
|
||||||
|
bool destroy() override { return true; }
|
||||||
|
void main_loop() override;
|
||||||
|
|
||||||
|
TPop() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TPop::create()
|
||||||
|
{
|
||||||
|
TFP_custom fp_custom("TEST");
|
||||||
|
TRecord_array& record_array = fp_custom.body(LF_FPCCAUS);
|
||||||
|
|
||||||
|
int nrow;
|
||||||
|
while((nrow = record_array.succ_row(1)) != record_array.rows())
|
||||||
|
{
|
||||||
|
const TRectype& rec = record_array.row(nrow);
|
||||||
|
TString app = rec.get(FPCCAUS_NRIGA);
|
||||||
|
TString app2 = rec.get(FPCCAUS_VALORE);
|
||||||
|
bool maxitolla = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fp_custom.remove();
|
||||||
|
|
||||||
|
bool tolla = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPop::main_loop()
|
||||||
|
{
|
||||||
|
TFP_custom fp_custom("TEST");
|
||||||
|
|
||||||
|
|
||||||
|
bool tolla = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int fp0600(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TPop pop;
|
||||||
|
pop.run(argc, argv, TR("Fatturazione F.P."));
|
||||||
|
return 0;
|
||||||
|
}
|
0
src/fp/fp0600a.h
Normal file
0
src/fp/fp0600a.h
Normal file
0
src/fp/fp0600a.uml
Normal file
0
src/fp/fp0600a.uml
Normal file
@ -370,7 +370,7 @@ public:
|
|||||||
TFP_selected_docs();
|
TFP_selected_docs();
|
||||||
};
|
};
|
||||||
|
|
||||||
class TFp_mail_sender
|
class TFp_mail_sender : public TObject
|
||||||
{
|
{
|
||||||
int _anno;
|
int _anno;
|
||||||
TString16 _codnum;
|
TString16 _codnum;
|
||||||
@ -415,4 +415,68 @@ public:
|
|||||||
TRecord_array& bodyof##__rdoc = (__doc).body(); \
|
TRecord_array& bodyof##__rdoc = (__doc).body(); \
|
||||||
for (int __r = bodyof##__rdoc.first_row(); bodyof##__rdoc.exist(__r) && (__rdoc=&(TFPRiga_documento&)bodyof##__rdoc.row(__r))!=NULL; __r=bodyof##__rdoc.succ_row(__r))
|
for (int __r = bodyof##__rdoc.first_row(); bodyof##__rdoc.exist(__r) && (__rdoc=&(TFPRiga_documento&)bodyof##__rdoc.row(__r))!=NULL; __r=bodyof##__rdoc.succ_row(__r))
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************************************************************************************************************
|
||||||
|
* PERSONALIZZAZIONI FP
|
||||||
|
***********************************************************************************************************************************************************************/
|
||||||
|
|
||||||
|
struct TFP_row_art
|
||||||
|
{
|
||||||
|
TString _codice_tipo;
|
||||||
|
TString _codice_valore;
|
||||||
|
TFP_row_art(const TString& codice_tipo, const TString& codice_valore) : _codice_tipo(codice_tipo), _codice_valore(codice_valore) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TFP_adg
|
||||||
|
{
|
||||||
|
TString _tipo_dato;
|
||||||
|
TString _riferimento_testo;
|
||||||
|
int _riferimento_numero;
|
||||||
|
TDate _riferimento_data;
|
||||||
|
|
||||||
|
TFP_adg(const TString& tipo_dato, const TString& riferimento_testo, const int riferimento_numero,
|
||||||
|
const TDate& riferimento_data)
|
||||||
|
: _tipo_dato(tipo_dato),
|
||||||
|
_riferimento_testo(riferimento_testo),
|
||||||
|
_riferimento_numero(riferimento_numero),
|
||||||
|
_riferimento_data(riferimento_data){}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**<
|
||||||
|
* Classe per la gestione di personalizzazioni FP
|
||||||
|
*/
|
||||||
|
class TFP_custom : public TMultiple_rectype
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
TString _codcust;
|
||||||
|
TString_array _causale;
|
||||||
|
vector<TFP_row_art> _articoli;
|
||||||
|
vector<TFP_adg> _altri_dati_gestionali;
|
||||||
|
bool _loaded;
|
||||||
|
void init();
|
||||||
|
int write_rewrite(TBaseisamfile& f, bool re = FALSE) const override;
|
||||||
|
bool load(const char* codcust);
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool set_codcust(const char* codcust, const bool to_load) { return to_load ? load(codcust) : _codcust = codcust; }
|
||||||
|
void autoload(const TSheet_field& sf, const int file) const;
|
||||||
|
|
||||||
|
TFP_custom();
|
||||||
|
explicit TFP_custom(const TRectype& rec);
|
||||||
|
explicit TFP_custom(const char* codcust);
|
||||||
|
};
|
||||||
|
|
||||||
|
#define FOR_EACH_FPCAUS_ROW(__fpcust, __r, __rcaus) TRectype* __rcaus=NULL; \
|
||||||
|
TRecord_array& bodyof##__rcaus = (__fpcust).body(LF_FPCCAUS); \
|
||||||
|
for (int __r = bodyof##__rcaus.first_row(); bodyof##__rcaus.exist(__r) && (__rcaus=&(TRectype&)bodyof##__rcaus.row(__r))!=NULL; __r=bodyof##__rcaus.succ_row(__r))
|
||||||
|
|
||||||
|
#define FOR_EACH_FPART_ROW(__fpcust, __r, __rart) TRectype* __rart=NULL; \
|
||||||
|
TRecord_array& bodyof##__rart = (__fpcust).body(LF_FPCART); \
|
||||||
|
for (int __r = bodyof##__rart.first_row(); bodyof##__rart.exist(__r) && (__rart=&(TRectype&)bodyof##__rart.row(__r))!=NULL; __r=bodyof##__rart.succ_row(__r))
|
||||||
|
|
||||||
|
#define FOR_EACH_FPADG_ROW(__fpcust, __r, __radg) TRectype* __radg=NULL; \
|
||||||
|
TRecord_array& bodyof##__radg = (__fpcust).body(LF_FPCADG); \
|
||||||
|
for (int __r = bodyof##__radg.first_row(); bodyof##__radg.exist(__r) && (__radg=&(TRectype&)bodyof##__radg.row(__r))!=NULL; __r=bodyof##__radg.succ_row(__r))
|
||||||
|
|
||||||
|
|
||||||
#endif // __FPLIB_H
|
#endif // __FPLIB_H
|
||||||
|
@ -1240,7 +1240,6 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) con
|
|||||||
real prezzo_unit = rdoc->prezzo(_nascondi_sconti_righe_fatt, false);
|
real prezzo_unit = rdoc->prezzo(_nascondi_sconti_righe_fatt, false);
|
||||||
real prezzo_tot = rdoc->imponibile(false);
|
real prezzo_tot = rdoc->imponibile(false);
|
||||||
|
|
||||||
|
|
||||||
if(qta < ZERO)
|
if(qta < ZERO)
|
||||||
{
|
{
|
||||||
// Metto la qualità senza il segno
|
// Metto la qualità senza il segno
|
||||||
@ -1250,6 +1249,7 @@ void TDoc_fp::set_qta_prezzo(TPaf_record& paf1800f, TFPRiga_documento* rdoc) con
|
|||||||
prezzo_unit = -abs(prezzo_unit);
|
prezzo_unit = -abs(prezzo_unit);
|
||||||
prezzo_tot = -abs(prezzo_tot);
|
prezzo_tot = -abs(prezzo_tot);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Salvo tutto
|
// Salvo tutto
|
||||||
paf1800f.set("PI_QUANTITA", qta_string);
|
paf1800f.set("PI_QUANTITA", qta_string);
|
||||||
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(prezzo_unit));
|
paf1800f.set("PI_PREZZOUNIT", converti_prezzo(prezzo_unit));
|
||||||
|
91
src/fp/fplib05.cpp
Normal file
91
src/fp/fplib05.cpp
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
#include "fplib.h"
|
||||||
|
#include <fpcust.h>
|
||||||
|
#include <fpccaus.h>
|
||||||
|
#include <fpcart.h>
|
||||||
|
#include <fpcadg.h>
|
||||||
|
|
||||||
|
|
||||||
|
void TFP_custom::init()
|
||||||
|
{
|
||||||
|
add_file(LF_FPCCAUS, FPCCAUS_NRIGA);
|
||||||
|
add_file(LF_FPCART, FPCART_NRIGA);
|
||||||
|
add_file(LF_FPCADG, FPCADG_NRIGA);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TFP_custom::write_rewrite(TBaseisamfile& f, bool re) const
|
||||||
|
{
|
||||||
|
return TMultiple_rectype::write_rewrite(f, re);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TFP_custom::load(const char* codcust)
|
||||||
|
{
|
||||||
|
// Metto il codice nel rectype principale ed effettuo una read
|
||||||
|
put(FPCUST_CODICE, codcust);
|
||||||
|
|
||||||
|
return _loaded = TMultiple_rectype::read() == NOERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TFP_custom::autoload(const TSheet_field& sf, const int file) const
|
||||||
|
{
|
||||||
|
switch(file)
|
||||||
|
{
|
||||||
|
case LF_FPCCAUS:
|
||||||
|
{
|
||||||
|
TRecord_array& rcaus = body(file);
|
||||||
|
rcaus.destroy_rows();
|
||||||
|
FOR_EACH_SHEET_ROW(sf, r, row)
|
||||||
|
{
|
||||||
|
TRectype& rec_row = rcaus.row(-1, true);
|
||||||
|
rec_row.put(FPCCAUS_VALORE, row->get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LF_FPCART:
|
||||||
|
{
|
||||||
|
TRecord_array& rart = body(file);
|
||||||
|
rart.destroy_rows();
|
||||||
|
FOR_EACH_SHEET_ROW(sf, r, row)
|
||||||
|
{
|
||||||
|
TRectype& rec_row = rart.row(-1, true);
|
||||||
|
rec_row.put(FPCART_TIPO, row->get(0));
|
||||||
|
rec_row.put(FPCART_VALORE, row->get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LF_FPCADG:
|
||||||
|
{
|
||||||
|
TRecord_array& radg = body(file);
|
||||||
|
radg.destroy_rows();
|
||||||
|
FOR_EACH_SHEET_ROW(sf, r, row)
|
||||||
|
{
|
||||||
|
TRectype& rec_row = radg.row(-1, true);
|
||||||
|
rec_row.put(FPCADG_TIPODATO, row->get(0));
|
||||||
|
rec_row.put(FPCADG_RTESTO, row->get());
|
||||||
|
rec_row.put(FPCADG_RNUMERO, row->get());
|
||||||
|
rec_row.put(FPCADG_RDATA, row->get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fatal_box("File non riconosciuto %d", file);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TFP_custom::TFP_custom() : TMultiple_rectype(LF_FPCUST), _codcust(""), _loaded(false)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
TFP_custom::TFP_custom(const TRectype& rec) : TMultiple_rectype(rec)
|
||||||
|
{
|
||||||
|
_codcust = get(FPCUST_CODICE);
|
||||||
|
_loaded = _codcust.full();
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
TFP_custom::TFP_custom(const char* codcust) : TFP_custom()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
load(codcust);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user