diff --git a/lv/f168.dir b/lv/f168.dir index 7ddacf60b..ca6d8f3b7 100755 --- a/lv/f168.dir +++ b/lv/f168.dir @@ -1,3 +1,3 @@ 168 0 -$lvcondv|||176|0|Tabella testate di contratto||| +$lvcondv|||184|0|Tabella testate di contratto||| diff --git a/lv/f168.trr b/lv/f168.trr index c079a8e3e..8e852d316 100755 --- a/lv/f168.trr +++ b/lv/f168.trr @@ -1,5 +1,5 @@ 168 -44 +46 CODCONT|3|6|0|Codice Contratto STATUS|1|2|0|Stato del contratto, chiuso, confermato, da confermare PROPOSTA|8|1|0|Proposta di contratto @@ -44,5 +44,7 @@ PERCTOLPES|4|6|2|Percentuale tolleranza peso teorico/effettivo RITAUDTTMP|8|1|0|Ritiro automatico dotazione temporanea DTFIXDDT|5|8|0|Data fissa per creazione DDT da sporco COMMENTI|11|10|0|Commenti e note +CODNUM|1|4|0|Codice numerazione Buono di Consegna +TPDOC|1|4|0|Tipo documento Buono di Consegna 1 CODCF+CODCONT| diff --git a/lv/lv0400.h b/lv/lv0400.h index d98ad5647..01c716b1e 100755 --- a/lv/lv0400.h +++ b/lv/lv0400.h @@ -44,6 +44,9 @@ #define F_RAGART 242 #define F_RIFTEST 243 #define F_NOLCICTE 246 +#define F_CODNUM 247 +#define F_TPDOC 248 +#define F_DESCR 249 // Campi del dettalio sotto lo spreadsheet diff --git a/lv/lv0400a.uml b/lv/lv0400a.uml index 8c2a92009..9ac780fd3 100755 --- a/lv/lv0400a.uml +++ b/lv/lv0400a.uml @@ -478,6 +478,41 @@ BEGIN WARNING "Inserire una data finale maggiore della data di inizio" END +STRING F_CODNUM 4 +BEGIN + PROMPT 2 14 "Buono di Consegna " + USE %NUM + INPUT CODTAB F_CODNUM + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_CODNUM CODTAB + FIELD CODNUM + FLAG "UPA" +END + +STRING F_TPDOC 4 +BEGIN + PROMPT 28 14 "" + USE %TIP + INPUT CODTAB F_TPDOC + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + OUTPUT F_TPDOC CODTAB + OUTPUT F_DESCR S0 + FIELD TPDOC + FLAG "UP" +END + +STRING F_DESCR 50 40 +BEGIN + PROMPT 36 14 "" + USE %TIP + INPUT CODTAB F_TPDOC + DISPLAY "Descrizione@50" S0 + DISPLAY "Codice" CODTAB + COPY OUTPUT F_TPDOC +END + LISTBOX F_TIPOIMB 1 8 BEGIN PROMPT 2 15 "Tipo imballo " diff --git a/lv/lv2400.cpp b/lv/lv2400.cpp index 2bef43cc2..e6b90a2f2 100755 --- a/lv/lv2400.cpp +++ b/lv/lv2400.cpp @@ -147,8 +147,20 @@ bool TGenera_documenti_app::crea_documento(const TISAM_recordset& plan, TLog_rep TString4 tpdoc; TString4 statoi; TString4 statof; - //se non trovo quale documento generare, evito il resto dell'elaborazione - if (!numerazione_ddt(codnum, tpdoc, statoi, statof)) + + //Cerco il tipo documento da generaresul contratto; se non lo trovo lo cerco in configurazione. + //Se non trovo quale documento generare, evito il resto dell'elaborazione + if(tcont.get(LVCONDV_CODNUM).full() && _buono == 'C') + { + codnum = tcont.get(LVCONDV_CODNUM); + tpdoc = tcont.get(LVCONDV_TPDOC); + + //instanzio una cache sulla tabella dei tipi documento (cerco lo stato iniziale) + const TString& s2 = cache().get("%TIP",tpdoc,"S2"); + statoi = s2.left(1); + statof = s2.mid(1,1); + } + else if (!numerazione_ddt(codnum, tpdoc, statoi, statof)) return NOERR; if(_ndoc == 0) diff --git a/lv/lv2900.cpp b/lv/lv2900.cpp index 35bccc60e..0deb34b07 100755 --- a/lv/lv2900.cpp +++ b/lv/lv2900.cpp @@ -98,8 +98,17 @@ TObject* TBuoni_cache::key2obj(const char* key) //reupero la cuasale di magazzino di testata const TString16 causmag = cache().get("%TIP", _tipodoc, "S9"); - doc = new TDocumento('D', datadoc.year(), _codnum, ++_ndoc); - doc->put(DOC_TIPODOC, _tipodoc); + if (cont.get(LVCONDV_CODNUM).empty()) + { + doc = new TDocumento('D', datadoc.year(), _codnum, ++_ndoc); + doc->put(DOC_TIPODOC, _tipodoc); + } + else + { + doc = new TDocumento('D', datadoc.year(), cont.get(LVCONDV_CODNUM), ++_ndoc); + doc->put(DOC_TIPODOC, cont.get(LVCONDV_TPDOC)); + } + doc->put(DOC_STATO, _stato); doc->put(DOC_DATADOC, datadoc); doc->put(DOC_TIPOCF, 'C'); diff --git a/lv/lv3200.cpp b/lv/lv3200.cpp index 2d85265c7..a6d260275 100755 --- a/lv/lv3200.cpp +++ b/lv/lv3200.cpp @@ -306,8 +306,18 @@ void TEvasione_msk::genera_documento() const bool prinbo = true; //sempre a true; verrą gestita a video in futuro (27/10/2009) //dati documento da generare - TString4 codnum = ini_get_string(CONFIG_DITTA, "lv", "NUM_GEN"); - TString4 tipodoc = ini_get_string(CONFIG_DITTA, "lv", "TIPODOC_GEN"); + TString4 codnum; + TString4 tipodoc; + if (cont.get(LVCONDV_CODNUM).empty()) + { + codnum = ini_get_string(CONFIG_DITTA, "lv", "NUM_GEN"); + tipodoc = ini_get_string(CONFIG_DITTA, "lv", "TIPODOC_GEN"); + } + else + { + codnum = cont.get(LVCONDV_CODNUM); + tipodoc = cont.get(LVCONDV_TPDOC); + } char stato = cache().get("%TIP", tipodoc, "S2").left(1)[0]; const TDate databpre = bpre.datadoc(); diff --git a/lv/lvcondv.h b/lv/lvcondv.h index 924e9a27b..d914eea68 100755 --- a/lv/lvcondv.h +++ b/lv/lvcondv.h @@ -46,6 +46,7 @@ #define LVCONDV_DTFIXDDT "DTFIXDDT" #define LVCONDV_PREZROT "PREZROT" #define LVCONDV_COMMENTI "COMMENTI" - +#define LVCONDV_CODNUM "CODNUM" +#define LVCONDV_TPDOC "TPDOC" #endif \ No newline at end of file