Patch level : 10.0
Files correlati : cg2 Ricompilazione Demo : [ ] Commento : Migliorata lettura TBill da record git-svn-id: svn://10.65.10.50/trunk@20536 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
053fcd1ea5
commit
8ef1b107f0
@ -193,12 +193,21 @@ bool TMovimentoPN::controlla_liquidazione(const TDate& data, TRegistro& registro
|
||||
|
||||
int TMovimentoPN::registra(bool re, bool force)
|
||||
{
|
||||
const TRectype& m = curr();
|
||||
long numreg = m.get_long(MOV_NUMREG);
|
||||
|
||||
if (!re && numreg <= 0) // Tento di numerare automaticamente in caso di write
|
||||
{
|
||||
TLocalisamfile mov(LF_MOV); // Non sposto il file principale della relazione!
|
||||
numreg = 1;
|
||||
if (mov.last() == NOERR)
|
||||
numreg += mov.get_long(MOV_NUMREG);
|
||||
curr().put(MOV_NUMREG, numreg);
|
||||
}
|
||||
|
||||
int err = re ? TRelation::rewrite(force) : TRelation::write(force);
|
||||
if (err != NOERR)
|
||||
return err;
|
||||
|
||||
const TRectype& m = curr();
|
||||
const long numreg = m.get_long(MOV_NUMREG);
|
||||
|
||||
_cg.renum_key(MOV_NUMREG, numreg);
|
||||
err = _cg.write(re);
|
||||
|
@ -8,8 +8,10 @@
|
||||
#include <recarray.h>
|
||||
#include <relation.h>
|
||||
|
||||
#include <clifo.h>
|
||||
#include <comuni.h>
|
||||
#include <pconti.h>
|
||||
#include <rcausali.h>
|
||||
#include <rmoviva.h>
|
||||
#include <rmov.h>
|
||||
|
||||
@ -766,13 +768,14 @@ const TBill& TBill::add_to(TToken_string& ts, int from, int mode)
|
||||
}
|
||||
|
||||
|
||||
const char* TBill::field_name(int n, bool contro) const
|
||||
const char* TBill::field_name(int n, const TRectype& r, bool contro) const
|
||||
{
|
||||
CHECKD(n >= 0 && n <= 3, "Invalid bill field ", n);
|
||||
|
||||
const char* f = NULL;
|
||||
if (contro)
|
||||
{
|
||||
CHECKD(r.num() == LF_RMOV || r.num() == LF_PAGSCA, "Record non valido per contropartita: ", r.num());
|
||||
switch(n)
|
||||
{
|
||||
case 0: f = RMV_GRUPPOC; break;
|
||||
@ -787,8 +790,20 @@ const char* TBill::field_name(int n, bool contro) const
|
||||
{
|
||||
case 0: f = RMV_GRUPPO; break;
|
||||
case 1: f = RMV_CONTO; break;
|
||||
case 2: f = RMV_SOTTOCONTO; break;
|
||||
default:f = RMV_TIPOC; break;
|
||||
case 2:
|
||||
if (r.num() == LF_CLIFO)
|
||||
f = CLI_CODCF;
|
||||
else
|
||||
f = RMV_SOTTOCONTO;
|
||||
break;
|
||||
default:
|
||||
switch(r.num())
|
||||
{
|
||||
case LF_CLIFO : f = CLI_TIPOCF; break;
|
||||
case LF_RCAUSALI: f = RCA_TIPOCF; break;
|
||||
default : f = RMV_TIPOC; break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return f;
|
||||
@ -796,21 +811,21 @@ const char* TBill::field_name(int n, bool contro) const
|
||||
|
||||
void TBill::put(TRectype& r, bool c) const
|
||||
{
|
||||
r.put(field_name(0, c), gruppo());
|
||||
r.put(field_name(1, c), conto());
|
||||
r.put(field_name(2, c), sottoconto());
|
||||
r.put(field_name(3, c), tipo());
|
||||
r.put(field_name(0, r, c), gruppo());
|
||||
r.put(field_name(1, r, c), conto());
|
||||
r.put(field_name(2, r, c), sottoconto());
|
||||
r.put(field_name(3, r, c), tipo());
|
||||
}
|
||||
|
||||
bool TBill::get(const TRectype& r, bool c)
|
||||
{
|
||||
char t = ' ';
|
||||
if (r.type(field_name(3, c)) != _nullfld)
|
||||
t = r.get_char(field_name(3, c));
|
||||
if (r.type(field_name(3, r, c)) != _nullfld)
|
||||
t = r.get_char(field_name(3, r, c));
|
||||
|
||||
set(r.get_int(field_name(0, c)),
|
||||
r.get_int(field_name(1, c)),
|
||||
r.get_long(field_name(2, c)),
|
||||
set(r.get_int(field_name(0, r, c)),
|
||||
r.get_int(field_name(1, r, c)),
|
||||
r.get_long(field_name(2, r, c)),
|
||||
t);
|
||||
|
||||
set_description(NULL);
|
||||
|
@ -178,7 +178,7 @@ class TBill : public TSortable
|
||||
protected:
|
||||
void set_description(const char* d);
|
||||
const TBill& copy(const TBill& b);
|
||||
const char* field_name(int n, bool contro) const;
|
||||
const char* field_name(int n, const TRectype& rec, bool contro) const;
|
||||
|
||||
public: // TObject
|
||||
virtual int compare(const TSortable& s) const;
|
||||
|
@ -593,8 +593,6 @@ TImporto TRiga_scadenze::esposto(bool valuta, const TDate & data_scad, const TDa
|
||||
|
||||
return esposto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool TRiga_scadenze::modifica_pagamento(const TRectype& new_pag, const TValuta& valuta,
|
||||
char& old_ap, TImporto& old_abb, TImporto& old_diffcam,
|
||||
@ -1038,12 +1036,10 @@ TImporto TRiga_partite::calcola_pagato_al(bool valuta,const TDate& al, const TDa
|
||||
const char sez = sezione();
|
||||
const bool rischio = data_scaduto != data_rischio;
|
||||
const int lastr = rate();
|
||||
|
||||
for (int r = lastr; r > 0; r--)
|
||||
{
|
||||
const TRiga_scadenze& scad = rata(r);
|
||||
const TImporto pag = scad.importo_pagato_al(valuta, al, mode);
|
||||
|
||||
pagato += pag;
|
||||
if (!pag.is_zero() && rischio)
|
||||
{
|
||||
@ -1063,31 +1059,22 @@ char TPartita::_cli_align = ' ';
|
||||
char TPartita::_for_align = ' ';
|
||||
|
||||
TPartita::TPartita(const TBill& clifo, int anno, const char* num)
|
||||
: _part(LF_PARTITE, PART_NRIGA), _unassigned(LF_PAGSCA, "NRIGP"),
|
||||
_align(' ')
|
||||
{
|
||||
read(clifo, anno, num);
|
||||
}
|
||||
: _part(LF_PARTITE, PART_NRIGA), _unassigned(LF_PAGSCA, PAGSCA_NRIGP), _align(' ')
|
||||
{ read(clifo, anno, num); }
|
||||
|
||||
TPartita::TPartita(const TRectype& r)
|
||||
: _part(LF_PARTITE, PART_NRIGA), _unassigned(LF_PAGSCA, "NRIGP"),
|
||||
_align(' ')
|
||||
: _part(LF_PARTITE, PART_NRIGA), _unassigned(LF_PAGSCA, PAGSCA_NRIGP), _align(' ')
|
||||
{
|
||||
TBill clifo; clifo.get(r);
|
||||
if (clifo.gruppo() == 0)
|
||||
{
|
||||
clifo.set(r.get_int(PART_GRUPPOCL), r.get_int(PART_CONTOCL),
|
||||
clifo.sottoconto(), clifo.tipo());
|
||||
}
|
||||
|
||||
clifo.set(r.get_int(PART_GRUPPOCL), r.get_int(PART_CONTOCL), clifo.sottoconto(), clifo.tipo());
|
||||
const int anno = r.get_int(PART_ANNO);
|
||||
const TString8 num(r.get(PART_NUMPART));
|
||||
read(clifo, anno, num);
|
||||
}
|
||||
|
||||
TPartita::~TPartita()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
const char* TPartita::build_key(TString& key) const
|
||||
{
|
||||
|
@ -183,14 +183,14 @@ END
|
||||
|
||||
NUMBER F_GRUPPO_INC 3
|
||||
BEGIN
|
||||
PROMPT 2 10 "Conto attivi "
|
||||
PROMPT 2 10 "Conto attivi "
|
||||
FIELD I0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER F_CONTO_INC 3
|
||||
BEGIN
|
||||
PROMPT 21 10 ""
|
||||
PROMPT 22 10 ""
|
||||
FIELD I1
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
@ -229,14 +229,14 @@ END
|
||||
|
||||
NUMBER F_GRUPPO_INCP 3
|
||||
BEGIN
|
||||
PROMPT 2 11 "Conto addebito "
|
||||
PROMPT 2 10 "Conto addebito "
|
||||
FIELD I9
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER F_CONTO_INCP 3
|
||||
BEGIN
|
||||
PROMPT 21 11 ""
|
||||
PROMPT 22 11 ""
|
||||
FIELD I10
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user