On 30 Apr 02:12, Axel Braun wrote:
>
>
> Am Mittwoch, 29. April 2015 17:40:03 UTC+2 schrieb Cédric Krier:
> >
> > On 29 Apr 08:22, Axel Braun wrote:
> > >
> > >
> > > Am Mittwoch, 29. April 2015 15:10:03 UTC+2 schrieb Cédric Krier:
> > > >
> > > > > > I also needed to implement a way to re-compute the cost price of a
> > > > > > product: https://bugs.tryton.org/issue4729
> > > > > > The current implementation is quite naive as it re-compute from
> > the
> > > > > > first move. We will see if we need to improve this computation and
> > if
> > > > so
> > > > > > I already put some idea on the issue.
> > > > > >
> > > > > >
> > > > > I dont think that a recompute is required. Common practice is (as
> > > > described
> > > > > before):
> > > > > --
> > > > > I think you need to consider for which quantity of material the
> > > > subsequent
> > > > > charge applies:
> > > > > If the quantity is still on stock, fine, you can recalculate
> > > > accordingly.
> > > >
> > > > How can you know that?
> > > >
> > >
> > > By checking the stock quantity?
> >
> > This doesn't tell me if the actual products are still in the warehouse.
> >
>
> Now I dont understand. Tryton tells you your stock situation, so when you
> are having to do what you call a recaluclation, you can check the stock
> situation, and it gives you the quantities. Unless you are batch-managed,
> it's a dont -care on the product level. Just the quantity is of interest.
I think you don't correctly understand what is the "average" cost
method. Because the timing of event is very important.
It is wrong to add the landed cost to the average cost of a product if
the *real* product on which this landed cost applies is no more in the
warehouse (and we don't care about just the quantity but the *exact*
product).
Example:
- I buy 10 products @ 10€
- I buy 10 products @ 12€
- current average cost: 11€
- I sale 10 products
- current average cost: 11€
- I book landed cost for the first purchase: 1€
- current average cost: 11.5€ (not 12€)
- I book landed cost for the second purchase: 2€
- current average cost: 12.5€ (not 14€)
> > > > > If not, only the amount that relates to the stock is charged to the
> > > > stock,
> > > > > the rest goes to the price difference account.
> > > >
> > > > I don't understand. <http://www.b2ck.com/>
> > >
> > >
> > > I try an example:
> > > You have a stock of 100 pieces @ 1,20 EUR = 120 EUR stock value
> > >
> > > Now you order another 100 @ 1,30 EUR = 130 EUR stock value (stock value
> > at
> > > goods receipt)
> > >
> > > The total stock is now 200 pcs at a value of 250 EUR = 1,25EUR/pcs. Any
> > > withdrawal would mean: COGS = 1,25 EUR/piece
> > >
> > > Some time later you receive the invoice: with some reabates, you get
> > > charges 100pcs @ 1,24 = 124 EUR
> > >
> > > As you still have 100 on stock, you can reduce the material account by 6
> > > EUR = 200 pcs @ 244 EUR = 1,22 EUR/piece.
> > >
> > > That was the easy part.
> > >
> > > Now lets take a look if not sufficient stock is there.
> > > You have a stock of 100 pieces @ 1,20 EUR = 120 EUR stock value
> > >
> > > Now you order another 100 @ 1,30 EUR = 130 EUR (stock value at goods
> > > receipt)
> > >
> > > The total stock is now 200 pcs at a value of 250 EUR = 1,25EUR/pcs. Any
> > > withdrawal would mean: COGS = 1,25 EUR/piece
> > >
> > > You sell 120 pcs @ 1,25 = 150 EUR value (Costs of good sold - COGS)
> > >
> > > Now you get the bill with additional freight costs on it, say 100 pcs
> > @1,40
> > > = 140 EUR.
> > > As you have only 80 pcs left on stock (value: 100 EUR) , you can only
> > > charge a price difference for 80 pcs:
> > >
> > > 80 pcs *( 1,40€ - 1,30€) = 8 EUR
> > > Value of stock: 80 pcs , 108 EUR = 1,35 EUR/pcs
> > >
> > > The remainder has to go to the price difference account:
> > > 20 pcs *( 1,40€ - 1,30€) = 2 EUR (Expenses from price difference)
> > >
> > > At moving average, the stock value is always according to its current
> > > price. If you start recalculating, you would have to change bookings ex
> > > post, which would be wrong.
> >
> > This is exactly what does the re-computation.
> >
>
> Good. But I could not read this from the blueprint. Maybe you just add the
> example, so it is easier to follow...
Just test the code.
--
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/