Patch level :10.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunta fase alle ripartizioni


git-svn-id: svn://10.65.10.50/trunk@16609 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2008-05-13 13:22:22 +00:00
parent cb186ad011
commit abb57ee779
11 changed files with 87 additions and 43 deletions

View File

@ -7,6 +7,7 @@
#include "calib01.h"
#include "fasi.h"
#include "rip.h"
#include "rrip.h"
///////////////////////////////////////////////////////////
@ -232,7 +233,7 @@ TRiparti_msk::TRiparti_msk() : TAutomask("ca0800a")
TConfig& ini = ca_config();
// Crea gli eventuali campi per commessa e centro di costo
const TMultilevel_code_info& fasinfo = ca_multilevel_code_info(LF_FASI);
int y = 11;
for (int i = 0; i < 2; i++)
{
@ -246,8 +247,33 @@ TRiparti_msk::TRiparti_msk() : TAutomask("ca0800a")
} else
if (level == "CMS") // Crea commessa
{
h = ca_create_fields(*this, 0, LF_COMMESSE, 2, y, F_CODCMS_1, F_DESCMS_1);
prompt = TR("@bCommessa");
if (fasinfo.parent() == LF_COMMESSE)
{
h = ca_create_fields(*this, 0, LF_FASI, 2, y, F_CODCMS_1, F_DESCMS_1);
prompt = TR("@bCommessa/Fase");
const TMultilevel_code_info& cmsinfo = ca_multilevel_code_info(LF_COMMESSE);
const int cmslevels = cmsinfo.levels();
for (int j = 0; j < cmslevels; j++)
{
TEdit_field& cfld = efield(F_CODCMS_1+j);
const TFieldref& fr = cmsinfo.fieldref(j);
TString80 str = RIP_CODCMS;
if (cmslevels > 1)
str.format("%s[%d,%d]", RIP_CODCMS, fr.from()+1, fr.to());
cfld.set_field(str);
}
}
else
{
h = ca_create_fields(*this, 0, LF_COMMESSE, 2, y, F_CODCMS_1, F_DESCMS_1);
prompt = TR("@bCommessa");
}
} else
if (level == "FSC" && fasinfo.parent() <= 0)
{
h = ca_create_fields(*this, 0, LF_FASI, 2, y, F_CODCMS_1, F_DESCMS_1);
prompt = TR("@bFase");
}
if (prompt != NULL) // Crea groupbox

View File

@ -1,10 +1,11 @@
#include "ca0800a.h"
TOOLBAR "" 0 -2 0 2
#include <toolbar.h>
TOOLBAR "topbar" 0 0 0 2
#include <relapbar.h>
ENDPAGE
PAGE "Ripartizioni" -1 -1 64 6
PAGE "Ripartizioni" 0 0 0 2
GROUPBOX DLG_NULL 78 4
BEGIN
@ -55,6 +56,7 @@ BEGIN
DISPLAY "Codice@8 " CODICE
DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS
DISPLAY "Fase@10" CODFASE
DISPLAY "Descrizione@50" DESCRIZ
OUTPUT F_CODICE_B CODICE
OUTPUT F_DESCRIZ_B DESCRIZ
@ -91,6 +93,7 @@ BEGIN
DISPLAY "Codice " CODICE
DISPLAY "Costo@20" CODCOSTO
DISPLAY "Commessa@20" CODCMS
DISPLAY "Fase@10" CODFASE
COPY OUTPUT F_CODICE_B
FIELD DESCRIZ
KEY 2

View File

@ -1,12 +1,12 @@
#include "ca2100a.h"
TOOLBAR "" 0 -3 0 3
TOOLBAR "topbar" 0 0 0 2
#include <toolbar.h>
#include <relapbar.h>
ENDPAGE
PAGE "Testata" -1 -1 80 20
PAGE "Testata" 0 0 0 2
GROUPBOX DLG_NULL 78 3
BEGIN

View File

