2005-03-17 14:20:42 +00:00
|
|
|
#ifndef __CALIB02_H
|
|
|
|
#define __CALIB02_H
|
|
|
|
|
|
|
|
#ifndef __REPORT_H
|
|
|
|
#include <report.h>
|
|
|
|
#endif
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_bill
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Classe simile al TBill, che contiene un conto piu' o meno completo di analitica
|
|
|
|
class TAnal_bill : public TSortable
|
|
|
|
{
|
|
|
|
TString _conto, _costo, _commessa, _fase;
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
protected:
|
|
|
|
void copy(const TAnal_bill& bill);
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
public:
|
|
|
|
virtual int compare(const TSortable& s) const;
|
|
|
|
bool match(const TAnal_bill& b) const;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void set_conto(const char* c);
|
|
|
|
void set_costo(const char* c);
|
|
|
|
void set_commessa(const char* c);
|
|
|
|
void set_fase(const char* c);
|
|
|
|
|
|
|
|
const TString& conto() const;
|
|
|
|
const TString& costo() const;
|
|
|
|
const TString& commessa() const;
|
|
|
|
const TString& fase() const;
|
|
|
|
|
2005-09-12 13:25:55 +00:00
|
|
|
int indicatore_bilancio() const;
|
2005-06-27 16:35:27 +00:00
|
|
|
bool get(const TRectype& rec);
|
|
|
|
void reset();
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
const TAnal_bill& operator=(const TAnal_bill& bill);
|
|
|
|
|
2005-06-27 16:35:27 +00:00
|
|
|
TAnal_bill();
|
|
|
|
TAnal_bill(const TAnal_bill& bill);
|
2005-09-12 13:25:55 +00:00
|
|
|
TAnal_bill(const char* conto, const char* costo = "", const char* commessa = "", const char* fase = "");
|
2005-06-27 16:35:27 +00:00
|
|
|
TAnal_bill(const TRectype& rec);
|
|
|
|
};
|
|
|
|
|
2005-06-23 12:16:21 +00:00
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_balance
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
#define _saldanal_consuntivo 0x1
|
|
|
|
#define _saldanal_preventivo 0x2
|
|
|
|
#define _saldanal_variazione 0x4
|
|
|
|
#define _saldanal_preventivi 0x6
|
|
|
|
#define _saldanal_qualsiasi 0x7
|
|
|
|
#define _saldanal_ultima_imm 0x8
|
|
|
|
#define _saldanal_riclassify 0x10
|
2005-06-23 15:32:55 +00:00
|
|
|
|
2005-06-24 11:24:40 +00:00
|
|
|
struct TSaldanal : public TObject
|
2005-06-23 12:16:21 +00:00
|
|
|
{
|
2005-06-24 11:24:40 +00:00
|
|
|
TImporto _ini, _dare, _avere, _fin;
|
|
|
|
bool _movimentato;
|
2005-08-08 14:08:52 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void copy(const TSaldanal& sa);
|
|
|
|
|
|
|
|
public:
|
|
|
|
TObject* dup() const { return new TSaldanal(*this); }
|
|
|
|
const TSaldanal& operator=(const TSaldanal& sa) { copy(sa); return *this; }
|
|
|
|
|
2006-02-08 13:11:11 +00:00
|
|
|
TSaldanal() : _movimentato(false) { }
|
2005-08-08 14:08:52 +00:00
|
|
|
TSaldanal(const TSaldanal& sa) { copy(sa); }
|
2005-06-23 12:16:21 +00:00
|
|
|
};
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
const TSaldanal& ca_saldo(const TAnal_bill& bill, const TDate& dal, const TDate& al, word tipi = _saldanal_consuntivo);
|
2005-06-23 12:16:21 +00:00
|
|
|
|
2005-06-29 13:04:49 +00:00
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
// TPconana_recordset
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TPconana_recordset : public TISAM_recordset
|
|
|
|
{
|
2005-07-07 17:05:02 +00:00
|
|
|
char _tipo;
|
2005-06-29 13:04:49 +00:00
|
|
|
word _tipimov;
|
|
|
|
TString _da_conto, _a_conto;
|
2005-07-07 17:05:02 +00:00
|
|
|
int _conto_minlen;
|
2005-06-29 13:04:49 +00:00
|
|
|
TAnal_bill _bill;
|
|
|
|
TDate _dal, _al;
|
|
|
|
bool _movimentati, _nonnulli;
|
|
|
|
|
2005-09-08 13:05:21 +00:00
|
|
|
// Variabili per verifica conti contabili col flag di analitica
|
|
|
|
bool _is_anal[3];
|
|
|
|
|
2005-06-29 13:04:49 +00:00
|
|
|
protected:
|
|
|
|
bool valid_record(const TRelation& rel) const;
|
|
|
|
static bool pianoconti_filter(const TRelation* rel);
|
|
|
|
|
|
|
|
virtual void set_custom_filter(TCursor& cursor) const;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual const TVariant& get(const char* column_name) const;
|
|
|
|
|
2005-07-07 17:05:02 +00:00
|
|
|
void set_tipo(char tipo);
|
|
|
|
void set_filter(char tipo, const char* da_conto, const char* a_conto,
|
2005-06-29 13:04:49 +00:00
|
|
|
const char* costo, const char* commessa, const char* fase,
|
|
|
|
const TDate& dal, const TDate& al,
|
|
|
|
word tipimov, bool movimentati, bool nonnulli);
|
2005-07-07 17:05:02 +00:00
|
|
|
TPconana_recordset(char tipo = ' ');
|
2005-06-29 13:04:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_rapport
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TAnal_report : public TReport
|
|
|
|
{
|
|
|
|
unsigned int _first_msg;
|
|
|
|
|
|
|
|
protected: // protected is safer
|
|
|
|
virtual size_t get_usr_words(TString_array& words) const;
|
|
|
|
virtual bool execute_usr_word(unsigned int opcode, TVariant_stack& stack);
|
2005-10-10 11:26:19 +00:00
|
|
|
virtual bool use_mask() { return false; }
|
2005-06-29 13:04:49 +00:00
|
|
|
|
2005-10-10 11:26:19 +00:00
|
|
|
virtual void msg_format(int logicnum, TVariant_stack& stack);
|
2005-08-08 11:55:59 +00:00
|
|
|
virtual void msg_format_costo (TVariant_stack& stack);
|
|
|
|
virtual void msg_format_commessa (TVariant_stack& stack);
|
|
|
|
virtual void msg_format_fase (TVariant_stack& stack);
|
|
|
|
virtual void msg_format_conto (TVariant_stack& stack);
|
|
|
|
virtual void msg_format_commessa_costo(TVariant_stack& stack);
|
2005-06-29 13:04:49 +00:00
|
|
|
|
|
|
|
public: // meglio pubic?
|
|
|
|
};
|
|
|
|
|
2005-09-05 17:14:07 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
// TAnal_rapport_mask
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class TAnal_report_mask : public TAutomask
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
void create_sheet(short sheet_id);
|
|
|
|
int create_sheet_fields(short sheet_id, int lf, int& y, short& dlg);
|
|
|
|
|
|
|
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
|
|
|
|
|
|
|
public:
|
2005-10-10 11:26:19 +00:00
|
|
|
int get_row_bill(TSheet_field& sf, int r, TAnal_bill& bill);
|
|
|
|
int set_row_bill(TSheet_field& sf, int r, const TAnal_bill& bill);
|
2005-11-21 18:19:36 +00:00
|
|
|
bool esistono_riclassificazioni() const;
|
2005-10-10 11:26:19 +00:00
|
|
|
|
|
|
|
TAnal_report_mask(const char* name) : TAutomask(name) {}
|
2005-09-05 17:14:07 +00:00
|
|
|
};
|
|
|
|
|
2005-03-17 14:20:42 +00:00
|
|
|
#endif
|