Patch level : 10.0 286

Files correlati     : ve0.exe
Ricompilazione Demo : [ ]
Commento            :

Preventivi/incarichi (Dinamica)


git-svn-id: svn://10.65.10.50/trunk@18756 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-04-21 15:31:08 +00:00
parent b9f21c97b9
commit fe678ec774
6 changed files with 51 additions and 28 deletions

View File

@ -44,19 +44,19 @@ void TGenerazione_esecutivo::genera_matricola(TRiga_documento & row)
const TString & name = str->get(i); const TString & name = str->get(i);
if (name.starts_with("PROG")) if (name.starts_with("PROG"))
{ {
TTable lv(format("LV%1d", livello + 1)); TTable mat(format("VE%1d", livello + 1));
const int chars = atoi(name.after("PROG")); const int chars = atoi(name.after("PROG"));
lv.put("CODTAB", code); mat.put("CODTAB", code);
if (lv.read(_isequal) != NOERR) if (mat.read(_isequal) != NOERR)
{ {
lv.zero(); mat.zero();
lv.put("CODTAB", code); mat.put("CODTAB", code);
lv.write(); mat.write();
} }
const int prog = lv.get_int("I0") + 1; const int prog = mat.get_int("I0") + 1;
lv.put("I0", prog); mat.put("I0", prog);
lv.rewrite(); mat.rewrite();
TString s; s << prog; s.lpad(chars, '0'); TString s; s << prog; s.lpad(chars, '0');
code << s; code << s;
} }
@ -241,8 +241,8 @@ void TGenEsecutivo_app::main_loop()
TGenerazione_esecutivo e(m.get(F_CODICE_ESEC)); TGenerazione_esecutivo e(m.get(F_CODICE_ESEC));
TGenerazione_ordine o(m.get(F_CODICE_ORC)); TGenerazione_ordine o(m.get(F_CODICE_ORC));
e.preserve_original_row(); e.preserve_original_rif();
o.preserve_original_row(); o.preserve_original_rif();
cur.freeze(); cur.freeze();
TProgind pi(tot, "Generazione in corso...", FALSE, TRUE); TProgind pi(tot, "Generazione in corso...", FALSE, TRUE);
for (cur = 0; cur.pos() < tot; ++cur) for (cur = 0; cur.pos() < tot; ++cur)
@ -258,7 +258,7 @@ void TGenEsecutivo_app::main_loop()
doc_in.add(srcdoc); doc_in.add(srcdoc);
e.elabora(doc_in, doc_out, data); e.elabora(doc_in, doc_out, data);
doc_in.rewrite(); // doc_in.rewrite();
doc_out.write(); doc_out.write();
doc_in.destroy(-1); doc_in.destroy(-1);
{ {

View File

@ -6,7 +6,7 @@
#define F_FROM_FRNDOC 206 #define F_FROM_FRNDOC 206
#define F_FROM_TONDOC 207 #define F_FROM_TONDOC 207
#define F_CODICE_ESEC 208 #define F_CODICE_ESEC 208
#define F_DESCR_ESEC 209 #define F_DESC_ESEC 209
#define F_CODICE_ORC 210 #define F_CODICE_ORC 210
#define F_DESCR_ORC 211 #define F_DESC_ORC 211
#define F_DATA 212 #define F_DATA 212

View File

@ -89,7 +89,7 @@ END
STRING F_CODICE_ESEC 8 STRING F_CODICE_ESEC 8
BEGIN BEGIN
PROMPT 1 6 "Esecutivi " PROMPT 2 6 "Esecutivi "
FLAG "U" FLAG "U"
USE %ELD SELECT I0==4 USE %ELD SELECT I0==4
INPUT CODTAB F_CODICE_ESEC INPUT CODTAB F_CODICE_ESEC
@ -103,7 +103,7 @@ END
STRING F_DESC_ESEC 50 STRING F_DESC_ESEC 50
BEGIN BEGIN
PROMPT 20 6 "" PROMPT 24 6 ""
USE %ELD KEY 2 SELECT I0==4 USE %ELD KEY 2 SELECT I0==4
INPUT S0 F_DESC_ESEC INPUT S0 F_DESC_ESEC
DISPLAY "Descrizione@55" S0 DISPLAY "Descrizione@55" S0
@ -113,7 +113,7 @@ END
STRING F_CODICE_ORC 8 STRING F_CODICE_ORC 8
BEGIN BEGIN
PROMPT 1 7 "Ordini " PROMPT 2 7 "Ordini "
FLAG "U" FLAG "U"
USE %ELD SELECT I0==4 USE %ELD SELECT I0==4
INPUT CODTAB F_CODICE_ORC INPUT CODTAB F_CODICE_ORC
@ -127,7 +127,7 @@ END
STRING F_DESC_ORC 50 STRING F_DESC_ORC 50
BEGIN BEGIN
PROMPT 20 7 "" PROMPT 24 7 ""
USE %ELD KEY 2 SELECT I0==4 USE %ELD KEY 2 SELECT I0==4
INPUT S0 F_DESC_ORC INPUT S0 F_DESC_ORC
DISPLAY "Descrizione@55" S0 DISPLAY "Descrizione@55" S0
@ -137,7 +137,17 @@ END
DATE F_DATA DATE F_DATA
BEGIN BEGIN
PROMPT 1 9 "Data " PROMPT 2 9 "Data "
END
ENDPAGE
TOOLBAR "" 0 -2 0 2
STRING DLG_PROFILE 50
BEGIN
PROMPT 9 -11 "Profilo "
PSELECT
END END
ENDPAGE ENDPAGE

View File

@ -166,10 +166,12 @@ void TGenOrdini_app::main_loop()
const long tot = cur.items(); const long tot = cur.items();
if (tot > 0L) if (tot > 0L)
{ {
TGenerazione_ordine_produzione e(m.get(F_CODICE_ORP)); TGenerazione_ordine_produzione p(m.get(F_CODICE_ORP));
TGenerazione_ordine_acquisto o(m.get(F_CODICE_ORA)); TGenerazione_ordine_acquisto a(m.get(F_CODICE_ORA));
cur.freeze(); p.preserve_original_rif();
a.preserve_original_rif();
cur.freeze();
TProgind pi(tot, "Generazione in corso...", FALSE, TRUE); TProgind pi(tot, "Generazione in corso...", FALSE, TRUE);
for (cur = 0; cur.pos() < tot; ++cur) for (cur = 0; cur.pos() < tot; ++cur)
{ {
@ -177,19 +179,19 @@ void TGenOrdini_app::main_loop()
TDocumento srcdoc(cur.curr()), newdoc; TDocumento srcdoc(cur.curr()), newdoc;
if (e.is_document_ok(srcdoc)) if (p.is_document_ok(srcdoc))
{ {
TLista_documenti doc_in; TLista_documenti doc_in;
TLista_documenti doc_out; TLista_documenti doc_out;
doc_in.add(srcdoc); doc_in.add(srcdoc);
e.elabora(doc_in, doc_out, data); p.elabora(doc_in, doc_out, data);
doc_in.rewrite(); doc_in.rewrite();
doc_out.write(); doc_out.write();
doc_in.destroy(-1); doc_in.destroy(-1);
doc_out.destroy(-1); doc_out.destroy(-1);
doc_in.add(srcdoc); doc_in.add(srcdoc);
o.elabora(doc_in, doc_out, data); a.elabora(doc_in, doc_out, data);
doc_in.rewrite(); doc_in.rewrite();
doc_out.write(); doc_out.write();
} }

View File

@ -142,4 +142,12 @@ END
ENDPAGE ENDPAGE
TOOLBAR "" 0 -2 0 2
STRING DLG_PROFILE 50
BEGIN
PROMPT 9 -11 "Profilo "
PSELECT
END
ENDMASK ENDMASK

View File

@ -592,13 +592,16 @@ bool TCopia_documento::elabora(TLista_documenti& doc_in, TLista_documenti& doc_o
const TDocumento& doc_src = doc_in[d]; const TDocumento& doc_src = doc_in[d];
if (doc_out.items() <= d) if (doc_out.items() <= d)
{ {
doc_out.add(new TDocumento('D', doc_src.get_int(DOC_ANNO), codice_numerazione_finale(), 0L)); const TString4 codnum = codice_numerazione_finale();
doc_out[d].put(DOC_TIPODOC, tipo_finale()); doc_out.add(new TDocumento('D', doc_src.get_int(DOC_ANNO), codnum, 0L));
doc_out[d].put(DOC_STATO, stato_finale());
} }
TDocumento& doc_dest = doc_out[d]; TDocumento& doc_dest = doc_out[d];
doc_dest.copy_contents(doc_src); doc_dest.copy_contents(doc_src);
const TString4 tipodoc = tipo_finale();
doc_dest.put(DOC_TIPODOC, tipodoc);
const TString4 stato = stato_finale();
doc_dest.put(DOC_STATO, stato);
// Scancello tutti gli inutili riferimenti al documento origine // Scancello tutti gli inutili riferimenti al documento origine
if (!_preserve_original_rif) if (!_preserve_original_rif)