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

OP-1332 OP-1199 OP-1200 Pharmacy Inventory feature #2127

Draft
wants to merge 355 commits into
base: develop
Choose a base branch
from

Conversation

mwithi
Copy link
Member

@mwithi mwithi commented Jan 28, 2025

See OP-1199 and OP-1200 (also addresses OP-1332).

Paired with informatici/openhospital-core#1480.

mwithi and others added 30 commits September 5, 2024 12:12
OP-1303 | Make status more evident in edit inventory
* add logic to delete inventory

* add import

* extract inventory.getStatus()

* set status on UpperCamel case when create new Inventory

* Update src/main/java/org/isf/medicalinventory/gui/InventoryBrowser.java

* add missiong bundle

---------

Co-authored-by: ArnaudFonzam <gui.fofou@umi2growcameroun.com>
Co-authored-by: Alessandro Domanico <alessandro.domanico@yahoo.it>
OP-1302 | Make JTable sortable in edit inventory
* add validate action

* Update bundle/language_en.properties

* update logique and apply the new

* update  src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java

* update bundle to add new message

* Rename one field

* Remove useless field and format code

* Remove deprecated field

* Fix exception after focus out on real qty

* Update one label

* update logic of validate Inventory

* update InventoryEdit

* update validate method

* update InventoryEdit

* update validate inventory'

* update Inventory Edit

* update InventoryEdit.java

* git fix error Index out of bound

* update Inventory

* apply suggestion

* fix error on update Cost of lot

* OP-1344: dialog method takes bundle key and not the final text (#2060)

* Add bundles

* Refactor validation method and change errors severity

* create new inventory during validation phase if we have new charge movement created after the creation date of inventory

---------

Co-authored-by: ArnaudFonzam <gui.fofou@umi2growcameroun.com>
Co-authored-by: David B Malkovsky <david@malkovsky.org>
Co-authored-by: Alessandro Domanico <alessandro.domanico@yahoo.it>
@mwithi mwithi changed the title OP-1199 OP-1200 Pharmacy Inventory feature OP-1332 OP-1199 OP-1200 Pharmacy Inventory feature Jan 31, 2025
MessageDialog.error(null, "angal.inventory.referencealreadyused.msg");
return;
}
inventory = new MedicalInventory();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inventory = new MedicalInventory();
inventory = new MedicalInventory();
wardSelected = (Ward)wardComboBox.getSelectedItem();
inventory.setWard(wardSelected.getCode());

Copy link
Member Author

@mwithi mwithi Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the setWard method is already on the line 498, wardSelected is global and it should be already set at this point because ward selection is compulsory before to even start a new inventory, so in theory we could also remove the null check...

Have you experienced a bug?
Anyway we have also a global wardId, which seems just unnecessary if we already have wardSelected... I guess we can simplify a lot the logic here...

Copy link
Contributor

@ArnaudFofou ArnaudFofou Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I have the error after the inventory was created after checking I see that ward column was null even as we set the value before create its. I think the problem is because the value of selected ward is not set to the variable wardSelect and the value is null during creation. look the listener of wardComboBox you didn't set the value of the wardSelected but you used wardId, so you can use wardSelected instead of wardId on wardCombox Listener to avoid a lot of variable doing the same things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for now I've published a quick fix, please try.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @ArnaudFofou did you try if the latest code on this branch solved your error?
Please update, just added some changes to ackknowledge the new develop...

@mwithi mwithi marked this pull request as draft March 5, 2025 08:52
mwithi and others added 8 commits March 5, 2025 10:00
* update inventory and inventoryward report and add missing inventory bundle

* remove bundle and update the inventory report

* update inventoryWard properties

* update ward inventory report

---------

Co-authored-by: David B Malkovsky <david@malkovsky.org>
Co-authored-by: ArnaudFofou <gui.fofou@umi2growcameroun.com>
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

Successfully merging this pull request may close these issues.

5 participants