Thermasys_ProStar by xiuliliaofz

VIEWS: 6 PAGES: 38

									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
                                                                         field cim_acct like sod_acct
define variable PriceDelta as decimal      no-undo.
                                                                         field cim_cc like sod_cc
define variable CustType as character no-undo.
                                                                         field cim_dsc_acct like sod_dsc_acct
define variable SodLine as integer         no-undo.
                                                                         field cim_dsc_cc like sod_dsc_cc
define variable NonCatSurcharge as decimal         no-undo.
                                                                         field cim_cmmt as char format "x(70)".
define variable v_cimfile as character initial "soivmt.cim“ no-undo.
                                                                         define stream soh.
define variable v_outfile as character initial "soivmt.out" no-undo.
                                                                         define stream sol.
define variable v_sohfile as character initial "soheader.cim“ no-undo.
                                                                         define stream cim.
define variable v_solfile as character initial "soline.cim"   no-undo.
                                                                         {getscrn.i &FieldName = '"so_nbr"'
define variable v_delim as character initial "|"          no-undo.
                                                                            &frameName = '"a"'
define variable v_taxable as logical                      no-undo.
                                                                            &variable = vso_nbr}
define variable v_multslsp as logical                     no-undo.
                                                                         {getscrn.i &FieldName = '"so_cust"'
define variable v_slspsn as logical                       no-undo.
                                                                            &frameName = '"a"'
def var vcommand as char format "x(60)".
                                                                            &variable = vso_cust}
define variable v_batchrun as logical                     no-undo.
                                                                         vShipDate = today.
define variable v_acct like sod_acct no-undo.
                                                                         find first so_mstr where so_domain = global_domain
define variable v_cc like sod_cc no-undo.
                                                                                        and so_nbr = vso_nbr no-lock no-error.
define variable v_dsc_acct like sod_dsc_acct no-undo.
                                                                         if not available so_mstr then return.
define variable v_dsc_cc like sod_dsc_cc no-undo.
                                                                           vso_ship = so_ship.
def var vso_cmtindx like so_cmtindx no-undo.
                                                                           find first xcm_mstr where xcm_addr = vso_cust
def var ok as logical.
                                                                                         and xcm_chargeable = yes
def var set-f1 as logical.
                                                                                         no-lock no-error.
define temp-table components
                                                                           if not available xcm_mstr then return.
field c_comp like ps_comp
                                                                           /*insert CAT program here if xcm_chg_type = "cat" */
field c_qty_per like ps_qty_per
                                                                           if xcm_chg_type = "" then return.
field c_price as decimal format "->>>>>>.99"
                                                                           if xcm_chg_type = "CAT" then do:
field c_cmmt as char format "x(70)".
                                                                              {xcalc_cat.i}
def var i as int.
                                                                              end.
def var basedate as date.
                                                                           else do:
def var t as char format "x(78)".
                                                                              if xcm_chg_type = "OTHER" then do:
def temp-table cim
                                                                                 {xcalc_other.i}
field cim_nbr like so_nbr
                                                                                 end.
field cim_line like sod_line
                                                                              if xcm_chg_type = "MNTHLY" then do:
field cim_part like c_comp
                                                                                 {xcalc_month.i}
field cim_price as decimal format "->>>>>>.99"
                                                                                 end.
field cim_qty_per like ps_qty_per
                                                                              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                                           if action = "C" then do:
                                                                    find first cd_det where cd_domain = global_domain
def new shared var tailored like po_nbr.                                       and cd_ref = vpo_vend and cd_type = "EM" no-lock no-error.
def var vpo_nbr like po_nbr.                                        if available cd_det then email = cd_cmmt[1].
def var vpo_vend like po_vend.                                      if email matches "*@*" then do:
def var command as char format "x(60)".                                output stream email to email.prn.
def var email like command.                                            find first cd_det where cd_domain = global_domain
def var i as int.                                                                        and cd_ref = "cpl-message" no-lock no-error.
def stream t.                                                          if available cd_det then do:
db1 = pdbname("qaddb").                                                   do i = 1 to 15:
find first usr_mstr where usr_userid = userid("qaddb")                       put stream email cd_cmmt[i] skip.
     no-lock no-error.                                                       end.
def stream email.                                                        output stream email close.
def new shared var action as char format "x".                             command = 'mailx -v -s "TTP Order Alert" '
{mfdeclre.i}                                                                         + email + " < email.prn".
form skip(1) action at 5                                                  unix silent value(command).
     label "Action" " (C)PL (E)mail or Blank=No Action"                   end.
     skip(1) email at 1 no-label skip(1)                               else do:
     with frame action width 80 row 5 overlay side-labels                 message
     title "PO Action Acknowlegde (C)PL, (E)Mail or Nothing".             "No CPL Message Text set-up in 1.12" skip(1)
                                                                          "CPL Supplier cannot be informed" skip(1)
 {getscrn.i &fieldname = '"po_nbr"'                                       view-as alert-box
            &framename = '"a"'                                            title "CPL Message Text Missing".
            &variable = vpo_nbr }                                         end.
                                                                       end.
 {getscrn.i &fieldname = '"po_vend"'                                else do:
            &framename = '"a"'                                         message skip(1)
            &variable = vpo_vend }                                     "No Email setup in 1.12 for CPL Supplier"
 vpo_vend = trim(vpo_vend).                                            skip(1)
action = “E“.                                                          view-as alert-box title "No Email setup".
find first ad_mstr where ad_domain = global_domain                     end.
                    and ad_addr = vpo_vend no-lock no-error.        end.
 if available ad_mstr and ad_name matches "*CPL*"
    then action = "C".                                           if action = "e" then do:
 find first cd_det where cd_domain = global_domain
                   and cd_ref = vpo_vend and cd_type = "EM"
                                                                    tailored = vpo_nbr.
                   no-lock no-error.                                output stream t to mail-po.last.
 if available cd_det then email = cd_cmmt[1].
 if not email matches "*@*" then email = usr_mail_address.          put stream t tailored skip.
 disp email with frame action.
 update ACTION with frame action.                                   output stream t close.
 hide frame action.
