-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #693 from hargata/Hargata/order.missing.supplies
Add functionality to order insufficient supplies for plan templates.
- Loading branch information
Showing
8 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace CarCareTracker.Models | ||
{ | ||
public class SupplyAvailability | ||
{ | ||
public bool Missing { get; set; } | ||
public string Description { get; set; } = string.Empty; | ||
public decimal Required { get; set; } | ||
public decimal InStock { get; set; } | ||
public bool Insufficient { get { return Required > InStock; } } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@using CarCareTracker.Helper | ||
@inject IConfigHelper config | ||
@inject ITranslationHelper translator | ||
@model List<SupplyAvailability> | ||
@{ | ||
var userConfig = config.GetUserConfig(User); | ||
var userLanguage = userConfig.UserLanguage; | ||
} | ||
<div class="modal-header"> | ||
<h5 class="modal-title">@translator.Translate(userLanguage, "Order Supplies")</h5> | ||
<button type="button" class="btn-close" onclick="hideOrderSupplyModal()" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
@if (!Model.Any() || Model.Any(x => x.Missing)) | ||
{ | ||
<p class="lead">@translator.Translate(userLanguage, "Missing Supplies, Please Delete This Template and Recreate It.")</p> | ||
} else | ||
{ | ||
<div class="row"> | ||
<div class="col-12" style="max-height:50vh; overflow-y:auto;"> | ||
<table class="table table-hover"> | ||
<thead class="sticky-top"> | ||
<tr class="d-flex"> | ||
<th scope="col" class="col-6 text-truncate">@translator.Translate(userLanguage, "Description")</th> | ||
<th scope="col" class="col-3 text-truncate">@translator.Translate(userLanguage, "Required")</th> | ||
<th scope="col" class="col-3 text-truncate">@translator.Translate(userLanguage, "In Stock")</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (SupplyAvailability supplyAvailability in Model) | ||
{ | ||
<tr class="d-flex @(supplyAvailability.Insufficient ? "table-danger" : "")"> | ||
<td class="col-6 text-truncate">@StaticHelper.TruncateStrings(supplyAvailability.Description)</td> | ||
<td class="col-3 text-truncate">@supplyAvailability.Required.ToString("N2")</td> | ||
<td class="col-3 text-truncate">@supplyAvailability.InStock.ToString("N2")</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
} | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" onclick="hideOrderSupplyModal()">@translator.Translate(userLanguage, "Cancel")</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters