About ProStar Software

advertisement
ThermaSys Corp
And
ProStar Software
Albin Hess
IT Manager
ThermaSys Corporation
John Campbell
VP R&D
ProStar Software
Supplier of highly engineered copper/brass and aluminum heat
exchanger components and assemblies.
Headquartered in Montgomery Alabama with sites in Europe,
China & the USA
MFG/PRO V2009SE User since 1998
4 databases ranging from 1 Gig to 30 Gig, 236 named QAD users
Creators of
Non-invasive Customizations
Integrated Business Process Control
PrISM
TailorPro
eLite
Logon / Logoff
Credit Card Integration
Data Auditing
Many of our products involve materials whose prices fluctuate
in a matter of hours or days
We have arrangements with customers to add a surcharge to an
individual order line (part) if the price has increased since time
of order
Surcharges are based on the metal component, as well as the
weight for a given part
They are also based on the customer type: preferred,
government, etc.
Surcharges are controlled at several points:
At the item level: components and weight per
component
At the customer level: is this customer surcharged or
not?
At the order line level: is this line surcharged or not.
At the shipping level
Fields are added to the Customer
Maintenance Screen
They determine whether Metal Surcharges
apply to this customer
Data is stored in an extended table:
xcm_mstr
This table is ‘married’ to the cm_mstr using
Tailorpro Global Table Rules
The item master table also has a TP
extended table (xpt_mstr)
The data is maintained with a TailorPro
anchor
On GO of the first item master
maintenance frame
During Sales Order Maintenance the user
can manually turn the surcharge on or off
for each line
The metal components of an item, and the
proportion are controlled in 1.4.1
In 7.9.15 Tailorpro activates the Surcharge
handling
When leaving the last screen of 7.9.15 the program xcalc_chrg.p
is executed if the customer and the SO Line
are marked as surchargeable
The Program xcalc_chrg.p
define variable PriceDelta as decimal
no-undo.
define variable CustType as character no-undo.
define variable SodLine as integer
no-undo.
define variable NonCatSurcharge as decimal
no-undo.
define variable v_cimfile as character initial "soivmt.cim“ no-undo.
define variable v_outfile as character initial "soivmt.out" no-undo.
define variable v_sohfile as character initial "soheader.cim“ no-undo.
define variable v_solfile as character initial "soline.cim"
no-undo.
define variable v_delim as character initial "|"
no-undo.
define variable v_taxable as logical
no-undo.
define variable v_multslsp as logical
no-undo.
define variable v_slspsn as logical
no-undo.
def var vcommand as char format "x(60)".
define variable v_batchrun as logical
no-undo.
define variable v_acct like sod_acct no-undo.
define variable v_cc like sod_cc no-undo.
define variable v_dsc_acct like sod_dsc_acct no-undo.
define variable v_dsc_cc like sod_dsc_cc no-undo.
def var vso_cmtindx like so_cmtindx no-undo.
def var ok as logical.
def var set-f1 as logical.
define temp-table components
field c_comp like ps_comp
field c_qty_per like ps_qty_per
field c_price as decimal format "->>>>>>.99"
field c_cmmt as char format "x(70)".
def var i as int.
def var basedate as date.
def var t as char format "x(78)".
def temp-table cim
field cim_nbr like so_nbr
field cim_line like sod_line
field cim_part like c_comp
field cim_price as decimal format "->>>>>>.99"
field cim_qty_per like ps_qty_per
field cim_acct like sod_acct
field cim_cc like sod_cc
field cim_dsc_acct like sod_dsc_acct
field cim_dsc_cc like sod_dsc_cc
field cim_cmmt as char format "x(70)".
define stream soh.
define stream sol.
define stream cim.
{getscrn.i &FieldName = '"so_nbr"'
&frameName = '"a"'
&variable = vso_nbr}
{getscrn.i &FieldName = '"so_cust"'
&frameName = '"a"'
&variable = vso_cust}
vShipDate = today.
find first so_mstr where so_domain = global_domain
and so_nbr = vso_nbr no-lock no-error.
if not available so_mstr then return.
vso_ship = so_ship.
find first xcm_mstr where xcm_addr = vso_cust
and xcm_chargeable = yes
no-lock no-error.
if not available xcm_mstr then return.
/*insert CAT program here if xcm_chg_type = "cat" */
if xcm_chg_type = "" then return.
if xcm_chg_type = "CAT" then do:
{xcalc_cat.i}
end.
else do:
if xcm_chg_type = "OTHER" then do:
{xcalc_other.i}
end.
if xcm_chg_type = "MNTHLY" then do:
{xcalc_month.i}
end.
end.
There is a TailorPro anchor on ENTRY of the first PO frame
which will read a file written by the previous program
and executes the emailing of the PO last entered
This is a TailorPro anchor on the GO of the last PO frame
Program mail-po.p
def new shared var tailored like po_nbr.
def var vpo_nbr like po_nbr.
def var vpo_vend like po_vend.
def var command as char format "x(60)".
def var email like command.
def var i as int.
def stream t.
db1 = pdbname("qaddb").
find first usr_mstr where usr_userid = userid("qaddb")
no-lock no-error.
def stream email.
def new shared var action as char format "x".
{mfdeclre.i}
form skip(1) action at 5
label "Action" " (C)PL (E)mail or Blank=No Action"
skip(1) email at 1 no-label skip(1)
with frame action width 80 row 5 overlay side-labels
title "PO Action Acknowlegde (C)PL, (E)Mail or Nothing".
{getscrn.i &fieldname = '"po_nbr"'
&framename = '"a"'
&variable = vpo_nbr }
{getscrn.i &fieldname = '"po_vend"'
&framename = '"a"'
&variable = vpo_vend }
vpo_vend = trim(vpo_vend).
action = “E“.
find first ad_mstr where ad_domain = global_domain
and ad_addr = vpo_vend no-lock no-error.
if available ad_mstr and ad_name matches "*CPL*"
then action = "C".
find first cd_det where cd_domain = global_domain
and cd_ref = vpo_vend and cd_type = "EM"
no-lock no-error.
if available cd_det then email = cd_cmmt[1].
if not email matches "*@*" then email = usr_mail_address.
disp email with frame action.
update ACTION with frame action.
hide frame action.
end.
if action = "C" then do:
find first cd_det where cd_domain = global_domain
and cd_ref = vpo_vend and cd_type = "EM" no-lock no-error.
if available cd_det then email = cd_cmmt[1].
if email matches "*@*" then do:
output stream email to email.prn.
find first cd_det where cd_domain = global_domain
and cd_ref = "cpl-message" no-lock no-error.
if available cd_det then do:
do i = 1 to 15:
put stream email cd_cmmt[i] skip.
end.
output stream email close.
command = 'mailx -v -s "TTP Order Alert" '
+ email + " < email.prn".
unix silent value(command).
end.
else do:
message
"No CPL Message Text set-up in 1.12" skip(1)
"CPL Supplier cannot be informed" skip(1)
view-as alert-box
title "CPL Message Text Missing".
end.
end.
else do:
message skip(1)
"No Email setup in 1.12 for CPL Supplier"
skip(1)
view-as alert-box title "No Email setup".
end.
end.
if action = "e" then do:
tailored = vpo_nbr.
output stream t to mail-po.last.
put stream t tailored skip.
output stream t close.
end.
Program mail-exe.p
{mfdeclre.i}
def new shared var action as char.
def var command as char.
def stream t.
def new shared var tailored like po_nbr.
def var t as char format "x(40)".
t = "mail-po.last".
if search(t) <> ? then do:
input stream t from mail-po.last no-echo.
set stream t t.
tailored = t.
action = "e".
input stream t close.
command = "rm mail-po.last".
unix silent value(command).
{gprun.i ""x3p-order2.p""} /* this is a custom PO print program*/
output to terminal.
/* which selects the Optio printer to send
end.
emails*/
Customized Returns Maintenance Screen
QAD Original
Screen
TailorPro modified
Screen
Customized Returns Maintenance Screen
QAD Original
Screen
TailorPro modified
Screen
Request from Accounting
During Sales Order Shipment Processing
We have to check the system if the
Customer is on Credit-Hold and make this a hard stop!!
Let’s do it !!!
/*Program credithold.p will stop Shipping if Customer is on credit-hold*/
{mfdeclre.i}
/* include required to fill variable global_domain*/
def var vso_nbr like so_nbr.
/* variable to hold the SO number*/
Def var name like ad_name.
{getscrn.i &fieldname = '"so_nbr"‘
/* TailorPro include to fill variable with entered SO #*/
&framename = '"a"'
&variable = vso_nbr }
find first so_mstr where so_domain = global_domain
/*check if entered SO # is valid*/
and so_nbr = vso_nbr no-lock no-error.
if available so_mstr then do:
find first cm_mstr where cm_domain = global_domain
/*find the customer and check credit-hold flag */
and cm_addr = so_cust
and cm_cr_hold = true
no-lock no-error.
if available cm_mstr then do:
name = so_cust.
find first ad_mstr where ad_domain = global_domain
/* find customer name*/
and ad_addr = cm_addr
no-lock no-error.
if available ad_mstr then name = name + “: “ + ad_name.
message "Customer: " ad_name skip(1)
/*message for user*/
"**********On Credit Hold***********" skip(1)
"Please contact Accounting" skip(1)
view-as alert-box.
{scrnvalu.i
/* TailorPro include to enter a value to a field*/
&FieldName = '"so_nbr"‘
/* on the screen, in this case field so_nbr*/
&FieldValue = ''}
/* create an error by putting a BLANK into the SO Nbr*/
end.
end.
Execute TailorPro TOOLBAR
Activate Design Mode
From the TailorPro TOOLBAR
When in Design Mode hit CTRL-T
And select Anchor
Enter the program name on the GO Execute
This will activate the program to run
Every time the 7.9.15 screen is exited
On the GO event of Order selection frame (a) the
Program credithold.p will be executed by TailorPro
and checks if the customer is on credit hold
And give the user this message!!
The program credithold.p enters a BLANK in the SO Nbr
And cause this error!!
This anchor is linked to the ENTRY event
of the PO Receipt screen and will print labels for the receiver entered.
When you first enter this screen the Receiver Field is blank and
Nothing happens --- but
When the program returns to the screen after a receipt is done,
The receiver number is filled and the label print starts.
Program: print-rec.p Prints Receipt Labels of entered receiver
def new shared temp-table r
field r_nbr like prh_nbr
field r_receiver like prh_receiver
field r_line like prh_line
field r_recid as recid
field r_part like prh_part
field r_label as int init 1
field r_desc1 like pt_desc1 format "x(20)"
field r_qty_open like tr_qty_loc
field r_qty like tr_qty_loc
field r_loc like loc_loc extent 10
field r_certi as char format "x(8)"
field r_qty_loc like tr_qty_loc extent 10
index r r_part r_nbr.
def var i as int.
def var print-date as logical.
def var t as char format "x(30)".
def var desc1 like pt_desc1.
def var vreceivernbr like format_length.
{getscrn.i &fieldname = '"receivernbr"'
&framename = '"a1"'
&variable = vreceivernbr }
/*vreceivernbr = "RC160237".*/
if vreceivernbr > "" then do:
create r.
r_receiver = vreceivernbr.
end.
if vreceivernbr > "" then
message "Do Not Print Item Labels??"
view-as alert-box buttons YES-NO
update choice as logical.
find first prd_det where prd_dev = "ttprclbl".
if not available prd_det then return.
find first r no-error.
if not available r then return.
output thru value(prd_path).
r:
for each r where r_receiver > "".
do i = 1 to r_label:
find first prh_hist where prh_receiver = r_receiver
no-lock no-error.
if not available prh_hist then next r.
find first po_mstr where po_nbr = prh_nbr no-lock no-error.
if available po_mstr then do:
print-date = false.
find first vd_mstr where vd_addr = po_vend no-lock no-error.
if available vd_mstr then do:
if vd_buyer = "CERT" then
R_CERTI = '"C"'.
if vd_type = "DATE" then print-date = true.
end.
end.
find first pt_mstr where pt_part = prh_part no-lock no-error.
if not available pt_mstr and r_certi = "" then
r_certi = po_rmks.
put
"^XA^CFD" skip
"^FO 410,10^A0N,20,10^FDDate/Time:^FS" skip
"^FO 410,30^A0N,20,20^FD" today "^FS" skip
"^FO 410,50^A0N,20,20^FD" string(time,"HH:MM:SS") "^FS" skip
"^FO 500,10^A0N,20,10^FDPO:^FS" skip
"^FO 500,30^A0N,50,30^FD" prh_nbr "^FS" skip
"^FO 230,10^A0N,20,10^FDReceiver:^FS" skip
"^FO 230,40^A0N,60,40^FD" r_receiver "^FS" skip
"^FO 230,90^B3N,N,40,N,N^FD" r_receiver "^FS" SKIP
"^FO 230,140^A0N,40,40^FD" r_certi "^FS" skip.
put "^XZ" skip.
find first prd_det where prd_dev = "ttprclb1".
if not available prd_det then return.
if choice then return.
output thru value(prd_path).
parts:
for each prh_hist where prh_receiver = r_receiver no-lock.
find first pt_mstr where pt_part = prh_part no-lock no-error.
if not available pt_mstr then next parts.
put "^XA^CFD" skip.
find first vp_mstr where vp_vend = prh_vend and vp_part = prh_part
no-lock no-error.
if available vp_mstr then
put "^FO 95,100^A0R,30,30^FDV-Part:^FS" skip
"^FO 95,300^A0R,90,90^FD" vp_vend_part "^FS" skip.
put "^FO 45,10^A0R,30,30^FDDate:^FS" skip
"^FO 45,100^A0R,30,30^FD" today "^FS" skip
"^FO 35,550^A0R,60,60^FDQTY: ____ CHKD: ______^FS" skip
"^FO 15,10^A0R,30,30^FDReceiver:^FS" skip
"^FO 15,150^A0R,30,30^FD" r_receiver "^FS" skip.
t = trim(pt_draw) + "/" + trim(pt_rev).
if t <> "/" then
put "^FO 45,220^A0R,30,30^FDDwg/Rev:^FS" skip
"^FO 45,350^A0R,30,30^FD" t "^FS" skip.
put
"^FO 700,10^A0R,30,30^FDItem:^FS" skip
"^FO 300,10^A0R,400,140^FD" prh_part "^FS" skip
"^FO 190,300^A0R,60,60^FD" pt_desc1 "^FS" skip
"^FO 270,300^B3R,N,80,N,N^FD" prh_part "^FS" SKIP
"^FO 200,10^A0R,120,120^FD" r_certi "^FS" skip.
if (pt_desc1 matches "*ASME*" or pt_desc2 matches "*ASME*") then
put
"^FO 280,600^A0R,120,120^FD*ASME*^FS" skip.
put
"^XZ" skip.
if print-date then
put
"^XA^CFD" skip
"^FO 15,30^A0R,30,30^FDReceiver:^FS" skip
"^FO 10,160^A0R,40,40^FD" caps(r_receiver) "^FS"skip
"^FO 10,10^A0R,800,340^FD" prh_rcp_date "^FS" skip
"^XZ" skip.
end.
end.
end.
output to terminal.
If time is available, we will do a live demo
Albin Hess
ahess@thermasys.com
John Campbell
john@prostarsoftware.com
Download