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-1186 View Inventory #2028

Merged
merged 43 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
26619f4
start with update issue
Mar 20, 2024
005d4c9
update src/main/java/org/isf/medicalinventory/gui/InventoryBrowser.java
Mar 20, 2024
d3763b4
Merge branch 'OP-1184' into OP-1185
Mar 21, 2024
b786632
start with update inventory
Mar 21, 2024
fdf1285
add method to update medical inventory
Mar 25, 2024
0a989e9
update src/main/java/org/isf/medicalinventory/gui/InventoryBrowser.java
Mar 25, 2024
e8681b1
use the good Message Dialog
Mar 25, 2024
2a127bd
update bundle/language_en.properties
Mar 25, 2024
229b89b
Update src/main/java/org/isf/medicalinventory/gui/InventoryBrowser.java
ArnaudFonzam Mar 25, 2024
054684d
Update bundle/language_en.properties
ArnaudFonzam Mar 25, 2024
44983bc
Update bundle/language_en.properties
ArnaudFonzam Mar 25, 2024
1eb248e
Update bundle/language_en.properties
ArnaudFonzam Mar 25, 2024
9dcecfe
Update bundle/language_en.properties
ArnaudFonzam Mar 25, 2024
80cb3f3
Update bundle/language_en.properties
ArnaudFonzam Mar 25, 2024
d692a57
Update src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java
ArnaudFonzam Mar 25, 2024
255dc60
apply changes
Mar 25, 2024
237e685
update the variable type on InventoryEdit and update bundle/language_…
Mar 25, 2024
94c384d
add possibility to view inventory
Mar 26, 2024
139d518
Merge branch 'develop' into OP-1186
May 23, 2024
64d5c50
Merge branch 'develop' into OP-1186
May 24, 2024
04ba3ab
add new field'
May 24, 2024
41d00f8
OP-1278 resource bundle addition (#2015)
dbmalkovsky Jun 13, 2024
d0f2e01
Chore: update Intellij settings to match Eclipse (#2019)
dbmalkovsky Jun 14, 2024
c62a846
Chore(deps): Bump org.apache.maven.plugins:maven-surefire-plugin
dependabot[bot] Jun 17, 2024
b8b66ff
Hibernate renamed org.hibernate.type to org.hibernate.orm.jdbc.bind (…
dbmalkovsky Jun 17, 2024
14fefeb
Chore(deps): Bump org.apache.maven.plugins:maven-jar-plugin
dependabot[bot] Jun 20, 2024
894460a
Merge pull request #2022 from informatici/dependabot/maven/org.apache…
dbmalkovsky Jun 20, 2024
730ca0c
Merge pull request #2020 from informatici/dependabot/maven/org.apache…
dbmalkovsky Jun 24, 2024
802e5c2
Chore(deps-dev): Bump org.junit.jupiter:junit-jupiter-engine
dependabot[bot] Jun 28, 2024
49302c4
Merge pull request #2024 from informatici/dependabot/maven/org.junit.…
dbmalkovsky Jun 28, 2024
04cad6c
Chore(deps-dev): Bump org.assertj:assertj-core from 3.25.3 to 3.26.0
dependabot[bot] Jul 6, 2024
77b3d83
Chore(deps): Bump org.apache.maven.plugins:maven-dependency-plugin
dependabot[bot] Jul 6, 2024
f7ee54e
Merge pull request #2011 from informatici/dependabot/maven/org.assert…
dbmalkovsky Jul 6, 2024
bb20adf
Merge pull request #2023 from informatici/dependabot/maven/org.apache…
dbmalkovsky Jul 6, 2024
f153d0e
Chore(deps-dev): Bump org.assertj:assertj-core from 3.26.0 to 3.26.3
dependabot[bot] Jul 10, 2024
e32e243
Merge pull request #2025 from informatici/dependabot/maven/org.assert…
dbmalkovsky Jul 10, 2024
2b49478
Chore(deps): Bump org.apache.maven.plugins:maven-surefire-plugin
dependabot[bot] Jul 11, 2024
53f306a
Merge pull request #2026 from informatici/dependabot/maven/org.apache…
dbmalkovsky Jul 11, 2024
37499d7
OP-1301-fix-units-packets-management-in-main-store (#2027)
mwithi Jul 24, 2024
041f07b
fix conflict
Jul 25, 2024
30569a8
fix error
Jul 25, 2024
caa7621
update bundle/language_en.properties
Jul 25, 2024
945b29f
fix bug
Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bundle/language_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ angal.inventoryrow.pleaseselectoneinventoryrow.msg
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.pleaseinsertinventory.msg = Please add and inventory in this inventory row.
angal.inventory.pleaseselectinventory.msg = Please select inventory.
angal.inventoryoperation.save.error.msg = Inventory not saved.
angal.inventory.nextarrow.btn = >
Expand Down Expand Up @@ -893,7 +893,7 @@ angal.medicalstock.lotpreparationdate
angal.medicalstock.medtype.col = Med Type
angal.medicalstock.movement = Movement
angal.medicalstock.movementdatefromcannotbelaterthanmovementdateto = Movement Date From cannot be later than movement Date To
angal.medicalstock.movementquantityisgreaterthanthequantityof.msg = Movement quantity is greater than the quantity of the lot selected; split the movement.
angal.medicalstock.movementquantityisgreaterthanthequantityof.fmt.msg = Movement quantity ({0}) is greater than the quantity of the lot selected ({1}); split the movement or adjust Units/Packets.
angal.medicalstock.multiplecharging.adateinthefutureisnotallowed.msg = A date in the future is not allowed.
angal.medicalstock.multiplecharging.chargetype = Charge Type
angal.medicalstock.multiplecharging.chooseamedical = Choose a Medical
Expand Down Expand Up @@ -935,7 +935,9 @@ angal.medicalstock.multipledischarging.isabouttoend
angal.medicalstock.multipledischarging.lotinformations = Lot Information
angal.medicalstock.multipledischarging.lotnumberabb = Lot No.
angal.medicalstock.multipledischarging.lyinginstock = Lying in stock:
angal.medicalstock.multipledischarging.movementexceedstheavailablequantityformedical.fmt.msg = Movement exceeds the available quantity ({0}) for medical {1}.
angal.medicalstock.multipledischarging.noelementtosave = No elements to save
angal.medicalstock.multipledischarging.nolotswithavailablequantityfoundformedicalpleasereport.fmt.msg = No lots with available quantity found for medical {0}; please report to system administrator.
angal.medicalstock.multipledischarging.outofstock = Out of stock!
angal.medicalstock.multipledischarging.packets = Packets
angal.medicalstock.multipledischarging.pleaseinsertavalidvalue = Insert a valid value
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -192,7 +192,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<version>3.7.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
Expand Down Expand Up @@ -336,13 +336,13 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.2</version>
<version>5.10.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.25.3</version>
<version>3.26.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ private JButton getNewButton() {
});
return jButtonNew;
}

private JButton getUpdateButton() {
jButtonEdit = new JButton(MessageBundle.getMessage("angal.common.edit.btn"));
jButtonEdit.setMnemonic(MessageBundle.getMnemonic("angal.common.edit.btn.key"));
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/org/isf/medicalinventory/gui/InventoryEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ private void fireInventoryUpdated() {
for (int i = 0; i < listeners.length; i++) {
((InventoryListener) listeners[i]).InventoryUpdated(event);
}
jTableInventoryRow.updateUI();

jTableInventoryRow.updateUI();
}

private GoodDateChooser jCalendarInventory;
Expand Down Expand Up @@ -215,11 +214,15 @@ private void fireInventoryUpdated() {
private MedicalDsrStockMovementTypeBrowserManager movTypeManager = Context.getApplicationContext().getBean(MedicalDsrStockMovementTypeBrowserManager.class);
private SupplierBrowserManager supplierManager = Context.getApplicationContext().getBean(SupplierBrowserManager.class);
private WardBrowserManager wardManager = Context.getApplicationContext().getBean(WardBrowserManager.class);


public InventoryEdit() {
mode = "new";
initComponents();
if (mode.equals("view")) {
saveButton.setVisible(false);
deleteButton.setVisible(false);
columnEditable = columnEditableView;
}
}

private boolean isAutomaticLotIn() {
Expand Down Expand Up @@ -992,6 +995,7 @@ public InventoryRowModel() throws OHServiceException {
}
}
}

}

public Class< ? > getColumnClass(int c) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/isf/medicals/gui/MedicalBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ private JButton getJButtonNew() {
buttonNew.setMnemonic(MessageBundle.getMnemonic("angal.common.new.btn.key"));
buttonNew.addActionListener(actionEvent -> {
// medical will reference the new record
medical = new Medical(null, new MedicalType("", ""), "", "", 0, 0, 0, 0, 0);
medical = new Medical(null, new MedicalType("", ""), "", "", 0, 0, 0, 0);
MedicalEdit newrecord = new MedicalEdit(medical, true, me);
newrecord.addMedicalListener(this);
newrecord.setVisible(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class MovStockMultipleDischarging extends JDialog {
MessageBundle.getMessage("angal.medicalstock.multipledischarging.expiringdate").toUpperCase()
};
private final Class[] columnClasses = { String.class, String.class, Integer.class, Integer.class, String.class, Integer.class, String.class, String.class };
private boolean[] columnEditable = { false, false, false, false, true, false, false, false };
private boolean[] columnEditable = { false, false, false, true, true, false, false, false };
private int[] columnWidth = { 50, 100, 70, 50, 70, 50, 100, 80 };
private boolean[] columnResizable = { false, true, false, false, false, false, false, false };
private boolean[] columnVisible = { true, true, true, true, true, true, !GeneralData.AUTOMATICLOT_OUT, !GeneralData.AUTOMATICLOT_OUT };
Expand Down Expand Up @@ -315,12 +315,7 @@ private JTextField getJTextFieldSearch() {
String refNo = jTextFieldReference.getText();

Movement movement = new Movement(med, (MovementType) jComboBoxDischargeType.getSelectedItem(), null, lot, date, qty, null, refNo);
if (med.getPcsperpck() > 1) {
model.addItem(movement, PACKETS);
} else {
model.addItem(movement, UNITS);
}

model.addItem(movement, UNITS);
jTextFieldSearch.setText(""); //$NON-NLS-1$
jTextFieldSearch.requestFocus();
}
Expand Down Expand Up @@ -596,7 +591,7 @@ protected Lot chooseLot(List<Lot> lots, double qty) {
private boolean checkQuantityInLot(Lot lot, double qty) {
double lotQty = lot.getMainStoreQuantity();
if (qty > lotQty) {
MessageDialog.error(this, "angal.medicalstock.movementquantityisgreaterthanthequantityof.msg");
MessageDialog.error(this, "angal.medicalstock.movementquantityisgreaterthanthequantityof.fmt.msg", qty, lotQty);
return false;
}
return true;
Expand Down Expand Up @@ -862,6 +857,15 @@ public Object getValueAt(int r, int c) {
@Override
public void setValueAt(Object value, int r, int c) {
Movement movement = movements.get(r);
if (c == 3) {
int oldQuantity = movement.getQuantity();
movement.setQuantity((int) value);

int total = calcTotal(movement, units.get(r));
if (!checkQuantityInMovement(movement, total)) {
movement.setQuantity(oldQuantity);
}
}
if (c == 4) {
int newOption = 0;
if (qtyOption[1].equals(value)) {
Expand Down