<%# /templates/receipts/_row.html.ep %> <% my $get_store_icon = sub { my $name = shift; return undef unless $name; my $slug = lc($name); $slug =~ s/[^a-z0-9]/-/g; $slug =~ s/-+/-/g; for my $ext (qw(png jpg jpeg gif svg)) { my $path = "public/images/shops/$slug.$ext"; return "/images/shops/$slug.$ext" if -e $path; } return undef; }; my $icon_path = $get_store_icon->($r->{store_name}); %> % if ($r->{mime_type} =~ /^image/) {
% } else { <%= icon('receipts') %> % } <%= $r->{original_filename} %>
<% if ($icon_path) { %> <% } %> <%= $r->{store_name} || 'Unknown' %> % if ($r->{ai_json} && $r->{ai_json} =~ /^\s*\{/) { 🧠 % }
% if ($r->{description}) {
<%= $r->{description} %> % } <%= $r->{formatted_date} || '-' %> $<%= sprintf("%.2f", $r->{total_amount} // 0) %> <%= $r->{uploaded_by} %>
<%= icon('view') %> % if ($r->{uploaded_by} eq session('user') || is_admin) { % }