DrCr/austax/templates/cgt_adjustments_edit.html

69 lines
4.0 KiB
HTML
Raw Normal View History

2023-01-07 14:07:58 +11:00
{# DrCr: Web-based double-entry bookkeeping framework
Copyright (C) 2022–2024 Lee Yingtong Li (RunasSudo)
2023-01-07 14:07:58 +11:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
#}
2024-04-04 19:38:59 +11:00
{% extends 'base.html' %}
2023-01-07 14:07:58 +11:00
{% block title %}{{ 'Edit' if adjustment else 'New' }} CGT adjustment{% endblock %}
{% block content %}
<div class="max-w-lg mx-auto px-4">
<h1 class="text-3xl text-gray-900 mb-4">
{{ 'Edit' if adjustment else 'New' }} CGT adjustment
</h1>
2023-01-07 14:07:58 +11:00
<form method="POST">
<div class="grid grid-cols-[max-content_1fr] space-y-2 mb-4 items-baseline">
<h2 class="col-span-2 text-xl text-gray-900 font-semibold">CGT asset</h2>
<label for="acquisition_date" class="block text-gray-900 pr-4">Acquisition date</label>
<div>
<input type="date" class="block w-full border-0 py-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-emerald-600" name="acquisition_date" id="acquisition_date" value="{{ adjustment.acquisition_date.strftime('%Y-%m-%d') if adjustment else request.args.get('acquisition_date', '') }}">
</div>
<label for="account" class="block text-gray-900 pr-4">Account</label>
<div>
<input type="text" class="block w-full border-0 py-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-emerald-600" name="account" id="account" value="{{ adjustment.account if adjustment else request.args.get('account', '') }}">
</div>
<label for="asset" class="block text-gray-900 pr-4">Asset</label>
<div>
<input type="text" class="block w-full border-0 py-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-emerald-600" name="asset" id="asset" value="{{ adjustment.asset().quantity_string() if adjustment else request.args.get('asset', '') }}">
</div>
<h2 class="col-span-2 text-xl text-gray-900 font-semibold pt-4">CGT adjustment</h2>
<label for="dt" class="block text-gray-900 pr-4">Adjustment date</label>
<div>
<input type="date" class="block w-full border-0 py-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-emerald-600" name="dt" id="dt" value="{{ adjustment.dt.strftime('%Y-%m-%d') if adjustment else '' }}">
</div>
<label for="description" class="block text-gray-900 pr-4">Description</label>
<div>
<input type="text" class="block w-full border-0 py-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-emerald-600" name="description" id="description" value="{{ adjustment.description if adjustment else '' }}">
</div>
<label for="cost_adjustment" class="block text-gray-900 pr-4">Cost adjustment</label>
<div class="relative shadow-sm">
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
<span class="text-gray-500">$</span>
</div>
<input type="number" class="block w-full border-0 py-1 pl-7 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-emerald-600" name="cost_adjustment" id="cost_adjustment" step="0.01" value="{{ adjustment.cost_adjustment_amount().quantity_string() if adjustment else '' }}" placeholder="0.00">
</div>
2023-01-07 14:07:58 +11:00
</div>
<div class="text-end">
<button type="submit" class="bg-emerald-600 px-3 py-1 text-white shadow-sm hover:bg-emerald-700">Save</button>
2023-01-07 14:07:58 +11:00
</div>
</form>
</div>
2023-01-07 14:07:58 +11:00
{% endblock %}