Stock subtraction (1 Viewer)

Gismo

Registered User.
Local time
Today, 16:31
Joined
Jun 12, 2017
Messages
1,298
Hi All, does anyone know where I could download as sample DB to see how to handle stock level in purchases and in sales. not sure how to go about it
 

MarkK

bit cruncher
Local time
Today, 06:31
Joined
Mar 17, 2004
Messages
8,180
Typically this number is calculated from stock transactions like a bank balance. Your bank balance is...
Code:
Balance = Deposits - Withdrawals
QuantityOnHand is...
Code:
Quantity = Purchases - Sales
The theory here is that this number is never stored, but is in fact always calculated for a particular point in time from other data.
hth
Mark
 

Gismo

Registered User.
Local time
Today, 16:31
Joined
Jun 12, 2017
Messages
1,298
so you will log all received, all sales then calculate the balance? should stock received and stock issued qty be in the same field with sales as a negative or 2 different fields for quantity?
 

MarkK

bit cruncher
Local time
Today, 06:31
Joined
Mar 17, 2004
Messages
8,180
should stock received and stock issued qty be in the same field with sales as a negative or 2 different fields for quantity?
If I did it in the same table I would use the same field and then + or -. But some people will implement sales and purchases in different tables too. This is probably largely determined by the specific purpose of your system. Maybe only a sales system, or purchasing system, etc...
hth
Mark
 

Gismo

Registered User.
Local time
Today, 16:31
Joined
Jun 12, 2017
Messages
1,298
Thank you so much, do you know where I could download such a sample db?
 

MarkK

bit cruncher
Local time
Today, 06:31
Joined
Mar 17, 2004
Messages
8,180
Solving this problem is a significant hurdle in any business. Business rules are so customized, and people that can do that customization are unlikely to give it away.

Cheers,
Mark
 

Gismo

Registered User.
Local time
Today, 16:31
Joined
Jun 12, 2017
Messages
1,298
Thank you will have a look at the link
 

Users who are viewing this thread

Top Bottom