From e700a5f1c2765f2b139a4b2fb421e4816177f870 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sat, 17 Feb 2024 10:51:39 -0700 Subject: [PATCH 01/10] functionality to duplicate collaborators across vehicles. --- Controllers/VehicleController.cs | 29 +++++++++++++++++++++ Views/Home/_GarageDisplay.cshtml | 4 +-- wwwroot/js/garage.js | 44 ++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/Controllers/VehicleController.cs b/Controllers/VehicleController.cs index 692b909..5d953bd 100644 --- a/Controllers/VehicleController.cs +++ b/Controllers/VehicleController.cs @@ -154,6 +154,34 @@ namespace CarCareTracker.Controllers _dataAccess.DeleteVehicle(vehicleId); return Json(result); } + [HttpPost] + public IActionResult DuplicateVehicleCollaborators(int sourceVehicleId, int destVehicleId) + { + try + { + //retrieve collaborators for both source and destination vehicle id. + if (_userLogic.UserCanEditVehicle(GetUserID(), sourceVehicleId) && _userLogic.UserCanEditVehicle(GetUserID(), destVehicleId)) + { + var sourceCollaborators = _userLogic.GetCollaboratorsForVehicle(sourceVehicleId).Select(x => x.UserVehicle.UserId).ToList(); + var destCollaborators = _userLogic.GetCollaboratorsForVehicle(destVehicleId).Select(x => x.UserVehicle.UserId).ToList(); + sourceCollaborators.RemoveAll(x => destCollaborators.Contains(x)); + if (sourceCollaborators.Any()) { + foreach (int collaboratorId in sourceCollaborators) + { + _userLogic.AddUserAccessToVehicle(collaboratorId, destVehicleId); + } + } else + { + return Json(new OperationResponse { Success = false, Message = "All collaborators already exist in destination vehicle" }); + } + } + return Json(new OperationResponse { Success = true, Message = "Collaborators Copied"}); + } catch (Exception ex) + { + _logger.LogError(ex.Message); + return Json(new OperationResponse { Success = false, Message = StaticHelper.GenericErrorMessage }); + } + } #region "Bulk Imports and Exports" [HttpGet] public IActionResult GetBulkImportModalPartialView(ImportMode mode) @@ -1906,5 +1934,6 @@ namespace CarCareTracker.Controllers return Json(result); } #endregion + } } diff --git a/Views/Home/_GarageDisplay.cshtml b/Views/Home/_GarageDisplay.cshtml index d168efc..cc145c5 100644 --- a/Views/Home/_GarageDisplay.cshtml +++ b/Views/Home/_GarageDisplay.cshtml @@ -23,9 +23,9 @@
@foreach (Vehicle vehicle in Model) { -
+
- +
@($"{vehicle.Year}")
@($"{vehicle.Make}")
diff --git a/wwwroot/js/garage.js b/wwwroot/js/garage.js index 501e13a..f26d492 100644 --- a/wwwroot/js/garage.js +++ b/wwwroot/js/garage.js @@ -306,4 +306,48 @@ function sortGarage(sender, isMobile) { sortVehicles(false); } } +} + +let dragged = null; +let draggedId = 0; +function dragEnter(event) { + event.preventDefault(); +} +function dragStart(event, vehicleId) { + dragged = event.target; + draggedId = vehicleId; + event.dataTransfer.setData('text/plain', draggedId); +} +function dragOver(event) { + event.preventDefault(); +} +function dropBox(event, targetVehicleId) { + if (dragged.parentElement != event.target && event.target != dragged && draggedId != targetVehicleId) { + copyContributors(draggedId, targetVehicleId); + } + event.preventDefault(); +} +function copyContributors(sourceVehicleId, destVehicleId) { + var sourceVehicleName = $(`#gridVehicle_${sourceVehicleId} .card-body`).children('h5').map((index, elem) => { return elem.innerText }).toArray().join(" "); + var destVehicleName = $(`#gridVehicle_${destVehicleId} .card-body`).children('h5').map((index, elem) => { return elem.innerText }).toArray().join(" "); + Swal.fire({ + title: "Copy Collaborators?", + text: `Copy collaborators over from ${sourceVehicleName} to ${destVehicleName}?`, + showCancelButton: true, + confirmButtonText: "Copy", + confirmButtonColor: "#0d6efd" + }).then((result) => { + if (result.isConfirmed) { + $.post('/Vehicle/DuplicateVehicleCollaborators', { sourceVehicleId: sourceVehicleId, destVehicleId: destVehicleId }, function (data) { + if (data.success) { + successToast("Collaborators Copied"); + loadGarage(); + } else { + errorToast(data.message); + } + }) + } else { + $("#workAroundInput").hide(); + } + }); } \ No newline at end of file From 95c8cd19f895cb58fb383e954f944146a2d52b08 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sat, 17 Feb 2024 10:53:29 -0700 Subject: [PATCH 02/10] Updated error message --- Controllers/VehicleController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controllers/VehicleController.cs b/Controllers/VehicleController.cs index 5d953bd..57bcf1c 100644 --- a/Controllers/VehicleController.cs +++ b/Controllers/VehicleController.cs @@ -172,7 +172,7 @@ namespace CarCareTracker.Controllers } } else { - return Json(new OperationResponse { Success = false, Message = "All collaborators already exist in destination vehicle" }); + return Json(new OperationResponse { Success = false, Message = "Both vehicles already have identical collaborators" }); } } return Json(new OperationResponse { Success = true, Message = "Collaborators Copied"}); From 802c7923d5a5c3ebe808a62f9bfc2ae7d071b549 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sat, 17 Feb 2024 17:07:31 -0700 Subject: [PATCH 03/10] added supply usage history --- Controllers/VehicleController.cs | 19 +++++++++++++------ Models/Supply/SupplyRecord.cs | 1 + Models/Supply/SupplyRecordInput.cs | 4 +++- Models/Supply/SupplyUsageHistory.cs | 9 +++++++++ Views/Vehicle/_SupplyRecordModal.cshtml | 17 +++++++++++++---- wwwroot/js/supplyrecord.js | 3 ++- 6 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 Models/Supply/SupplyUsageHistory.cs diff --git a/Controllers/VehicleController.cs b/Controllers/VehicleController.cs index 57bcf1c..a8de258 100644 --- a/Controllers/VehicleController.cs +++ b/Controllers/VehicleController.cs @@ -703,7 +703,7 @@ namespace CarCareTracker.Controllers var result = _serviceRecordDataAccess.SaveServiceRecordToVehicle(serviceRecord.ToServiceRecord()); if (result && serviceRecord.Supplies.Any()) { - RequisitionSupplyRecordsByUsage(serviceRecord.Supplies); + RequisitionSupplyRecordsByUsage(serviceRecord.Supplies, DateTime.Parse(serviceRecord.Date), serviceRecord.Description); } return Json(result); } @@ -774,7 +774,7 @@ namespace CarCareTracker.Controllers var result = _collisionRecordDataAccess.SaveCollisionRecordToVehicle(collisionRecord.ToCollisionRecord()); if (result && collisionRecord.Supplies.Any()) { - RequisitionSupplyRecordsByUsage(collisionRecord.Supplies); + RequisitionSupplyRecordsByUsage(collisionRecord.Supplies, DateTime.Parse(collisionRecord.Date), collisionRecord.Description); } return Json(result); } @@ -1455,7 +1455,7 @@ namespace CarCareTracker.Controllers var result = _upgradeRecordDataAccess.SaveUpgradeRecordToVehicle(upgradeRecord.ToUpgradeRecord()); if (result && upgradeRecord.Supplies.Any()) { - RequisitionSupplyRecordsByUsage(upgradeRecord.Supplies); + RequisitionSupplyRecordsByUsage(upgradeRecord.Supplies, DateTime.Parse(upgradeRecord.Date), upgradeRecord.Description); } return Json(result); } @@ -1552,7 +1552,7 @@ namespace CarCareTracker.Controllers } return result; } - private void RequisitionSupplyRecordsByUsage(List supplyUsage) + private void RequisitionSupplyRecordsByUsage(List supplyUsage, DateTime dateRequisitioned, string usageDescription) { foreach(SupplyUsage supply in supplyUsage) { @@ -1563,6 +1563,12 @@ namespace CarCareTracker.Controllers result.Quantity -= supply.Quantity; //deduct cost. result.Cost -= (supply.Quantity * unitCost); + result.UsageHistory.Add(new SupplyUsageHistory { + Date = dateRequisitioned, + Description = usageDescription, + Quantity = supply.Quantity, + Cost = (supply.Quantity * unitCost) + }); //save _supplyRecordDataAccess.SaveSupplyRecordToVehicle(result); } @@ -1635,6 +1641,7 @@ namespace CarCareTracker.Controllers VehicleId = result.VehicleId, Files = result.Files, Tags = result.Tags, + UsageHistory = result.UsageHistory, ExtraFields = StaticHelper.AddExtraFields(result.ExtraFields, _extraFieldDataAccess.GetExtraFieldsById((int)ImportMode.SupplyRecord).ExtraFields) }; return PartialView("_SupplyRecordModal", convertedResult); @@ -1668,7 +1675,7 @@ namespace CarCareTracker.Controllers var result = _planRecordDataAccess.SavePlanRecordToVehicle(planRecord.ToPlanRecord()); if (result && planRecord.Supplies.Any()) { - RequisitionSupplyRecordsByUsage(planRecord.Supplies); + RequisitionSupplyRecordsByUsage(planRecord.Supplies, DateTime.Parse(planRecord.DateCreated), planRecord.Description); } return Json(result); } @@ -1722,7 +1729,7 @@ namespace CarCareTracker.Controllers var result = _planRecordDataAccess.SavePlanRecordToVehicle(existingRecord.ToPlanRecord()); if (result && existingRecord.Supplies.Any()) { - RequisitionSupplyRecordsByUsage(existingRecord.Supplies); + RequisitionSupplyRecordsByUsage(existingRecord.Supplies, DateTime.Parse(existingRecord.DateCreated), existingRecord.Description); } return Json(new OperationResponse { Success = result, Message = result ? "Plan Record Added" : StaticHelper.GenericErrorMessage }); } diff --git a/Models/Supply/SupplyRecord.cs b/Models/Supply/SupplyRecord.cs index 6ecfbe9..f9212a3 100644 --- a/Models/Supply/SupplyRecord.cs +++ b/Models/Supply/SupplyRecord.cs @@ -35,5 +35,6 @@ public List Files { get; set; } = new List(); public List Tags { get; set; } = new List(); public List ExtraFields { get; set; } = new List(); + public List UsageHistory { get; set; } = new List(); } } diff --git a/Models/Supply/SupplyRecordInput.cs b/Models/Supply/SupplyRecordInput.cs index 14896d2..c43f248 100644 --- a/Models/Supply/SupplyRecordInput.cs +++ b/Models/Supply/SupplyRecordInput.cs @@ -14,6 +14,7 @@ public List Files { get; set; } = new List(); public List Tags { get; set; } = new List(); public List ExtraFields { get; set; } = new List(); + public List UsageHistory { get; set; } = new List(); public SupplyRecord ToSupplyRecord() { return new SupplyRecord { Id = Id, VehicleId = VehicleId, @@ -26,7 +27,8 @@ Notes = Notes, Files = Files, Tags = Tags, - ExtraFields = ExtraFields + ExtraFields = ExtraFields, + UsageHistory = UsageHistory }; } } } diff --git a/Models/Supply/SupplyUsageHistory.cs b/Models/Supply/SupplyUsageHistory.cs new file mode 100644 index 0000000..0cb2365 --- /dev/null +++ b/Models/Supply/SupplyUsageHistory.cs @@ -0,0 +1,9 @@ +namespace CarCareTracker.Models +{ + public class SupplyUsageHistory { + public DateTime Date { get; set; } + public string Description { get; set; } + public decimal Quantity { get; set; } + public decimal Cost { get; set; } + } +} diff --git a/Views/Vehicle/_SupplyRecordModal.cshtml b/Views/Vehicle/_SupplyRecordModal.cshtml index b55c03d..5372e54 100644 --- a/Views/Vehicle/_SupplyRecordModal.cshtml +++ b/Views/Vehicle/_SupplyRecordModal.cshtml @@ -80,6 +80,10 @@ +
+ + +
\ No newline at end of file diff --git a/Views/Vehicle/_UpgradeRecordModal.cshtml b/Views/Vehicle/_UpgradeRecordModal.cshtml index da578e3..aea6a5e 100644 --- a/Views/Vehicle/_UpgradeRecordModal.cshtml +++ b/Views/Vehicle/_UpgradeRecordModal.cshtml @@ -83,6 +83,10 @@ + \ No newline at end of file diff --git a/wwwroot/js/planrecord.js b/wwwroot/js/planrecord.js index 555e821..838ab75 100644 --- a/wwwroot/js/planrecord.js +++ b/wwwroot/js/planrecord.js @@ -25,6 +25,10 @@ function showEditPlanRecordModal(planRecordId) { } function hideAddPlanRecordModal() { $('#planRecordModal').modal('hide'); + if (getPlanRecordModelData().createdFromReminder) { + //show reminder Modal + $("#reminderRecordModal").modal("show"); + } } function deletePlanRecord(planRecordId) { $("#workAroundInput").show(); @@ -64,10 +68,12 @@ function savePlanRecordToVehicle(isEdit) { if (data) { successToast(isEdit ? "Plan Record Updated" : "Plan Record Added."); hideAddPlanRecordModal(); - saveScrollPosition(); - getVehiclePlanRecords(formValues.vehicleId); - if (formValues.addReminderRecord) { - setTimeout(function () { showAddReminderModal(formValues); }, 500); + if (!getPlanRecordModelData().createdFromReminder) { + saveScrollPosition(); + getVehiclePlanRecords(formValues.vehicleId); + if (formValues.addReminderRecord) { + setTimeout(function () { showAddReminderModal(formValues); }, 500); + } } } else { errorToast(genericErrorMessage()); @@ -139,9 +145,6 @@ function savePlanRecordTemplate() { $.post('/Vehicle/SavePlanRecordTemplateToVehicleId', { planRecord: formValues }, function (data) { if (data.success) { successToast(data.message); - hideAddPlanRecordModal(); - saveScrollPosition(); - getVehiclePlanRecords(formValues.vehicleId); } else { errorToast(data.message); } @@ -157,6 +160,7 @@ function getAndValidatePlanRecordValues() { var planDateCreated = getPlanRecordModelData().dateCreated; var vehicleId = GetVehicleId().vehicleId; var planRecordId = getPlanRecordModelData().id; + var reminderRecordId = getPlanRecordModelData().reminderRecordId; //validation var hasError = false; var extraFields = getAndValidateExtraFields(); @@ -189,7 +193,8 @@ function getAndValidatePlanRecordValues() { progress: planProgress, importMode: planType, extraFields: extraFields.extraFields, - requisitionHistory: supplyUsageHistory + requisitionHistory: supplyUsageHistory, + reminderRecordId: reminderRecordId } } //drag and drop stuff. diff --git a/wwwroot/js/reminderrecord.js b/wwwroot/js/reminderrecord.js index f6edf6a..5159b39 100644 --- a/wwwroot/js/reminderrecord.js +++ b/wwwroot/js/reminderrecord.js @@ -217,4 +217,26 @@ function getAndValidateReminderRecordValues() { customMileageInterval: customMileageInterval, customMonthInterval: customMonthInterval } +} +function createPlanRecordFromReminder(reminderRecordId) { + //get values + var formValues = getAndValidateReminderRecordValues(); + //validate + if (formValues.hasError) { + errorToast("Please check the form data"); + return; + } + var planModelInput = { + id: 0, + createdFromReminder: true, + vehicleId: formValues.vehicleId, + reminderRecordId: reminderRecordId, + description: formValues.description, + notes: formValues.notes + }; + $.post('/Vehicle/GetAddPlanRecordPartialView', { planModel: planModelInput }, function (data) { + $("#reminderRecordModal").modal("hide"); + $("#planRecordModalContent").html(data); + $("#planRecordModal").modal("show"); + }); } \ No newline at end of file From fe1b96d58ca1e8cc8b66b08837c352adcfea2ec7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sun, 18 Feb 2024 14:22:43 -0700 Subject: [PATCH 08/10] updated translation --- wwwroot/defaults/en_US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wwwroot/defaults/en_US.json b/wwwroot/defaults/en_US.json index 433e320..c396e7f 100644 --- a/wwwroot/defaults/en_US.json +++ b/wwwroot/defaults/en_US.json @@ -1 +1 @@ -{"Garage":"Garage","Settings":"Settings","Admin_Panel":"Admin Panel","Logout":"Logout","Dark_Mode":"Dark Mode","Enable_CSV_Imports":"Enable CSV Imports","Use_Imperial_Calculation_for_Fuel_Economy_Calculations(MPG)":"Use Imperial Calculation for Fuel Economy Calculations(MPG)","This_Will_Also_Change_Units_to_Miles_and_Gallons":"This Will Also Change Units to Miles and Gallons","Use_UK_MPG_Calculation":"Use UK MPG Calculation","Input_Gas_Consumption_in_Liters,_it_will_be_converted_to_UK_Gals_for_MPG_Calculation":"Input Gas Consumption in Liters, it will be converted to UK Gals for MPG Calculation","Sort_lists_in_Descending_Order(Newest_to_Oldest)":"Sort lists in Descending Order(Newest to Oldest)","Replace_$0.00_Costs_with_---":"Replace $0.00 Costs with ---","Use_Three_Decimals_For_Fuel_Cost":"Use Three Decimals For Fuel Cost","Display_Saved_Notes_in_Markdown":"Display Saved Notes in Markdown","Auto_Refresh_Lapsed_Recurring_Reminders":"Auto Refresh Lapsed Recurring Reminders","Auto_Insert_Odometer_Records":"Auto Insert Odometer Records","Only_when_Adding_Service/Repair/Upgrade/Fuel_Record_or_Completing_a_Plan":"Only when Adding Service/Repair/Upgrade/Fuel Record or Completing a Plan","Enable_Authentication":"Enable Authentication","Visible_Tabs":"Visible Tabs","Service_Records":"Service Records","Dashboard":"Dashboard","Repairs":"Repairs","Upgrades":"Upgrades","Fuel":"Fuel","Odometer":"Odometer","Taxes":"Taxes","Notes":"Notes","Reminder":"Reminder","Supplies":"Supplies","Planner":"Planner","Default_Tab":"Default Tab","Service_Record":"Service Record","Tax":"Tax","Reminders":"Reminders","Backups":"Backups","Make":"Make","Restore":"Restore","About":"About","Add_New_Vehicle":"Add New Vehicle","Year":"Year","Year(must_be_after_1900)":"Year(must be after 1900)","Model":"Model","License_Plate":"License Plate","Electric_Vehicle":"Electric Vehicle","Use_Engine_Hours":"Use Engine Hours","Tags(optional)":"Tags(optional)","Upload_a_picture(optional)":"Upload a picture(optional)","Cancel":"Cancel","Edit_Vehicle":"Edit Vehicle","Delete_Vehicle":"Delete Vehicle","Manage_Vehicle":"Manage Vehicle","Expenses_by_Type":"Expenses by Type","Service":"Service","Expenses_by_Month":"Expenses by Month","As_of_Today":"As of Today","\u002B30_Days":"\u002B30 Days","\u002B60_Days":"\u002B60 Days","\u002B90_Days":"\u002B90 Days","Not_Urgent":"Not Urgent","Urgent":"Urgent","Very_Urgent":"Very Urgent","Past_Due":"Past Due","Reminders_by_Category":"Reminders by Category","Reminders_by_Urgency":"Reminders by Urgency","Collaborators":"Collaborators","Username":"Username","Delete":"Delete","Fuel_Mileage_by_Month":"Fuel Mileage by Month","Vehicle_Maintenance_Report":"Vehicle Maintenance Report","Export_Attachments":"Export Attachments","Gasoline":"Gasoline","Last_Reported_Odometer_Reading":"Last Reported Odometer Reading","Average_Fuel_Economy":"Average Fuel Economy","Total_Spent(excl._fuel)":"Total Spent(excl. fuel)","Total_Spent_on_Fuel":"Total Spent on Fuel","Type":"Type","Date":"Date","Description":"Description","Cost":"Cost","Repair":"Repair","Upgrade":"Upgrade","#_of_Odometer_Records":"# of Odometer Records","Add_Odometer_Record":"Add Odometer Record","Import_via_CSV":"Import via CSV","Export_to_CSV":"Export to CSV","Print":"Print","Add_New_Odometer_Record":"Add New Odometer Record","Date_recorded":"Date recorded","Odometer_reading":"Odometer reading","Notes(optional)":"Notes(optional)","Upload_documents(optional)":"Upload documents(optional)","Max_File_Size:_28.6MB":"Max File Size: 28.6MB","#_of_Service_Records":"# of Service Records","Total":"Total","Add_Service_Record":"Add Service Record","No_data_found,_create_reminders_to_see_visualizations_here.":"No data found, create reminders to see visualizations here.","No_data_found,_insert/select_some_data_to_see_visualizations_here.":"No data found, insert/select some data to see visualizations here.","Edit_Odometer_Record":"Edit Odometer Record","Import_Data_from_CSV":"Import Data from CSV","In_order_for_this_utility_to_function_properly,_your_CSV_file_MUST_be_formatted_exactly_like_the_provided_sample._Dates_must_be_supplied_in_a_string._Numbers_must_be_supplied_as_numbers_without_currency_formatting.":"In order for this utility to function properly, your CSV file MUST be formatted exactly like the provided sample. Dates must be supplied in a string. Numbers must be supplied as numbers without currency formatting.","Failure_to_format_the_data_correctly_can_cause_data_corruption._Please_make_sure_you_make_a_copy_of_the_local_database_before_proceeding.":"Failure to format the data correctly can cause data corruption. Please make sure you make a copy of the local database before proceeding.","Download_Sample":"Download Sample","Upload_CSV_File":"Upload CSV File","Import":"Import","Edit_Service_Record":"Edit Service Record","Date_service_was_performed":"Date service was performed","Odometer_reading_when_serviced":"Odometer reading when serviced","Description_of_item(s)_serviced(i.e._Oil_Change)":"Description of item(s) serviced(i.e. Oil Change)","Cost_of_the_service":"Cost of the service","Move_To":"Move To","#_of_Repair_Records":"# of Repair Records","Add_Repair_Record":"Add Repair Record","Add_New_Repair_Record":"Add New Repair Record","Date_repair_was_performed":"Date repair was performed","Odometer_reading_when_repaired":"Odometer reading when repaired","Description_of_item(s)_repaired(i.e._Alternator)":"Description of item(s) repaired(i.e. Alternator)","Cost_of_the_repair":"Cost of the repair","Choose_Supplies":"Choose Supplies","Add_Reminder":"Add Reminder","Select_Supplies":"Select Supplies","No_supplies_with_quantities_greater_than_0_is_found.":"No supplies with quantities greater than 0 is found.","Select":"Select","#_of_Upgrade_Records":"# of Upgrade Records","Add_Upgrade_Record":"Add Upgrade Record","Add_New_Upgrade_Record":"Add New Upgrade Record","Date_upgrade/mods_was_installed":"Date upgrade/mods was installed","Odometer_reading_when_upgraded/modded":"Odometer reading when upgraded/modded","Description_of_item(s)_upgraded/modded":"Description of item(s) upgraded/modded","Cost_of_the_upgrade/mods":"Cost of the upgrade/mods","#_of_Gas_Records":"# of Gas Records","Total_Fuel_Consumed":"Total Fuel Consumed","Total_Cost":"Total Cost","Add_Gas_Record":"Add Gas Record","Date_Refueled":"Date Refueled","Consumption":"Consumption","Fuel_Economy":"Fuel Economy","Unit_Cost":"Unit Cost","#_of_Supply_Records":"# of Supply Records","Add_Supply_Record":"Add Supply Record","Part_#":"Part #","Supplier":"Supplier","Quantity":"Quantity","Add_New_Supply_Record":"Add New Supply Record","Date_purchased":"Date purchased","Part_Number":"Part Number","Part_#/Model_#/SKU_#":"Part #/Model #/SKU #","Description_of_the_Part/Supplies":"Description of the Part/Supplies","Supplier/Vendor":"Supplier/Vendor","Part_Supplier":"Part Supplier","Edit_Supply_Record":"Edit Supply Record","Add_New_Service_Record":"Add New Service Record","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.":"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.","In_Stock":"In Stock","Edit_Repair_Record":"Edit Repair Record","Edit_Upgrade_Record":"Edit Upgrade Record","Save_Vehicle":"Save Vehicle","Add_New_Gas_Record":"Add New Gas Record","Date_refueled":"Date refueled","Odometer_Reading":"Odometer Reading","Odometer_reading_when_refueled":"Odometer reading when refueled","Fuel_Consumption":"Fuel Consumption","Amount_of_gas_refueled":"Amount of gas refueled","Is_Filled_To_Full":"Is Filled To Full","Missed_Fuel_Up(Skip_MPG_Calculation)":"Missed Fuel Up(Skip MPG Calculation)","Cost_of_gas_refueled":"Cost of gas refueled","Unit":"Unit","#_of_Tax_Records":"# of Tax Records","Add_Tax_Record":"Add Tax Record","Add_New_Tax_Record":"Add New Tax Record","Date_tax_was_paid":"Date tax was paid","Description_of_tax_paid(i.e._Registration)":"Description of tax paid(i.e. Registration)","Cost_of_tax_paid":"Cost of tax paid","Is_Recurring":"Is Recurring","Month":"Month","1_Month":"1 Month","3_Months":"3 Months","6_Months":"6 Months","1_Year":"1 Year","2_Years":"2 Years","3_Years":"3 Years","5_Years":"5 Years","Edit_Tax_Record":"Edit Tax Record","#_of_Notes":"# of Notes","Add_Note":"Add Note","Note":"Note","Add_New_Note":"Add New Note","Pinned":"Pinned","Description_of_the_note":"Description of the note","Min_Fuel_Economy":"Min Fuel Economy","Max_Fuel_Economy":"Max Fuel Economy","Edit_Gas_Record":"Edit Gas Record","#_of_Plan_Records":"# of Plan Records","Add_Plan_Record":"Add Plan Record","Planned":"Planned","Doing":"Doing","Testing":"Testing","Done":"Done","Add_New_Plan_Record":"Add New Plan Record","Describe_the_Plan":"Describe the Plan","Cost_of_the_Plan":"Cost of the Plan","Priority":"Priority","Critical":"Critical","Normal":"Normal","Low":"Low","Current_Stage":"Current Stage","#_of_Reminders":"# of Reminders","Urgency":"Urgency","Metric":"Metric","Add_New_Reminder":"Add New Reminder","Reminder_Description":"Reminder Description","Remind_me_on":"Remind me on","Future_Date":"Future Date","Future_Odometer_Reading":"Future Odometer Reading","Whichever_comes_first":"Whichever comes first","Other":"Other","Edit_Reminder":"Edit Reminder","Replace_picture(optional)":"Replace picture(optional)","Language":"Language","Manage_Languages":"Manage Languages","Upload":"Upload","Tokens":"Tokens","Generate_User_Token":"Generate User Token","Auto_Notify(via_Email)":"Auto Notify(via Email)","Token":"Token","Issued_To":"Issued To","Users":"Users","Email":"Email","Is_Admin":"Is Admin","An_error_has_occurred,_please_try_again_later":"An error has occurred, please try again later","Edit_Note":"Edit Note","Password":"Password","Remember_Me":"Remember Me","Login":"Login","Forgot_Password":"Forgot Password","Register":"Register","Request":"Request","I_Have_a_Token":"I Have a Token","Back_to_Login":"Back to Login","Email_Address":"Email Address","New_Password":"New Password","Reset_Password":"Reset Password","No_data_found_or_all_records_have_zero_sums,_insert_records_with_non-zero_sums_to_see_visualizations_here.":"No data found or all records have zero sums, insert records with non-zero sums to see visualizations here.","Save_as_Template":"Save as Template","View_Templates":"View Templates","Select_Template":"Select Template","No_templates_are_found.":"No templates are found.","Use":"Use","Edit_Plan_Record":"Edit Plan Record","Date_Created":"Date Created","Last_Modified":"Last Modified","Shop_Supplies":"Shop Supplies","Uploaded_Documents":"Uploaded Documents","Upload_more_documents":"Upload more documents","Database_Migration":"Database Migration","Instructions":"Instructions","To_Postgres":"To Postgres","From_Postgres":"From Postgres","Import_To_Postgres":"Import To Postgres","Export_From_Postgres":"Export From Postgres","Create":"Create","Manage_Extra_Fields":"Manage Extra Fields","Add/Remove_Extra_Fields":"Add/Remove Extra Fields","Name":"Name","Required":"Required","Add_New_Field":"Add New Field","Close":"Close","Calendar":"Calendar","View_Reminder":"View Reminder","Mark_as_Done":"Mark as Done","Login_via":"Login via","Distance_Traveled_by_Month":"Distance Traveled by Month","Expenses_and_Distance_Traveled_by_Month":"Expenses and Distance Traveled by Month","Select_All":"Select All","Supply_Requisition_History":"Supply Requisition History","No_supply_requisitions_in_history":"No supply requisitions in history"} \ No newline at end of file +{"Garage":"Garage","Settings":"Settings","Admin_Panel":"Admin Panel","Logout":"Logout","Dark_Mode":"Dark Mode","Enable_CSV_Imports":"Enable CSV Imports","Use_Imperial_Calculation_for_Fuel_Economy_Calculations(MPG)":"Use Imperial Calculation for Fuel Economy Calculations(MPG)","This_Will_Also_Change_Units_to_Miles_and_Gallons":"This Will Also Change Units to Miles and Gallons","Use_UK_MPG_Calculation":"Use UK MPG Calculation","Input_Gas_Consumption_in_Liters,_it_will_be_converted_to_UK_Gals_for_MPG_Calculation":"Input Gas Consumption in Liters, it will be converted to UK Gals for MPG Calculation","Sort_lists_in_Descending_Order(Newest_to_Oldest)":"Sort lists in Descending Order(Newest to Oldest)","Replace_$0.00_Costs_with_---":"Replace $0.00 Costs with ---","Use_Three_Decimals_For_Fuel_Cost":"Use Three Decimals For Fuel Cost","Display_Saved_Notes_in_Markdown":"Display Saved Notes in Markdown","Auto_Refresh_Lapsed_Recurring_Reminders":"Auto Refresh Lapsed Recurring Reminders","Auto_Insert_Odometer_Records":"Auto Insert Odometer Records","Only_when_Adding_Service/Repair/Upgrade/Fuel_Record_or_Completing_a_Plan":"Only when Adding Service/Repair/Upgrade/Fuel Record or Completing a Plan","Enable_Authentication":"Enable Authentication","Visible_Tabs":"Visible Tabs","Service_Records":"Service Records","Dashboard":"Dashboard","Repairs":"Repairs","Upgrades":"Upgrades","Fuel":"Fuel","Odometer":"Odometer","Taxes":"Taxes","Notes":"Notes","Reminder":"Reminder","Supplies":"Supplies","Planner":"Planner","Default_Tab":"Default Tab","Service_Record":"Service Record","Tax":"Tax","Reminders":"Reminders","Backups":"Backups","Make":"Make","Restore":"Restore","About":"About","Add_New_Vehicle":"Add New Vehicle","Year":"Year","Year(must_be_after_1900)":"Year(must be after 1900)","Model":"Model","License_Plate":"License Plate","Electric_Vehicle":"Electric Vehicle","Use_Engine_Hours":"Use Engine Hours","Tags(optional)":"Tags(optional)","Upload_a_picture(optional)":"Upload a picture(optional)","Cancel":"Cancel","Edit_Vehicle":"Edit Vehicle","Delete_Vehicle":"Delete Vehicle","Manage_Vehicle":"Manage Vehicle","Expenses_by_Type":"Expenses by Type","Service":"Service","Expenses_by_Month":"Expenses by Month","As_of_Today":"As of Today","\u002B30_Days":"\u002B30 Days","\u002B60_Days":"\u002B60 Days","\u002B90_Days":"\u002B90 Days","Not_Urgent":"Not Urgent","Urgent":"Urgent","Very_Urgent":"Very Urgent","Past_Due":"Past Due","Reminders_by_Category":"Reminders by Category","Reminders_by_Urgency":"Reminders by Urgency","Collaborators":"Collaborators","Username":"Username","Delete":"Delete","Fuel_Mileage_by_Month":"Fuel Mileage by Month","Vehicle_Maintenance_Report":"Vehicle Maintenance Report","Export_Attachments":"Export Attachments","Gasoline":"Gasoline","Last_Reported_Odometer_Reading":"Last Reported Odometer Reading","Average_Fuel_Economy":"Average Fuel Economy","Total_Spent(excl._fuel)":"Total Spent(excl. fuel)","Total_Spent_on_Fuel":"Total Spent on Fuel","Type":"Type","Date":"Date","Description":"Description","Cost":"Cost","Repair":"Repair","Upgrade":"Upgrade","#_of_Odometer_Records":"# of Odometer Records","Add_Odometer_Record":"Add Odometer Record","Import_via_CSV":"Import via CSV","Export_to_CSV":"Export to CSV","Print":"Print","Add_New_Odometer_Record":"Add New Odometer Record","Date_recorded":"Date recorded","Odometer_reading":"Odometer reading","Notes(optional)":"Notes(optional)","Upload_documents(optional)":"Upload documents(optional)","Max_File_Size:_28.6MB":"Max File Size: 28.6MB","#_of_Service_Records":"# of Service Records","Total":"Total","Add_Service_Record":"Add Service Record","No_data_found,_create_reminders_to_see_visualizations_here.":"No data found, create reminders to see visualizations here.","No_data_found,_insert/select_some_data_to_see_visualizations_here.":"No data found, insert/select some data to see visualizations here.","Edit_Odometer_Record":"Edit Odometer Record","Import_Data_from_CSV":"Import Data from CSV","In_order_for_this_utility_to_function_properly,_your_CSV_file_MUST_be_formatted_exactly_like_the_provided_sample._Dates_must_be_supplied_in_a_string._Numbers_must_be_supplied_as_numbers_without_currency_formatting.":"In order for this utility to function properly, your CSV file MUST be formatted exactly like the provided sample. Dates must be supplied in a string. Numbers must be supplied as numbers without currency formatting.","Failure_to_format_the_data_correctly_can_cause_data_corruption._Please_make_sure_you_make_a_copy_of_the_local_database_before_proceeding.":"Failure to format the data correctly can cause data corruption. Please make sure you make a copy of the local database before proceeding.","Download_Sample":"Download Sample","Upload_CSV_File":"Upload CSV File","Import":"Import","Edit_Service_Record":"Edit Service Record","Date_service_was_performed":"Date service was performed","Odometer_reading_when_serviced":"Odometer reading when serviced","Description_of_item(s)_serviced(i.e._Oil_Change)":"Description of item(s) serviced(i.e. Oil Change)","Cost_of_the_service":"Cost of the service","Move_To":"Move To","#_of_Repair_Records":"# of Repair Records","Add_Repair_Record":"Add Repair Record","Add_New_Repair_Record":"Add New Repair Record","Date_repair_was_performed":"Date repair was performed","Odometer_reading_when_repaired":"Odometer reading when repaired","Description_of_item(s)_repaired(i.e._Alternator)":"Description of item(s) repaired(i.e. Alternator)","Cost_of_the_repair":"Cost of the repair","Choose_Supplies":"Choose Supplies","Add_Reminder":"Add Reminder","Select_Supplies":"Select Supplies","No_supplies_with_quantities_greater_than_0_is_found.":"No supplies with quantities greater than 0 is found.","Select":"Select","#_of_Upgrade_Records":"# of Upgrade Records","Add_Upgrade_Record":"Add Upgrade Record","Add_New_Upgrade_Record":"Add New Upgrade Record","Date_upgrade/mods_was_installed":"Date upgrade/mods was installed","Odometer_reading_when_upgraded/modded":"Odometer reading when upgraded/modded","Description_of_item(s)_upgraded/modded":"Description of item(s) upgraded/modded","Cost_of_the_upgrade/mods":"Cost of the upgrade/mods","#_of_Gas_Records":"# of Gas Records","Total_Fuel_Consumed":"Total Fuel Consumed","Total_Cost":"Total Cost","Add_Gas_Record":"Add Gas Record","Date_Refueled":"Date Refueled","Consumption":"Consumption","Fuel_Economy":"Fuel Economy","Unit_Cost":"Unit Cost","#_of_Supply_Records":"# of Supply Records","Add_Supply_Record":"Add Supply Record","Part_#":"Part #","Supplier":"Supplier","Quantity":"Quantity","Add_New_Supply_Record":"Add New Supply Record","Date_purchased":"Date purchased","Part_Number":"Part Number","Part_#/Model_#/SKU_#":"Part #/Model #/SKU #","Description_of_the_Part/Supplies":"Description of the Part/Supplies","Supplier/Vendor":"Supplier/Vendor","Part_Supplier":"Part Supplier","Edit_Supply_Record":"Edit Supply Record","Add_New_Service_Record":"Add New Service Record","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.":"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.","In_Stock":"In Stock","Edit_Repair_Record":"Edit Repair Record","Edit_Upgrade_Record":"Edit Upgrade Record","Save_Vehicle":"Save Vehicle","Add_New_Gas_Record":"Add New Gas Record","Date_refueled":"Date refueled","Odometer_Reading":"Odometer Reading","Odometer_reading_when_refueled":"Odometer reading when refueled","Fuel_Consumption":"Fuel Consumption","Amount_of_gas_refueled":"Amount of gas refueled","Is_Filled_To_Full":"Is Filled To Full","Missed_Fuel_Up(Skip_MPG_Calculation)":"Missed Fuel Up(Skip MPG Calculation)","Cost_of_gas_refueled":"Cost of gas refueled","Unit":"Unit","#_of_Tax_Records":"# of Tax Records","Add_Tax_Record":"Add Tax Record","Add_New_Tax_Record":"Add New Tax Record","Date_tax_was_paid":"Date tax was paid","Description_of_tax_paid(i.e._Registration)":"Description of tax paid(i.e. Registration)","Cost_of_tax_paid":"Cost of tax paid","Is_Recurring":"Is Recurring","Month":"Month","1_Month":"1 Month","3_Months":"3 Months","6_Months":"6 Months","1_Year":"1 Year","2_Years":"2 Years","3_Years":"3 Years","5_Years":"5 Years","Edit_Tax_Record":"Edit Tax Record","#_of_Notes":"# of Notes","Add_Note":"Add Note","Note":"Note","Add_New_Note":"Add New Note","Pinned":"Pinned","Description_of_the_note":"Description of the note","Min_Fuel_Economy":"Min Fuel Economy","Max_Fuel_Economy":"Max Fuel Economy","Edit_Gas_Record":"Edit Gas Record","#_of_Plan_Records":"# of Plan Records","Add_Plan_Record":"Add Plan Record","Planned":"Planned","Doing":"Doing","Testing":"Testing","Done":"Done","Add_New_Plan_Record":"Add New Plan Record","Describe_the_Plan":"Describe the Plan","Cost_of_the_Plan":"Cost of the Plan","Priority":"Priority","Critical":"Critical","Normal":"Normal","Low":"Low","Current_Stage":"Current Stage","#_of_Reminders":"# of Reminders","Urgency":"Urgency","Metric":"Metric","Add_New_Reminder":"Add New Reminder","Reminder_Description":"Reminder Description","Remind_me_on":"Remind me on","Future_Date":"Future Date","Future_Odometer_Reading":"Future Odometer Reading","Whichever_comes_first":"Whichever comes first","Other":"Other","Edit_Reminder":"Edit Reminder","Replace_picture(optional)":"Replace picture(optional)","Language":"Language","Manage_Languages":"Manage Languages","Upload":"Upload","Tokens":"Tokens","Generate_User_Token":"Generate User Token","Auto_Notify(via_Email)":"Auto Notify(via Email)","Token":"Token","Issued_To":"Issued To","Users":"Users","Email":"Email","Is_Admin":"Is Admin","An_error_has_occurred,_please_try_again_later":"An error has occurred, please try again later","Edit_Note":"Edit Note","Password":"Password","Remember_Me":"Remember Me","Login":"Login","Forgot_Password":"Forgot Password","Register":"Register","Request":"Request","I_Have_a_Token":"I Have a Token","Back_to_Login":"Back to Login","Email_Address":"Email Address","New_Password":"New Password","Reset_Password":"Reset Password","No_data_found_or_all_records_have_zero_sums,_insert_records_with_non-zero_sums_to_see_visualizations_here.":"No data found or all records have zero sums, insert records with non-zero sums to see visualizations here.","Save_as_Template":"Save as Template","View_Templates":"View Templates","Select_Template":"Select Template","No_templates_are_found.":"No templates are found.","Use":"Use","Edit_Plan_Record":"Edit Plan Record","Date_Created":"Date Created","Last_Modified":"Last Modified","Shop_Supplies":"Shop Supplies","Uploaded_Documents":"Uploaded Documents","Upload_more_documents":"Upload more documents","Database_Migration":"Database Migration","Instructions":"Instructions","To_Postgres":"To Postgres","From_Postgres":"From Postgres","Import_To_Postgres":"Import To Postgres","Export_From_Postgres":"Export From Postgres","Create":"Create","Manage_Extra_Fields":"Manage Extra Fields","Add/Remove_Extra_Fields":"Add/Remove Extra Fields","Name":"Name","Required":"Required","Add_New_Field":"Add New Field","Close":"Close","Calendar":"Calendar","View_Reminder":"View Reminder","Mark_as_Done":"Mark as Done","Login_via":"Login via","Distance_Traveled_by_Month":"Distance Traveled by Month","Expenses_and_Distance_Traveled_by_Month":"Expenses and Distance Traveled by Month","Select_All":"Select All","Supply_Requisition_History":"Supply Requisition History","No_supply_requisitions_in_history":"No supply requisitions in history","Plan":"Plan"} \ No newline at end of file From 2b2fd3ae2830ed5bb67334728769493e3e6ec776 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sun, 18 Feb 2024 14:42:05 -0700 Subject: [PATCH 09/10] Updated version number --- Views/Home/_Settings.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Views/Home/_Settings.cshtml b/Views/Home/_Settings.cshtml index c1286c3..606f2f1 100644 --- a/Views/Home/_Settings.cshtml +++ b/Views/Home/_Settings.cshtml @@ -201,7 +201,7 @@
- Version 1.2.0 + Version 1.2.1

Proudly developed in the rural town of Price, Utah by Hargata Softworks. From a02684f92161a79a966fcff44eaa4e2a9377b9f0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sun, 18 Feb 2024 15:04:02 -0700 Subject: [PATCH 10/10] check if reminder still exists. --- Controllers/VehicleController.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Controllers/VehicleController.cs b/Controllers/VehicleController.cs index 1e80098..0d22741 100644 --- a/Controllers/VehicleController.cs +++ b/Controllers/VehicleController.cs @@ -1740,6 +1740,15 @@ namespace CarCareTracker.Controllers return Json(new OperationResponse { Success = false, Message = string.Join("
", supplyAvailability) }); } } + if (existingRecord.ReminderRecordId != default) + { + //check if reminder still exists and is still recurring. + var existingReminder = _reminderRecordDataAccess.GetReminderRecordById(existingRecord.ReminderRecordId); + if (existingReminder is null || existingReminder.Id == default || !existingReminder.IsRecurring) + { + return Json(new OperationResponse { Success = false, Message = "Missing or Non-recurring Reminder, Please Delete This Template and Recreate It." }); + } + } //populate createdDate existingRecord.DateCreated = DateTime.Now.ToString("G"); existingRecord.DateModified = DateTime.Now.ToString("G"); @@ -1839,14 +1848,14 @@ namespace CarCareTracker.Controllers if (existingRecord.ReminderRecordId != default) { var existingReminder = _reminderRecordDataAccess.GetReminderRecordById(existingRecord.ReminderRecordId); - if (existingReminder is not null && existingReminder.Id != default) + if (existingReminder is not null && existingReminder.Id != default && existingReminder.IsRecurring) { existingReminder = _reminderHelper.GetUpdatedRecurringReminderRecord(existingReminder); //save to db. var reminderUpdateResult = _reminderRecordDataAccess.SaveReminderRecordToVehicle(existingReminder); if (!reminderUpdateResult) { - _logger.LogError("Unable to update reminder"); + _logger.LogError("Unable to update reminder either because the reminder no longer exists or is no longer recurring"); } } else {