Handling negative inventory quantities

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Handling negative inventory quantities

Rene Scheibe
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

How is it possible in OFBiz to handle negative inventory quantities?
It should be possible to sell goods even if the quantity in the
inventory is not sufficient and gets negative after an order.

If I try to sell a product (ProductB) without any inventory entry,
OFBiz does some strange things in the database.
It inserts 3 entries: decreasing the ATP, increasing the ATP and
decreasing the ATP again.
For a product (ProductA) with positive ATP everything is fine.

- -- initial data fill

- -- ProductA

inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
0001, quantityOnHandDiff:  300,0, availableToPromiseDiff:  200.0]

inventory_item[       inventoryItemId: 9000, productId:
ProductA,            quantityOnHandTotal: 300.0,
availableToPromiseTotal: 200.0]


- -- order (5x ProductA, 2x ProductB)

- -- ProductA

inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
10002, quantityOnHandDiff:    0.0, availableToPromiseDiff:   -5.0]

inventory_item[       inventoryItemId: 9000, productId:
ProductA,             quantityOnHandTotal: 300.0,
availableToPromiseTotal: 195.0]


- -- ProductB

inventory_item_detail[inventoryItemId: 10000,
inventoryItemDetailSeqId: 10001, quantityOnHandDiff:  0.0,
availableToPromiseDiff:  -2.0]

inventory_item_detail[inventoryItemId: 10000,
inventoryItemDetailSeqId: 10003, quantityOnHandDiff:  0.0,
availableToPromiseDiff:   2.0]

inventory_item_detail[inventoryItemId: 10001,
inventoryItemDetailSeqId: 10004, quantityOnHandDiff:  0.0,
availableToPromiseDiff:  -2.0]

inventory_item[       inventoryItemId: 10000, productId:
ProductB,             quantityOnHandTotal: 0.0,
availableToPromiseTotal:  0.0]

inventory_item[       inventoryItemId: 10001, productId:
ProductB,             quantityOnHandTotal: 0.0,
availableToPromiseTotal: -2.0]


I have seen balancing services in InventoryServices.xml (eg.
"balanceInventoryItems") but I don't how the details.

Any suggestions?

Regards,
Rene

- --
René Scheibe * [hidden email] * +49-176-62192936
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Sitz: Unterföhring * Amtsgericht München * HRB 135082
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx9IyQACgkQUXs9EHvIuCoqxgCeOa5op2dr5Opa7nm1szmqmryG
G3cAn1fgTI3UHT3PgrZqi48C8ZIy0Egs
=/aRL
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: Handling negative inventory quantities

Rene Scheibe
Maybe it's better to read the example as HTML-formatted email.

-- initial data fill
-- ProductA
inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
0001, quantityOnHandDiff:  300,0, availableToPromiseDiff:  200.0]
inventory_item[       inventoryItemId: 9000, productId:
ProductA,            quantityOnHandTotal: 300.0,
availableToPromiseTotal: 200.0]

-- order (5x ProductA, 2x ProductB)
-- ProductA
inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
10002, quantityOnHandDiff:    0.0, availableToPromiseDiff:   -5.0]
inventory_item[       inventoryItemId: 9000, productId:
ProductA,             quantityOnHandTotal: 300.0,
availableToPromiseTotal: 195.0]

-- ProductB
inventory_item_detail[inventoryItemId: 10000, inventoryItemDetailSeqId:
10001, quantityOnHandDiff:  0.0, availableToPromiseDiff:  -2.0]
inventory_item_detail[inventoryItemId: 10000, inventoryItemDetailSeqId:
10003, quantityOnHandDiff:  0.0, availableToPromiseDiff:   2.0]
inventory_item_detail[inventoryItemId: 10001, inventoryItemDetailSeqId:
10004, quantityOnHandDiff:  0.0, availableToPromiseDiff:  -2.0]
inventory_item[       inventoryItemId: 10000, productId:
ProductB,             quantityOnHandTotal: 0.0,
availableToPromiseTotal:  0.0]
inventory_item[       inventoryItemId: 10001, productId:
ProductB,             quantityOnHandTotal: 0.0, availableToPromiseTotal:
-2.0]

On 08/31/2010 05:43 PM, Rene Scheibe wrote:

