Aggiunta gestione Codice articolo in analitica per facilitare collegamento ad industriale
git-svn-id: svn://10.65.10.50/branches/R_10_00@22876 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
2674c09263
commit
ecde331bed
@ -8,7 +8,7 @@ int main(int argc, char** argv)
|
||||
switch (r)
|
||||
{
|
||||
// case 1: ca0200(argc,argv); break; // stampa tabelle
|
||||
case 2: ca0300(argc,argv); break; // parametri configurazione Contabilita' Analitica
|
||||
case 2: ca0300(argc,argv); break; // parametri configurazione Contabilità Analitica
|
||||
case 3: ca0400(argc,argv); break; // immissione piano dei conti
|
||||
case 4: ca0500(argc,argv); break; // gestione centri di costo
|
||||
case 5: ca0600(argc,argv); break; // gestione commesse
|
||||
|
@ -414,11 +414,11 @@ void TRiparti_app::write_rows()
|
||||
if (mf.field() != NULL)
|
||||
{
|
||||
const int idx = sheet.cid2index(mf.dlg());
|
||||
if (idx < 17)
|
||||
if (idx >= 0 && idx <= 17)
|
||||
mf.field()->write(row->get(idx), rec);
|
||||
}
|
||||
}
|
||||
if ( has_tot)
|
||||
if (has_tot)
|
||||
diff -= rec.get_real(RRIP_RIPARTO);
|
||||
}
|
||||
if (has_tot && !_msk->get_real(F_DIFFERENZA).is_zero())
|
||||
@ -454,7 +454,7 @@ void TRiparti_app::read_rows()
|
||||
if (mf.field() != NULL)
|
||||
{
|
||||
const int idx = sheet.cid2index(mf.dlg());
|
||||
if (idx < 17)
|
||||
if (idx >= 0 && idx <= 17)
|
||||
row.add(mf.field()->read(rec), idx);
|
||||
}
|
||||
}
|
||||
|
@ -213,13 +213,13 @@ END
|
||||
|
||||
NUMBER F_SOMMA 15 5
|
||||
BEGIN
|
||||
PROMPT 26 3 "Somma "
|
||||
PROMPT 27 3 "Somma "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
NUMBER F_DIFFERENZA 15 5
|
||||
BEGIN
|
||||
PROMPT 48 3 "Differenza "
|
||||
PROMPT 51 3 "Differenza "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
@ -243,11 +243,12 @@ BEGIN
|
||||
ITEM "Con2"
|
||||
ITEM "Con3"
|
||||
ITEM "Con4"
|
||||
ITEM "Articolo@20"
|
||||
END
|
||||
|
||||
BUTTON F_GENFASI 40 2
|
||||
BUTTON F_GENFASI 60 2
|
||||
BEGIN
|
||||
PROMPT 0 -1 "Ripartisci la commessa di origine tra le sue fasi"
|
||||
PROMPT -11 -1 "Ripartire la commessa d'origine tra le sue fasi"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
@ -384,6 +385,20 @@ BEGIN
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING 118 20
|
||||
BEGIN
|
||||
PROMPT 1 16 "Articolo "
|
||||
USE LF_ANAMAG
|
||||
INPUT CODART 118
|
||||
DISPLAY "Codice@20" CODART
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT 118 CODART
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN ve2 -3
|
||||
FIELD CODART
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include <defmask.h>
|
||||
#include <execp.h>
|
||||
#include <modaut.h>
|
||||
#include <postman.h>
|
||||
#include <recset.h>
|
||||
|
||||
@ -8,16 +10,17 @@
|
||||
|
||||
#include "../cg/cglib01.h"
|
||||
|
||||
#include <causali.h>
|
||||
#include <mov.h>
|
||||
#include <rmov.h>
|
||||
|
||||
#include "cdc.h"
|
||||
#include "commesse.h"
|
||||
#include "fasi.h"
|
||||
#include "movana.h"
|
||||
#include "rmovana.h"
|
||||
#include "rrip.h"
|
||||
#include "saldana.h"
|
||||
#include "cdc.h"
|
||||
#include "commesse.h"
|
||||
#include "fasi.h"
|
||||
|
||||
|
||||
class TMovanal_msk : public TAutomask
|
||||
@ -31,7 +34,6 @@ class TMovanal_msk : public TAutomask
|
||||
short _pcon_start;
|
||||
short _pcon_end;
|
||||
|
||||
|
||||
TCache_ripartizioni _cache_rip;
|
||||
|
||||
protected:
|
||||
@ -144,15 +146,18 @@ void TMovanal_msk::show_locked_buttons()
|
||||
|
||||
TToken_string& TMovanal_msk::get_rip_row(const TRectype& rrip)
|
||||
{
|
||||
TSheet_field& sheet = sfield(F_RIGHE);
|
||||
const bool ci = app().has_module(CIAUT);
|
||||
|
||||
TToken_string keyrip;
|
||||
keyrip.add(rrip.get(RRIP_CODCOSTO));
|
||||
keyrip.add(rrip.get(RRIP_CODCMS));
|
||||
keyrip.add(rrip.get(RRIP_CODFASE));
|
||||
keyrip.add(rrip.get(RRIP_CODCONTO));
|
||||
if (ci)
|
||||
keyrip.add(rrip.get(RRIP_CODART));
|
||||
|
||||
TRectype rmov(LF_RMOVANA);
|
||||
TSheet_field& sheet = sfield(F_RIGHE);
|
||||
const int totrows = sheet.items();
|
||||
if (totrows > 0)
|
||||
{
|
||||
@ -165,6 +170,8 @@ TToken_string& TMovanal_msk::get_rip_row(const TRectype& rrip)
|
||||
keyrow.add(rmov.get(RMOVANA_CODCMS));
|
||||
keyrow.add(rmov.get(RMOVANA_CODFASE));
|
||||
keyrow.add(rmov.get(RMOVANA_CODCONTO));
|
||||
if (ci)
|
||||
keyrow.add(rmov.get(RMOVANA_CODART));
|
||||
if (keyrow == keyrip)
|
||||
return sheet.row(i); // Ho trovato una riga compatibile
|
||||
}
|
||||
@ -176,6 +183,8 @@ TToken_string& TMovanal_msk::get_rip_row(const TRectype& rrip)
|
||||
rmov.put(RMOVANA_CODCMS, keyrip.get());
|
||||
rmov.put(RMOVANA_CODFASE, keyrip.get());
|
||||
rmov.put(RMOVANA_CODCONTO, keyrip.get());
|
||||
if (ci)
|
||||
rmov.put(RMOVANA_CODART, keyrip.get());
|
||||
TToken_string& row = rec2row(rmov, -1);
|
||||
return row;
|
||||
}
|
||||
@ -186,15 +195,14 @@ void TMovanal_msk::split_cg_row(const TRectype& row, const TAnal_ripartizioni_ba
|
||||
TGeneric_distrib distrib(row.get_real(RMV_IMPORTO), TCurrency::get_firm_dec());
|
||||
|
||||
// Calcolo tutte le percentuali da ripartire
|
||||
int i;
|
||||
for (i = 1; i <= rrip.rows(); i++)
|
||||
for (int i = 1; i <= rrip.rows(); i++)
|
||||
{
|
||||
const real quota = rrip[i].get_real(RRIP_RIPARTO);
|
||||
distrib.add(quota);
|
||||
}
|
||||
|
||||
TString80 desc; // Variabile di appoggio per descrizione riga
|
||||
for (i = 1; i <= rrip.rows(); i++)
|
||||
for (int i = 1; i <= rrip.rows(); i++)
|
||||
{
|
||||
TToken_string& riga = get_rip_row(rrip[i]); // Cerca o crea la riga cui sommare la quota
|
||||
TImporto impriga; row2imp(riga, impriga); // Legge l'importo della riga
|
||||
@ -984,7 +992,7 @@ void TMovanal_msk::create_sheet()
|
||||
TConfig& ini = ca_config();
|
||||
const bool fsc_req = ini.get_bool("FscRequired");
|
||||
|
||||
int y = 3;
|
||||
int y = 4;
|
||||
short dlg = S_CDC1+100; // id del primo campo da generare
|
||||
_cdc_start = _cdc_end = -1;
|
||||
_cms_start = _cms_end = -1;
|
||||
@ -1044,6 +1052,14 @@ void TMovanal_msk::create_sheet()
|
||||
sf.delete_column(id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!main_app().has_module(CIAUT))
|
||||
{
|
||||
hide(S_CODART);
|
||||
hide(S_DESCART);
|
||||
sf.delete_column(S_CODART);
|
||||
sf.delete_column(S_DESCART);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1091,8 +1107,25 @@ void TMovanal_app::write_rows(const TMask& m)
|
||||
|
||||
TRectype& rec = mov.new_row(); // Crea una riga nuova
|
||||
_msk->row2rec(i, rec);
|
||||
|
||||
} //FOR_EACH_SHEET...
|
||||
|
||||
if (has_module(CIAUT))
|
||||
{
|
||||
const TRectype& caus = cache().get(LF_CAUSALI, m.get(F_CODCAUS));
|
||||
if (caus.get_bool(CAU_MOVCGIND))
|
||||
{
|
||||
TFilename n; n.tempdir(); n.add("mov_caci.ini");
|
||||
n.fremove();
|
||||
if (n.full()) // dummy test
|
||||
{
|
||||
TConfig cini(n, "105");
|
||||
mask2ini(m, cini);
|
||||
}
|
||||
TString cmd; cmd << "ci0 -6 -i" << n;
|
||||
TExternal_app ci0(cmd);
|
||||
ci0.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TMovanal_app::read_rows(const TMask& m)
|
||||
|
10
ca/ca2100a.h
10
ca/ca2100a.h
@ -47,7 +47,9 @@
|
||||
#define S_CON2 117
|
||||
#define S_CON3 118
|
||||
#define S_CON4 119
|
||||
#define S_CDC_ORI 120
|
||||
#define S_CMS_ORI 121
|
||||
#define S_FAS_ORI 122
|
||||
#define S_CON_ORI 123
|
||||
#define S_CODART 120
|
||||
#define S_DESCART 121
|
||||
#define S_CDC_ORI 122
|
||||
#define S_CMS_ORI 123
|
||||
#define S_FAS_ORI 124
|
||||
#define S_CON_ORI 125
|
||||
|
@ -44,6 +44,7 @@ BEGIN
|
||||
DISPLAY "Data comp.@10" DATACOMP
|
||||
DISPLAY "Eser." ANNOES
|
||||
DISPLAY "P. nota" NUMREGCG
|
||||
DISPLAY "Caus." CODCAUS
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_NUMREG NUMREG
|
||||
CHECKTYPE REQUIRED
|
||||
@ -103,6 +104,7 @@ BEGIN
|
||||
INPUT CODCAUS F_CODCAUS
|
||||
DISPLAY "Codice" CODCAUS
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPLAY "Industriale@C" MOVCGIND
|
||||
OUTPUT F_CODCAUS CODCAUS
|
||||
OUTPUT F_DESCAUS DESCR
|
||||
CHECKTYPE REQUIRED
|
||||
@ -118,6 +120,7 @@ BEGIN
|
||||
INPUT DESCR F_DESCAUS
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPLAY "Codice" CODCAUS
|
||||
DISPLAY "Industriale@C" MOVCGIND
|
||||
COPY OUTPUT F_CODCAUS
|
||||
CHECKTYPE REQUIRED
|
||||
GROUP 5
|
||||
@ -281,6 +284,8 @@ BEGIN
|
||||
ITEM "Con 2"
|
||||
ITEM "Con 3"
|
||||
ITEM "Con 4"
|
||||
ITEM "Articolo@20"
|
||||
ITEM "Descrizione@30"
|
||||
ITEM "Cdc.Orig."
|
||||
ITEM "Cms.Orig."
|
||||
ITEM "Fase Orig."
|
||||
@ -306,7 +311,7 @@ END
|
||||
|
||||
BUTTON DLG_USER 10 2
|
||||
BEGIN
|
||||
PROMPT -24 -1 "Ripartisce"
|
||||
PROMPT -24 -1 "Ripartizione"
|
||||
PICTURE TOOL_MULTISEL
|
||||
END
|
||||
|
||||
@ -326,20 +331,44 @@ PAGE "Riga" 0 2 0 0
|
||||
|
||||
CURRENCY S_DARE 15
|
||||
BEGIN
|
||||
PROMPT 1 1 "Dare "
|
||||
PROMPT 8 0 "Dare "
|
||||
END
|
||||
|
||||
CURRENCY S_AVERE 15
|
||||
BEGIN
|
||||
PROMPT 31 1 "Avere "
|
||||
PROMPT 42 0 "Avere "
|
||||
END
|
||||
|
||||
STRING S_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 1 2 "Descrizione "
|
||||
PROMPT 1 1 "Descrizione "
|
||||
FIELD DESCR
|
||||
END
|
||||
|
||||
STRING S_CODART 20
|
||||
BEGIN
|
||||
PROMPT 1 2 "Articolo "
|
||||
USE LF_ANAMAG
|
||||
INPUT CODART S_CODART
|
||||
DISPLAY "Codice@20" CODART
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT S_CODART CODART
|
||||
OUTPUT S_DESCART DESCR
|
||||
CHECKTYPE NORMAL
|
||||
FIELD CODART
|
||||
END
|
||||
|
||||
STRING S_DESCART 50 35
|
||||
BEGIN
|
||||
PROMPT 38 2 ""
|
||||
USE LF_ANAMAG KEY 2
|
||||
INPUT DESCR S_DESCART
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
DISPLAY "Codice@20" CODART
|
||||
COPY OUTPUT S_CODART
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING S_CDC1 20
|
||||
BEGIN
|
||||
PROMPT 1 4 "Cdc 1"
|
||||
|
@ -1,3 +1,3 @@
|
||||
108
|
||||
0
|
||||
$rmovana|0|0|233|0|Righe Movimenti di Analitica|||
|
||||
$rmovana|0|0|253|0|Righe Movimenti di Analitica|||
|
||||
|
@ -1,5 +1,5 @@
|
||||
108
|
||||
16
|
||||
17
|
||||
ANNOES|9|4|0|Anno di Esercizio
|
||||
NUMREG|3|7|0|Numero di Registrazione
|
||||
NUMRIG|2|3|0|Numero riga
|
||||
@ -9,6 +9,7 @@ CODCCOSTO|1|20|0|Codice centro di costo
|
||||
CODCMS|1|20|0|Codice commessa
|
||||
CODFASE|1|10|0|Codice fase
|
||||
CODCONTO|1|20|0|Codice Conto Analitica
|
||||
CODART|1|20|0|Codice Articolo Industriale
|
||||
DESCR|1|50|0|Descrizione
|
||||
IMPORTO|4|18|3|Importo della riga
|
||||
ROWTYPE|1|1|0|Tipo Riga
|
||||
|
@ -1,3 +1,3 @@
|
||||
150
|
||||
0
|
||||
$rrip|0|0|98|0|Archivio righe di ripartizione analitica|||
|
||||
$rrip|0|0|118|0|Archivio righe di ripartizione analitica|||
|
||||
|
@ -1,5 +1,5 @@
|
||||
150
|
||||
8
|
||||
9
|
||||
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch)
|
||||
CODICE|1|8|0|Codice ripartizione
|
||||
NRIGA|2|3|0|Numero riga
|
||||
@ -8,5 +8,6 @@ CODCMS|1|20|0|Codice commessa
|
||||
CODFASE|1|10|0|Codice fase
|
||||
CODCONTO|1|20|0|Codice Conto analitica
|
||||
RIPARTO|4|15|5|Ripartizione
|
||||
CODART|1|20|0|Codice articolo (industriale)
|
||||
1
|
||||
TIPO+CODICE+NRIGA|
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define RMOVANA_CODCMS "CODCMS"
|
||||
#define RMOVANA_CODFASE "CODFASE"
|
||||
#define RMOVANA_CODCONTO "CODCONTO"
|
||||
#define RMOVANA_CODART "CODART"
|
||||
#define RMOVANA_DESCR "DESCR"
|
||||
#define RMOVANA_IMPORTO "IMPORTO"
|
||||
#define RMOVANA_ROWTYPE "ROWTYPE"
|
||||
|
Loading…
x
Reference in New Issue
Block a user