Update Field - Amount Including VAT???

nvermanverma Member Posts: 396
Hey guyz,

I am having a slight issue updating a field in Purchase Invoice form.

The field is called "Amount Including VAT" (TAX). This field is located in the subform of Purchase Invoice. I would like it to be updated as soon as I enter "Quantiy" and "Direct Unit Cost Excl. Tax" or change either of those two fields. Right now, to update this field I have to release purchase documents everytime (which is pointless).

If anyone else had this issue before and could provide me with guidance as to how I can go about fixing this. Any help would be greatly appreciated.

Comments

  • SavatageSavatage Member Posts: 7,142
    I would instead of messing with the way that Amount Including Vat works is to create your own field on the purchase line table call it "Temp Amt Inc Vat" or whatever. On validate of either your cost field or qty field have it do whatever calculation you want it to do and update this new field. Then that field can be added to the form for viewing.
  • nvermanverma Member Posts: 396
    After doing a bit of research. I found a similar issue that someone had.

    http://dynamicsuser.net/forums/p/8550/31460.aspx
    Have a look at what happens when you press F9 from a sales order, there is a function SalesLine.UpdateVATOnLines that does the calculation.
    Just call it for each line.

    When I press F9, it opens another form (Purchase Invoice Statistics). In this form there is a field called "Amount Included VAT". If we are to drill down on this field. It opens another form called "Purchase Lines". This purchase Lines form has a field called "Outstanding Amount". This field seems to hold the value before it is inputted in the Amount Included VAT. So I was thinking about reading this value line by line and putting it in my Purchase Invoice form.

    This seems like a very nooby question. Any suggestions how I can do this.

    Basic Workflow would be:
    1) GET Purchase Header
    2) Drill down on Amount Included VAT
    3) Read the value "Outstanding Amount". Line by line.
    3) Input it to the "Amount Inlcluded VAT" in our Purchase Invoice subform.
  • SavatageSavatage Member Posts: 7,142
    Again why would you want to play around with "Amount Including Vat" field.

    It's works fine as you said when you release the order.
    the other thing you mentioned it "You would like it to update".

    I'm sure there are a ton of things people would "like" have happen but just beacuse it doesn't, doesn't mean you have to go around and change how the system was designed to work. When I hear "I would like it to do..." I assume this is purely visual for the user and not business related. You can train them on how the system works.

    That's why I mentioned creating a new field where you do what you "like" without messing around with the integrity of the product.

    Just my opinion. :wink:

    And if you think the field "Outstanding Amount" holds the value you are looking for without the need of releasing then add it to the form if it's not visible already. then the users can look at that field instead of messing with AIV field.

    I feel i'm wasting my breath and you will plow thru with whatever you want to change without thought to future problem & future upgrade problems.
  • nvermanverma Member Posts: 396
    It works fine when I release the order. But, can anyone tell me why the Amount including VAT fields are not populated on an unposted Purchase Line unless the document is Released?

    The clients wants to be able to give a Amount Including VAT for the Purchase Document/Header BEFORE posting it.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    nverma wrote:
    It works fine when I release the order. But, can anyone tell me why the Amount including VAT fields are not populated on an unposted Purchase Line unless the document is Released?

    The clients wants to be able to give a Amount Including VAT for the Purchase Document/Header BEFORE posting it.

    Are you an end user or a partner?

    If a partner, then you really should know all this.

    If an end user, then talk with your partner. They are the ones that understand your system and your business and will be able to advise you the best way to proceed.
    David Singleton
  • nvermanverma Member Posts: 396
    The company I work for does all the development for this organization.

    Well, I am not sure how to update the "Amount Included TAX" field without doing a release, that is why I am asking for suggestion or guidance so I can implement this for our client.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    nverma wrote:
    The company I work for does all the development for this organization.

    Well, I am not sure how to update the "Amount Included TAX" field without doing a release, that is why I am asking for suggestion or guidance so I can implement this for our client.

    The question is not "HOW" the question is "WHY".
    David Singleton
  • nvermanverma Member Posts: 396
    The question is how to do it.

    Sorry, if I caused confusion before.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    nverma wrote:
    The question is how to do it.

    Sorry, if I caused confusion before.

    The question is not "HOW" the question is "WHY".

    You know how you don't know why.
    David Singleton
  • nvermanverma Member Posts: 396
    ummm....i guess.. it can be seen as why its not working...

    any idea how i can fix it or implement it???
  • SavatageSavatage Member Posts: 7,142
    nverma wrote:
    The clients wants to be able to give a Amount Including VAT for the Purchase Document/Header BEFORE posting it.

    You have already figured out two answers that required no modifications.

    1)F9 to see the PO Statistics
    2)Release the order

    Now you have to ask them why they don't want to do these things.
  • nvermanverma Member Posts: 396
    I checked out the PO stats and I cant use it because even there the value is not calculated unless I release it. Once I release the document the values is updated there.

    I am going to try debugging the code to see where in the release function it calculates the Amount Included VAT and try to implement that same functionality so the user doesnt have to realease the funds to see the updated amount.
  • SogSog Member Posts: 1,023
    Nverma,

    Why are you researching code when you don't understand the business "requirement"?

    Does releasing, reopening documents have any value according to you?
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • SavatageSavatage Member Posts: 7,142
    nverma wrote:
    realease the funds
    :?: :-k is there some mod done on releasing a PO that does more than just update fields and lockdown the po? What funds are being released?
Sign In or Register to comment.