Skip to content

Commit

Permalink
OP-1305 | Confirm Inventory (#2070)
Browse files Browse the repository at this point in the history
* add confirm inventory feature

* update bundle/language_en.properties

* revert changes

* format the code

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

* update button order

* apply suggestion

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

* remove unused imports

* add possibilty to update prise of existing lot

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

* add check of existing reference on stock movement

* add another condition to enable lot button

* fix error on bundler

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

* add check of reference number on validateInventory

* reset param of settings.properties.dist

* update InventoryEdit

* revert code

* remove non used import

* update inventory during validation

* fix bugs

* fix bugs on InventoryBrowser

* add TimeTools to date properties

* add missng bundle key

* apply suggestion

* update InventoryEdit

* revert settings.properties.dist

* update InventoryEdit

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

* updat InventoryEdit.java

* add method the know if all medical are in inventory

* add logic to select and deselect specific and all radio button

* update the logic when saving inventory

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

* Update bundle/language_en.properties

* fix bug during save action

* fix bug

* charge Iterator by ListIterator

* Update bundle/language_en.properties

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

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

* remove empty comment

* fix conflit after merge

---------

Co-authored-by: ArnaudFonzam <[email protected]>
Co-authored-by: FOFOU FONZAM Gui Arnaud <[email protected]>
Co-authored-by: Alessandro Domanico <[email protected]>
Co-authored-by: David B Malkovsky <[email protected]>
  • Loading branch information
5 people authored Nov 19, 2024
1 parent c0109a3 commit d901d81
Show file tree
Hide file tree
Showing 4 changed files with 391 additions and 299 deletions.
16 changes: 13 additions & 3 deletions bundle/language_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -672,16 +672,21 @@ angal.hospital.visitstarthour.txt
angal.inventory.allproduct.txt = All products
angal.inventory.askforrealquantityempty.msg = Do you want to print without the real quantity?
angal.inventory.canceled = Canceled
angal.inventory.confirm.btn = Confirm
angal.inventory.confirm.btn.key = O
angal.inventory.confirm.success.msg = Inventory confirmation complete. All stock has been accurately verified and updated in the system.
angal.inventory.cannotcreateanotherinventorywithstatusdraft.msg = Cannot create another inventory with status draft, Because you already have an inventory with status draft or validated.
angal.inventory.cannotsavelot.msg = Cannot save the lot. Please verify lot information and retry.
angal.inventory.cannotsaveinventorywithoutproducts.msg = Cannot save inventory without products.
angal.inventory.cancelednoteditable.msg = A canceled inventory can not be modified.
angal.inventory.donenoteditable.msg = A confirm inventory can not be modified.
angal.inventory.chargetype.label = Charge Type
angal.inventory.clean.btn = Clean Table
angal.inventory.clean.btn.key = T
angal.inventory.choosedischargetypebeforevalidation.msg = Please choose the discharge type and save the inventory before validation.
angal.inventory.choosechargetypebeforevalidation.msg = Please choose the charge type and save the inventory before validation.
angal.inventory.choosesupplierbeforevalidation.msg = Please choose the supplier and save the inventory before validation.
angal.inventory.choosedestinationbeforevalidation.msg = Please choose the ward destination and save the inventory before validation.
angal.inventory.deletion.confirm.msg = Do you really want to delete this inventory?
angal.inventory.deletion.confirm.title = Confirm Deletion
angal.inventory.deletion.success.msg = The inventory has been successfully marked as deleted.
Expand Down Expand Up @@ -712,18 +717,19 @@ angal.inventory.supplier.label
angal.inventoryrow.addnotyetlistedproducts.title = Add products
angal.inventoryrow.doyoureallywanttodeletethisinventoryrow.msg = Do you really want to delete this/those inventory(ies) row(s)?
angal.inventoryrow.doyoureallywanttocleanthistable.msg = Do you really want to clean this table?
angal.inventory.doyouwanttoactualizetheinventory.msg = Do you want to actualize this inventory?
angal.inventoryrow.doyouwanttoaddallnotyetlistedproducts.msg = Do you want to add all not yet listed products?
angal.inventoryrow.doyouwanttocontinueediting.msg = Do you want to continue editing?
angal.inventoryrow.doyouwanttosavethechanges.msg = Do you want to save the changes?
angal.inventoryrow.doyoureallywanttovalidatethisinventory.msg = Do you really want to validate this inventory?
angal.inventory.doyoureallywanttoconfirmthisinventory.msg = Do you really want to confirm this inventory?
angal.inventoryrow.notfound.msg = Inventory not found.
angal.inventoryrow.invalidquantity.msg = Invalid quantity.
angal.inventory.pleaseinsertavalidinventorydate.msg = Please insert a valid inventory date.
angal.inventoryrow.pleaseselectonlyoneinventoryrow.msg = Please select only one inventory row.
angal.inventoryrow.pleaseselectatleastoneinventoryrow.msg = Please select at least one inventory row.
angal.inventoryrow.pleaseselectoneinventoryrow.msg = Please select one inventory row.
angal.inventoryrow.thislotcodealreadyexists.msg = This lot code already exists. Please change it.
angal.inventory.inventoryisalreadysaved.msg = This inventory is already saved. Please enter at least one inventory row before continue.
angal.inventory.pleaseselectonlyoneinventory.msg = Please select only one inventory.
angal.inventory.pleaseinsertinventory.msg = Please add and inventory in this inventory row.
angal.inventory.pleaseselectinventory.msg = Please select inventory.
Expand All @@ -739,8 +745,11 @@ angal.inventory.specificproduct.txt
angal.inventoryrow.theoreticqty.col = Theoretic Qty
angal.inventory.totalprice = Total price
angal.inventoryrow.unitprice.col = Unit price
angal.inventory.pleasevalidateinventoryagainsbeforeconfirmation.msg = Please validate this inventory again before confirmation.
angal.inventory.update.error.msg = Inventory not updated.
angal.inventory.update.success.msg = Inventory updated.
angal.inventory.doyouwanttoupdatethisinventory.msg = Do you want to update this inventory?
angal.inventory.nothinghasbeenaddedonthisinventory.msg = Nothing has been added to this inventory.
angal.inventory.validated = Validated
angal.inventory.done = Done
angal.inventory.validate.btn = Validate
Expand All @@ -749,7 +758,6 @@ angal.inventory.inventorymustsavebeforevalidation.msg
angal.inventory.validate.success.msg = The inventory has been successfully validated.
angal.inventory.theoreticalqtyhavebeenupdatedforsomemedical.fmt.msg = Theoretical(s) quantity(ies) have been updated by new movement(s) in main store for: {0}
angal.inventory.theoreticalqtyhavebeenupdatedforsomemedical.detail.fmt.msg = {0} lot: {1} qty: {2} -> {3} ({4})
angal.inventory.validate.error.msg = Error during inventory validation.
angal.inventory.allinventoryrowshouldhavelotbeforevalidation.msg = All the inventory rows should have lots before validation.
angal.inventory.viewinventory.title = View Inventory
angal.inventory.youhavealreadyaddedallproduct.msg = You have already added all the products.
Expand Down Expand Up @@ -900,7 +908,8 @@ angal.medicalstock.cost.col
angal.medicalstock.deletemovementsuccess.msg = Last movement successfully deleted.
angal.medicalstock.discharge.btn = Discharge
angal.medicalstock.discharge.btn.key = R
angal.medicalstock.notpossibletodeletethismovementthemedicalhasbeenusedafterbeenreceivedinward.fmt.msg = Not possible to delete this movement: the medical {0} has already been used after been received in ward {1}.
angal.medicalstock.notpossibletodeletethismovementthemedicalhasbeenusedafterbeenreceivedinward.fmt.msg = Not possible to delete this movement: the medical {0} has been used after it was received in ward {1}.
angal.medicalstock.notpossibletodeletethismovementbecauseitisrelatedtoaninventory.msg = Not possible to delete this movement because it is related to an inventory.
angal.medicalstock.duedate = Due date
angal.medicalstock.duedate.col = Due Date
angal.medicalstock.duedatefromcannotbelaterthanduedateto = Due Date From cannot be later than Due Date To
Expand Down Expand Up @@ -1901,6 +1910,7 @@ angal.ward.newward.title
angal.ward.nurses.col = Nurses
angal.ward.nursesedit = Number of nurses *
angal.ward.opd.txt = OPD
angal.ward.opdwardmusthaveopdservicechecked.msg = OPD ward must have OPD service checked.
angal.ward.pleasecheckinadmissionpatients.msg = Please check in admission / patients.
angal.ward.requiredfields = * Required fields
angal.ward.theemailmustbevalid.msg = The email must be valid.
Expand Down
21 changes: 19 additions & 2 deletions src/main/java/org/isf/medicalinventory/gui/InventoryBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

public class InventoryBrowser extends ModalJFrame implements InventoryListener {

private static final long serialVersionUID = 1L;
private GoodDateChooser jCalendarTo;
private GoodDateChooser jCalendarFrom;
private LocalDateTime dateFrom = TimeTools.getNow();
Expand All @@ -97,7 +98,7 @@ public class InventoryBrowser extends ModalJFrame implements InventoryListener {
private JLabel statusLabel;
JButton next;
JButton previous;
JComboBox pagesCombo = new JComboBox();
JComboBox<Integer> pagesCombo = new JComboBox<>();
JLabel under = new JLabel("/ 0 Page");
private static int PAGE_SIZE = 50;
private int startIndex = 0;
Expand Down Expand Up @@ -377,6 +378,11 @@ private JButton getUpdateButton() {
MessageDialog.error(null, "angal.inventory.cancelednoteditable.msg");
return;
}

if (inventory.getStatus().equals(InventoryStatus.done.toString())) {
MessageDialog.error(null, "angal.inventory.donenoteditable.msg");
return;
}
InventoryEdit inventoryEdit = new InventoryEdit(inventory,"update");
InventoryEdit.addInventoryListener(InventoryBrowser.this);
inventoryEdit.showAsModal(InventoryBrowser.this);
Expand Down Expand Up @@ -475,7 +481,18 @@ public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting()) {
int[] selectedRows = jTableInventory.getSelectedRows();
if (selectedRows.length == 1) {
jButtonEdit.setEnabled(true);
int selectedRow = jTableInventory.getSelectedRow();
MedicalInventory inventory = inventoryList.get(selectedRow);
if (inventory.getStatus().equals(InventoryStatus.canceled.toString()) ||
inventory.getStatus().equals(InventoryStatus.done.toString())) {
jButtonEdit.setEnabled(false);
jButtonDelete.setEnabled(false);
} else {
jButtonEdit.setEnabled(true);
jButtonDelete.setEnabled(true);

}
jButtonView.setEnabled(true);
jButtonView.setEnabled(true);
jButtonDelete.setEnabled(true);
} else {
Expand Down
Loading

0 comments on commit d901d81

Please sign in to comment.