Jump to content

Inventory Script


This topic is 5760 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I need to track the amount of wine stored in tanks at the winery I work at. I have three parent tables:

One called STORAGE with a portal that is used to enter data about the movement of wine, the date of the transaction and which tank it went into. The next table (called WINES) stores data about the wine (vintage, varietal, etc.) The third table (called TANKS) keeps track of which tanks have what wine and how much free space, if any, is left in them.

The three parent tables are related the a third child table called LINES. This table keeps track of the portal records in the STORAGE table.

I've created a button on the STORAGE_Form layout which runs the script "Tank Inventory". It's first supposed to check if the storage report has been processed by seeing if a field called date_create is empty. If not, it goes on through the portal records removing and putting in wine depending on a field which can have a value of either "ship" or "receive". If the value is ship, then the script subtracts the wine from the gallonage of the tank. If it is receive it's the oppostie. If, at any time, the script notices there is not enough or too much wine in a tank, it will show a custom dialog and halt the script. Each tank has its own capacity, and the script should check each one.

However, the script doesn't properly check for the amount of wine in the given tank. It shows my custom dialog box saying there isn't enough room in the tank. If you read over the script I'm sure it will make more sense. I've looked over it a bunch and can't figure out what's wrong. I've attached a screen shot of the script. Thanks for any help you can give.

inventory_script.gif

Link to comment
Share on other sites

  • 3 weeks later...

If, at any time, the script notices there is not enough or too much wine in a tank

I have just seen this unattended post during a search, and at first glance does it look like the scripting can be simplified by using multicriteria relations utilizing the > or <

Next thing I need some answers to is why you in the transaction are writing real data, the ID's for linking is all it should be, since we're in a many2many or rather several.

--sd

Link to comment
Share on other sites

This topic is 5760 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.