<%- include('partials/header', { title: 'Gas Card Expenses' }) %> <% if (error) { %>
<%= decodeURIComponent(error) %>
<% } %> <% if (success) { %>
<%= decodeURIComponent(success) %>
<% } %>
<% if (locals.activeView === 'cards') { %>

Active Gas Cards

<% if (myGasCards && myGasCards.length > 0) { %>
<% myGasCards.forEach(card => { %>
•••• <%= card.card_number.slice(-4) %> <%= card.card_type %>
Expiry: <%= card.expiry_date %> Truck: <%= card.truck_assigned || 'None' %> <% if (card.user_name) { %> Assigned to: <%= card.user_name %> <% } %>
<% }) %>
<% } else { %>

No active gas cards assigned.

<% } %>
<% } else if (locals.activeView === 'add-form') { %>

Add Gas Expense

<% if (myGasCards && myGasCards.length > 0) { %>
<% if (jobNumbers && jobNumbers.length > 0) { %> <% } else { %> <% } %>
Total Amount: $0.00
<% } else { %>

You must have an active gas card to add gas expenses.

<% } %>
<% } else { %>

Gas Expenses Audit & History

<%= gasExpenses.length %> expense(s) Scroll table
<% if (gasExpenses && gasExpenses.length > 0) { %>
<% if (user.role === 'admin' || user.role === 'accounting' || user.role === 'approver' || user.role === 'pm') { %> <% } %> <% gasExpenses.forEach(exp => { %> <% if (user.role === 'admin' || user.role === 'accounting' || user.role === 'approver' || user.role === 'pm') { %> <% } %> <% }) %>
User Card Details Store / Vendor Date Job # Net Tax Fees Total Liters Receipt Status Actions
<%= exp.user_name %>
•••• <%= exp.card_number.slice(-4) %>
<%= exp.card_type %>
<%= exp.store_name %>
<%= exp.transaction_id %>
<%= exp.date %> <%= exp.job_number || '—' %> $<%= parseFloat(exp.net_amount || 0).toFixed(2) %> $<%= parseFloat(exp.tax_amount || 0).toFixed(2) %> $<%= parseFloat(exp.fees_amount || 0).toFixed(2) %> $<%= parseFloat(exp.total_amount || 0).toFixed(2) %> <%= parseFloat(exp.liters_in_tank || 0).toFixed(1) %> L <% if (exp.receipt_photo_path) { %> <% } else { %>
<% } %>
<% if (exp.status === 'valid') { %> Valid <% } else if (exp.status === 'contested') { %> Contested <% } else if (exp.status === 'rebutted') { %> Rebutted <% } %>
<% if (exp.status === 'contested' && exp.user_id === user.id) { %> <% } %> <% if (user.role === 'admin' || user.role === 'accounting') { %> <% if (exp.status === 'valid') { %> <% } else if (exp.status === 'contested' || exp.status === 'rebutted') { %>
<% } %> <% } %> <% if (exp.user_id === user.id || user.role === 'admin' || user.role === 'accounting') { %>
<% } %>
<% } else { %>

No gas expenses recorded yet.

<% } %>
<% } %>
<%- include('partials/footer') %>