Merge pull request #811 from hargata/Hargata/801.3
Add sticker printing for supplies.
This commit is contained in:
@@ -1045,10 +1045,10 @@ namespace CarCareTracker.Controllers
|
||||
{
|
||||
foreach (int recordId in recordIds)
|
||||
{
|
||||
//stickerViewModel.VehicleRecords.SupplyRecords.Add(_supplyRecordDataAccess.GetSupplyRecordById(recordId));
|
||||
var record = _supplyRecordDataAccess.GetSupplyRecordById(recordId);
|
||||
stickerViewModel.SupplyRecords.Add(record);
|
||||
recordsAdded++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case ImportMode.NoteRecord:
|
||||
|
||||
@@ -6,5 +6,6 @@
|
||||
public Vehicle VehicleData { get; set; } = new Vehicle();
|
||||
public List<ReminderRecord> ReminderRecords { get; set; } = new List<ReminderRecord>();
|
||||
public List<GenericRecord> GenericRecords { get; set; } = new List<GenericRecord>();
|
||||
public List<SupplyRecord> SupplyRecords { get; set; } = new List<SupplyRecord>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stickerPrintContainer hideOnPrint">
|
||||
</div>
|
||||
<script>
|
||||
loadGarage();
|
||||
bindWindowResize();
|
||||
|
||||
@@ -178,4 +178,100 @@
|
||||
</div>
|
||||
}
|
||||
<script>setMarkDownStickerNotes()</script>
|
||||
} else if (Model.SupplyRecords.Any()){
|
||||
@foreach (SupplyRecord supplyRecord in Model.SupplyRecords)
|
||||
{
|
||||
<div class="d-flex flex-column recordSticker">
|
||||
<div class="d-flex">
|
||||
<img src="@config.GetLogoUrl()" class="lubelogger-logo" />
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
@if(Model.VehicleData.Id != default){
|
||||
<div class="col-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<span class="display-6">@($"{Model.VehicleData.Year} {Model.VehicleData.Make} {Model.VehicleData.Model}")</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<span class="lead">@($"{StaticHelper.GetVehicleIdentifier(Model.VehicleData)}")</span>
|
||||
</li>
|
||||
@foreach (ExtraField extraField in Model.VehicleData.ExtraFields)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(extraField.Value))
|
||||
{
|
||||
<li class="list-group-item">
|
||||
<span class="lead">@($"{extraField.Name}: {extraField.Value}")</span>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Description")}: {supplyRecord.Description}")
|
||||
</li>
|
||||
@if(!string.IsNullOrWhiteSpace(supplyRecord.PartNumber)){
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Part Number")}: {supplyRecord.PartNumber}")
|
||||
</li>
|
||||
}
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Supplier/Vendor")}: {supplyRecord.PartSupplier}")
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Cost")}: {supplyRecord.Cost.ToString("C")}")
|
||||
</li>
|
||||
@foreach (ExtraField extraField in supplyRecord.ExtraFields)
|
||||
{
|
||||
<li class="list-group-item">
|
||||
@($"{extraField.Name}: {extraField.Value}")
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
} else {
|
||||
<div class="col-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Description")}: {supplyRecord.Description}")
|
||||
</li>
|
||||
@if (!string.IsNullOrWhiteSpace(supplyRecord.PartNumber))
|
||||
{
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Part Number")}: {supplyRecord.PartNumber}")
|
||||
</li>
|
||||
}
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Supplier/Vendor")}: {supplyRecord.PartSupplier}")
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
@($"{translator.Translate(userLanguage, "Cost")}: {supplyRecord.Cost.ToString("C")}")
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<ul class="list-group">
|
||||
@foreach (ExtraField extraField in supplyRecord.ExtraFields)
|
||||
{
|
||||
<li class="list-group-item">
|
||||
@($"{extraField.Name}: {extraField.Value}")
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row flex-grow-1 flex-shrink-1">
|
||||
<div class="col-12">
|
||||
<div class="stickerNote ms-1 me-1 p-1">
|
||||
@(supplyRecord.Notes)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<script>setMarkDownStickerNotes()</script>
|
||||
}
|
||||
|
||||
@@ -194,6 +194,9 @@
|
||||
<li><hr class="context-menu-multiple dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecords(selectedRow, 'SupplyRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="duplicateRecordsToOtherVehicles(selectedRow, 'SupplyRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Duplicate To Vehicle")</span><i class="bi bi-copy"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#" onclick="printTabStickers(selectedRow, 'SupplyRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Print")</span><i class="bi bi-printer"></i></div></a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item text-danger" href="#" onclick="deleteRecords(selectedRow, 'SupplyRecord')"><div class="d-flex justify-content-between"><span class="me-5">@translator.Translate(userLanguage, "Delete")</span><i class="bi bi-trash"></i></div></a></li>
|
||||
</ul>
|
||||
@if (userColumnPreferences.Any())
|
||||
|
||||
@@ -362,7 +362,23 @@ function initTagSelector(input, noDataList) {
|
||||
input.tagsinput();
|
||||
}
|
||||
}
|
||||
|
||||
function getAndValidateSelectedVehicle() {
|
||||
var selectedVehiclesArray = [];
|
||||
$("#vehicleSelector :checked").map(function () {
|
||||
selectedVehiclesArray.push(this.value);
|
||||
});
|
||||
if (selectedVehiclesArray.length == 0) {
|
||||
return {
|
||||
hasError: true,
|
||||
ids: []
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
hasError: false,
|
||||
ids: selectedVehiclesArray
|
||||
}
|
||||
}
|
||||
}
|
||||
function showMobileNav() {
|
||||
$(".lubelogger-mobile-nav").addClass("lubelogger-mobile-nav-show");
|
||||
}
|
||||
@@ -1282,8 +1298,11 @@ function replenishSupplies() {
|
||||
currentCost = 0;
|
||||
}
|
||||
var currentQuantity = globalParseFloat($('#supplyRecordQuantity').val());
|
||||
if (isNaN(currentQuantity)) {
|
||||
currentQuantity = 0;
|
||||
}
|
||||
var newQuantity = currentQuantity + replenishedQuantity;
|
||||
if (replenishedCost.trim() == '') {
|
||||
if (replenishedCost.trim() == '' && currentCost > 0 && currentQuantity > 0) {
|
||||
|
||||
var unitCost = currentCost / currentQuantity;
|
||||
var newCost = newQuantity * unitCost;
|
||||
|
||||
@@ -576,23 +576,6 @@ function showMultipleRemindersSelector() {
|
||||
$("#recurringReminderInput").show();
|
||||
}
|
||||
}
|
||||
function getAndValidateSelectedVehicle() {
|
||||
var selectedVehiclesArray = [];
|
||||
$("#vehicleSelector :checked").map(function () {
|
||||
selectedVehiclesArray.push(this.value);
|
||||
});
|
||||
if (selectedVehiclesArray.length == 0) {
|
||||
return {
|
||||
hasError: true,
|
||||
ids: []
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
hasError: false,
|
||||
ids: selectedVehiclesArray
|
||||
}
|
||||
}
|
||||
}
|
||||
function getAndValidateSelectedRecurringReminder() {
|
||||
if ($("#multipleRemindersCheck").is(":checked")) {
|
||||
//validate multiple reminders
|
||||
|
||||
Reference in New Issue
Block a user