end.
                                                                    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   emails*/
     end.
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                                            put
field r_nbr like prh_nbr                                               "^XA^CFD" skip
field r_receiver like prh_receiver                                     "^FO 410,10^A0N,20,10^FDDate/Time:^FS" skip
field r_line like prh_line                                             "^FO 410,30^A0N,20,20^FD" today "^FS" skip
field r_recid as recid                                                 "^FO 410,50^A0N,20,20^FD" string(time,"HH:MM:SS") "^FS" skip
field r_part like prh_part                                             "^FO 500,10^A0N,20,10^FDPO:^FS" skip
field r_label as int init 1                                            "^FO 500,30^A0N,50,30^FD" prh_nbr "^FS" skip
field r_desc1 like pt_desc1 format "x(20)"                             "^FO 230,10^A0N,20,10^FDReceiver:^FS" skip
field r_qty_open like tr_qty_loc                                       "^FO 230,40^A0N,60,40^FD" r_receiver "^FS" skip
field r_qty like tr_qty_loc                                            "^FO 230,90^B3N,N,40,N,N^FD" r_receiver "^FS" SKIP
field r_loc like loc_loc extent 10                                     "^FO 230,140^A0N,40,40^FD" r_certi "^FS" skip.
field r_certi as char format "x(8)"                                    put "^XZ" skip.
field r_qty_loc like tr_qty_loc extent 10                          find first prd_det where prd_dev = "ttprclb1".
index r r_part r_nbr.                                              if not available prd_det then return.
def var i as int.                                                  if choice then return.
def var print-date as logical.                                     output thru value(prd_path).
def var t as char format "x(30)".                                      parts:
def var desc1 like pt_desc1.                                           for each prh_hist where prh_receiver = r_receiver no-lock.
def var vreceivernbr like format_length.                                  find first pt_mstr where pt_part = prh_part no-lock no-error.
{getscrn.i &fieldname = '"receivernbr"'                                   if not available pt_mstr then next parts.
           &framename = '"a1"'                                            put "^XA^CFD" skip.
           &variable = vreceivernbr }                                     find first vp_mstr where vp_vend = prh_vend and vp_part = prh_part
/*vreceivernbr = "RC160237".*/                                                            no-lock no-error.
if vreceivernbr > "" then do:                                             if available vp_mstr then
   create r.                                                                 put "^FO 95,100^A0R,30,30^FDV-Part:^FS" skip
   r_receiver = vreceivernbr.                                                     "^FO 95,300^A0R,90,90^FD" vp_vend_part "^FS" skip.
   end.                                                                   put "^FO 45,10^A0R,30,30^FDDate:^FS" skip
if vreceivernbr > "" then                                                        "^FO 45,100^A0R,30,30^FD" today "^FS" skip
message "Do Not Print Item Labels??"                                             "^FO 35,550^A0R,60,60^FDQTY: ____ CHKD: ______^FS" skip
              view-as alert-box buttons YES-NO                                   "^FO 15,10^A0R,30,30^FDReceiver:^FS" skip
               update choice as logical.                                        "^FO 15,150^A0R,30,30^FD" r_receiver "^FS" skip.
find first prd_det where prd_dev = "ttprclbl".                            t = trim(pt_draw) + "/" + trim(pt_rev).
if not available prd_det then return.                                     if t <> "/" then
find first r no-error.                                                       put "^FO 45,220^A0R,30,30^FDDwg/Rev:^FS" skip
if not available r then return.                                                    "^FO 45,350^A0R,30,30^FD" t "^FS" skip.
output thru value(prd_path).                                              put
r:                                                                         "^FO 700,10^A0R,30,30^FDItem:^FS" skip
for each r where r_receiver > "".                                          "^FO 300,10^A0R,400,140^FD" prh_part "^FS" skip
    do i = 1 to r_label:                                                   "^FO 190,300^A0R,60,60^FD" pt_desc1 "^FS" skip
    find first prh_hist where prh_receiver = r_receiver                    "^FO 270,300^B3R,N,80,N,N^FD" prh_part "^FS" SKIP
                        no-lock no-error.                                  "^FO 200,10^A0R,120,120^FD" r_certi "^FS" skip.
    if not available prh_hist then next r.                                if (pt_desc1 matches "*ASME*" or pt_desc2 matches "*ASME*") then
    find first po_mstr where po_nbr = prh_nbr no-lock no-error.              put
if available po_mstr then do:                                                  "^FO 280,600^A0R,120,120^FD*ASME*^FS" skip.
       print-date = false.                                                put
 find first vd_mstr where vd_addr = po_vend no-lock no-error.              "^XZ" skip.
       if available vd_mstr then do:                                      if print-date then
          if vd_buyer = "CERT" then                                                 put
          R_CERTI = '"C"'.                                                                  "^XA^CFD" skip
          if vd_type = "DATE" then print-date = true.                                               "^FO 15,30^A0R,30,30^FDReceiver:^FS" skip
          end.                                                                "^FO 10,160^A0R,40,40^FD" caps(r_receiver) "^FS"skip
       end.                                                                             "^FO 10,10^A0R,800,340^FD" prh_rcp_date "^FS" skip
   find first pt_mstr where pt_part = prh_part no-lock no-error.                                "^XZ" skip.
    if not available pt_mstr and r_certi = "" then                        end.
       r_certi = po_rmks.                                               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

								
To top