Patch level : 10.0 patch 643
Files correlati : lv3 Ricompilazione Demo : [ ] Commento : Modificata la gestione delle righe spezzate e del salvataggio delle righe documento in modo che le informazioni sulle righe originali non vadano perse git-svn-id: svn://10.65.10.50/trunk@20131 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ffba90fcc7
commit
a7c4e187c1
@ -293,6 +293,7 @@ void TEvasione_msk::carica_righe()
|
|||||||
riga.add(rdoc.cong_pre(), sheet.cid2index(S_CONGPRE));
|
riga.add(rdoc.cong_pre(), sheet.cid2index(S_CONGPRE));
|
||||||
riga.add(rdoc.cong_att(), sheet.cid2index(S_CONGATT));
|
riga.add(rdoc.cong_att(), sheet.cid2index(S_CONGATT));
|
||||||
riga.add(rdoc.rifbcon(), sheet.cid2index(S_RIFBCON));
|
riga.add(rdoc.rifbcon(), sheet.cid2index(S_RIFBCON));
|
||||||
|
riga.add(row.get(RDOC_IDRIGA), sheet.cid2index(S_NROW));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rdoc.set_evaso(true);
|
rdoc.set_evaso(true);
|
||||||
@ -534,6 +535,8 @@ void TEvasione_msk::genera_documento()
|
|||||||
const TString4 um = cache().get(LF_UMART, key, UMART_UM);
|
const TString4 um = cache().get(LF_UMART, key, UMART_UM);
|
||||||
|
|
||||||
TRiga_documento& rdoc = doc.new_row("21");
|
TRiga_documento& rdoc = doc.new_row("21");
|
||||||
|
|
||||||
|
TDocumento::copy_data(rdoc, row);
|
||||||
rdoc.put(RDOC_CODART, codart);
|
rdoc.put(RDOC_CODART, codart);
|
||||||
rdoc.put(RDOC_CODARTMAG,codart);
|
rdoc.put(RDOC_CODARTMAG,codart);
|
||||||
rdoc.put(RDOC_CHECKED,'X');
|
rdoc.put(RDOC_CHECKED,'X');
|
||||||
@ -711,12 +714,16 @@ void TEvasione_msk::spezza_riga()
|
|||||||
TToken_string& riga2 = sheet.row(-1);
|
TToken_string& riga2 = sheet.row(-1);
|
||||||
riga2 = *riga1;
|
riga2 = *riga1;
|
||||||
|
|
||||||
|
int idriga2 = riga2.get_int(sheet.cid2index(S_NROW));
|
||||||
|
idriga2 *= -1;
|
||||||
|
|
||||||
//scrivi le quantità sulla seconda riga
|
//scrivi le quantità sulla seconda riga
|
||||||
const int dacons2 = arrotonda(riga2.get_int(sheet.cid2index(S_RITIRATO)) - riga2.get_int(sheet.cid2index(S_CONSEGNATO)));
|
const int dacons2 = arrotonda(riga2.get_int(sheet.cid2index(S_RITIRATO)) - riga2.get_int(sheet.cid2index(S_CONSEGNATO)));
|
||||||
riga2.add(dacons2, sheet.cid2index(S_RITIRATO));
|
riga2.add(dacons2, sheet.cid2index(S_RITIRATO));
|
||||||
riga2.add(dacons2, sheet.cid2index(S_DACONS));
|
riga2.add(dacons2, sheet.cid2index(S_DACONS));
|
||||||
riga2.add(0L, sheet.cid2index(S_CONSEGNATO));
|
riga2.add(0L, sheet.cid2index(S_CONSEGNATO));
|
||||||
riga2.add(0L, sheet.cid2index(S_PACCHI));
|
riga2.add(0L, sheet.cid2index(S_PACCHI));
|
||||||
|
riga2.add(idriga2, sheet.cid2index(S_NROW));
|
||||||
|
|
||||||
//scrivi le quantità sulla prima riga
|
//scrivi le quantità sulla prima riga
|
||||||
const int dacons1 = riga1->get_int(sheet.cid2index(S_RITIRATO)) - riga1->get_int(sheet.cid2index(S_CONSEGNATO));
|
const int dacons1 = riga1->get_int(sheet.cid2index(S_RITIRATO)) - riga1->get_int(sheet.cid2index(S_CONSEGNATO));
|
||||||
@ -741,18 +748,6 @@ void TEvasione_msk::salva()
|
|||||||
|
|
||||||
TLaundry_contract cont(get_long(F_CODCF), get_long(F_CODCONT));
|
TLaundry_contract cont(get_long(F_CODCF), get_long(F_CODCONT));
|
||||||
|
|
||||||
//nel caso avessi spezzato le righe, risrcivendole da capo mi vengono ordinate per codice
|
|
||||||
//ATTENZIONE: devo eliminare le sole righe che sono sullo sheet, cioè quelle che hanno
|
|
||||||
//quantità da consegnare maggiore di zero
|
|
||||||
for (int i = doc.rows(); i > 0; i--)
|
|
||||||
{
|
|
||||||
TRiga_documento& row = doc[i];
|
|
||||||
TBuono_prelievo_row rdoc(row);
|
|
||||||
|
|
||||||
if (rdoc.qta_dacons() > 0)
|
|
||||||
doc.destroy_row(i, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
TSheet_field& sheet = sfield(F_RIGHE);
|
TSheet_field& sheet = sfield(F_RIGHE);
|
||||||
//riordino lo sheet
|
//riordino lo sheet
|
||||||
sheet.sort(sort_by_codart);
|
sheet.sort(sort_by_codart);
|
||||||
@ -760,9 +755,18 @@ void TEvasione_msk::salva()
|
|||||||
|
|
||||||
//per ogni riga dello sheet genero una riga documento
|
//per ogni riga dello sheet genero una riga documento
|
||||||
FOR_EACH_SHEET_ROW(sheet, r, riga)
|
FOR_EACH_SHEET_ROW(sheet, r, riga)
|
||||||
|
{
|
||||||
|
const int rowid = riga->get_int(sheet.cid2index(S_NROW));
|
||||||
|
const TRiga_documento* riori = doc.get_row_id(abs(rowid));
|
||||||
|
int nriga = riori ? riori->get_int(RDOC_NRIGA) : -1;
|
||||||
|
if (rowid < 0)
|
||||||
{
|
{
|
||||||
TRiga_documento& row = doc.new_row("24");
|
TRiga_documento& row = doc.new_row("24");
|
||||||
TBuono_prelievo_row rdoc(row);
|
if (riori != NULL)
|
||||||
|
TDocumento::copy_data(row, *riori);
|
||||||
|
nriga = row.get_int(RDOC_NRIGA);
|
||||||
|
}
|
||||||
|
TBuono_prelievo_row rdoc(doc[nriga]);
|
||||||
|
|
||||||
const char flgev = riga->get(sheet.cid2index(S_EVASO))[0];
|
const char flgev = riga->get(sheet.cid2index(S_EVASO))[0];
|
||||||
bool flag;
|
bool flag;
|
||||||
@ -816,6 +820,7 @@ void TEvasione_msk::salva()
|
|||||||
rdoc.set_mag(magazzino);
|
rdoc.set_mag(magazzino);
|
||||||
rdoc.set_magc(magazzinoc);
|
rdoc.set_magc(magazzinoc);
|
||||||
}
|
}
|
||||||
|
doc.sort_rows(RDOC_CODART "|" RDOC_QTA);
|
||||||
doc.rewrite();
|
doc.rewrite();
|
||||||
|
|
||||||
//se sto evadendo tramite barcode quando salvo salvo anche tutti i pacchi associati
|
//se sto evadendo tramite barcode quando salvo salvo anche tutti i pacchi associati
|
||||||
|
@ -31,4 +31,4 @@
|
|||||||
#define S_CONGPRE 109
|
#define S_CONGPRE 109
|
||||||
#define S_CONGATT 110
|
#define S_CONGATT 110
|
||||||
#define S_RIFBCON 111
|
#define S_RIFBCON 111
|
||||||
#define S_RIFBRIT 112
|
#define S_NROW 112
|
||||||
|
@ -211,6 +211,7 @@ BEGIN
|
|||||||
ITEM "Cong.\nPrec."
|
ITEM "Cong.\nPrec."
|
||||||
ITEM "Cong.\nAtt."
|
ITEM "Cong.\nAtt."
|
||||||
ITEM "Riferimenti\nbuoni cons."
|
ITEM "Riferimenti\nbuoni cons."
|
||||||
|
ITEM "ID\nriga"
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
@ -321,5 +322,11 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER S_NROW 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "ID riga "
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
ENDMASK
|
ENDMASK
|
@ -507,6 +507,8 @@ void TEvasione_ter_msk::genera_buono()
|
|||||||
|
|
||||||
//creo la nuova riga documento
|
//creo la nuova riga documento
|
||||||
TRiga_documento& rdoc = doc.new_row("21");
|
TRiga_documento& rdoc = doc.new_row("21");
|
||||||
|
|
||||||
|
TDocumento::copy_data(rdoc, row);
|
||||||
rdoc.put(RDOC_CODART, codart);
|
rdoc.put(RDOC_CODART, codart);
|
||||||
rdoc.put(RDOC_CODARTMAG,codart);
|
rdoc.put(RDOC_CODARTMAG,codart);
|
||||||
rdoc.put(RDOC_CHECKED,'X');
|
rdoc.put(RDOC_CHECKED,'X');
|
||||||
@ -717,7 +719,7 @@ void TEvasione_ter_msk::registra()
|
|||||||
TRiga_documento& row1 = doc[i];
|
TRiga_documento& row1 = doc[i];
|
||||||
TRiga_documento& row2 = doc.new_row("24");
|
TRiga_documento& row2 = doc.new_row("24");
|
||||||
|
|
||||||
row2 = row1;
|
TDocumento::copy_data(row2, row1);
|
||||||
TBuono_prelievo_row rdoc(row2);
|
TBuono_prelievo_row rdoc(row2);
|
||||||
|
|
||||||
//setto le quantità corrette
|
//setto le quantità corrette
|
||||||
|
Loading…
x
Reference in New Issue
Block a user