mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 04:16:16 +02:00
Code formatting / naming
This commit is contained in:
parent
4374712346
commit
260cccd299
|
|
@ -2330,6 +2330,5 @@ msgstr ""
|
||||||
msgid "Move on open"
|
msgid "Move on open"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
||||||
msgid "When checked, opening the product will move one unit to the default consume location"
|
msgid "When checked, opening the product will move one unit to the default consume location"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -239,20 +239,26 @@ $('#product-form input').keyup(function(event)
|
||||||
$('#location_id').change(function(event)
|
$('#location_id').change(function(event)
|
||||||
{
|
{
|
||||||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||||
updateMoveOnOpen();
|
UpdateMoveOnOpen();
|
||||||
});
|
|
||||||
$('#default_consume_location_id').change(function(event) {
|
|
||||||
updateMoveOnOpen();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateMoveOnOpen() {
|
$('#default_consume_location_id').change(function(event)
|
||||||
|
{
|
||||||
|
UpdateMoveOnOpen();
|
||||||
|
});
|
||||||
|
|
||||||
|
function UpdateMoveOnOpen()
|
||||||
|
{
|
||||||
var defaultLocation = $("#location_id :selected").val();
|
var defaultLocation = $("#location_id :selected").val();
|
||||||
var consumeLocationLocation = $("#default_consume_location_id :selected").val();
|
var consumeLocationLocation = $("#default_consume_location_id :selected").val();
|
||||||
|
|
||||||
if (!consumeLocationLocation || defaultLocation === consumeLocationLocation) {
|
if (!consumeLocationLocation || defaultLocation === consumeLocationLocation)
|
||||||
|
{
|
||||||
document.getElementById("move_on_open").checked = false;
|
document.getElementById("move_on_open").checked = false;
|
||||||
$("#move_on_open").attr("disabled", true);
|
$("#move_on_open").attr("disabled", true);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$("#move_on_open").attr("disabled", false);
|
$("#move_on_open").attr("disabled", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -572,7 +578,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
updateMoveOnOpen();
|
UpdateMoveOnOpen();
|
||||||
Grocy.FrontendHelpers.ValidateForm("product-form");
|
Grocy.FrontendHelpers.ValidateForm("product-form");
|
||||||
Grocy.Components.ProductPicker.GetPicker().trigger("change");
|
Grocy.Components.ProductPicker.GetPicker().trigger("change");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1057,9 +1057,12 @@ class StockService extends BaseService
|
||||||
|
|
||||||
$amount = 0;
|
$amount = 0;
|
||||||
}
|
}
|
||||||
if ($product->move_on_open) {
|
|
||||||
|
if ($product->move_on_open)
|
||||||
|
{
|
||||||
$locationIdTo = $product->default_consume_location_id;
|
$locationIdTo = $product->default_consume_location_id;
|
||||||
if ($locationIdTo && $locationIdTo !== $stockEntry->location_id) {
|
if ($locationIdTo && $locationIdTo !== $stockEntry->location_id)
|
||||||
|
{
|
||||||
$this->TransferProduct($stockEntry->product_id, $amount, $stockEntry->location_id, $locationIdTo, $stockEntry->stock_id, $transactionId);
|
$this->TransferProduct($stockEntry->product_id, $amount, $stockEntry->location_id, $locationIdTo, $stockEntry->stock_id, $transactionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user