@ -147,8 +147,8 @@ bool TRib_movanal_app::explode_rows(const TRecord_array& input_rows, TRecord_arr
const TRectype& rec = input_rows.row(r);
TAnal_bill zio(rec);
const int rmovana_indbil = zio.indicatore_bilancio();
const TAnal_ripartizioni_batch& rrip = _cache_rip.righe(rec.get(RMOVANA_CODCCOSTO),
rec.get(RMOVANA_CODCMS), annoes, rmovana_indbil, tipomov);
const TAnal_ripartizioni_batch& rrip = _cache_rip.righe(rec.get(RMOVANA_CODCCOSTO), rec.get(RMOVANA_CODCMS),
rec.get(RMOVANA_CODFASE), annoes, rmovana_indbil, tipomov);
//ci sono righe di ripartizione
const int righe_ripartizione = rrip.rows();
bool ripartisci = righe_ripartizione > 0;

View File

@ -1,13 +1,7 @@
#include "ca2200a.h"
#include "camask.h"
TOOLBAR "" 0 -3 0 3
STRING DLG_PROFILE 50
BEGIN
PROMPT 9 0 "Profilo "
PSELECT
END
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 10 2
BEGIN
@ -29,7 +23,17 @@ END
ENDPAGE
PAGE "Ripartizione movimenti" 0 0 64 12
TOOLBAR "" 0 -2 0 2
STRING DLG_PROFILE 50
BEGIN
PROMPT 9 -11 "Profilo "
PSELECT
END
ENDPAGE
PAGE "Ripartizione movimenti" 0 0 0 2
GROUPBOX DLG_NULL 78 4
BEGIN

View File

@ -22,7 +22,14 @@
<field border="1" x="1" y="3" type="Linea" width="169" height="0" pattern="1" />
<field x="43" y="2" type="Testo" align="center" width="6" id="3" pattern="1" text="Fase" />
<field x="50.5" y="2" type="Testo" align="center" width="6" id="4" pattern="1" text="CdC" />
<field x="56" y="2" type="Testo" align="center" width="6" id="5" pattern="1" text="% Av." />
<field x="56" y="2" type="Array" align="center" width="7" id="5" pattern="1">
<source>TIPOSTIMA</source>
<list>
<li Value="% Av." Code="T" />
<li Value="% Ric." Code="C" />
<li Value="% Ric." Code="R" />
</list>
</field>
<field x="61" y="2" type="Testo" align="right" width="13" id="69" pattern="1" text="Testata" />
<field x="1" y="2" type="Testo" width="15" id="121" pattern="1" text="Commessa" />
<field x="75" y="1" type="Stringa" valign="bottom" align="right" width="13" height="2" id="169" pattern="1">

View File

@ -1567,48 +1567,49 @@ int TAnal_ripartizioni_batch::read (const char* codice)
}
int TAnal_ripartizioni_batch::read_rip_4(TLocalisamfile& rip, const char* codcosto, const char* commessa,
const int annoes, const int indbil, const int classe_mov) const
const char* fase, const int annoes, const int indbil, const int classe_mov) const
{
rip.put(RIP_TIPO, "B"); //solo tipi batch!
rip.put(RIP_CODCOSTO, codcosto);
rip.put(RIP_CODCMS, commessa);
rip.put(RIP_CODFASE, fase);
rip.put(RIP_ANNOES, annoes);
rip.put(RIP_INDBIL, indbil);
rip.put(RIP_CLASSEMOV, classe_mov);
return rip.read();
}
int TAnal_ripartizioni_batch::read (const char* codcosto, const char* commessa,
int TAnal_ripartizioni_batch::read (const char* codcosto, const char* commessa, const char* fase,
const int annoes, const int indbil, const int classe_mov)
{
CHECKD(classe_mov > 0, "Classe movimento non valida ", classe_mov);
TLocalisamfile rip(LF_RIP);
rip.setkey(4);
int err = read_rip_4(rip, codcosto, commessa, annoes, indbil, classe_mov);
int err = read_rip_4(rip, codcosto, commessa, fase, annoes, indbil, classe_mov);
if (err != NOERR)
err = read_rip_4(rip, codcosto, commessa, annoes, indbil, 0);
//la put va rifatta la put perche' potrebbe essersi spostato al record successivo!!!
err = read_rip_4(rip, codcosto, commessa, fase, annoes, indbil, 0);
//la put va rifatta perche' potrebbe essersi spostato al record successivo!!!
//se fallisce il primo tentativo prova con lo stesso anno e indbil=0
if (err != NOERR && indbil != 0)
{
err = read_rip_4(rip, codcosto, commessa, annoes, 0, classe_mov);
err = read_rip_4(rip, codcosto, commessa, fase, annoes, 0, classe_mov);
if (err != NOERR)
err = read_rip_4(rip, codcosto, commessa, annoes, 0, 0);
err = read_rip_4(rip, codcosto, commessa, fase, annoes, 0, 0);
}
//se fallisce ancora riprova con anno=0 e lo stesso indbil
if (err != NOERR && annoes != 0)
{
err = read_rip_4(rip, codcosto, commessa, 0, indbil, classe_mov);
err = read_rip_4(rip, codcosto, commessa, fase, 0, indbil, classe_mov);
if (err != NOERR)
err = read_rip_4(rip, codcosto, commessa, 0, indbil, 0);
err = read_rip_4(rip, codcosto, commessa, fase, 0, indbil, 0);
//estremo tentativo con annoes e indbil = 0
if (err != NOERR && indbil != 0)
{
err = read_rip_4(rip, codcosto, commessa, 0, 0, classe_mov);
err = read_rip_4(rip, codcosto, commessa, fase, 0, 0, classe_mov);
if (err != NOERR)
err = read_rip_4(rip, codcosto, commessa, 0, 0, 0);
err = read_rip_4(rip, codcosto, commessa, fase, 0, 0, 0);
}
}
@ -1700,11 +1701,12 @@ TObject* TCache_ripartizioni::key2obj(const char* key)
{
const TString80 codcosto = parametro.get(1);
const TString80 commessa = parametro.get(2);
const int anno = parametro.get_int(3);
const int indbil = parametro.get_int(4);
const int classe_mov = parametro.get_int(5);
const TString16 fase = parametro.get(3);
const int anno = parametro.get_int(4);
const int indbil = parametro.get_int(5);
const int classe_mov = parametro.get_int(6);
rip->read(codcosto, commessa, anno, indbil, classe_mov);
rip->read(codcosto, commessa, fase, anno, indbil, classe_mov);
}
if (rip->head().get_int(RIP_TIPORIP) == 1)
@ -1755,7 +1757,7 @@ void TCache_ripartizioni::set_esercizio(const int codes)
}
}
const TAnal_ripartizioni_batch& TCache_ripartizioni::righe(const char* costo, const char* commessa,
const TAnal_ripartizioni_batch& TCache_ripartizioni::righe(const char* costo, const char* commessa, const char* fase,
const int annoes, const int indbil, const char tipomov)
{
//classi di movimento: se preventivi 2, se normali 1
@ -1766,7 +1768,7 @@ const TAnal_ripartizioni_batch& TCache_ripartizioni::righe(const char* costo, co
classe_movimento = 1;
TToken_string parametro;
parametro << "4|" << costo << '|' << commessa << '|' << annoes << '|' << indbil << '|' << classe_movimento; //per chiave 4
parametro << "4|" << costo << '|' << commessa << '|' << fase << '|' << annoes << '|' << indbil << '|' << classe_movimento; //per chiave 4
return *(const TAnal_ripartizioni_batch*)objptr(parametro);
}

View File

@ -171,13 +171,13 @@ class TAnal_ripartizioni_batch : public TRecord_array
private:
int read_rip_3(TLocalisamfile& rip, const int gr, const int co, const long sot,
const int annoes, const int indbil, const int classe_mov) const;
int read_rip_4(TLocalisamfile& rip, const char* codcosto, const char* commessa,
int read_rip_4(TLocalisamfile& rip, const char* codcosto, const char* commessa, const char* fase,
const int annoes, const int indbil, const int classe_mov) const;
public:
const TRectype& head() const { return _rip; }
int indbil() const;
int read (const char* codice);
int read (const char* codcosto, const char* commessa, const int annoes, const int indbil, const int classe_mov);
int read (const char* codcosto, const char* commessa, const char* fase, const int annoes, const int indbil, const int classe_mov);
int read (const int gr, const int co, const long sot, const int annoes, const int indbil, const int classe_mov);
TAnal_ripartizioni_batch();
};
@ -196,7 +196,7 @@ protected:
public:
void set_esercizio(const int codes);
const TAnal_ripartizioni_batch& righe(const char* costo, const char* commessa,
const TAnal_ripartizioni_batch& righe(const char* costo, const char* commessa, const char* fase,
const int annoes, const int indbil, const char tipomov);
const TAnal_ripartizioni_batch& righe(const TBill& bill, const int annoes, const char tipomov);

View File

@ -1,3 +1,3 @@
149
0
$rip|||119|0|Archivio tabelle di ripartizione analitica|||
$rip|||129|0|Archivio tabelle di ripartizione analitica|||

View File

@ -1,5 +1,5 @@
149
12
13
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch)
CODICE|1|8|0|Codice ripartizione
GRUPPO|2|3|0|Gruppo
@ -7,6 +7,7 @@ CONTO|2|3|0|Conto
SOTTOCONTO|3|6|0|Sottoconto
CODCOSTO|1|20|0|Codice centro di costo
CODCMS|1|20|0|Codice commessa
CODFASE|1|10|0|Codice fase
DESCRIZ|1|50|0|Descrizione
TIPORIP|1|1|0|Modalita' ripartizione (percentuale, quote, parti)
ANNOES|9|4|0|Codice esercizio
@ -16,4 +17,4 @@ CLASSEMOV|2|1|0|Classe movimento (0=tutti,1=normali e temp.,2=preventivi e varia
TIPO+CODICE|
TIPO+DESCRIZ|X
TIPO+GRUPPO+CONTO+SOTTOCONTO+ANNOES+INDBIL+CLASSEMOV|X
TIPO+CODCOSTO+CODCMS+ANNOES+INDBIL+CLASSEMOV|X
TIPO+CODCOSTO+CODCMS+CODFASE+ANNOES+INDBIL+CLASSEMOV|X

View File

@ -8,6 +8,7 @@
#define RIP_SOTTOCONTO "SOTTOCONTO"
#define RIP_CODCOSTO "CODCOSTO"
#define RIP_CODCMS "CODCMS"
#define RIP_CODFASE "CODFASE"
#define RIP_DESCRIZ "DESCRIZ"
#define RIP_TIPORIP "TIPORIP"
#define RIP_ANNOES "ANNOES"