> -- order (5x ProductA, 2x ProductB)
>
> -- ProductA
>
> inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
> 10002, quantityOnHandDiff:    0.0, availableToPromiseDiff:   -5.0]
>
> inventory_item[       inventoryItemId: 9000, productId:
> ProductA,             quantityOnHandTotal: 300.0,
> availableToPromiseTotal: 195.0]
>
>
> -- ProductB
>
> inventory_item_detail[inventoryItemId: 10000,
> inventoryItemDetailSeqId: 10001, quantityOnHandDiff:  0.0,
> availableToPromiseDiff:  -2.0]
>
> inventory_item_detail[inventoryItemId: 10000,
> inventoryItemDetailSeqId: 10003, quantityOnHandDiff:  0.0,
> availableToPromiseDiff:   2.0]
>
> inventory_item_detail[inventoryItemId: 10001,
> inventoryItemDetailSeqId: 10004, quantityOnHandDiff:  0.0,
> availableToPromiseDiff:  -2.0]
>
> inventory_item[       inventoryItemId: 10000, productId:
> ProductB,             quantityOnHandTotal: 0.0,
> availableToPromiseTotal:  0.0]
>
> inventory_item[       inventoryItemId: 10001, productId:
> ProductB,             quantityOnHandTotal: 0.0,
> availableToPromiseTotal: -2.0]
>  

--
René Scheibe * [hidden email]
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Sitz: Unterföhring * Amtsgericht München * HRB 135082

Reply | Threaded
Open this post in threaded view
|

Re: Handling negative inventory quantities

Jacques Le Roux
Administrator
Well tried :o) Unfortunately, but reasonably enough, the Apache MLs don't support HTML at all

Jacques

From: "Rene Scheibe" <[hidden email]>

> Maybe it's better to read the example as HTML-formatted email.
>
> -- initial data fill
> -- ProductA
> inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
> 0001, quantityOnHandDiff:  300,0, availableToPromiseDiff:  200.0]
> inventory_item[       inventoryItemId: 9000, productId:
> ProductA,            quantityOnHandTotal: 300.0,
> availableToPromiseTotal: 200.0]
>
> -- order (5x ProductA, 2x ProductB)
> -- ProductA
> inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
> 10002, quantityOnHandDiff:    0.0, availableToPromiseDiff:   -5.0]
> inventory_item[       inventoryItemId: 9000, productId:
> ProductA,             quantityOnHandTotal: 300.0,
> availableToPromiseTotal: 195.0]
>
> -- ProductB
> inventory_item_detail[inventoryItemId: 10000, inventoryItemDetailSeqId:
> 10001, quantityOnHandDiff:  0.0, availableToPromiseDiff:  -2.0]
> inventory_item_detail[inventoryItemId: 10000, inventoryItemDetailSeqId:
> 10003, quantityOnHandDiff:  0.0, availableToPromiseDiff:   2.0]
> inventory_item_detail[inventoryItemId: 10001, inventoryItemDetailSeqId:
> 10004, quantityOnHandDiff:  0.0, availableToPromiseDiff:  -2.0]
> inventory_item[       inventoryItemId: 10000, productId:
> ProductB,             quantityOnHandTotal: 0.0,
> availableToPromiseTotal:  0.0]
> inventory_item[       inventoryItemId: 10001, productId:
> ProductB,             quantityOnHandTotal: 0.0, availableToPromiseTotal:
> -2.0]
>
> On 08/31/2010 05:43 PM, Rene Scheibe wrote:
>> -- order (5x ProductA, 2x ProductB)
>>
>> -- ProductA
>>
>> inventory_item_detail[inventoryItemId: 9000, inventoryItemDetailSeqId:
>> 10002, quantityOnHandDiff:    0.0, availableToPromiseDiff:   -5.0]
>>
>> inventory_item[       inventoryItemId: 9000, productId:
>> ProductA,             quantityOnHandTotal: 300.0,
>> availableToPromiseTotal: 195.0]
>>
>>
>> -- ProductB
>>
>> inventory_item_detail[inventoryItemId: 10000,
>> inventoryItemDetailSeqId: 10001, quantityOnHandDiff:  0.0,
>> availableToPromiseDiff:  -2.0]
>>
>> inventory_item_detail[inventoryItemId: 10000,
>> inventoryItemDetailSeqId: 10003, quantityOnHandDiff:  0.0,
>> availableToPromiseDiff:   2.0]
>>
>> inventory_item_detail[inventoryItemId: 10001,
>> inventoryItemDetailSeqId: 10004, quantityOnHandDiff:  0.0,
>> availableToPromiseDiff:  -2.0]
>>
>> inventory_item[       inventoryItemId: 10000, productId:
>> ProductB,             quantityOnHandTotal: 0.0,
>> availableToPromiseTotal:  0.0]
>>
>> inventory_item[       inventoryItemId: 10001, productId:
>> ProductB,             quantityOnHandTotal: 0.0,
>> availableToPromiseTotal: -2.0]
>>
>
> --
> René Scheibe * [hidden email]
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> Sitz: Unterföhring * Amtsgericht München * HRB 135082
>