Options

How to put restriction on Purchase Invoice

mkpjsrmkpjsr Member Posts: 587
Hi all,

As per our requirement we archive purchase orders for sending delivery schedules on a monthly basis to our vendors by changing the quantity on orders.
Now, when we receive the item against that order no we just want to make sure that the received qty must be less than or equal to the scheduled quantity.

For doing this we have added a new field called Month (Type->Option) on Purchase header,Purchase Header Archive and Purch. Inv Header( having same Object Id) tables and when we archive the Purchase order (Month value is updated in Purchase Header Archive table) we just select the month (Jan,Feb,...etc) and also we change the quantity for that month to be scheduled and we take a print of it to send to the vendors. here in the same month we can send multiple schedule to our vendors for the same month.

Suppose we send schedule for Item X for the month of November and quantity is 10, again we send the schedule for the same item but qty is 50, i.e. the total scheduled qty is now 60 for the month of November. Now the vendor has to supply the item X of qty 60 to us and they can supply in one invoice or more than one invoice. Suppose the vendor has supplied us the quantity 40 in two invoices i.e. they have to supply 20 more quantity. Now if our vendor supply a quantity of 25 then the system should not allow this.

how we should proceed to resolve this issue.
The main goal is to restrict the vendors from supplying extra items, they need to supply as per the schedules only.

As far as i understand this, i think we have to count the no of quantity in "Purchase Header Archive" and "Purch. Inv. Header" table by putting appropriate filters under OnValidate trigger of "Qty. To Receive" field of Purchase Header table.

Can anybody suggest me am I going right or wrong, what piece of code i need to write here
for putting appropriate filter.

