For each stores each business segment of the cost of goods (call in cost, and bring up the cost, cost of sales, etc.)
Consult bosses should how to do.
A simple introduction of business:
Store business quantity unit price
Headquarters warehousing p1, 100, 100
Headquarters warehousing p2 60 120
Headquarters - & gt; A shop in allocating p1 15
Headquarters - & gt; A shop in allocating the p2 20
Headquarters sales p1 20 180
Headquarters sales p2 30 160
A shop selling p1 5 190
A shop selling p2 6 150
CodePudding user response:
This is to want to know how SQL is calculated, or if you want to know the cost calculation logic, if the former, you should list your logic as well as the resultsSoftware has a cost calculation system, generally need to perform monthly cost calculation, to calculate the cost of the monthly balance, general enterprise using weighted average method,
Outbound cost weighted calculation results at the end of each month by month to write back, as for transfers into the (library), usually take out warehouse cost directly, allocating outbound by the end of calculation cost to write back
CodePudding user response:
Thank you for reply.Would like to know how to write SQL statements to.
First-in, first-out method and weighted average method can.
Mainly is to want to by calculating the cost of the various business. So you don't need to go in business computing and update the cost of each store business.
Because of possible operator error or change a single
Due to cost. With calculation method can avoid the problem.
Even change single don't every time to update the cost of other business.
Several business such as I wrote above. How late through SQL statements the cost of each business documents.
Thank you very much!