Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,7 @@
<artifactId>DMS</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>DMS</name>
<description>Demo project for Spring Boot</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<description>Dealer management system for an independent auto repair shop</description>
<properties>
<java.version>21</java.version>
</properties>
Expand All @@ -34,11 +21,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
Expand Down Expand Up @@ -73,11 +55,6 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>jakarta.validation</groupId>-->
<!-- <artifactId>jakarta.validation-api</artifactId>-->
<!-- <version>3.0.2</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
Expand All @@ -93,23 +70,11 @@
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>

<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<version>0.15</version>
</dependency>

<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ private Date addDays(Date date, int amount) {
d.setTime(date);
d.add(Calendar.DAY_OF_MONTH, amount);
return d.getTime();

// return Date.from(
// date
// .toInstant()
// .atZone(ZoneId.systemDefault())
// .plus(period)
// .toInstant()
// );
}

private Date subtractDays(Date date, int amount) {
Expand All @@ -88,14 +80,6 @@ private Date subtractDays(Date date, int amount) {
d.add(Calendar.DAY_OF_MONTH, amount * -1);

return d.getTime();

// return Date.from(
// date
// .toInstant()
// .atZone(ZoneId.systemDefault())
// .minus(period)
// .toInstant()
// );
}

@Override
Expand All @@ -106,11 +90,6 @@ public PayPeriod getCurrentPayPeriod() {
.filter(p -> isPayPeriodCurrent(p))
.collect(Collectors.toList());

// System.out.println(String.format("periods before: %s", periods));

// periods = periods.stream().filter(p -> isPayPeriodCurrent(p)).collect(Collectors.toList());

// System.out.println(String.format("periods after: %s", periods));
if (periods.size() < 1) {
throw new ResourceFoundException("Error: Could not get current PayPeriod!");
}
Expand Down
26 changes: 2 additions & 24 deletions src/main/java/com/heftyb/dms/account/statement/StatementItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,6 @@ public void setStatus(StatementStatus status) {
this.status = status;
}

// private int numberOfDaysInvoiceIsPastDue() {
// return (int) Duration.between(Date, ZonedDateTime.now()).toDaysPart();
// }

// private double calculateFinanceFee() {
//
// int pastDue = numberOfDaysInvoiceIsPastDue();
//
// StatementStatusRate statusRate = pastDue < 180 ? invoice.getTerms().getStatusRates().stream().filter(r -> r.getStatus() == StatementRateType.MONTHLY).collect(Collectors.toList()).getFirst() :
// invoice.getTerms().getStatusRates().stream().filter(r -> r.getStatus() == StatementRateType.ANNUAL).collect(Collectors.toList()).getFirst();
//
// if ( statusRate.getStatus() == StatementRateType.MONTHLY ) {
// int months due
// } else {
//
// }

/**
*
*
* TODO: calculate finance charge per interval
*/
// return null;
// }
// TODO: calculate the finance charge per interval, from the days the invoice is past due and
// the invoice terms' status rates: the monthly rate under 180 days, the annual rate after.
}
4 changes: 0 additions & 4 deletions src/main/java/com/heftyb/dms/config/WebSecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
@EnableMethodSecurity
public class WebSecurityConfig {

// private final UserDetailsService userDetailsService;
//
// public WebSecurityConfig(final UserDetailsService userDetailsService) {this.userDetailsService = userDetailsService;}

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ public Vendor update(Vendor vendor) {
if (vendor.getTaxId() != null) v.setTaxId(vendor.getTaxId());
if (vendor.getPaymentMethod() != null) v.setPaymentMethod(vendor.getPaymentMethod());

// if (vendor.getSentPurchaseOrders() != null
// || vendor.getReceivedPurchaseOrders() != null
// || vendor.getInvoices() != null) {
// throw new ResourceFoundException("Error: Could not update vendor!");
// }

return vendorRepository.save(v);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ public class WorkOrderJobServiceImp implements WorkOrderJobService {

private final WorkOrderJobRepository jobRepo;
private final RepairOrderService roService;
// private final TimeClockService timeClockService;
private final TechnicianFlatRateHourService technicianFlatRateHourService;

public WorkOrderJobServiceImp(final WorkOrderJobRepository workOrderJobRepository,
final RepairOrderService repairOrderService,
// final TimeClockService timeClockService,
final TechnicianFlatRateHourService technicianFlatRateHourService) {
jobRepo = workOrderJobRepository;
roService = repairOrderService;
// this.timeClockService = timeClockService;
this.technicianFlatRateHourService = technicianFlatRateHourService;
}

Expand Down Expand Up @@ -80,26 +77,7 @@ public WorkOrderJob update(WorkOrderJob job) {

j.setStatus(job.getStatus());

// updated through parts service
// for (WorkOrderJobPart part : job.getParts()) {
// part.setJob(j);
// j.getParts().add(part);
// }

// updated through timeservice
// for (JobTimePunchSet punchSet : job.getTimeClockPunchSets()) {
// JobTimePunchSet ps = timeClockService.findJobTimePunchSetById(punchSet.getId());
// ps.setJob(j);
// j.getTimeClockPunchSets().add(ps);
// }

// updated through pay service
// for (TechnicianFlatRateHour flatRateHour : job.getLabor()) {
// TechnicianFlatRateHour frh = technicianFlatRateHourService.findById(flatRateHour.getId());
// frh.setJob(j);
// j.getLabor().add(frh);
// }

// parts, job time punches and labor hours are updated through their own services
j.setMiscItems(job.getMiscItems());

return jobRepo.save(j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import java.security.Principal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
Expand Down Expand Up @@ -92,7 +91,6 @@ public String clockOut(@RequestParam TimePunchCode code, Principal principal) {
@GetMapping({"/punches", "/punches/"})
public String getDatesPunches(@RequestParam String date, Principal principal, ModelMap model) throws ParseException {
User u = userService.findUserByUsername(principal.getName());
// SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
List<TimeClockPunchSet> punchSets = timeClockService
.findCurrentUsersTimeClockPunchSetsByDate(principal.getName(), LocalDate.parse(date));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ public boolean isValid(final String password, final ConstraintValidatorContext c
// @formatter:off
final PasswordValidator validator = new PasswordValidator(Arrays.asList(
new LengthRule(8, 30),
// new UppercaseCharacterRule(1),
// new DigitCharacterRule(1),
// new SpecialCharacterRule(1),
// new NumericalSequenceRule(3,false),
// new AlphabeticalSequenceRule(3,false),
// new QwertySequenceRule(3,false),
new WhitespaceRule()));
final RuleResult result = validator.validate(new PasswordData(password));
if (result.isValid()) {
Expand Down
Binary file modified src/main/resources/static/oil.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 0 additions & 34 deletions src/main/resources/templates/appointments.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head th:replace="~{fragments::head (page_title='Appointments')}"></head>
<body>
<div class="page-wrapper">
<!-- <header th:insert="~{fragments::header-top (username = username)}"></header>-->
<style th:inline="css">

.schedule {
Expand Down Expand Up @@ -325,13 +324,6 @@ <h3 th:id="|appt_${appt.id}_name|">[[${appt.contactInformation.contactName}]]</h
<input type="hidden" th:id="|appt_${appt.id}_vin|" th:value="${appt.vin}">


<!-- <input type="hidden" th:id="|appt_${appt.id}_address1|"-->
<!-- th:value="${appt.contactInformation.address.addressLine1}">-->
<!-- <input type="hidden" th:id="|appt_${appt.id}_address2|"-->
<!-- th:value="${appt.contactInformation.address.addressLine2}">-->
<!-- <input type="hidden" th:id="|appt_${appt.id}_city|" th:value="${appt.contactInformation.address.city}">-->
<!-- <input type="hidden" th:id="|appt_${appt.id}_state|" th:value="${appt.contactInformation.address.state}">-->
<!-- <input type="hidden" th:id="|appt_${appt.id}_zip|" th:value="${appt.contactInformation.address.zip.zip}">-->
</div>
</div>

Expand Down Expand Up @@ -366,7 +358,6 @@ <h3 th:id="|appt_${appt.id}_name|">[[${appt.contactInformation.contactName}]]</h
<input type="hidden" id="start_time" name="start_time">
<input type="hidden" id="start_DT" name="startDateTime">

<!-- <label for="advisor_name">Advisor: </label>-->
<input type="hidden" id="advisor_name" th:value="${advisors[0].getName()}">
<input type="hidden" id="advisor_id" name="advisor.id" th:value="${advisors[0].id}">
</div>
Expand All @@ -390,33 +381,11 @@ <h3 th:id="|appt_${appt.id}_name|">[[${appt.contactInformation.contactName}]]</h
<input type="text" id="contact_email" name="contactInformation.contactEmail" class="address">
</div>

<!-- <p>-->
<!-- <label for="contact_address_line_1">Address Line 1:</label>-->
<!-- <input type="text" id="contact_address_line_1" name="contactInformation.address.addressLine1"-->
<!-- class="address">-->
<!-- </p>-->

<!-- <p>-->
<!-- <label for="contact_address_line_2">Address Line 2:</label>-->
<!-- <input type="text" id="contact_address_line_2" name="contactInformation.address.addressLine2"-->
<!-- class="address">-->
<!-- </p>-->

<!-- <p>-->


<!-- <label for="address_city">City:</label>-->
<!-- <input type="text" id="address_city" name="contactInformation.address.city">-->
<!-- </p>-->
<!-- <p>-->
<!-- <label for="address_state">State:</label>-->
<!-- <input type="text" id="address_state" name="contactInformation.address.state">-->
<!-- </p>-->

<!-- <p>-->
<!-- <label for="address_zip">ZipCode: </label>-->
<!-- <input type="text" id="address_zip" name="contactInformation.address.zip.zip">-->
<!-- </p>-->


<div class="appt-vehicle-info">
Expand Down Expand Up @@ -449,15 +418,13 @@ <h4>Appointment Items:</h4>
<label for="menu_items">New Items</label>
<select name="menu-items" id="menu_items">
<option th:each="mi : ${menu_items}" th:value="${mi.item}">[[${mi.item}]]</option>
<!-- <option value="other">Other</option>-->
</select>
<button type="button" id="add_menu_button">+</button>
</div>
</div>


<p>
<!-- <label for="total_time">Estimated Time Blocks:</label>-->
<input type="hidden" name="total_blocks" id="total_time">
<input type="hidden" id="appt_end_dt" name="endDateTime">
</p>
Expand Down Expand Up @@ -743,7 +710,6 @@ <h4>Appointment Items:</h4>
}
</script>

<!-- <footer th:insert="~{fragments::foot}"></footer>-->
</div>
</body>
</html>
3 changes: 0 additions & 3 deletions src/main/resources/templates/fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<li class="no-bullet-list nav-item"><a class="clean-link" href="#">Support</a></li>

<li class="no-bullet-list nav-item"><a class="clean-link" th:href="@{/two}">Work-Orders</a></li>
<!-- <li class="no-bullet-list nav-item"><a class="clean-link" href="#">User</a></li>-->
<li sec:authorize="hasRole('ROLE_ADMIN')" class="no-bullet-list nav-item"><a class="clean-link" href="#"
th:href="@{/admin}">Admin</a>
</li>
Expand All @@ -46,7 +45,6 @@
<a class="clean-link back-button print-hide" href="javascript:window.history.back();">
<button type="button">Back</button>
</a>
<!-- <a href="javascript:window.history.forward();">></a>-->
</div>

<div th:fragment="customer-list (customers)">
Expand Down Expand Up @@ -272,7 +270,6 @@
let m = document.querySelector("#nav_user_menu")

let toggleUserMenu = () => {
console.log(`menu=${m}`)
m.classList.toggle("user-menu-closed")
m.classList.toggle("user-menu-open")
}
Expand Down
15 changes: 0 additions & 15 deletions src/main/resources/templates/hr_administrator.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<body class="body">
<div class="page-wrapper">

<!-- <nav th:insert="~{fragments::header-top (username=${username})}"></nav>-->

<style>

Expand Down Expand Up @@ -226,18 +225,6 @@

</style>
<div class="admin_main">
<!-- <nav class="side-navbar-open">-->
<!-- <ul class="no-bullet-list side-navbar">-->
<!-- <li><a href="" th:href="@{/admin/}" class="sidebar-link nav-item clean-link">Dashboard</a></li>-->
<!-- <li><a href="" th:href="@{/admin/}" class="nav-item clean-link">Current work week</a></li>-->
<!-- <li><a href="" th:href="@{/admin/employees}" class="nav-item clean-link">Employee Management</a></li>-->
<!-- <li><a href="" th:href="@{/admin/users}" class="nav-item clean-link">User Management</a></li>-->
<!-- <li><a href="" th:href="@{/admin/roles}" class="nav-item clean-link">Role Management</a></li>-->
<!-- <li><a href="" th:href="@{/admin/rd}" class="nav-item clean-link">Reports & Data</a></li>-->
<!-- <li><a href="" th:href="@{/admin/vendors}" class="nav-item clean-link">Vendors</a></li>-->
<!-- <li><a href="" th:href="@{/admin/accounts}" class="nav-item clean-link">Accounts</a></li>-->
<!-- </ul>-->
<!-- </nav>-->

<div class="dash-tab-buttons">
<button id="dashboard_button" class="tab-button active">Dashboard</button>
Expand Down Expand Up @@ -282,7 +269,6 @@ <h2 class="center-text">
<div id="dash-4" class="grid-button">
<canvas id="myChart2"></canvas>
</div>
<!-- <div id="dash-1"></div>-->


</div>
Expand Down Expand Up @@ -646,6 +632,5 @@ <h4>[[${role.role}]]</h4>
</script>
</div>

<!--<footer th:replace="~{fragments::foot}"></footer>-->
</body>
</html>
Loading
Loading