Answers

  • Options
    bbrownbbrown Member Posts: 3,268
    Any reason why you did not use Blanket Order functionality?
    There are no bugs - only undocumented features.
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    Have you ever been in a situation where you need to drive somewhere to visit a friend where you haven't been before. You know where you are, and you know approximately where you need to be (lets say your friend lives in the North East and you live in the South West, and so you just start driving in that direction, without checking the map first. Soon you find that you are no longer heading the correct direction, becasue the road curved and you are now heading due east and soon South East. You really are not sure now where you are, and you are starting to wonder if you were actually heading in the right direction. You stop to ask directions, but now you are in small town, and the people can guide you to the end of their town, but no further, and sometimes when you get to the end of town you realize that the road you are on doesn't go the direction you need.

    Eventually you see a phone, so you stop and call the friend you are going to visit. He tells you that from your home, you need to drive south to the highway, then the highway loops your city and then heads North East, and you will be there in 20 minutes, but you have already been traveling one hour on the short cuts. You then see another highway that heads Due West, and will get you back home in 20 minutes, but you know you are closer to your friends house, which is now due north of you some where.

    The decision you have to make, is; will it be simpler to keep driving through small towns, asking directions at each town, getting lost, and not really knowing where you are heading and when you will get there, OR is it better to turn around, go back home get on the correct highway and start the trip again.

    You need to make that decision.
    David Singleton
  • Options
    mkpjsrmkpjsr Member Posts: 587
    bbrown wrote:
    Any reason why you did not use Blanket Order functionality?

    We are using Blanket Order for creating the "One Time Purchase Order for the whole year" then this is converted to "Purchase Order" from here we send monthly schedule to our vendors.

    Actually the yearly Purchase Order contains the quantity that is to be supplied for the whole year and the monthly schedule (Purchase Order" contains the quantity that is to be supplied in the current month. So, we just want to put a check that whenever we receive items from the order then it should remind us of the actually quantity to receive.
  • Options
    mkpjsrmkpjsr Member Posts: 587
    Have you ever been in a situation where you need to drive somewhere to visit a friend where you haven't been before. You know where you are, and you know approximately where you need to be (lets say your friend lives in the North East and you live in the South West, and so you just start driving in that direction, without checking the map first. Soon you find that you are no longer heading the correct direction, becasue the road curved and you are now heading due east and soon South East. You really are not sure now where you are, and you are starting to wonder if you were actually heading in the right direction. You stop to ask directions, but now you are in small town, and the people can guide you to the end of their town, but no further, and sometimes when you get to the end of town you realize that the road you are on doesn't go the direction you need.

    Eventually you see a phone, so you stop and call the friend you are going to visit. He tells you that from your home, you need to drive south to the highway, then the highway loops your city and then heads North East, and you will be there in 20 minutes, but you have already been traveling one hour on the short cuts. You then see another highway that heads Due West, and will get you back home in 20 minutes, but you know you are closer to your friends house, which is now due north of you some where.

    The decision you have to make, is; will it be simpler to keep driving through small towns, asking directions at each town, getting lost, and not really knowing where you are heading and when you will get there, OR is it better to turn around, go back home get on the correct highway and start the trip again.

    You need to make that decision.

    Thanx for the valuable suggestion that I always experience from you.


    Actually, We are using Blanket Order for creating the "One Time Purchase Order for the whole year" then this is converted to "Purchase Order" from here we send monthly schedule to our vendors.

    Actually the yearly Purchase Order contains the quantity that is to be supplied for the whole year and the monthly schedule (Purchase Order" contains the quantity that is to be supplied in the current month. So, we just want to put a check that whenever we receive items from the order then it should remind us of the actually quantity to receive.
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    Rather a long reply I know, but maybe it will also help other people. (I was actually writing it as a blog, so just put thetext in here).

    Anyway. Basically NEVER use the Archive tables for anything except archiving. Think this through and do it a different way.
    David Singleton
  • Options
    crisnicolascrisnicolas Member Posts: 177
    I haven't understood a single thing.

    Your whole workflow can be resolved using Blanket Orders.
    You are using Archive to control the quantity that has been ordered (which is already controlled by the blanket order), so really looks like you are not using Blanket Orders at all. But you are... ](*,)

    Create a single Blanket Order for the total quantity to be ordered that year (let's say 500)
    Every month, you decide the quantity to be ordered this month. You go to the blanket order, fill the Qty. to receive field with the quantity to be ordered this month and hit the Make Order (let's say 40).
    The Purchase Order will be created with the quantity filled on Qty. to receive field on the Blanket Order (40).
    You can do this several times on the same month.

    The Make Order functionallity will not let you create a new Purchase Order if sum of all quantities that have already been ordered, plus the one getting created now, is greater than the total quantity of the blanket order.
    Per each Blanket Order, you'll have several Purchase Orders. You will not be able to receive more than ordered in any of them.

    I do not undertand the use of Blanket Orders, Orders and the Archive.
    Are you creating a single Order for the whole Blanket Order Quantity, and then trying to do on the order what the blanket order already does?
  • Options
    mkpjsrmkpjsr Member Posts: 587
    I haven't understood a single thing.

    Your whole workflow can be resolved using Blanket Orders.
    You are using Archive to control the quantity that has been ordered (which is already controlled by the blanket order), so really looks like you are not using Blanket Orders at all. But you are... ](*,)

    Create a single Blanket Order for the total quantity to be ordered that year (let's say 500)
    Every month, you decide the quantity to be ordered this month. You go to the blanket order, fill the Qty. to receive field with the quantity to be ordered this month and hit the Make Order (let's say 40).
    The Purchase Order will be created with the quantity filled on Qty. to receive field on the Blanket Order (40).
    You can do this several times on the same month.


    The Make Order functionallity will not let you create a new Purchase Order if sum of all quantities that have already been ordered, plus the one getting created now, is greater than the total quantity of the blanket order.
    Per each Blanket Order, you'll have several Purchase Orders. You will not be able to receive more than ordered in any of them.

    I do not undertand the use of Blanket Orders, Orders and the Archive.
    Are you creating a single Order for the whole Blanket Order Quantity, and then trying to do on the order what the blanket order already does?

    Hi, Thanx for the reply, now I have understood it clearly as how Blanket Order can resolve my issue. Thanx a ton.
  • Options
    mkpjsrmkpjsr Member Posts: 587
    Thanx a lot Mr. David and Mr. crisnicolas for your valuable suggestion.
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    mkpjsr wrote:
    Thanx a lot Mr. David and Mr. crisnicolas for your valuable suggestion.

    :thumbsup:

    You are very welcome, I hope you have come up with a good design.
    David Singleton
Sign In or Register to comment.