Fixed upload and added category read to transaction

This commit is contained in:
Finn 2018-01-15 17:14:16 +00:00
parent c4f68332b9
commit 1f70f9b40a
2 changed files with 10 additions and 6 deletions

View file

@ -209,7 +209,7 @@ sub post_upload {
} }
if ( defined $category ) { if ( defined $category ) {
my $c->schema->resultset('TransactionCategory')->create({ $c->schema->resultset('TransactionCategory')->create({
category_id => $category, category_id => $category,
transaction_id => $new_transaction->id, transaction_id => $new_transaction->id,
}); });

View file

@ -23,23 +23,27 @@
<div class="card-body"> <div class="card-body">
<form> <form>
<div class="form-group"> <div class="form-group">
<label for="email">Buyer</label> <label for="buyer">Buyer</label>
<input id="buyer" type="text" class="form-control" placeholder="Buyer ID" name="buyer" value="<%= $transaction->buyer->name %>" disabled> <input id="buyer" type="text" class="form-control" placeholder="Buyer ID" name="buyer" value="<%= $transaction->buyer->name %>" disabled>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Seller</label> <label for="seller">Seller</label>
<input id="seller" type="text" class="form-control" placeholder="Seller ID" name="seller" value="<%= $transaction->seller->name %>" disabled> <input id="seller" type="text" class="form-control" placeholder="Seller ID" name="seller" value="<%= $transaction->seller->name %>" disabled>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Value</label> <label for="value">Value</label>
<input id="value" type="text" class="form-control" placeholder="Value" name="value" value="<%= sprintf '£%.2f', $transaction->value / 100000 %>" disabled> <input id="value" type="text" class="form-control" placeholder="Value" name="value" value="<%= sprintf '£%.2f', $transaction->value / 100000 %>" disabled>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Submitted At</label> <label for="text">Category</label>
<input id="category" type="text" class="form-control" placeholder="No Category" name="category" value="<%= $transaction->category->category->name %>" disabled>
</div>
<div class="form-group">
<label for="submitted_at">Submitted At</label>
<input id="submitted_at" type="text" class="form-control" placeholder="Submitted At" name="submitted_at" value="<%= format_human_datetime $transaction->submitted_at %>" disabled> <input id="submitted_at" type="text" class="form-control" placeholder="Submitted At" name="submitted_at" value="<%= format_human_datetime $transaction->submitted_at %>" disabled>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Purchase Time</label> <label for="purchase_time">Purchase Time</label>
<input id="purchase_time" type="text" class="form-control" placeholder="Purchase Time" name="purchase_time" value="<%= format_human_datetime $transaction->purchase_time %>" disabled> <input id="purchase_time" type="text" class="form-control" placeholder="Purchase Time" name="purchase_time" value="<%= format_human_datetime $transaction->purchase_time %>" disabled>
</div> </div>
<div class="form-group d-flex justify-content-center"> <div class="form-group d-flex justify-content-center">