mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-11 22:44:17 -06:00
Merge pull request #725 from hargata/Hargata/454
Allow users to add supplies onto existing records.
This commit is contained in:
commit
c49c8d67a2
8
Models/Supply/SupplyRequisitionHistory.cs
Normal file
8
Models/Supply/SupplyRequisitionHistory.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace CarCareTracker.Models
|
||||||
|
{
|
||||||
|
public class SupplyRequisitionHistory
|
||||||
|
{
|
||||||
|
public string CostInputId { get; set; }
|
||||||
|
public List<SupplyUsageHistory> RequisitionHistory { get; set; } = new List<SupplyUsageHistory>();
|
||||||
|
}
|
||||||
|
}
|
||||||
8
Models/Supply/SupplyStore.cs
Normal file
8
Models/Supply/SupplyStore.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace CarCareTracker.Models
|
||||||
|
{
|
||||||
|
public class SupplyStore
|
||||||
|
{
|
||||||
|
public string Tab { get; set; }
|
||||||
|
public bool AdditionalSupplies { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -44,10 +44,7 @@
|
|||||||
}
|
}
|
||||||
<label for="collisionRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
<label for="collisionRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="collisionRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage,"Cost of the repair")" value="@(isNew ? "" : Model.Cost)">
|
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="collisionRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage,"Cost of the repair")" value="@(isNew ? "" : Model.Cost)">
|
||||||
@if (isNew)
|
@await Html.PartialAsync("_SupplyStore", new SupplyStore { Tab = "RepairRecord", AdditionalSupplies = Model.RequisitionHistory.Any() })
|
||||||
{
|
|
||||||
@await Html.PartialAsync("_SupplyStore", "RepairRecord")
|
|
||||||
}
|
|
||||||
<label for="collisionRecordTag">@translator.Translate(userLanguage, "Tags(optional)")</label>
|
<label for="collisionRecordTag">@translator.Translate(userLanguage, "Tags(optional)")</label>
|
||||||
<select multiple class="form-select" id="collisionRecordTag">
|
<select multiple class="form-select" id="collisionRecordTag">
|
||||||
@foreach (string tag in Model.Tags)
|
@foreach (string tag in Model.Tags)
|
||||||
@ -126,7 +123,7 @@
|
|||||||
<button type="button" class="btn btn-primary" onclick="saveCollisionRecordToVehicle(true)">@translator.Translate(userLanguage, "Edit Repair Record")</button>
|
<button type="button" class="btn btn-primary" onclick="saveCollisionRecordToVehicle(true)">@translator.Translate(userLanguage, "Edit Repair Record")</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@await Html.PartialAsync("_SupplyRequisitionHistory", Model.RequisitionHistory)
|
@await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "collisionRecordCost" })
|
||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
var selectedSupplies = [];
|
var selectedSupplies = [];
|
||||||
|
|||||||
@ -21,10 +21,7 @@
|
|||||||
<input type="text" id="planRecordDescription" class="form-control" placeholder="@translator.Translate(userLanguage, "Describe the Plan")" value="@Model.Description">
|
<input type="text" id="planRecordDescription" class="form-control" placeholder="@translator.Translate(userLanguage, "Describe the Plan")" value="@Model.Description">
|
||||||
<label for="planRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
<label for="planRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="planRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage, "Cost of the Plan")" value="@Model.Cost">
|
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="planRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage, "Cost of the Plan")" value="@Model.Cost">
|
||||||
@if (isNew)
|
@await Html.PartialAsync("_SupplyStore", new SupplyStore { Tab = "PlanRecord", AdditionalSupplies = Model.RequisitionHistory.Any() })
|
||||||
{
|
|
||||||
@await Html.PartialAsync("_SupplyStore", "PlanRecord")
|
|
||||||
}
|
|
||||||
<label for="planRecordType">@translator.Translate(userLanguage, "Type")</label>
|
<label for="planRecordType">@translator.Translate(userLanguage, "Type")</label>
|
||||||
<select class="form-select" id="planRecordType">
|
<select class="form-select" id="planRecordType">
|
||||||
<!option value="ServiceRecord" @(Model.ImportMode == ImportMode.ServiceRecord || isNew ? "selected" : "")>@translator.Translate(userLanguage, "Service")</!option>
|
<!option value="ServiceRecord" @(Model.ImportMode == ImportMode.ServiceRecord || isNew ? "selected" : "")>@translator.Translate(userLanguage, "Service")</!option>
|
||||||
@ -108,7 +105,7 @@
|
|||||||
<button type="button" class="btn btn-primary" onclick="savePlanRecordToVehicle(true)">@translator.Translate(userLanguage, "Edit Plan Record")</button>
|
<button type="button" class="btn btn-primary" onclick="savePlanRecordToVehicle(true)">@translator.Translate(userLanguage, "Edit Plan Record")</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@await Html.PartialAsync("_SupplyRequisitionHistory", Model.RequisitionHistory)
|
@await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "planRecordCost" })
|
||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
var selectedSupplies = [];
|
var selectedSupplies = [];
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<input type="text" id="planRecordDescription" class="form-control" placeholder="@translator.Translate(userLanguage, "Describe the Plan")" value="@Model.Description">
|
<input type="text" id="planRecordDescription" class="form-control" placeholder="@translator.Translate(userLanguage, "Describe the Plan")" value="@Model.Description">
|
||||||
<label for="planRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
<label for="planRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="planRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage, "Cost of the Plan")" value="@Model.Cost">
|
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="planRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage, "Cost of the Plan")" value="@Model.Cost">
|
||||||
@await Html.PartialAsync("_SupplyStore", "PlanRecordTemplate")
|
@await Html.PartialAsync("_SupplyStore", new SupplyStore { Tab = "PlanRecordTemplate", AdditionalSupplies = Model.RequisitionHistory.Any() })
|
||||||
<label for="planRecordType">@translator.Translate(userLanguage, "Type")</label>
|
<label for="planRecordType">@translator.Translate(userLanguage, "Type")</label>
|
||||||
<select class="form-select" id="planRecordType">
|
<select class="form-select" id="planRecordType">
|
||||||
<!option value="ServiceRecord" @(Model.ImportMode == ImportMode.ServiceRecord || isNew ? "selected" : "")>@translator.Translate(userLanguage, "Service")</!option>
|
<!option value="ServiceRecord" @(Model.ImportMode == ImportMode.ServiceRecord || isNew ? "selected" : "")>@translator.Translate(userLanguage, "Service")</!option>
|
||||||
@ -85,7 +85,7 @@
|
|||||||
<button type="button" class="btn btn-secondary" onclick="hideAddPlanRecordModal()">@translator.Translate(userLanguage, "Cancel")</button>
|
<button type="button" class="btn btn-secondary" onclick="hideAddPlanRecordModal()">@translator.Translate(userLanguage, "Cancel")</button>
|
||||||
<button type="button" class="btn btn-primary" onclick="savePlanRecordTemplate(true)">@translator.Translate(userLanguage, "Edit Plan Record Template")</button>
|
<button type="button" class="btn btn-primary" onclick="savePlanRecordTemplate(true)">@translator.Translate(userLanguage, "Edit Plan Record Template")</button>
|
||||||
</div>
|
</div>
|
||||||
@await Html.PartialAsync("_SupplyRequisitionHistory", Model.RequisitionHistory)
|
@await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "planRecordCost" })
|
||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
var selectedSupplies = [];
|
var selectedSupplies = [];
|
||||||
|
|||||||
@ -44,10 +44,7 @@
|
|||||||
}
|
}
|
||||||
<label for="serviceRecordCost">@translator.Translate(userLanguage,"Cost")</label>
|
<label for="serviceRecordCost">@translator.Translate(userLanguage,"Cost")</label>
|
||||||
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="serviceRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage,"Cost of the service")" value="@(isNew ? "" : Model.Cost)">
|
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="serviceRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage,"Cost of the service")" value="@(isNew ? "" : Model.Cost)">
|
||||||
@if (isNew)
|
@await Html.PartialAsync("_SupplyStore", new SupplyStore { Tab = "ServiceRecord", AdditionalSupplies = Model.RequisitionHistory.Any() })
|
||||||
{
|
|
||||||
@await Html.PartialAsync("_SupplyStore", "ServiceRecord")
|
|
||||||
}
|
|
||||||
<label for="serviceRecordTag">@translator.Translate(userLanguage,"Tags(optional)")</label>
|
<label for="serviceRecordTag">@translator.Translate(userLanguage,"Tags(optional)")</label>
|
||||||
<select multiple class="form-select" id="serviceRecordTag">
|
<select multiple class="form-select" id="serviceRecordTag">
|
||||||
@foreach(string tag in Model.Tags)
|
@foreach(string tag in Model.Tags)
|
||||||
@ -126,7 +123,7 @@
|
|||||||
<button type="button" class="btn btn-primary" onclick="saveServiceRecordToVehicle(true)">@translator.Translate(userLanguage,"Edit Service Record")</button>
|
<button type="button" class="btn btn-primary" onclick="saveServiceRecordToVehicle(true)">@translator.Translate(userLanguage,"Edit Service Record")</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@await Html.PartialAsync("_SupplyRequisitionHistory", Model.RequisitionHistory)
|
@await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "serviceRecordCost" })
|
||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
var selectedSupplies = [];
|
var selectedSupplies = [];
|
||||||
|
|||||||
@ -102,7 +102,7 @@
|
|||||||
<button type="button" class="btn btn-primary" onclick="saveSupplyRecordToVehicle(true)">@translator.Translate(userLanguage,"Edit Supply Record")</button>
|
<button type="button" class="btn btn-primary" onclick="saveSupplyRecordToVehicle(true)">@translator.Translate(userLanguage,"Edit Supply Record")</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@await Html.PartialAsync("_SupplyRequisitionHistory", Model.RequisitionHistory)
|
@await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "" })
|
||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
getUploadedFilesFromModel();
|
getUploadedFilesFromModel();
|
||||||
|
|||||||
@ -1,24 +1,38 @@
|
|||||||
@using CarCareTracker.Helper
|
@using CarCareTracker.Helper
|
||||||
@inject IConfigHelper config
|
@inject IConfigHelper config
|
||||||
@inject ITranslationHelper translator
|
@inject ITranslationHelper translator
|
||||||
@model List<SupplyUsageHistory>
|
@model SupplyRequisitionHistory
|
||||||
@{
|
@{
|
||||||
var userConfig = config.GetUserConfig(User);
|
var userConfig = config.GetUserConfig(User);
|
||||||
var userLanguage = userConfig.UserLanguage;
|
var userLanguage = userConfig.UserLanguage;
|
||||||
var showDelete = Model.All(x => x.Id != default);
|
var showDelete = Model.RequisitionHistory.All(x => x.Id != default);
|
||||||
var showPartNumber = Model.Any(x => !string.IsNullOrWhiteSpace(x.PartNumber));
|
var showPartNumber = Model.RequisitionHistory.Any(x => !string.IsNullOrWhiteSpace(x.PartNumber));
|
||||||
}
|
}
|
||||||
<script>
|
<script>
|
||||||
var supplyUsageHistory = [];
|
var supplyUsageHistory = [];
|
||||||
var deletedSupplyUsageHistory = [];
|
var deletedSupplyUsageHistory = [];
|
||||||
|
function subtractFromCostInput(costToSubtract){
|
||||||
|
let costInputId = '@Model.CostInputId';
|
||||||
|
let costInput = $(`#${costInputId}`);
|
||||||
|
let newCostAmount = globalParseFloat(costInput.val()) - globalParseFloat(costToSubtract);
|
||||||
|
if (newCostAmount < 0){
|
||||||
|
newCostAmount = 0;
|
||||||
|
}
|
||||||
|
costInput.val(globalFloatToString(newCostAmount.toFixed(2)));
|
||||||
|
}
|
||||||
function deleteSupplyUsageHistory(supplyId, quantity, cost, supplyRow){
|
function deleteSupplyUsageHistory(supplyId, quantity, cost, supplyRow){
|
||||||
deletedSupplyUsageHistory.push({
|
deletedSupplyUsageHistory.push({
|
||||||
id: decodeHTMLEntities(supplyId),
|
id: decodeHTMLEntities(supplyId),
|
||||||
quantity: decodeHTMLEntities(quantity),
|
quantity: decodeHTMLEntities(quantity),
|
||||||
cost: decodeHTMLEntities(cost)
|
cost: decodeHTMLEntities(cost)
|
||||||
});
|
});
|
||||||
supplyUsageHistory = supplyUsageHistory.filter(x=>x.id != decodeHTMLEntities(supplyId));
|
let supplyIndexToRemove = supplyUsageHistory.findIndex(x=>x.id == decodeHTMLEntities(supplyId) && x.quantity == decodeHTMLEntities(quantity) && x.cost == decodeHTMLEntities(cost));
|
||||||
|
if (supplyIndexToRemove > -1){
|
||||||
|
supplyUsageHistory.splice(supplyIndexToRemove, 1);
|
||||||
|
}
|
||||||
$(supplyRow).parents(".supply-row").remove();
|
$(supplyRow).parents(".supply-row").remove();
|
||||||
|
//update cost input value
|
||||||
|
subtractFromCostInput(decodeHTMLEntities(cost));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<div id="supplyUsageHistoryModalContainer" class="d-none">
|
<div id="supplyUsageHistoryModalContainer" class="d-none">
|
||||||
@ -26,7 +40,7 @@
|
|||||||
<h5 class="modal-title">@translator.Translate(userLanguage, "Supply Requisition History")</h5>
|
<h5 class="modal-title">@translator.Translate(userLanguage, "Supply Requisition History")</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@if (Model.Any())
|
@if (Model.RequisitionHistory.Any())
|
||||||
{
|
{
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12" style="max-height:50vh; overflow-y:auto;">
|
<div class="col-12" style="max-height:50vh; overflow-y:auto;">
|
||||||
@ -49,7 +63,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach (SupplyUsageHistory usageHistory in Model)
|
@foreach (SupplyUsageHistory usageHistory in Model.RequisitionHistory)
|
||||||
{
|
{
|
||||||
<script>
|
<script>
|
||||||
supplyUsageHistory.push({ id: decodeHTMLEntities("@usageHistory.Id"), date: decodeHTMLEntities("@usageHistory.Date.ToShortDateString()"), partNumber: decodeHTMLEntities('@usageHistory.PartNumber'), description: decodeHTMLEntities("@usageHistory.Description"), quantity: decodeHTMLEntities("@usageHistory.Quantity.ToString("F")"), cost: decodeHTMLEntities("@usageHistory.Cost.ToString("F")") })
|
supplyUsageHistory.push({ id: decodeHTMLEntities("@usageHistory.Id"), date: decodeHTMLEntities("@usageHistory.Date.ToShortDateString()"), partNumber: decodeHTMLEntities('@usageHistory.PartNumber'), description: decodeHTMLEntities("@usageHistory.Description"), quantity: decodeHTMLEntities("@usageHistory.Quantity.ToString("F")"), cost: decodeHTMLEntities("@usageHistory.Cost.ToString("F")") })
|
||||||
|
|||||||
@ -5,36 +5,51 @@
|
|||||||
var userConfig = config.GetUserConfig(User);
|
var userConfig = config.GetUserConfig(User);
|
||||||
var userLanguage = userConfig.UserLanguage;
|
var userLanguage = userConfig.UserLanguage;
|
||||||
}
|
}
|
||||||
@model string
|
@model SupplyStore
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<a onclick="showSuppliesModal()" class="btn btn-link">@translator.Translate(userLanguage,"Choose Supplies")</a>
|
<a onclick="showSuppliesModal()" class="btn btn-link">@translator.Translate(userLanguage,Model.AdditionalSupplies ? "Choose Additional Supplies" : "Choose Supplies")</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
resetSuppliesModal();
|
resetSuppliesModal();
|
||||||
function GetCaller() {
|
function GetCaller() {
|
||||||
return { tab: '@Model' };
|
return {
|
||||||
|
tab: '@Model.Tab',
|
||||||
|
addToSum: @Model.AdditionalSupplies.ToString().ToLower()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
function resetSuppliesModal() {
|
function resetSuppliesModal() {
|
||||||
$("#inputSuppliesModalContent").html("");
|
$("#inputSuppliesModalContent").html("");
|
||||||
}
|
}
|
||||||
|
function setCostInputWithSupplySum(selectedSum, input){
|
||||||
|
var addToSum = GetCaller().addToSum;
|
||||||
|
if (addToSum){
|
||||||
|
//sum of all requisitioned supplies
|
||||||
|
var currentSum = supplyUsageHistory.length > 0 ? supplyUsageHistory.map(x => globalParseFloat(x.cost)).reduce((a,b) => a + b) : 0;
|
||||||
|
selectedSum = globalParseFloat(selectedSum);
|
||||||
|
var newSum = currentSum + selectedSum;
|
||||||
|
input.val(globalFloatToString(newSum.toFixed(2)));
|
||||||
|
} else {
|
||||||
|
input.val(selectedSum);
|
||||||
|
}
|
||||||
|
}
|
||||||
function selectSupplies() {
|
function selectSupplies() {
|
||||||
var selectedSupplyResult = getSuppliesAndQuantity();
|
var selectedSupplyResult = getSuppliesAndQuantity();
|
||||||
var caller = GetCaller().tab;
|
var caller = GetCaller().tab;
|
||||||
switch (caller) {
|
switch (caller) {
|
||||||
case "ServiceRecord":
|
case "ServiceRecord":
|
||||||
$('#serviceRecordCost').val(selectedSupplyResult.totalSum);
|
setCostInputWithSupplySum(selectedSupplyResult.totalSum, $('#serviceRecordCost'))
|
||||||
break;
|
break;
|
||||||
case "RepairRecord":
|
case "RepairRecord":
|
||||||
$('#collisionRecordCost').val(selectedSupplyResult.totalSum);
|
setCostInputWithSupplySum(selectedSupplyResult.totalSum, $('#collisionRecordCost'))
|
||||||
break;
|
break;
|
||||||
case "UpgradeRecord":
|
case "UpgradeRecord":
|
||||||
$('#upgradeRecordCost').val(selectedSupplyResult.totalSum);
|
setCostInputWithSupplySum(selectedSupplyResult.totalSum, $('#upgradeRecordCost'))
|
||||||
break;
|
break;
|
||||||
case "PlanRecord":
|
case "PlanRecord":
|
||||||
case "PlanRecordTemplate":
|
case "PlanRecordTemplate":
|
||||||
$('#planRecordCost').val(selectedSupplyResult.totalSum);
|
setCostInputWithSupplySum(selectedSupplyResult.totalSum, $('#planRecordCost'))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
selectedSupplies = getSuppliesAndQuantity().selectedSupplies;
|
selectedSupplies = getSuppliesAndQuantity().selectedSupplies;
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12" style="max-height:50vh; overflow-y:auto;" id="supplies-table">
|
<div class="col-12" style="max-height:50vh; overflow-y:auto;" id="supplies-table">
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
@translator.Translate(userLanguage,"Supplies are requisitioned immediately after the record is created and cannot be modified. If you have incorrectly entered the amount you needed you will need to correct it in the Supplies tab.")
|
@translator.Translate(userLanguage,"Supplies are requisitioned immediately after the record saved.")
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center flex-wrap">
|
<div class="d-flex align-items-center flex-wrap">
|
||||||
@foreach (string recordTag in recordTags)
|
@foreach (string recordTag in recordTags)
|
||||||
|
|||||||
@ -44,10 +44,7 @@
|
|||||||
}
|
}
|
||||||
<label for="upgradeRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
<label for="upgradeRecordCost">@translator.Translate(userLanguage, "Cost")</label>
|
||||||
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="upgradeRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage,"Cost of the upgrade/mods")" value="@(isNew ? "" : Model.Cost)">
|
<input type="text" inputmode="decimal" onkeydown="interceptDecimalKeys(event)" onkeyup="fixDecimalInput(this, 2)" id="upgradeRecordCost" class="form-control" placeholder="@translator.Translate(userLanguage,"Cost of the upgrade/mods")" value="@(isNew ? "" : Model.Cost)">
|
||||||
@if (isNew)
|
@await Html.PartialAsync("_SupplyStore", new SupplyStore { Tab = "UpgradeRecord", AdditionalSupplies = Model.RequisitionHistory.Any() })
|
||||||
{
|
|
||||||
@await Html.PartialAsync("_SupplyStore", "UpgradeRecord")
|
|
||||||
}
|
|
||||||
<label for="upgradeRecordTag">@translator.Translate(userLanguage, "Tags(optional)")</label>
|
<label for="upgradeRecordTag">@translator.Translate(userLanguage, "Tags(optional)")</label>
|
||||||
<select multiple class="form-select" id="upgradeRecordTag">
|
<select multiple class="form-select" id="upgradeRecordTag">
|
||||||
@foreach (string tag in Model.Tags)
|
@foreach (string tag in Model.Tags)
|
||||||
@ -126,7 +123,7 @@
|
|||||||
<button type="button" class="btn btn-primary" onclick="saveUpgradeRecordToVehicle(true)">@translator.Translate(userLanguage, "Edit Upgrade Record")</button>
|
<button type="button" class="btn btn-primary" onclick="saveUpgradeRecordToVehicle(true)">@translator.Translate(userLanguage, "Edit Upgrade Record")</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@await Html.PartialAsync("_SupplyRequisitionHistory", Model.RequisitionHistory)
|
@await Html.PartialAsync("_SupplyRequisitionHistory", new SupplyRequisitionHistory { RequisitionHistory = Model.RequisitionHistory, CostInputId = "upgradeRecordCost" })
|
||||||
<script>
|
<script>
|
||||||
var uploadedFiles = [];
|
var uploadedFiles = [];
|
||||||
var selectedSupplies = [];
|
var selectedSupplies = [];
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user