fix: cleanup and small improvements
- added empty check in inventory alerts - corrected parts cost calculation - removed unused getUser method - updated default admin password - fixed missing includes in menus - cleaned up MenuHelper comments
This commit is contained in:
+4
@@ -59,6 +59,10 @@ Returns:
|
||||
void InventoryManagementService::sendLowStockAlerts()
|
||||
{
|
||||
auto& inventoryItems = m_dataStore.getInventoryItems();
|
||||
if (inventoryItems.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
int inventoryItemsSize = inventoryItems.getSize();
|
||||
auto& usersMap = m_dataStore.getUsers();
|
||||
int usersMapSize = usersMap.getSize();
|
||||
|
||||
+1
-1
@@ -315,7 +315,7 @@ void PaymentManagementService::generateInvoice(ServiceBooking* booking)
|
||||
{
|
||||
createInventoryItemsMap(completeInventoryItemMapOfBooking, currentService);
|
||||
totalLabourCost += currentService->getLaborCost();
|
||||
totalPartsCost += calculatePartsCost(currentService);
|
||||
totalPartsCost += util::calculatePartsCost(currentService);
|
||||
}
|
||||
}
|
||||
totalServiceCost = totalLabourCost + totalPartsCost;
|
||||
|
||||
+1
-15
@@ -305,18 +305,4 @@ util::Map<std::string, User*> UserManagementService::getUsers(util::UserType typ
|
||||
}
|
||||
}
|
||||
return filteredUsersMap;
|
||||
}
|
||||
|
||||
User* UserManagementService::getUser(const std::string& userID)
|
||||
{
|
||||
util::Map<std::string, User*>& currentUsers = m_dataStore.getUsers();
|
||||
for (int iterator = 0; iterator < currentUsers.getSize(); iterator++)
|
||||
{
|
||||
User* currentUser = currentUsers.getValueAt(iterator);
|
||||
if (currentUser->getId() == userID)
|
||||
{
|
||||
return currentUser;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user