Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/branches/R_10_00@21965 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1a9b29646a
commit
1093d0f3b0
@ -147,14 +147,21 @@ void TInserimento_storico::elabora(const TMask& mask)
|
||||
const long doc_ndoc = rdoc_recset.get(RDOC_NDOC).as_int();
|
||||
const TString& codart = rdoc_recset.get(RDOC_CODART).as_string();
|
||||
const TString& matricola = rdoc_recset.get(RDOC_LIVELLO).as_string();
|
||||
TString80 codtab;
|
||||
codtab.format("%-15s%-15s", (const char*)codart, (const char*)matricola);
|
||||
TModule_table tab_att("&ATT");
|
||||
const int err = tab_att.read();
|
||||
//se l'attrezzatura (intesa come codart+matricola) non esiste -> la deve aggiungere
|
||||
if (err != NOERR)
|
||||
tab_att.put("CODTAB", codtab);
|
||||
TString80 str_s0;
|
||||
str_s0.format("%-5s%-15s", (const char*)codart, (const char*)matricola);
|
||||
|
||||
TString80 codtab;
|
||||
TModule_table tab_att("&ATT");
|
||||
tab_att.setkey(2);
|
||||
tab_att.put("S0", str_s0);
|
||||
const int err = tab_att.read();
|
||||
//se l'attrezzatura (intesa come codart+matricola) non esiste -> la deve aggiungere (sara' sicuramente la prima..
|
||||
//..per quanto riguarda il progressivo)
|
||||
if (err != NOERR)
|
||||
{
|
||||
codtab.format("%-5s%07d", (const char*)codart, 1);
|
||||
tab_att.put("CODTAB", codtab);
|
||||
}
|
||||
//comunque deve scrivere il cliente e la data perchè è un'apertura quindi la macchina è assegnata..
|
||||
//..al cliente con questo documento
|
||||
const long doc_clifo = rdoc_recset.get("33.CODCF").as_int();
|
||||
@ -178,6 +185,7 @@ void TInserimento_storico::elabora(const TMask& mask)
|
||||
query_his << "\nFROM CODTAB=#CODTAB";
|
||||
query_his << "\nTO CODTAB=#CODTAB";
|
||||
TISAM_recordset recset_his(query_his);
|
||||
codtab = tab_att.get("CODTAB"); //il codtab va preso se per caso la macchina non fosse nuova (pressoche' impossibile, ma insomma..)
|
||||
recset_his.set_var("#CODTAB", codtab);
|
||||
|
||||
const long recset_his_items = recset_his.items();
|
||||
@ -209,7 +217,7 @@ void TInserimento_storico::elabora(const TMask& mask)
|
||||
curr_ndoc = recset_his.get("S5[9,15]").as_int();
|
||||
if (curr_ndoc == doc_ndoc)
|
||||
{
|
||||
n_line_to_update = recset_his.get("CODTAB[31,35]").as_int();
|
||||
n_line_to_update = recset_his.get("CODTAB[21,25]").as_int();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -221,14 +229,13 @@ void TInserimento_storico::elabora(const TMask& mask)
|
||||
|
||||
//adesso ha il numero di riga da aggiornare
|
||||
TString80 new_codtab;
|
||||
new_codtab.format("%30s%05d", (const char*) codtab, n_line_to_update);
|
||||
new_codtab.format("%20s%05d", (const char*)codtab, n_line_to_update);
|
||||
tab_his.put("CODTAB", new_codtab);
|
||||
//ed aggiunge tutti i campi
|
||||
const TString& descr = rdoc_recset.get(RDOC_DESCR).as_string();
|
||||
tab_his.put("S0", descr);
|
||||
//tab_his.put("S2", articolo_collegato);
|
||||
const TString& codmag = rdoc_recset.get(RDOC_CODMAG).as_string();
|
||||
tab_his.put("S3", codmag);
|
||||
//tab_his.put("S3", articolo_collegato);
|
||||
|
||||
TString16 str_key_doc;
|
||||
str_key_doc.format("%4d%4s%7d", doc_anno, (const char*)doc_codnum, doc_ndoc);
|
||||
if (bopen)
|
||||
@ -236,7 +243,10 @@ void TInserimento_storico::elabora(const TMask& mask)
|
||||
else
|
||||
tab_his.put("S5", str_key_doc);
|
||||
tab_his.put("S6", rdoc_recset.get(RDOC_UMQTA).as_string());
|
||||
tab_his.put("S7", "C");
|
||||
const TString& codmag = rdoc_recset.get(RDOC_CODMAG).as_string();
|
||||
TString4 s7; //s7[1,1]=tipo s7[2,4]=codmag
|
||||
s7 << "C" << codmag;
|
||||
tab_his.put("S7", s7);
|
||||
tab_his.put("I0", doc_clifo);
|
||||
tab_his.put("D0", doc_datadoc);
|
||||
const real qta = rdoc_recset.get(RDOC_QTA).as_real();
|
||||
@ -244,6 +254,9 @@ void TInserimento_storico::elabora(const TMask& mask)
|
||||
const real prezzo = rdoc_recset.get(RDOC_PREZZO).as_real();
|
||||
const real importo = qta * prezzo;
|
||||
tab_his.put("R1", importo);
|
||||
//se è il documento di chiusura fa segnalato
|
||||
if (!bopen)
|
||||
tab_his.put("B0", true);
|
||||
|
||||
const int written = tab_his.write_rewrite();
|
||||
//segna sul log la riga aggiunta alla tabella storico &HIS
|
||||
|
Loading…
x
Reference in New Issue
Block a user