Added the suggested accounts to the summary helper.
This commit is contained in:
		@@ -19,7 +19,7 @@ entry-form-modal.html: The modal of the summary helper
 | 
			
		||||
Author: imacat@mail.imacat.idv.tw (imacat)
 | 
			
		||||
First written: 2023/2/28
 | 
			
		||||
#}
 | 
			
		||||
<form id="accounting-summary-helper-{{ summary_helper.type }}" class="accounting-summary-helper" data-entry-type="{{ summary_helper.type }}" data-default-tab-id="general">
 | 
			
		||||
<form id="accounting-summary-helper-{{ summary_helper.type }}" class="accounting-summary-helper" data-entry-type="{{ summary_helper.type }}" data-default-tab-id="general" data-selected-account-code="" data-selected-account-text="">
 | 
			
		||||
  <div id="accounting-summary-helper-{{ summary_helper.type }}-modal" class="modal fade" tabindex="-1" aria-labelledby="accounting-summary-helper-{{ summary_helper.type }}-modal-label" aria-hidden="true">
 | 
			
		||||
    <div class="modal-dialog">
 | 
			
		||||
      <div class="modal-content">
 | 
			
		||||
@@ -70,7 +70,7 @@ First written: 2023/2/28
 | 
			
		||||
 | 
			
		||||
            <div>
 | 
			
		||||
              {% for tag in summary_helper.general.tags %}
 | 
			
		||||
                <button class="btn btn-outline-primary accounting-summary-helper-{{ summary_helper.type }}-btn-tag accounting-summary-helper-{{ summary_helper.type }}-general-btn-tag" type="button" tabindex="-1" data-value="{{ tag.name }}">
 | 
			
		||||
                <button class="btn btn-outline-primary accounting-summary-helper-{{ summary_helper.type }}-btn-tag accounting-summary-helper-{{ summary_helper.type }}-general-btn-tag" type="button" tabindex="-1" data-value="{{ tag.name }}" data-accounts="{{ tag.account_codes|tojson|forceescape }}">
 | 
			
		||||
                  {{ tag }}
 | 
			
		||||
                </button>
 | 
			
		||||
              {% endfor %}
 | 
			
		||||
@@ -87,7 +87,7 @@ First written: 2023/2/28
 | 
			
		||||
 | 
			
		||||
            <div>
 | 
			
		||||
              {% for tag in summary_helper.travel.tags %}
 | 
			
		||||
                <button class="btn btn-outline-primary accounting-summary-helper-{{ summary_helper.type }}-btn-tag accounting-summary-helper-{{ summary_helper.type }}-travel-btn-tag" type="button" tabindex="-1" data-value="{{ tag.name }}">
 | 
			
		||||
                <button class="btn btn-outline-primary accounting-summary-helper-{{ summary_helper.type }}-btn-tag accounting-summary-helper-{{ summary_helper.type }}-travel-btn-tag" type="button" tabindex="-1" data-value="{{ tag.name }}" data-accounts="{{ tag.account_codes|tojson|forceescape }}">
 | 
			
		||||
                  {{ tag }}
 | 
			
		||||
                </button>
 | 
			
		||||
              {% endfor %}
 | 
			
		||||
@@ -128,7 +128,7 @@ First written: 2023/2/28
 | 
			
		||||
 | 
			
		||||
            <div>
 | 
			
		||||
              {% for tag in summary_helper.bus.tags %}
 | 
			
		||||
                <button class="btn btn-outline-primary accounting-summary-helper-{{ summary_helper.type }}-btn-tag accounting-summary-helper-{{ summary_helper.type }}-bus-btn-tag" type="button" tabindex="-1" data-value="{{ tag.name }}">
 | 
			
		||||
                <button class="btn btn-outline-primary accounting-summary-helper-{{ summary_helper.type }}-btn-tag accounting-summary-helper-{{ summary_helper.type }}-bus-btn-tag" type="button" tabindex="-1" data-value="{{ tag.name }}" data-accounts="{{ tag.account_codes|tojson|forceescape }}">
 | 
			
		||||
                  {{ tag }}
 | 
			
		||||
                </button>
 | 
			
		||||
              {% endfor %}
 | 
			
		||||
@@ -161,6 +161,15 @@ First written: 2023/2/28
 | 
			
		||||
              <div id="accounting-summary-helper-{{ summary_helper.type }}-number-error" class="invalid-feedback"></div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          {# The suggested accounts #}
 | 
			
		||||
          <div class="mt-3">
 | 
			
		||||
            {% for account in summary_helper.accounts %}
 | 
			
		||||
              <button class="btn btn-outline-primary d-none accounting-summary-helper-{{ summary_helper.type }}-account" type="button" role="button" data-code="{{ account.code }}" data-text="{{ account }}">
 | 
			
		||||
                {{ account }}
 | 
			
		||||
              </button>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="modal-footer">
 | 
			
		||||
          <button type="button" class="btn btn-secondary accounting-summary-helper-{{ summary_helper.type }}-close" data-bs-toggle="modal" data-bs-target="">{{ A_("Cancel") }}</button>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user