Mysterious Numbers Appearing
  • JeffGrant
    Posts:32
    Joined:Thu Sep 20, 2018 3:38 pm
    Location:Sydney Australia
    Mysterious Numbers Appearing

    by JeffGrant » Thu Sep 05, 2019 12:54 pm

    Hi, I am at a real loss here. Spent hours scratching my head.

    I have this script that says:

    Sub CreateHoldForm()
    FormCreate()
    FormAdd("Did the customer request this hold?", 1, {"Yes", "No"})
    FormShow("Holding Facility ")
    If FormResult(1) = 1
    cSellPrice3:= Stock->C
    Return
    Else FormResult(1) = 2
    cSellPrice3:= Stock->E
    Return
    Endif
    Return

    If FormResult is Yes, then UnitSell on the invoice form is updated and the subtotal is correct. No Drama :-)

    If FormResult is No, then UnitSell on the invoice form is updated, but the subtotal shows a negative Stock->E. Therefore subtracting the value Stock->E from the invoice total instead of adding to it.

    I have tried using cSellPrice3:= Abs(Stock->E), but the negative still appears.


    This is happening on a few routines. So I must clearly be doing something wrong. I don't have any idea where the negative is coming from. The value of Stock->E is being picked up, but why is it negative ?????

    I am really really stumped and bemused :-(.

    Any guidance would be greatly appreciated.
  • JeffGrant
    Posts:32
    Joined:Thu Sep 20, 2018 3:38 pm
    Location:Sydney Australia

    UPDATE: Mysterious Numbers Appearing

    by JeffGrant » Fri Sep 06, 2019 9:53 am

    Morning,

    I have spent hours overnight trying to figure this out and tried all sorts of combinations and in many subroutines. The crux of the matter is that the UnitSell Price is being updated on the invoice form, but the subtotal is picking up a negative from somewhere or multiplying the stock price by -1.

    Why????

    I have tried all sorts of Stock Prices from A to H.
    I have tried the If .NOT. etc
    I have tried <> and many .OR.

    I have run out of ideas.

    Please give a direction.

    Thanks
  • JeffGrant
    Posts:32
    Joined:Thu Sep 20, 2018 3:38 pm
    Location:Sydney Australia

    UPDATE Part II : Mysterious Numbers Appearing

    by JeffGrant » Fri Sep 06, 2019 10:30 am

    Just for fun, I went the next step and printed the invoices. Even though the negative numbers are appearing in the subtotal box on the invoice form, the correct talleys have printed on the actual invoices.

    So now I am really bewildered.

    ????
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    Re: Mysterious Numbers Appearing

    by COBS Tech Support » Mon Sep 09, 2019 4:11 pm

    Unfortunately the tiny fragment of script you posted and the completely missing context of what you're actually doing makes question impossible to answer.

Who is online

Users browsing this forum: No registered users and 4 guests