diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php
index f8f6c0e9d..91d4c3eb3 100644
--- a/src/Controller/PartController.php
+++ b/src/Controller/PartController.php
@@ -414,6 +414,12 @@ public function withdrawAddHandler(Part $part, Request $request, EntityManagerIn
throw new \LogicException("The timestamp must not be in the future!");
}
+ //Ensure that the amount is not null or negative
+ if ($amount <= 0) {
+ $this->addFlash('warning', 'part.withdraw.zero_amount');
+ goto err;
+ }
+
try {
switch ($action) {
case "withdraw":
diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf
index 5b72a3075..c87b9af47 100644
--- a/translations/messages.en.xlf
+++ b/translations/messages.en.xlf
@@ -11958,115 +11958,115 @@ Please note, that you can not impersonate a disabled user. If you try you will g
-
+ collection_type.new_element.tooltipThis element was newly created and was not persisted to the database yet.
-
+ part.merge.titleMerge part
-
+ part.merge.title.intointo
-
+ part.merge.confirm.title
- Do you really want to merge <b>%other%</b> into <b>%target%</b>?
+ %other% into %target%?]]>
-
+ part.merge.confirm.message
- <b>%other%</b> will be deleted, and the part will be saved with the shown information.
+ %other% will be deleted, and the part will be saved with the shown information.]]>
-
+ part.info.merge_modal.titleMerge parts
-
+ part.info.merge_modal.other_partOther part
-
+ part.info.merge_modal.other_into_thisMerge other part into this one (delete other part, keep this one)
-
+ part.info.merge_modal.this_into_otherMerge this part into other one (delete this part, keep other one)
-
+ part.info.merge_btnMerge part
-
+ part.update_part_from_info_provider.btnUpdate part from info providers
-
+ info_providers.update_part.titleUpdate existing part from info provider
-
+ part.merge.flash.please_reviewData not saved yet. Review the changes and click save to persist the new data.
-
+ user.edit.flash.permissions_fixedPermissions required by other permissions were missing. This was corrected. Please check if the permissions are as you intended.
-
+ permission.legend.dependency_notePlease note that some permission operations depend on each other. If you encounter a warning that missing permissions were corrected and a permission was set to allow again, you have to set the dependent operation to forbid too. The dependents can normally found right of an operation.
-
+ log.part_stock_changed.timestampTimestamp
-
+ part.info.withdraw_modal.timestampAction timestamp
-
+ part.info.withdraw_modal.timestamp.hintThis field allows you to specify the real date, when the stock operation actually was performed, and not just when it was logged. This value is saved in the extra field of the log entry.
-
+ part.info.withdraw_modal.delete_lot_if_emptyDelete this lot, if it becomes empty
@@ -12078,112 +12078,118 @@ Please note, that you can not impersonate a disabled user. If you try you will g
-
+ eda_info.reference_prefix.placeholdere.g. R
-
+ eda_info.reference_prefixReference prefix
-
+ eda_info.kicad_section.titleKiCad specific settings
-
+ eda_info.valueValue
-
+ eda_info.value.placeholdere.g. 100n
-
+ eda_info.exclude_from_bomExclude part from BOM
-
+ eda_info.exclude_from_boardExclude part from PCB/Board
-
+ eda_info.exclude_from_simExclude part from simulation
-
+ eda_info.kicad_symbolKiCad schematic symbol
-
+ eda_info.kicad_symbol.placeholdere.g. Transistor_BJT:BC547
-
+ eda_info.kicad_footprintKiCad footprint
-
+ eda_info.kicad_footprint.placeholdere.g. Package_TO_SOT_THT:TO-92
-
+ part.edit.tab.edaEDA information
-
+ api.api_endpoints.titleAPI endpoints
-
+ api.api_endpoints.partdbPart-DB API
-
+ api.api_endpoints.kicad_root_urlKiCad API root URL
-
+ eda_info.visibilityForce visibility
-
+ eda_info.visibility.helpBy default, the visibility to the EDA software is automatically determined. With this checkbox, you can force the part to be visible or invisible.
+
+
+ part.withdraw.zero_amount
+ You tried to withdraw/add an amount of zero! No action was performed.
+
+