Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect calculation for adjustment #198

Open
JonnaQuismundo opened this issue Mar 9, 2023 · 1 comment
Open

Incorrect calculation for adjustment #198

JonnaQuismundo opened this issue Mar 9, 2023 · 1 comment

Comments

@JonnaQuismundo
Copy link

JonnaQuismundo commented Mar 9, 2023

See item AY131135 the msupply adjustment should be 10,800 but it's only showing 100

in mSupply the stock_on_hand calcluation is
stock_on_hand:=Cust_prev_stock_balance+Cust_stock_received+Cust_loss_adjust-Cust_stock_issued

then we calculate the msupply initial stock adjustment as
beginningBalanceAdjustment = (stock_on_hand || 0) - ((outgoingLine.beginningBalance || 0) + (inventoryAdjustments || 0) - (Cust_stock_issued || 0));

based on the screenshots below of item AY131135 the values are
stock_on_hand: 31,100+0+2,700-10,700 = 23,100
Adjustment = 23,100 - (20,300 + 2,700 - 10,700) = 10,800

msupply balance adjustment is calculated as 10,800
however, in eSigl the msupply balance adjustment only shows 100. Based on the pattern, it seems like is deducting again the Cust_stock_issued value, not sure why 😢

  1. It's unknown why the initial adjustment balance is incorrect. Could be that eSIGL is returning an incorrect outgoingLine.beginningBalance ???
  2. It's better to use a straightforward calculation for the initial adjustment balance: beginningBalanceAdjustment = Cust_prev_stock_balance (msupply initialStockOnHand) - outgoingLine.beginningBalance
    but we need to find out what happens in 1 first

DB: https://www.dropbox.com/s/p6rf9z5sac6bau6/IC%20eSigl%20-%20Copy.zip?dl=0
C2028 - DISTRICT SANITAIRE DIVO
program: PNLP-MEDICAMENTS ET INTRANTS

Screen Shot 2023-03-08 at 6 12 24 PM

Screen Shot 2023-03-08 at 6 10 23 PM

Screen Shot 2023-03-08 at 6 13 44 PM

@mark-prins
Copy link
Contributor

I've tested using the master branch of the elmis service and get this:

image

For the AY13115 the values are:
beginningBalanceAdjustment: 10800
Stock on Hand: 23100
eSIGL beginning balance: 20300
Inventory adjustments: 2700
Cust_stock_issued: 10700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants