Patch level : 10.0
Files correlati : pd0610 pd0610a.msk Ricompilazione Demo : [ ] Commento : Aggiunti i campi listino e contatto fornitore Aggiunto in chiave l'indirizzo di spedizione git-svn-id: svn://10.65.10.50/branches/R_10_00@22082 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c7ff726bc6
commit
41171bd6eb
@ -26,6 +26,7 @@ public:
|
|||||||
void TTabmod_caf_msk::riempi_sheet()
|
void TTabmod_caf_msk::riempi_sheet()
|
||||||
{
|
{
|
||||||
const long cliente = get_long(F_CLIENTE);
|
const long cliente = get_long(F_CLIENTE);
|
||||||
|
const int indsp = get_int(F_INDSPED);
|
||||||
TSheet_field& sheet = sfield(F_SHEET);
|
TSheet_field& sheet = sfield(F_SHEET);
|
||||||
sheet.destroy();
|
sheet.destroy();
|
||||||
if (cliente <= 0)
|
if (cliente <= 0)
|
||||||
@ -33,28 +34,39 @@ void TTabmod_caf_msk::riempi_sheet()
|
|||||||
sheet.force_update();
|
sheet.force_update();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TString8 codcli;
|
TString8 codcf; codcf.format("%06ld", cliente);
|
||||||
codcli.format("%06ld", cliente);
|
TString4 indsped; indsped.format("%03d", indsp);
|
||||||
|
TString16 key; key << codcf << indsped;
|
||||||
TString query;
|
TString query;
|
||||||
query << "USE &CAF\n"
|
query << "USE &CAF\n"
|
||||||
<< "FROM CODTAB=\"" << codcli << "\"\n"
|
<< "FROM CODTAB=\"" << key << "\"\n"
|
||||||
<< "TO CODTAB=\"" << codcli << "\"";
|
<< "TO CODTAB=\"" << key << "\"";
|
||||||
TISAM_recordset caf_query(query);
|
TISAM_recordset caf_query(query);
|
||||||
for (bool ok = caf_query.move_first(); ok; ok = caf_query.move_next())
|
for (bool ok = caf_query.move_first(); ok; ok = caf_query.move_next())
|
||||||
{
|
{
|
||||||
const TRectype& caf = caf_query.cursor()->curr();
|
const TRectype& caf = caf_query.cursor()->curr();
|
||||||
const TString80 codtab = caf.get("CODTAB");
|
const TString80 codtab = caf.get("CODTAB");
|
||||||
const TString8 forn1 = caf.get("I0");
|
const TString8 forn1 = caf.get("I0");
|
||||||
const TString8 forn2 = caf.get("I1");
|
const TString4 lis1 = caf.get("S4");
|
||||||
|
const TString4 con1 = caf.get("S5");
|
||||||
|
const TString8 forn2 = caf.get("I1");
|
||||||
|
const TString4 lis2 = caf.get("S6");
|
||||||
|
const TString4 con2 = caf.get("S7");
|
||||||
|
|
||||||
TToken_string& row = sheet.row(-1);
|
TToken_string& row = sheet.row(-1);
|
||||||
row.add(codtab.left(6), sheet.cid2index(S_CLIENTE));
|
row.add(codtab.left(6), sheet.cid2index(S_CLIENTE));
|
||||||
row.add(codtab.mid(6), sheet.cid2index(S_ARTICOLO));
|
row.add(codtab.mid(6, 3), sheet.cid2index(S_INDSPED));
|
||||||
row.add(forn1, sheet.cid2index(S_FORN1));
|
row.add(codtab.mid(9), sheet.cid2index(S_ARTICOLO));
|
||||||
row.add(forn2, sheet.cid2index(S_FORN2));
|
row.add(forn1, sheet.cid2index(S_FORN1));
|
||||||
|
row.add(lis1, sheet.cid2index(S_LIS1));
|
||||||
|
row.add(con1, sheet.cid2index(S_CON1));
|
||||||
|
row.add(forn2, sheet.cid2index(S_FORN2));
|
||||||
|
row.add(lis2, sheet.cid2index(S_LIS2));
|
||||||
|
row.add(con2, sheet.cid2index(S_CON2));
|
||||||
|
|
||||||
sheet.disable_cell(sheet.items()-1 , sheet.cid2index(S_ARTICOLO));
|
sheet.disable_cell(sheet.items()-1 , sheet.cid2index(S_ARTICOLO));
|
||||||
sheet.disable_cell(sheet.items()-1 , sheet.cid2index(S_DESART));
|
sheet.disable_cell(sheet.items()-1 , sheet.cid2index(S_DESART));
|
||||||
sheet.check_row(sheet.items()-1);
|
sheet.check_row(sheet.items()-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
sheet.force_update();
|
sheet.force_update();
|
||||||
}
|
}
|
||||||
@ -62,6 +74,7 @@ void TTabmod_caf_msk::riempi_sheet()
|
|||||||
void TTabmod_caf_msk::aggiungi_riga()
|
void TTabmod_caf_msk::aggiungi_riga()
|
||||||
{
|
{
|
||||||
const TString8 cliente = get(F_CLIENTE);
|
const TString8 cliente = get(F_CLIENTE);
|
||||||
|
const TString4 indsped = get(F_INDSPED);
|
||||||
if (cliente.empty())
|
if (cliente.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -69,6 +82,8 @@ void TTabmod_caf_msk::aggiungi_riga()
|
|||||||
TToken_string& row = sheet.row(-1);
|
TToken_string& row = sheet.row(-1);
|
||||||
|
|
||||||
row.add(cliente, sheet.cid2index(S_CLIENTE));
|
row.add(cliente, sheet.cid2index(S_CLIENTE));
|
||||||
|
row.add(indsped, sheet.cid2index(S_INDSPED));
|
||||||
|
|
||||||
sheet.enable_cell(sheet.items() - 1, sheet.cid2index(S_ARTICOLO));
|
sheet.enable_cell(sheet.items() - 1, sheet.cid2index(S_ARTICOLO));
|
||||||
sheet.enable_cell(sheet.items() - 1, sheet.cid2index(S_DESART));
|
sheet.enable_cell(sheet.items() - 1, sheet.cid2index(S_DESART));
|
||||||
sheet.force_update();
|
sheet.force_update();
|
||||||
@ -83,17 +98,29 @@ void TTabmod_caf_msk::registra()
|
|||||||
{
|
{
|
||||||
caf.zero();
|
caf.zero();
|
||||||
TToken_string& row = *(TToken_string*)riga;
|
TToken_string& row = *(TToken_string*)riga;
|
||||||
|
TString8 codcf; codcf.format("%06d", row.get_long(sheet.cid2index(S_CLIENTE)));
|
||||||
|
TString4 indsped; indsped.format("%03d", row.get_int(sheet.cid2index(S_INDSPED)));
|
||||||
TString80 codtab;
|
TString80 codtab;
|
||||||
codtab << row.get(sheet.cid2index(S_CLIENTE));
|
codtab << codcf;
|
||||||
|
codtab << indsped;
|
||||||
codtab << row.get(sheet.cid2index(S_ARTICOLO));
|
codtab << row.get(sheet.cid2index(S_ARTICOLO));
|
||||||
|
|
||||||
const long forn1 = row.get_long(sheet.cid2index(S_FORN1));
|
const long forn1 = row.get_long(sheet.cid2index(S_FORN1));
|
||||||
const long forn2 = row.get_long(sheet.cid2index(S_FORN2));
|
const long forn2 = row.get_long(sheet.cid2index(S_FORN2));
|
||||||
|
const TString4 list1 = row.get(sheet.cid2index(S_LIS1));
|
||||||
|
const TString4 list2 = row.get(sheet.cid2index(S_LIS2));
|
||||||
|
const TString4 cont1 = row.get(sheet.cid2index(S_CON1));
|
||||||
|
const TString4 cont2 = row.get(sheet.cid2index(S_CON2));
|
||||||
|
|
||||||
caf.put("CODTAB", codtab);
|
caf.put("CODTAB", codtab);
|
||||||
if (forn1 > 0 || forn2 > 0)
|
if (forn1 > 0 || forn2 > 0)
|
||||||
{
|
{
|
||||||
caf.put("I0", forn1);
|
caf.put("S4", list1);
|
||||||
caf.put("I1", forn2);
|
caf.put("S5", cont1);
|
||||||
|
caf.put("S6", list2);
|
||||||
|
caf.put("S7", cont2);
|
||||||
|
caf.put("I0", forn1);
|
||||||
|
caf.put("I1", forn2);
|
||||||
caf.rewrite_write();
|
caf.rewrite_write();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -111,6 +138,7 @@ bool TTabmod_caf_msk::on_field_event(TOperable_field& o, TField_event e, long jo
|
|||||||
{
|
{
|
||||||
reset(F_CLIENTE);
|
reset(F_CLIENTE);
|
||||||
reset(F_RAGSOC);
|
reset(F_RAGSOC);
|
||||||
|
reset(F_INDSPED);
|
||||||
sfield(F_SHEET).destroy();
|
sfield(F_SHEET).destroy();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -131,6 +159,7 @@ bool TTabmod_caf_msk::on_field_event(TOperable_field& o, TField_event e, long jo
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case F_CLIENTE:
|
case F_CLIENTE:
|
||||||
|
case F_INDSPED:
|
||||||
if(e == fe_modify)
|
if(e == fe_modify)
|
||||||
riempi_sheet();
|
riempi_sheet();
|
||||||
break;
|
break;
|
||||||
|
@ -1,12 +1,22 @@
|
|||||||
//Definizione campi per maschera pd0610100a
|
//Definizione campi per maschera pd0610100a
|
||||||
#define F_CLIENTE 201
|
#define F_CLIENTE 201
|
||||||
#define F_RAGSOC 202
|
#define F_RAGSOC 202
|
||||||
#define F_SHEET 203
|
#define F_INDSPED 203
|
||||||
|
#define F_SHEET 204
|
||||||
|
|
||||||
#define S_CLIENTE 101
|
#define S_CLIENTE 101
|
||||||
#define S_ARTICOLO 102
|
#define S_INDSPED 102
|
||||||
#define S_DESART 103
|
#define S_ARTICOLO 103
|
||||||
#define S_FORN1 104
|
#define S_DESART 104
|
||||||
#define S_RAGSOC1 105
|
#define S_FORN1 105
|
||||||
#define S_FORN2 106
|
#define S_RAGSOC1 106
|
||||||
#define S_RAGSOC2 107
|
#define S_LIS1 107
|
||||||
|
#define S_DESLIS1 996
|
||||||
|
#define S_CON1 108
|
||||||
|
#define S_DESCON1 997
|
||||||
|
#define S_FORN2 109
|
||||||
|
#define S_RAGSOC2 110
|
||||||
|
#define S_LIS2 111
|
||||||
|
#define S_DESLIS2 998
|
||||||
|
#define S_CON2 112
|
||||||
|
#define S_DESCON2 999
|
@ -45,16 +45,34 @@ BEGIN
|
|||||||
CHECKTYPE REQUIRED
|
CHECKTYPE REQUIRED
|
||||||
END
|
END
|
||||||
|
|
||||||
SPREADSHEET F_SHEET 80 10
|
NUMBER F_INDSPED 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Articoli/Fornitori"
|
PROMPT 2 2 "Indirizzo di spedizione"
|
||||||
|
USE LF_INDSP
|
||||||
|
INPUT TIPOCF "C" SELECT
|
||||||
|
INPUT CODCF F_CLIENTE SELECT
|
||||||
|
DISPLAY "Codice" CODIND
|
||||||
|
DISPLAY "Indirizzo" INDIR
|
||||||
|
DISPLAY "CAP" CAP
|
||||||
|
DISPLAY "Località" LOCALITA
|
||||||
|
OUTPUT F_INDSPED CODIND
|
||||||
|
END
|
||||||
|
|
||||||
|
SPREADSHEET F_SHEET
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Articoli/Fornitori"
|
||||||
ITEM "Cliente@6"
|
ITEM "Cliente@6"
|
||||||
|
ITEM "Ind. Sped."
|
||||||
ITEM "Cod.articolo@20"
|
ITEM "Cod.articolo@20"
|
||||||
ITEM "Descrizione@45"
|
ITEM "Descrizione@45"
|
||||||
ITEM "Fornitore 1"
|
ITEM "Fornitore 1"
|
||||||
ITEM "Ragione sociale@45"
|
ITEM "Ragione sociale@45"
|
||||||
|
ITEM "Listino 1"
|
||||||
|
ITEM "Contratto 1"
|
||||||
ITEM "Fornitore 2"
|
ITEM "Fornitore 2"
|
||||||
ITEM "Ragione sociale@45"
|
ITEM "Ragione sociale@45"
|
||||||
|
ITEM "Listino 2"
|
||||||
|
ITEM "Contratto 2"
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
@ -65,13 +83,19 @@ PAGE "Articoli/Fornitori" -1 -1 80 18
|
|||||||
|
|
||||||
NUMBER S_CLIENTE 6
|
NUMBER S_CLIENTE 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 ""
|
PROMPT 2 2 "Codice Cliente "
|
||||||
FLAGS "ZD"
|
FLAGS "ZD"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
NUMBER S_INDSPED 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 2 "Indirizzo di spedizione "
|
||||||
|
FLAGS "ZD"
|
||||||
|
END
|
||||||
|
|
||||||
STRING S_ARTICOLO 20
|
STRING S_ARTICOLO 20
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 3 "Cod. art. "
|
PROMPT 2 4 "Cod. art. "
|
||||||
FLAG "UG"
|
FLAG "UG"
|
||||||
USE LF_ANAMAG
|
USE LF_ANAMAG
|
||||||
INPUT CODART S_ARTICOLO
|
INPUT CODART S_ARTICOLO
|
||||||
@ -84,7 +108,7 @@ END
|
|||||||
|
|
||||||
STRING S_DESART 50 45
|
STRING S_DESART 50 45
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Des. art. "
|
PROMPT 2 5 "Des. art. "
|
||||||
USE LF_ANAMAG KEY 2
|
USE LF_ANAMAG KEY 2
|
||||||
INPUT DESCR S_DESART
|
INPUT DESCR S_DESART
|
||||||
DISPLAY "Descrizione@45" DESCR
|
DISPLAY "Descrizione@45" DESCR
|
||||||
@ -95,7 +119,7 @@ END
|
|||||||
|
|
||||||
NUMBER S_FORN1 6
|
NUMBER S_FORN1 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Fornit. 1 "
|
PROMPT 2 6 "Fornit. 1 "
|
||||||
USE LF_CLIFO
|
USE LF_CLIFO
|
||||||
INPUT TIPOCF "F" SELECT
|
INPUT TIPOCF "F" SELECT
|
||||||
INPUT CODCF S_FORN1
|
INPUT CODCF S_FORN1
|
||||||
@ -108,7 +132,7 @@ END
|
|||||||
|
|
||||||
STRING S_RAGSOC1 50 45
|
STRING S_RAGSOC1 50 45
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 25 5 ""
|
PROMPT 25 6 ""
|
||||||
USE LF_CLIFO KEY 2
|
USE LF_CLIFO KEY 2
|
||||||
INPUT TIPOCF "F" SELECT
|
INPUT TIPOCF "F" SELECT
|
||||||
INPUT RAGSOC S_RAGSOC1
|
INPUT RAGSOC S_RAGSOC1
|
||||||
@ -118,9 +142,52 @@ BEGIN
|
|||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING S_LIS1 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 7 "Listino 1 "
|
||||||
|
USE LF_CONDV
|
||||||
|
INPUT TIPO "L"
|
||||||
|
INPUT CATVEN ""
|
||||||
|
INPUT COD S_LIS1
|
||||||
|
DISPLAY "Codice" COD
|
||||||
|
DISPLAY "Descrizione@50" DESCR
|
||||||
|
OUTPUT S_LIS1 COD
|
||||||
|
OUTPUT S_DESLIS1 DESCR
|
||||||
|
FLAGS "U"
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_DESLIS1 45
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 7 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_CON1 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 18 8 "Contratto 1 "
|
||||||
|
USE LF_CONDV
|
||||||
|
INPUT TIPO "C"
|
||||||
|
INPUT TIPOCF "F"
|
||||||
|
INPUT CODCF S_FORN1 SELECT
|
||||||
|
INPUT COD S_CON1
|
||||||
|
DISPLAY "Tipo" TIPOCF
|
||||||
|
DISPLAY "Forn" CODCF
|
||||||
|
DISPLAY "Codice" COD
|
||||||
|
DISPLAY "Descrizione@35" DESCR
|
||||||
|
OUTPUT S_CON1 COD
|
||||||
|
OUTPUT S_DESCON1 DESCR
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_DESCON1 45
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 8 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
NUMBER S_FORN2 6
|
NUMBER S_FORN2 6
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 6 "Fornit. 2 "
|
PROMPT 2 9 "Fornit. 2 "
|
||||||
USE LF_CLIFO
|
USE LF_CLIFO
|
||||||
INPUT TIPOCF "F" SELECT
|
INPUT TIPOCF "F" SELECT
|
||||||
INPUT CODCF S_FORN2
|
INPUT CODCF S_FORN2
|
||||||
@ -133,7 +200,7 @@ END
|
|||||||
|
|
||||||
STRING S_RAGSOC2 50 45
|
STRING S_RAGSOC2 50 45
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 25 6 ""
|
PROMPT 25 9 ""
|
||||||
USE LF_CLIFO KEY 2
|
USE LF_CLIFO KEY 2
|
||||||
INPUT TIPOCF "F" SELECT
|
INPUT TIPOCF "F" SELECT
|
||||||
INPUT RAGSOC S_RAGSOC2
|
INPUT RAGSOC S_RAGSOC2
|
||||||
@ -143,6 +210,49 @@ BEGIN
|
|||||||
CHECKTYPE NORMAL
|
CHECKTYPE NORMAL
|
||||||
END
|
END
|
||||||
|
|
||||||
|
STRING S_LIS2 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 10 "Listino 1 "
|
||||||
|
USE LF_CONDV
|
||||||
|
INPUT TIPO "L"
|
||||||
|
INPUT CATVEN ""
|
||||||
|
INPUT COD S_LIS2
|
||||||
|
DISPLAY "Codice" COD
|
||||||
|
DISPLAY "Descrizione@50" DESCR
|
||||||
|
OUTPUT S_LIS2 COD
|
||||||
|
OUTPUT S_DESLIS2 DESCR
|
||||||
|
FLAGS "U"
|
||||||
|
CHECKTYPE NORMAL
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_DESLIS2 45
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 10 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_CON2 3
|
||||||
|
BEGIN
|
||||||
|
PROMPT 18 11 "Contratto 1 "
|
||||||
|
USE LF_CONDV
|
||||||
|
INPUT TIPO "C"
|
||||||
|
INPUT TIPOCF "F"
|
||||||
|
INPUT CODCF S_FORN1 SELECT
|
||||||
|
INPUT COD S_CON2
|
||||||
|
DISPLAY "Tipo" TIPOCF
|
||||||
|
DISPLAY "Forn" CODCF
|
||||||
|
DISPLAY "Codice" COD
|
||||||
|
DISPLAY "Descrizione@35" DESCR
|
||||||
|
OUTPUT S_CON2 COD
|
||||||
|
OUTPUT S_DESCON2 DESCR
|
||||||
|
END
|
||||||
|
|
||||||
|
STRING S_DESCON2 45
|
||||||
|
BEGIN
|
||||||
|
PROMPT 25 11 ""
|
||||||
|
FLAGS "D"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
TOOLBAR "" 0 0 0 2
|
TOOLBAR "" 0 0 0 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user