Hello,
I know I need to place a tbl(close) on the Invoice and Customer File, but unsure of the best place.
Below is the code for the script I use...
'Date Created: 13-Mar-2009 02:26:53 AM
'Last Updated: 19-Apr-2009 02:49:05 PM
'Created By : Ryland
'Updated By : Ryland
DIM global_var_A as c
DIM GLOBAL user as C
DIM GLOBAL pword as C
DIM GLOBAL level as C
DIM GLOBAL varC_result as C
dim global try as n
dim global way as c
dim ans as n
dim time_in as c
dim tbl as p
dim tbl_1 as p
dim qry as p
dim qry_1 as p
dim recs as n
dim recs_1 as n
dim global user_level as c
DIM global v_personnel as c
dim XDialogStyle as p
user=""
pword=""
level=""
user_level=""
v_personnel=""
ok_button_label = "&Verify_ID"
cancel_button_label = "&Manual"
Delete XdialogStyle
XDialogStyle.AccentColor = "White"
XDialogStyle.Color = "#51+102+255"
varC_result = ui_dlg_box(" Please Scan Your CAC ",<<%dlg%
{Windowstyle=Gradient Radial Bottom Right}
{region}
SCAN CAC:| [%p%.30user];
{endregion};
{line=1,0};
{region}
{justify=center}
<15=ok_button_label!Verify_ID> <15=cancel_button_label!Manual>
{endregion};
%dlg%)
scan_id=upper(scan_id)
if varC_result="Manual" then
user="Manual User login"
script_play("login_script_1")
end
end if
tbl=table.open("customer") ' table open here
query.filter="scan_id = "+s_quote(user)
query.order=""
query.options="T"
qry=tbl.query_create()
recs=qry.records_get()
tbl_1=table.open("invoice_items") ' another table open here
query.filter="scan_id = "+s_quote(user)
query.order=""
query.options="T"
qry_1=tbl_1.query_create()
recs_1=qry_1.records_get()
if recs = 0 then
msgbox("CAC ID Not on Alpha-Roster, Please Re-enter")
script_play("Main_Menu")
end if
if recs > 0 .and. (tbl.level = "Supervisor" .or. tbl.level = "Commander" .or. tbl.level = "Custodian Primary" .or. tbl.level = "Custodian Alternate")
v_personnel= tbl.customer_id
user_level = tbl.Level
msgbox("Commander/Supervisor/Custodian Issue")
script_play("Invoice_Script")
end if
if recs > 0 .and. (tbl.level = "A-Roster Customer" .or. tbl.level = "Temporary Customer") then
v_personnel= tbl.customer_id
user_level = tbl.Level
'msgbox("Continue to Tool Issue", v_personnel)
script_play("Invoice_Script")
end if
end
Thanks, Ryland
I know I need to place a tbl(close) on the Invoice and Customer File, but unsure of the best place.
Below is the code for the script I use...
'Date Created: 13-Mar-2009 02:26:53 AM
'Last Updated: 19-Apr-2009 02:49:05 PM
'Created By : Ryland
'Updated By : Ryland
DIM global_var_A as c
DIM GLOBAL user as C
DIM GLOBAL pword as C
DIM GLOBAL level as C
DIM GLOBAL varC_result as C
dim global try as n
dim global way as c
dim ans as n
dim time_in as c
dim tbl as p
dim tbl_1 as p
dim qry as p
dim qry_1 as p
dim recs as n
dim recs_1 as n
dim global user_level as c
DIM global v_personnel as c
dim XDialogStyle as p
user=""
pword=""
level=""
user_level=""
v_personnel=""
ok_button_label = "&Verify_ID"
cancel_button_label = "&Manual"
Delete XdialogStyle
XDialogStyle.AccentColor = "White"
XDialogStyle.Color = "#51+102+255"
varC_result = ui_dlg_box(" Please Scan Your CAC ",<<%dlg%
{Windowstyle=Gradient Radial Bottom Right}
{region}
SCAN CAC:| [%p%.30user];
{endregion};
{line=1,0};
{region}
{justify=center}
<15=ok_button_label!Verify_ID> <15=cancel_button_label!Manual>
{endregion};
%dlg%)
scan_id=upper(scan_id)
if varC_result="Manual" then
user="Manual User login"
script_play("login_script_1")
end
end if
tbl=table.open("customer") ' table open here
query.filter="scan_id = "+s_quote(user)
query.order=""
query.options="T"
qry=tbl.query_create()
recs=qry.records_get()
tbl_1=table.open("invoice_items") ' another table open here
query.filter="scan_id = "+s_quote(user)
query.order=""
query.options="T"
qry_1=tbl_1.query_create()
recs_1=qry_1.records_get()
if recs = 0 then
msgbox("CAC ID Not on Alpha-Roster, Please Re-enter")
script_play("Main_Menu")
end if
if recs > 0 .and. (tbl.level = "Supervisor" .or. tbl.level = "Commander" .or. tbl.level = "Custodian Primary" .or. tbl.level = "Custodian Alternate")
v_personnel= tbl.customer_id
user_level = tbl.Level
msgbox("Commander/Supervisor/Custodian Issue")
script_play("Invoice_Script")
end if
if recs > 0 .and. (tbl.level = "A-Roster Customer" .or. tbl.level = "Temporary Customer") then
v_personnel= tbl.customer_id
user_level = tbl.Level
'msgbox("Continue to Tool Issue", v_personnel)
script_play("Invoice_Script")
end if
end
Thanks, Ryland
Comment