Correzione errori

Modifica gestione stati
Inserimento multiple_rectype


git-svn-id: svn://10.65.10.50/trunk@5072 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1997-08-18 16:06:51 +00:00
parent ea9a88fa7d
commit a6b425531e
13 changed files with 1028 additions and 578 deletions

View File

@ -60,23 +60,23 @@
#define F_STATOI_CANC_19 319
#define F_STATOI_CANC_20 320
#define F_STATOI_ST_1 301
#define F_STATOI_ST_2 302
#define F_STATOI_ST_3 303
#define F_STATOI_ST_4 304
#define F_STATOI_ST_5 305
#define F_STATOI_ST_6 306
#define F_STATOI_ST_7 307
#define F_STATOI_ST_8 308
#define F_STATOI_ST_9 309
#define F_STATOI_ST_10 310
#define F_STATOI_ST_11 311
#define F_STATOI_ST_12 312
#define F_STATOI_ST_13 313
#define F_STATOI_ST_14 314
#define F_STATOI_ST_15 315
#define F_STATOI_ST_16 316
#define F_STATOI_ST_17 317
#define F_STATOI_ST_18 318
#define F_STATOI_ST_19 319
#define F_STATOI_ST_20 320
#define F_STATOI_ST_1 401
#define F_STATOI_ST_2 402
#define F_STATOI_ST_3 403
#define F_STATOI_ST_4 404
#define F_STATOI_ST_5 405
#define F_STATOI_ST_6 406
#define F_STATOI_ST_7 407
#define F_STATOI_ST_8 408
#define F_STATOI_ST_9 409
#define F_STATOI_ST_10 410
#define F_STATOI_ST_11 411
#define F_STATOI_ST_12 412
#define F_STATOI_ST_13 413
#define F_STATOI_ST_14 414
#define F_STATOI_ST_15 415
#define F_STATOI_ST_16 416
#define F_STATOI_ST_17 417
#define F_STATOI_ST_18 418
#define F_STATOI_ST_19 419
#define F_STATOI_ST_20 420

View File

@ -191,6 +191,829 @@ END
ENDPAGE
PAGE "Stati validi" -1 -1 60 14
STRING F_STATOF_INS 1
BEGIN
PROMPT 2 1 "Stato finale dopo l'inserimento "
FIELD S2[1,1]
USE %STD
INPUT CODTAB F_STATOF_INS
DISPLAY "Stato" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_STATOF_INS CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
GROUPBOX DLG_NULL 75 6
BEGIN
PROMPT 1 2 "Stati iniziali validi per la modifica"
END
STRING F_STATOI_MOD_1 1
BEGIN
PROMPT 2 3 "1 "
FIELD S2[10,10]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_1
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_1 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_2 1
BEGIN
PROMPT 17 3 "2 "
FIELD S2[11,11]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_2
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_2 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_3 1
BEGIN
PROMPT 32 3 "3 "
FIELD S2[12,12]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_3
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_3 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_4 1
BEGIN
PROMPT 47 3 "4 "
FIELD S2[13,13]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_4
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_4 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_5 1
BEGIN
PROMPT 62 3 "5 "
FIELD S2[14,14]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_5
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_5 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_6 1
BEGIN
PROMPT 2 4 "6 "
FIELD S2[15,15]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_6
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_6 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_7 1
BEGIN
PROMPT 17 4 "7 "
FIELD S2[16,16]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_7
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_7 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_8 1
BEGIN
PROMPT 32 4 "8 "
FIELD S2[17,17]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_8
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_8 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_9 1
BEGIN
PROMPT 47 4 "9 "
FIELD S2[18,18]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_9
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_9 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_10 1
BEGIN
PROMPT 62 4 "10 "
FIELD S2[19,19]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_10
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_10 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_11 1
BEGIN
PROMPT 2 5 "11 "
FIELD S2[20,20]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_11
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_11 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_12 1
BEGIN
PROMPT 17 5 "12 "
FIELD S2[21,21]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_12
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_12 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_13 1
BEGIN
PROMPT 32 5 "13 "
FIELD S2[22,22]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_13
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_13 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_14 1
BEGIN
PROMPT 47 5 "14 "
FIELD S2[23,23]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_14
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_14 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_15 1
BEGIN
PROMPT 62 5 "15 "
FIELD S2[24,24]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_15
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_15 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_16 1
BEGIN
PROMPT 2 6 "16 "
FIELD S2[25,25]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_16
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_16 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_17 1
BEGIN
PROMPT 17 6 "17 "
FIELD S2[26,26]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_17
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_17 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_18 1
BEGIN
PROMPT 32 6 "18 "
FIELD S2[27,27]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_18
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_18 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_19 1
BEGIN
PROMPT 47 6 "19 "
FIELD S2[28,28]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_19
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_19 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_MOD_20 1
BEGIN
PROMPT 62 6 "20 "
FIELD S2[29,29]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_MOD_20
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_MOD_20 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
GROUPBOX DLG_NULL 75 6
BEGIN
PROMPT 1 8 "Stati iniziali validi per la cancellazione"
END
STRING F_STATOI_CANC_1 1
BEGIN
PROMPT 2 9 "1 "
FIELD S2[30,30]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_1
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_1 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_2 1
BEGIN
PROMPT 17 9 "2 "
FIELD S2[31,31]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_2
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_2 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_3 1
BEGIN
PROMPT 32 9 "3 "
FIELD S2[32,32]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_3
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_3 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_4 1
BEGIN
PROMPT 47 9 "4 "
FIELD S2[33,33]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_4
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_4 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_5 1
BEGIN
PROMPT 62 9 "5 "
FIELD S2[34,34]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_5
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_5 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_6 1
BEGIN
PROMPT 2 10 "6 "
FIELD S2[35,35]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_6
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_6 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_7 1
BEGIN
PROMPT 17 10 "7 "
FIELD S2[36,36]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_7
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_7 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_8 1
BEGIN
PROMPT 32 10 "8 "
FIELD S2[37,37]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_8
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_8 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_9 1
BEGIN
PROMPT 47 10 "9 "
FIELD S2[38,38]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_9
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_9 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_10 1
BEGIN
PROMPT 62 10 "10 "
FIELD S2[39,39]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_10
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_10 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_11 1
BEGIN
PROMPT 2 11 "11 "
FIELD S2[40,40]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_11
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_11 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_12 1
BEGIN
PROMPT 17 11 "12 "
FIELD S2[41,41]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_12
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_12 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_13 1
BEGIN
PROMPT 32 11 "13 "
FIELD S2[42,42]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_13
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_13 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_14 1
BEGIN
PROMPT 47 11 "14 "
FIELD S2[43,43]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_14
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_14 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_15 1
BEGIN
PROMPT 62 11 "15 "
FIELD S2[44,44]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_15
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_15 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_16 1
BEGIN
PROMPT 2 12 "16 "
FIELD S2[45,45]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_16
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_16 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_17 1
BEGIN
PROMPT 17 12 "17 "
FIELD S2[46,46]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_17
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_17 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_18 1
BEGIN
PROMPT 32 12 "18 "
FIELD S2[47,47]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_18
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_18 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_19 1
BEGIN
PROMPT 47 12 "19 "
FIELD S2[48,48]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_19
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_19 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_CANC_20 1
BEGIN
PROMPT 62 12 "20 "
FIELD S2[49,49]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_CANC_20
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_CANC_20 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
GROUPBOX DLG_NULL 75 6
BEGIN
PROMPT 1 14 "Stati iniziali validi per la stampa"
END
STRING F_STATOI_ST_1 1
BEGIN
PROMPT 2 15 "1 "
FIELD S2[50,50]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_1
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_1 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_2 1
BEGIN
PROMPT 17 15 "2 "
FIELD S2[51,51]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_2
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_2 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_3 1
BEGIN
PROMPT 32 15 "3 "
FIELD S2[52,52]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_3
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_3 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_4 1
BEGIN
PROMPT 47 15 "4 "
FIELD S2[53,53]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_4
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_4 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_5 1
BEGIN
PROMPT 62 15 "5 "
FIELD S2[54,54]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_5
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_5 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_6 1
BEGIN
PROMPT 2 16 "6 "
FIELD S2[55,55]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_6
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_6 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_7 1
BEGIN
PROMPT 17 16 "7 "
FIELD S2[56,56]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_7
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_7 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_8 1
BEGIN
PROMPT 32 16 "8 "
FIELD S2[57,57]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_8
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_8 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_9 1
BEGIN
PROMPT 47 16 "9 "
FIELD S2[58,58]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_9
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_9 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_10 1
BEGIN
PROMPT 62 16 "10 "
FIELD S2[59,59]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_10
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_10 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_11 1
BEGIN
PROMPT 2 17 "11 "
FIELD S2[60,60]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_11
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_11 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_12 1
BEGIN
PROMPT 17 17 "12 "
FIELD S2[61,61]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_12
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_12 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_13 1
BEGIN
PROMPT 32 17 "13 "
FIELD S2[62,62]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_13
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_13 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_14 1
BEGIN
PROMPT 47 17 "14 "
FIELD S2[63,63]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_14
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_14 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_15 1
BEGIN
PROMPT 62 17 "15 "
FIELD S2[64,64]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_15
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_15 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_16 1
BEGIN
PROMPT 2 18 "16 "
FIELD S2[65,65]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_16
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_16 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_17 1
BEGIN
PROMPT 17 18 "17 "
FIELD S2[66,66]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_17
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_17 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_18 1
BEGIN
PROMPT 32 18 "18 "
FIELD S2[67,67]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_18
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_18 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_19 1
BEGIN
PROMPT 47 18 "19 "
FIELD S2[68,68]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_19
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_19 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOI_ST_20 1
BEGIN
PROMPT 62 18 "20 "
FIELD S2[49,49]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOI_ST_20
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOI_ST_20 CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
STRING F_STATOF_ST 1
BEGIN
PROMPT 2 20 "Stato finale dopo la stampa definitiva "
FIELD S2[2,2]
COPY USE F_STATOF_INS
INPUT CODTAB F_STATOF_ST
COPY DISPLAY F_STATOF_INS
OUTPUT F_STATOF_ST CODTAB
CHECKYTPE NORMAL
FLAGS "U"
WARNING "Stato finale assente"
END
ENDPAGE
ENDMASK

