Added the "offset needed" option and badge in the account list, account detail and account form.
This commit is contained in:
		| @@ -79,6 +79,11 @@ First written: 2023/1/31 | ||||
| <div class="account col-sm-6"> | ||||
|   <div class="account-title">{{ obj.title }}</div> | ||||
|   <div class="account-code">{{ obj.code }}</div> | ||||
|   {% if obj.is_offset_needed %} | ||||
|     <div> | ||||
|       <span class="badge rounded-pill bg-info">{{ A_("Offset needed") }}</span> | ||||
|     </div> | ||||
|   {% endif %} | ||||
|   <div class="small text-secondary fst-italic"> | ||||
|     <div>{{ A_("Created") }} {{ obj.created_at }} {{ obj.created_by }}</div> | ||||
|     <div>{{ A_("Updated") }} {{ obj.updated_at }} {{ obj.updated_by }}</div> | ||||
|   | ||||
| @@ -62,6 +62,13 @@ First written: 2023/2/1 | ||||
|     <div id="account-title-error" class="invalid-feedback">{% if form.title.errors %}{{ form.title.errors[0] }}{% endif %}</div> | ||||
|   </div> | ||||
|  | ||||
|   <div class="form-check form-switch mb-3"> | ||||
|     <input id="account-is-offset-needed" class="form-check-input" type="checkbox" name="is_offset_needed" value="1" {% if form.is_offset_needed.data %} checked="checked" {% endif %}> | ||||
|     <label class="form-check-label" for="account-is-offset-needed"> | ||||
|       {{ A_("The entries in the account need offsets.") }} | ||||
|     </label> | ||||
|   </div> | ||||
|  | ||||
|   <div class="d-none d-md-block"> | ||||
|     <button class="btn btn-primary" type="submit"> | ||||
|       <i class="fa-solid fa-floppy-disk"></i> | ||||
|   | ||||
| @@ -58,6 +58,9 @@ First written: 2023/1/30 | ||||
|   {% for item in list %} | ||||
|     <a class="list-group-item list-group-item-action" href="{{ url_for("accounting.account.detail", account=item)|append_next }}"> | ||||
|       {{ item }} | ||||
|       {% if item.is_offset_needed %} | ||||
|         <span class="badge rounded-pill bg-info">{{ A_("Offset needed") }}</span> | ||||
|       {% endif %} | ||||
|     </a> | ||||
|   {% endfor %} | ||||
|   </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user