View File

@ -15,52 +15,9 @@ CALCOLI=BASESCONTO
TOTALE=TOTDOC
BASESCONTO=BASESCONTO
SPESE=TOTSPE
// modifica
// Procedure utente da chiamare per il documento ( preprocessarle? )
NUOVO=
MODIFICA=
CANCELLA=
STAMPA=
RAGGRUPPA=
USER=
// Indica se il documento è indirizzato ad un cliente o ad un fornitore
TIPOCF=C
[INSERIMENTO]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[MODIFICA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4
// Stato finale del documento dopo la operazione
STATOFINALE=N
[CANCELLAZIONE]
STATIVALIDI = 1,5,9
STATOFINALE = 4
REMOVE = 0
[STAMPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1
// Stato finale del documento dopo la operazione
STATOFINALE=2
[RAGGRUPPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[SPECIALE]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=9
[PROFILO]
// Si possono indicare, dopo il numero, PROMPT, HELP, WARNING cosi:
// 1|Prompt|Help|Warning

View File

@ -15,51 +15,9 @@ CALCOLI=
TOTALE=
BASESCONTO=
SPESE=
// Procedure utente da chiamare per il documento ( preprocessarle? )
NUOVO=
MODIFICA=
CANCELLA=
STAMPA=
RAGGRUPPA=
USER=
// Indica se il documento è indirizzato ad un cliente o ad un fornitore
TIPOCF=F
[INSERIMENTO]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[MODIFICA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5
// Stato finale del documento dopo la operazione
STATOFINALE=N
[CANCELLAZIONE]
STATIVALIDI = 1,2
STATOFINALE = 4
REMOVE = 0
[STAMPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5
// Stato finale del documento dopo la operazione
STATOFINALE=2
[RAGGRUPPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[SPECIALE]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=9
[PROFILO]
// Si possono indicare, dopo il numero, PROMPT, HELP, WARNING cosi:
// 1|Prompt|Help|Warning

View File

@ -16,51 +16,9 @@ TOTALE=TOTDOC
BASESCONTO=BASESCONTO
SPESE=TOTSPE
// modifica
// Procedure utente da chiamare per il documento ( preprocessarle? )
NUOVO=
MODIFICA=
CANCELLA=
STAMPA=
RAGGRUPPA=
USER=
// Indica se il documento è indirizzato ad un cliente o ad un fornitore
TIPOCF=C
[INSERIMENTO]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[MODIFICA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5
// Stato finale del documento dopo la operazione
STATOFINALE=N
[CANCELLAZIONE]
STATIVALIDI = 1,5,9
STATOFINALE = 4
REMOVE = 0
[STAMPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5
// Stato finale del documento dopo la operazione
STATOFINALE=2
[RAGGRUPPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[SPECIALE]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=9
[PROFILO]
// Si possono indicare, dopo il numero, PROMPT, HELP, WARNING cosi:
// 1|Prompt|Help|Warning

View File

@ -15,51 +15,9 @@ TOTALE=TOTDOC
BASESCONTO=BASESCONTO
SPESE=TOTSPE
// modifica
// Procedure utente da chiamare per il documento ( preprocessarle? )
NUOVO=
MODIFICA=
CANCELLA=
STAMPA=
RAGGRUPPA=
USER=
// Indica se il documento è indirizzato ad un cliente o ad un fornitore
TIPOCF=C
[INSERIMENTO]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[MODIFICA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5
// Stato finale del documento dopo la operazione
STATOFINALE=N
[CANCELLAZIONE]
STATIVALIDI = 1,5,9
STATOFINALE = 4
REMOVE = 0
[STAMPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1
// Stato finale del documento dopo la operazione
STATOFINALE=2
[RAGGRUPPA]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=1
[SPECIALE]
// Stati in cui è possibile effettuare la operazione
STATIVALIDI=1,2,3,4,5,6,7,8,9
// Stato finale del documento dopo la operazione
STATOFINALE=9
[PROFILO]
// Si possono indicare, dopo il numero, PROMPT, HELP, WARNING cosi:
// 1|Prompt|Help|Warning

View File

@ -52,8 +52,8 @@ void TMotore_application::init_insert_mode( TMask& m )
m.field(F_CODNUM).set_focusdirty(TRUE);
m.field(F_CODNUM).on_key(K_TAB);
m.field(F_TIPODOC).set_focusdirty(TRUE);
m.field(F_TIPODOC).on_key(K_TAB);
m.set(F_STATO, _doc->head().get("STATO"));
m.field(F_TIPODOC).on_key(K_TAB);
m.set(F_STATO, _doc->stato());
const TString16 data_doc(m.get( F_DATADOC));
const int pos = m.id2pos( F_DATACAMBIO1);
@ -77,7 +77,7 @@ void TMotore_application::init_insert_mode( TMask& m )
void TMotore_application::init_modify_mode( TMask& m )
{
m.enable(DLG_PRINT);
m.enable(DLG_PRINT);
}
void TMotore_application::update_profile()
@ -606,12 +606,6 @@ TMask* TMotore_application::get_mask( int mode )
}
}
void TMotore_application::set_descr( int i, const char * dfi )
{
TToken_string& r = ss( ).row( i );
r.add( dfi, 0 );
}
const char* TMotore_application::get_next_key( )
{
TToken_string key;
@ -642,7 +636,8 @@ const char* TMotore_application::get_next_key( )
int TMotore_application::read( TMask& m )
{
m.autoload(*_rel);
// m.autoload(*_rel);
TRelation_application::read(m);
*_doc = (TDocumento &) _rel->curr();
_codnum = m.get(F_CODNUM);
_tipodoc = m.get(F_TIPODOC);
@ -660,51 +655,27 @@ int TMotore_application::read( TMask& m )
rec.autoload(f);
f.check_row(i - 1);
}
}
return NOERR;
}
int TMotore_application::write( const TMask& m ) // C 90
{
int err = esegui_procedura(OP_NUOVO);
if (err == NOERR)
{
TDocumento & doc = (TDocumento &) _rel->curr();
TDocumento & doc = (TDocumento &) _rel->curr();
doc = *_doc;
m.field(F_STATO).set( _pro->get( "STATOFINALE", "INSERIMENTO" ) );
TRelation_application::write(m);
}
return err;
doc = *_doc;
return TRelation_application::write(m);
}
int TMotore_application::rewrite( const TMask& m ) // C 90
{
if (!valida_operazione(OP_MODIFICA))
return NOERR; // Errore gia' segnalato
int err = esegui_procedura(OP_MODIFICA);
if (err == NOERR)
{
TDocumento & doc = (TDocumento &) _rel->curr();
TDocumento & doc = (TDocumento &) _rel->curr();
doc = *_doc;
TRelation_application::rewrite(m);
}
return err;
doc = *_doc;
return TRelation_application::rewrite(m);
}
bool TMotore_application::remove( void ) // C 80
{
if ( ! valida_operazione( OP_CANCELLA ) )
return TRUE;
int err = esegui_procedura(OP_CANCELLA);
return TRelation_application::remove();
}
void TMotore_application::open_files(int logicnum, ...)
{
va_list marker;
@ -742,8 +713,7 @@ bool TMotore_application::user_create( )
_condv = new TCond_vendita(&doc().clifor(), _config_ditta);
_doc->set_condv(_condv);
((TDocumento &) _rel->curr()).set_condv(_condv);
_msk = new TMask("ve0100a");
_msk = new TMask("ve0100a");
set_search_field(F_NDOC);
query_mask().set_handler( F_CODNUM, num_handler );
@ -784,112 +754,11 @@ bool TMotore_application::user_destroy( )
return TRUE;
}
int TMotore_application::esegui_procedura( int operazione )
{
// Accesso unico alla chiamata di procedure tramite operazione
int index = ( int )pro( ).get_long( nome_sezione( operazione ), "MAIN" );
if ( index )
return ( user_function( index ) );
return ( NOERR );
}
bool TMotore_application::valida_operazione( int operazione ) // C 90
{
if (operazione != OP_NUOVO && !stato_valido( stato_corrente( ), operazione))
{
segnala_stato_non_valido( operazione );
return FALSE;
}
return TRUE;
}
const char * TMotore_application::nome_sezione( int op )
{
switch( op )
{
case OP_NUOVO:
return "INSERIMENTO";
break;
case OP_MODIFICA:
return "MODIFICA";
break;
case OP_CANCELLA:
return "CANCELLAZIONE";
break;
case OP_STAMPA:
return "STAMPA";
break;
case OP_RAGGRUPPA:
return "RAGGRUPPA";
break;
case OP_USER:
return "SPECIALE";
break;
default:
CHECK( FALSE, "tentativo di ottenere il nome di una operazione inesistente!" );
// Per evitare la warning
return "";
break;
}
}
int TMotore_application::stato_finale( int operazione )
{
TString s( pro( ).get( "STATOFINALE", nome_sezione( operazione ) ) );
if ( strcmp( s, "N" ) == 0 ) return NO_CHANGE_STATUS;
return ( atoi( s ) );
}
bool TMotore_application::stato_valido( int stato, int operazione )
{
#ifdef _DEBUG
warning_box( "Controllo stati validi!\nStato corrente %d.\nStati validi %s.", stato_corrente( ), ( const char * )stati_validi( operazione ) );
#endif
if (stato == 0)
return TRUE;
char p[2] = "0";
TToken_string ret ( stati_validi( operazione ), ',' );
p[0] += ( char )stato;
return ( ret.get_pos( p ) != -1 );
}
int TMotore_application::stato_corrente( )
{
return edit_mask().get_int(F_STATO);
}
void TMotore_application::segnala_stato_non_valido( int operazione )
{
TString messaggio;
switch( operazione )
{
case OP_NUOVO:
// Sempre valido
break;
case OP_MODIFICA:
messaggio = "Il documento non si trova in uno stato valido per poter essere modificato!";
break;
case OP_CANCELLA:
messaggio = "Il documento non si trova in uno stato valido per poter essere cancellato!";
break;
case OP_STAMPA:
messaggio = "Il documento non si trova in uno stato valido per poter essere stampato!";
break;
case OP_RAGGRUPPA:
messaggio = "Il documento non si trova in uno stato valido per poter essere raggruppato!";
break;
case OP_USER:
messaggio = "Il documento non si trova in uno stato valido per effettuare la operazione richiesta!";
break;
default:
CHECK( FALSE, "Tentativo di segnalare stato non valido di una operazione non esistente!" );
break;
}
messaggio << "\nStato corrente :%d.\nStati validi :%s.";
warning_box( messaggio, stato_corrente( ), ( const char * )stati_validi( operazione ) );
}
int ve0100( int argc, char** argv )
{
TMotore_application a;

View File

@ -1,18 +1,5 @@
#ifndef __VE0100_H
#define __VE0100_H
// Operazioni che pur fare il motore su un documento
#define OP_NUOVO 1
#define OP_MODIFICA 2
#define OP_CANCELLA 3
#define OP_STAMPA 4
#define OP_RAGGRUPPA 5
#define OP_USER 6
// Costante per il non-cambiamento di stato
#define NO_CHANGE_STATUS -1
// #define NO_DOC_STATUS -2
#define CHANGE_MESSAGE "Sono state effettuate modifiche alla configurazione.\nPrima di eseguire la gestione documenti occorre rigenerare le maschere.\nDesideri farlo ora ?"
@ -107,15 +94,10 @@ class TMotore_application : public TRelation_application
// Puntatore allo sheet delle righe documento
TSheet_field * _sheet;
// Oggetto cliente per il motore
// TCli_for_vendite * _clifor;
TCond_vendita * _condv;
// Indica se il documento ha come soggetto un <C>liente o un <F>ornitore
char _tipocf;
TString16 _codnum;
TString16 _tipodoc;
@ -133,23 +115,14 @@ class TMotore_application : public TRelation_application
virtual void init_insert_mode( TMask& m );
virtual void init_modify_mode( TMask& m );
virtual int read( TMask& m );
virtual bool remove( void );
virtual int write( const TMask& m );
virtual int rewrite( const TMask& m );
// Punti di ingresso per le funzioni utente
// Funzioni da associare ad ogni procedura
int user_function( int index );
// Funzioni per il calcolo delle righe
real user_row_calculate( TRectype& row, int index );
void user_set_handler( int fieldid, int index, TMask* m = NULL );
// Esegue, se c'h, la procedura utente relativa ad una certa operazione
int esegui_procedura( int operazione );
protected:
void open_files(int logicnum, ...);
@ -157,18 +130,10 @@ protected:
virtual void on_firm_change();
// Procedure e funzioni per la gestione della maschera e dei files
void read_rdoc( TMask& m );
void update_profile();
void set_descr ( int numrig, const char* descr );
// Procedure e funzioni per la gestione degli stati
const char* nome_sezione( int op );
int stato_corrente( );
int stato_finale( int operazione );
bool stato_valido( int stato, int operazione );
void segnala_stato_non_valido( int operazione );
TString& stati_validi( int operazione ){ return ( pro( ).get( "STATIVALIDI", nome_sezione( operazione ) ) );}
// Handle che ritorna la maschera per le righe
static TMask * ss_getmask( int numriga, TMask& fullmask);
@ -212,7 +177,6 @@ public:
const char tipocf( ) { return _tipocf; }
void tipocf( const char tcf ) { _tipocf = tcf; }
bool valida_operazione( int operazione );
TSheet_field & ss( ) const { return *_sheet; }
TMotore_application( ) { _pro = NULL; }

View File

@ -1285,7 +1285,21 @@ void TMask_generator::genera( const TString& profilo )
_m->begin( );
_m->prompt( 46, 3, "Data " );
_m->field( "DATADOC" );
_m->message( format("CO,7@|CO,%d", F_DATACAMBIO1) );
TString m("CO,7@");
TGruppo * g = (TGruppo *) _gruppi.objptr(GROUPKEY(200));
if (g)
{
TArray & f = g->campi();
bool found = FALSE;
for (TField * c = (TField *) f.first_item(); !found && c; c = (TField *) f.succ_item())
found = c->id() == F_DATACAMBIO1;
if (found && c->stato_reale() != S_NASCOSTO)
m << format("CO,%d", F_DATACAMBIO1);
}
_m->message(m);
_m->flag( "A" );
_m->end( );

View File

@ -156,7 +156,7 @@ protected:
virtual int parse_user_func(const char * name, int nparms) const;
public:
// @cmember Duplica l'espressione
// @cmember Duplica l'espressione
virtual TObject* dup() const;
// @cmember Assegna il documento corrente
void set_doc(TDocumento * doc) { _doc = doc; }
@ -245,10 +245,15 @@ public:
const TString & spese() const { return _spese;}
bool mov_mag() const { return get_bool("B1"); }
bool statistiche() const { return get_bool("B2"); }
const TString & stato_mov_iniziale() const {return get("S7"); }
const TString & stato_mov_finale() const {return get("S8"); }
const char stato_mov_iniziale() const {return get_char("S7"); }
const char stato_mov_finale() const {return get_char("S8"); }
const TString & caus_mov() const {return get("S9"); }
bool stato_with_mov_mag(const TString & stato) const;
const char stato_finale_inserimento() const {return get("S2")[0]; }
const char stato_finale_stampa() const {return get("S2")[1]; }
const TString & stati_iniziali_modifica() const {return get("S2").mid(9,20); }
const TString & stati_iniziali_cancellazione() const {return get("S2").mid(29,20); }
const TString & stati_iniziali_stampa() const {return get("S2").mid(49,20); }
bool stato_with_mov_mag(const char stato) const;
TFormula_documento * first_formula() { return succ_formula(TRUE); }
TFormula_documento * succ_formula(bool restart = FALSE);
@ -336,7 +341,7 @@ protected:
// @cmember Setta il contenuto del campo <p fieldname> (non tipizzata)
virtual void put_str(const char* fieldname, const char* val);
protected:
virtual TRiga_documento & copy(const TRiga_documento & r);
TObject* dup() const { return new TRiga_documento(*this); }
public:
@ -377,7 +382,6 @@ public:
bool sola_descrizione() const;
void forza_sola_descrizione();
virtual TRiga_documento & copy(const TRiga_documento & r);
virtual TRiga_documento & operator =(const TRiga_documento & r) { return copy(r);}
virtual TRectype & operator =(const TRectype & r);
virtual TRectype & operator =(const char * r);
@ -406,7 +410,7 @@ public:
enum TTipo_importo { _lordo, _netto, _imposta };
class TDocumento : public TAuto_variable_rectype // velib03
class TDocumento : public TMultiple_rectype // velib03
{
TRecfield *_tipocf;
TRecfield *_codcf;
@ -416,8 +420,8 @@ class TDocumento : public TAuto_variable_rectype // velib03
int _liv_len[4];
TRecord_array _rows; // Array di TRectype per le righe documenti di vendita.
bool _nuovo;
// TRecord_array _rows; // Array di TRectype per le righe documenti di vendita.
// bool _nuovo;
TCond_vendita * _condv;
TCli_for _cli_for;
@ -427,43 +431,44 @@ class TDocumento : public TAuto_variable_rectype // velib03
TRiga_documento * _esenzione; // Riga per l' esenzione iva
protected:
virtual TRectype * new_body_record(int logicnum = 0) { return new TRiga_documento(this); }
TRiga_documento & row(int index);
long get_next_key(char provv, int anno, const char* codnum) const;
virtual void put_str(const char* fieldname, const char* val);
long renum(long numdoc = 0);
long renum_ndoc(long numdoc = 0);
virtual bool key_complete() { return numero() > 0; }
virtual bool renum() { return renum_ndoc() > 0;}
void set_riga_sconto();
void set_riga_esenzione();
int write_rewrite(TBaseisamfile & f, bool re) const;
virtual TDocumento & copy(const TDocumento & d);
TObject* dup() const { return new TDocumento(*this); }
public:
void dirty_fields();
const TAuto_variable_rectype& head() const { return *this; } // Ritorna la testata del documento
TAuto_variable_rectype& head() { return *this; } // Ritorna la testata del documento
// const TAuto_variable_rectype& head() const { return *this; } // Ritorna la testata del documento
// TAuto_variable_rectype& head() { return *this; } // Ritorna la testata del documento
TCond_vendita & condv() const {CHECK(_condv, "Condizioni di vendita nulle"); return *_condv;}
TCli_for & clifor() const;
TOccasionale & occas() const;
void set_condv(TCond_vendita * condv) { _condv = condv; }
virtual TDocumento & copy(const TDocumento & d);
virtual TDocumento & operator =(const TDocumento & d) {return copy(d);}
virtual TRectype & operator =(const TRectype & r);
virtual TRectype & operator =(const char * r);
virtual void zero(const char * fieldname);
virtual void zero(char c = '\0');
virtual void zero(char c = '\0') { TMultiple_rectype::zero(c); }
int physical_rows() const { return _rows.rows(); }
int physical_rows() const { return body().rows(); }
int rows() const { return physical_rows() + ((_sconto != NULL) ? 1 : 0) + ((_esenzione != NULL) ? 1 : 0); }
const TRiga_documento& operator[](int index) const { return (const TRiga_documento&)((TDocumento *)this)->row(index); }
TRiga_documento& operator[](int index) { return (TRiga_documento&)row(index); }
TRiga_documento& insert_row(int row, const char *tipo = NULL);
TRiga_documento& new_row(const char *tipo = NULL);
bool destroy_row(int n, bool pack = FALSE) { return _rows.destroy_row(n, pack); }
void destroy_rows() { _rows.destroy_rows(); }
virtual int read(TBaseisamfile& f, word op = _isequal, word lockop = _nolock);
virtual int readat(TBaseisamfile& f, TRecnotype nrec, word lockop = _nolock);
virtual int write(TBaseisamfile& f) const { return write_rewrite(f, FALSE); }
virtual int rewrite(TBaseisamfile& f) const { return write_rewrite(f, TRUE); }
virtual int remove(TBaseisamfile& f) const;
@ -494,6 +499,9 @@ public:
bool provvisorio() const { return get_char("PROVV") == 'P'; }
char stato() const { return get_char("STATO"); }
void stato(char s) { put("STATO", s); }
bool modificabile() const;
bool cancellabile() const;
bool stampabile() const;
bool raggruppabile() const { return get_bool("RAGGR"); }
bool raggruppabile(const TDocumento& doc, TToken_string& campi) const;
@ -505,7 +513,6 @@ public:
static void copy_data(TRectype& dst, const TRectype& src);
void copy_contents(const TDocumento & src);
void reset_fields(TAuto_variable_rectype & rec) { rec.remove_field(); }
void set_fields(TAuto_variable_rectype & rec);
real spese_incasso(real & imp, int ndec, TTipo_importo netto = _lordo) const ;
@ -530,9 +537,8 @@ public:
TDocumento ();
TDocumento (const TDocumento & d);
TDocumento(char provv, int anno, const char* codnum, long numdoc,
TCond_vendita * condv = NULL, TRelation * rel = NULL);
TDocumento(const TRectype& doc, TCond_vendita * condv = NULL,
TRelation * rel = NULL);
TCond_vendita * condv = NULL);
TDocumento(const TRectype& doc, TCond_vendita * condv = NULL);
virtual ~TDocumento();
};

View File

@ -168,7 +168,7 @@ bool note_hndl( TMask_field& f, KEY key )
TDocumento_mask & m = (TDocumento_mask &) f.mask();
if (key == K_TAB && (f.focusdirty() || !m.is_running()))
{
{
TTable & note = (TTable &) ((TEdit_field &) f).browse()->cursor()->file();
note.setkey(1);
const TString16 cod(f.get());

View File

@ -153,14 +153,14 @@ void TTipo_documento::read_formule()
}
}
bool TTipo_documento::stato_with_mov_mag(const TString & stato) const
bool TTipo_documento::stato_with_mov_mag(const char stato) const
{
if (!mov_mag())
return FALSE;
const TString16 stato_finale(stato_mov_finale());
if (stato_finale.not_empty() && stato > stato_finale)
const char stato_finale(stato_mov_finale());
if (stato_finale > ' ' && stato > stato_finale)
return FALSE;
const TString16 stato_iniziale(stato_mov_iniziale());
const char stato_iniziale(stato_mov_iniziale());
return stato >= stato_iniziale;
}
@ -198,28 +198,32 @@ TAssoc_array TDocumento::_tipi;
TAssoc_array TDocumento::_numerazioni;
TDocumento::TDocumento()
: TAuto_variable_rectype(LF_DOC), _rows(LF_RIGHEDOC, "NRIGA"), _nuovo(TRUE),
_condv(NULL), _sconto(NULL), _esenzione(NULL)
: TMultiple_rectype(LF_DOC), _condv(NULL),
_sconto(NULL), _esenzione(NULL)
{
add_file(LF_RIGHEDOC, "NRIGA");
_tipocf = new TRecfield(*this, "TIPOCF");
_codcf = new TRecfield(*this, "CODCF");
_cod_occas = new TRecfield(*this, "OCFPI");
set_memo_fld("G1");
for (int i = 3 ; i >= 0; i--) _liv_len[i] = 0;
for (int i = 3 ; i >= 0; i--)
_liv_len[i] = 0;
}
TDocumento::TDocumento(const TDocumento & d)
: TAuto_variable_rectype(LF_DOC), _rows(LF_RIGHEDOC, "NRIGA"), _nuovo(TRUE),
_condv(NULL), _sconto(NULL), _esenzione(NULL)
: TMultiple_rectype(LF_DOC), _condv(NULL),
_sconto(NULL), _esenzione(NULL)
{
add_file(LF_RIGHEDOC, "NRIGA");
copy(d);
}
TDocumento::TDocumento(char provv, int anno, const char* codnum, long numdoc,
TCond_vendita * condv, TRelation * rel)
: TAuto_variable_rectype(LF_DOC), _rows(LF_RIGHEDOC, "NRIGA"), _nuovo(TRUE),
_condv(condv), _sconto(NULL), _esenzione(NULL)
TCond_vendita * condv)
: TMultiple_rectype(LF_DOC), _condv(condv), _sconto(NULL),
_esenzione(NULL)
{
add_file(LF_RIGHEDOC, "NRIGA");
_tipocf = new TRecfield(*this, "TIPOCF");
_codcf = new TRecfield(*this, "CODCF");
_cod_occas = new TRecfield(*this, "OCFPI");
@ -228,26 +232,25 @@ TDocumento::TDocumento(char provv, int anno, const char* codnum, long numdoc,
{
numdoc = 0;
set_key(*this, provv, anno, codnum, numdoc);
TRiga_documento* key = new TRiga_documento(this);
set_key(*key, provv, anno, codnum, numdoc);
_rows.set_key(key); // ok
}
else
read(provv, anno, codnum, numdoc);
for (int i = 3 ; i >= 0; i--) _liv_len[i] = 0;
for (int i = 3 ; i >= 0; i--)
_liv_len[i] = 0;
}
TDocumento::TDocumento(const TRectype& rec, TCond_vendita * condv, TRelation * rel)
: TAuto_variable_rectype(LF_DOC), _rows(LF_RIGHEDOC, "NRIGA"), _nuovo(FALSE),
_condv(condv), _sconto(NULL), _esenzione(NULL)
TDocumento::TDocumento(const TRectype& rec, TCond_vendita * condv)
: TMultiple_rectype(LF_DOC), _condv(condv), _sconto(NULL),
_esenzione(NULL)
{
add_file(LF_RIGHEDOC, "NRIGA");
_tipocf = new TRecfield(*this, "TIPOCF");
_codcf = new TRecfield(*this, "CODCF");
_cod_occas = new TRecfield(*this, "OCFPI");
set_memo_fld("G1");
read(rec);
for (int i = 3 ; i >= 0; i--) _liv_len[i] = 0;
for (int i = 3 ; i >= 0; i--)
_liv_len[i] = 0;
}
TDocumento::~TDocumento()
@ -444,7 +447,43 @@ real TDocumento::bolli(real & imp, int ndec, TTipo_importo t) const
return tot_bolli;
}
bool TDocumento::modificabile() const
{
const char stato_attuale = stato();
if (stato_attuale <= ' ')
return TRUE;
TString80 stati_modifica = tipo().stati_iniziali_modifica();
return stati_modifica.trim().empty() || stati_modifica.find(stato_attuale) >= 0;
}
bool TDocumento::cancellabile() const
{
const char stato_attuale = stato();
if (stato_attuale <= ' ')
return TRUE;
TString80 stati_cancellazione = tipo().stati_iniziali_cancellazione();
return stati_cancellazione.trim().empty() || stati_cancellazione.find(stato_attuale) >= 0;
}
bool TDocumento::stampabile() const
{
const char stato_attuale = stato();
if (stato_attuale <= ' ')
return TRUE;
TString80 stati_stampa = tipo().stati_iniziali_stampa();
return stati_stampa.trim().empty() || stati_stampa.find(stato_attuale) >= 0;
}
// Funzione statica utile a tutti gli utenti di LF_DOC e LF_RIGHEDOC
void TDocumento::set_key(TRectype& rec, char provv, int anno, const char* codnum, long numdoc)
{
@ -493,17 +532,15 @@ void TDocumento::copy_contents(const TDocumento & src)
TRiga_documento& TDocumento::insert_row(int row, const char *tipo)
{
TRiga_documento * r = new TRiga_documento((const TRiga_documento &) _rows.key(), this); // ok
r->set_numero(row);
TRiga_documento & r = (TRiga_documento &) TMultiple_rectype::insert_row(row); // ok
if (tipo)
r->set_tipo(tipo);
_rows.insert_row(r); // ok
return *r;
r.set_tipo(tipo);
return r;
}
TRiga_documento& TDocumento::new_row(const char *tipo)
{
TRiga_documento & r = (TRiga_documento&)_rows.row(-1, TRUE); // ok
TRiga_documento & r = (TRiga_documento&)TMultiple_rectype::new_row(); // ok
if (tipo)
r.set_tipo(tipo);
return r;
@ -511,33 +548,10 @@ TRiga_documento& TDocumento::new_row(const char *tipo)
int TDocumento::read(TBaseisamfile& f, word op, word lockop)
{
const TRectype rec(*this); // vecchia testata
int err = TRectype::read(f, op, lockop);
const char pr = tipo_numerazione();
const int an = anno();
const TString16 cn = numerazione();
const long nu = numero();
CHECK(nu > 0, "Numero documento nullo.");
TRiga_documento* key = new TRiga_documento(this);
set_key(*key, pr, an, cn, nu);
int err = TMultiple_rectype::read(f, op ,lockop);
_cli_for.zero();
_occas.zero();
if (err != NOERR && op == _isequal)
{
_nuovo = TRUE;
head() = rec;
destroy_rows();
_rows.set_key(key); // ok
}
else
{
_nuovo = FALSE;
_rows.read(key); //ok
}
set_riga_sconto();
if (is_fattura())
set_riga_esenzione();
@ -546,38 +560,13 @@ int TDocumento::read(TBaseisamfile& f, word op, word lockop)
int TDocumento::read(char provv, int anno, const char* codnum, long numdoc, word op, word lockop)
{
CHECK(numdoc > 0, "Numero documento nullo.");
CHECK(numdoc > 0, "Numero documento nullo.");
zero();
set_key(*this, provv, anno, codnum, numdoc);
return read(op, lockop);
}
// Guy: Mancava! Copio bovinamente tanto verra presto rimpiazzata da i Multirectype
int TDocumento::readat(TBaseisamfile& f, TRecnotype nrec, word lockop)
{
int err = TRectype::readat(f, nrec, lockop);
_cli_for.zero();
_occas.zero();
const char pr = tipo_numerazione();
const int an = anno();
const TString16 cn = numerazione();
const long nu = numero();
CHECK(nu > 0, "Numero documento nullo.");
TRiga_documento* key = new TRiga_documento(this);
set_key(*key, pr, an, cn, nu);
_nuovo = FALSE;
_rows.read(key); //ok
set_riga_sconto();
if (is_fattura())
set_riga_esenzione();
return err;
}
long TDocumento::renum(long numdoc)
long TDocumento::renum_ndoc(long numdoc)
{
if (numdoc <= 0)
{
@ -586,9 +575,8 @@ long TDocumento::renum(long numdoc)
const TString16 nu = numerazione();
numdoc = get_next_key(tn, an, nu);
}
char num[16]; sprintf(num, "%ld", numdoc);
renum_key("NDOC", num); // Aggiorna testata
_rows.renum_key("NDOC", num); // Aggiorna righe ok
put(DOC_NDOC, numdoc); // Aggiorna testata
TMultiple_rectype::renum_key(); // Aggiorna righe ok
return numdoc;
}
@ -623,10 +611,6 @@ void TDocumento::set_riga_sconto()
void TDocumento::set_riga_esenzione()
{
TCli_for & c = clifor();
// const char tipo = get_char("TIPOCF");
// const long cod = get_long("CODCF");
// const TString80 occ(get("OCFPI"));
// c.load(tipo, cod, occ);
const TIVA codes(c.vendite().get(CFV_ASSFIS));
const TString16 v_esenzione(c.vendite().get(CFV_VSPROT));
const TString16 v_data_esenzione(c.vendite().get(CFV_VSDATAREG));
@ -683,7 +667,7 @@ void TDocumento::dirty_fields()
for (TDocumento_variable_field * f = (TDocumento_variable_field *) first_variable_field();
f != NULL; f = (TDocumento_variable_field *) succ_variable_field())
f->set_dirty();
for (int i = rows(); i > 0; i--)
for (int i = loaded_rows(); i > 0; i--)
{
TRiga_documento & r = (TRiga_documento &) row(i);
@ -693,15 +677,26 @@ void TDocumento::dirty_fields()
}
int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
{
const bool nuovo = _nuovo || numero() <= 0; // E' nuovo di zecca!
{
TDocumento & myself = *((TDocumento *)this);
const bool new_doc = nuovo() || numero() <= 0; // E' nuovo di zecca!
if (new_doc)
{
char stato_finale = tipo().stato_finale_inserimento();
if (stato_finale > ' ')
myself.stato(stato_finale);
}
else
{
if (!modificabile() && !yesno_box("Documento non modificabile,\n vuoi continuare ugualmente"))
return NOERR;
}
const bool check_movmag = main_app().has_module(MGAUT, CHK_DONGLE) && tipo().mov_mag();
const TString16 stato_doc(get("STATO"));
const char stato_doc(stato());
const bool do_movmag = tipo().stato_with_mov_mag(stato_doc);
if (nuovo && re) // quindi ...
re = FALSE; // ... non fare la rewrite
if (tipo().spese_aut() && !get_bool("SPESEUPD"))
{
TString16 name("CODSP0");
@ -715,7 +710,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
if (s.not_empty())
spese.add(s);
}
((TDocumento *)this)->update_spese_aut(spese);
myself.update_spese_aut(spese);
}
int err = NOERR;
@ -730,14 +725,14 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
mov.zero();
if (num == 0 && do_movmag)
{
num = atol(mov.get_next_key());
mov.put(MOVMAG_NUMREG, num);
while (mov.write(m) == _isreinsert)
{
num = atol(mov.get_next_key());
mov.put(MOVMAG_NUMREG, num);
while (mov.write(m) == _isreinsert)
{
num++;
mov.put(MOVMAG_NUMREG, num);
}
((TDocumento *)this)->put("MOVMAG", num);
}
myself.put("MOVMAG", num);
}
if (num > 0)
{
@ -784,7 +779,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
for (i = 1; i <= rows; i++)
{
TRiga_documento & r = ((TDocumento *)this)->row(i);
TRiga_documento & r = myself.row(i);
if (r.is_articolo())
{
@ -817,7 +812,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
mov.remove(m);
for (int i = rows; i > 0; i--)
{
TRiga_documento & r = ((TDocumento *) this)->row(i);
TRiga_documento & r = myself.row(i);
long r_num = r.get_long("MOVMAG");
if (r_num == num)
r.zero("MOVMAG");
@ -830,7 +825,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
codalt.setkey(2);
for (int i = rows; i > 0; i--)
{
TRiga_documento & r = ((TDocumento *) this)->row(i);
TRiga_documento & r = myself.row(i);
if (!r.is_checked())
{
const TString & codart = r.get("CODART");
@ -848,42 +843,7 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
}
}
if (re)
{
err = _rows.write(re);
if (err == NOERR)
{
err = TRectype::rewrite(f);
if (err != NOERR)
err = TRectype::write(f);
}
}
else
{
if (nuovo)
{
TDocumento& myself = *(TDocumento*)this;
if (numero() <= 0)
myself.renum();
do
{
err = TRectype::write(f);
if (err == _isreinsert)
myself.renum();
} while (err == _isreinsert);
myself._nuovo = FALSE;
}
else
{
err = TRectype::write(f);
if (err != NOERR)
err = TRectype::rewrite(f);
}
if (err == NOERR)
err = _rows.write(re);
}
err = TMultiple_rectype::write_rewrite(f, re);
if (err == NOERR && clifor().occasionale())
{
@ -902,28 +862,25 @@ int TDocumento::write_rewrite(TBaseisamfile & f, bool re) const
// eliminare anche il mov di mag. ??????
int TDocumento::remove(TBaseisamfile& f) const
{
int err = _rows.remove();
if (err == NOERR)
{
const bool check_movmag = main_app().has_module(MGAUT, CHK_DONGLE) && tipo().mov_mag();
if (!cancellabile() && !yesno_box("Documento non cancellabile,\n vuoi continuare ugualmente"))
return NOERR;
const bool check_movmag = main_app().has_module(MGAUT, CHK_DONGLE) && tipo().mov_mag();
if (check_movmag)
{
const long num = get_long("MOVMAG");
if (check_movmag)
{
const long num = get_long("MOVMAG");
if (num > 0)
{
TMov_mag_doc mov(this);
TLocalisamfile m(LF_MOVMAG);
mov.put(MOVMAG_NUMREG, num);
while (mov.read(m, _isequal, _testandlock) == _islocked)
message_box("Movimento di magazzino in uso da parte di un'altro utente");
mov.remove(m);
}
if (num > 0)
{
TMov_mag_doc mov(this);
TLocalisamfile m(LF_MOVMAG);
mov.put(MOVMAG_NUMREG, num);
while (mov.read(m, _isequal, _testandlock) == _islocked)
message_box("Movimento di magazzino in uso da parte di un'altro utente");
mov.remove(m);
}
err = TRectype::remove(f);
}
return err;
return TMultiple_rectype::remove(f);
}
bool TDocumento::in_valuta() const
@ -932,14 +889,15 @@ bool TDocumento::in_valuta() const
return (val.not_empty() && val != "LIT");
}
TRiga_documento& TDocumento::row(int index)
{
const int nrows = _rows.rows();
TRiga_documento & TDocumento::row(int index)
{
TRecord_array & b = body();
const int nrows = b.rows();
TRiga_documento * r = NULL;
if (index <= nrows)
{
r = &((TRiga_documento &) _rows.row(index, FALSE));
r = &((TRiga_documento &) b.row(index, FALSE));
CHECKD(r, "Riga documento non esistente ", index);
}
else
@ -1219,17 +1177,10 @@ void TDocumento::zero(const char * fieldname)
{
if (strcmp(fieldname, "TIPODOC") == 0)
reset_fields(*this);
TAuto_variable_rectype::zero(fieldname);
TRectype::zero(fieldname);
dirty_fields();
}
void TDocumento::zero(char c)
{
reset_fields(*this);
TAuto_variable_rectype::zero(c);
destroy_rows();
}
TCli_for & TDocumento::clifor() const
{
const char tipo = tipocf();
@ -1260,8 +1211,7 @@ TOccasionale & TDocumento::occas() const
TDocumento & TDocumento::copy(const TDocumento & d)
{
operator=((TRectype &)d);
_rows = d._rows;
TMultiple_rectype::operator=((TMultiple_rectype &)d);
for (int i = physical_rows(); i > 0; i--)
{
TRiga_documento & r = row(i);
@ -1273,24 +1223,17 @@ TDocumento & TDocumento::copy(const TDocumento & d)
if (is_fattura())
set_riga_esenzione();
set_condv(d._condv);
_nuovo = d._nuovo;
return *this;
}
TRectype & TDocumento::operator =(const TRectype & r)
{
TRectype::operator=(r);
reset_fields(*this);
set_fields(*this);
return *this;
return TMultiple_rectype::operator=(r);
}
TRectype & TDocumento::operator =(const char * r)
{
TRectype::operator=(r);
reset_fields(*this);
set_fields(*this);
return *this;
return TMultiple_rectype::operator=(r);
}
void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old, TSheet_field * sh)
@ -1305,8 +1248,8 @@ void TDocumento::update_spese_aut(TString_array & spese_aut, bool preserve_old,
if (tipo().spese_aut())
{
const int nrows = _rows.rows();
for (int i = nrows; i > 0; i--)
const int nrows = physical_rows();
for (int i = nrows; i > 0; i--)
{
TRiga_documento & r = row(i);

View File

@ -201,7 +201,7 @@ void TDocumento_mask::cli2mask( TCli_for & c, TOccasionale & o, TConfig & ditta)
short pos = id2pos(F_CAMBIO);
if ((pos >= 0) && (newcodval.empty() || newdatacambio.empty()))
fld(F_CAMBIO).reset();
fld(pos).reset();
pos = id2pos(F_CODVAL);
if (pos >= 0 && fld(pos).active())
fld(pos).check();
@ -254,7 +254,7 @@ void TDocumento_mask::sconto_testa2mask( TCli_for & c, TConfig & ditta )
case 'N': // Sconti non gestiti: pussa via!
break;
case 'P': // Percentuale su anagrafica cliente
set( F_SCONTOPERC, c.get(CLI_SCONTO));
set( F_SCONTOPERC, c.vendite().get(CFV_SCONTO));
break;
case 'T': // Gestione tabella sconti
{