Improve look of invoice address form
This commit is contained in:
parent
87439c62d0
commit
81932c4da0
1 changed files with 70 additions and 26 deletions
|
@ -5,31 +5,75 @@
|
||||||
{% translate "Create a new organization" %}
|
{% translate "Create a new organization" %}
|
||||||
{% endblock page_title %}
|
{% endblock page_title %}
|
||||||
{% endblock html_title %}
|
{% endblock html_title %}
|
||||||
{% block card_content %}
|
{% block content %}
|
||||||
<form method="post" class="form form-vertical">
|
<section class="section">
|
||||||
{% include "frontend/forms/errors.html" %}
|
<form method="post" class="form form-vertical">
|
||||||
{% csrf_token %}
|
<div class="card">
|
||||||
<div class="form-body">
|
<div class="card-content">
|
||||||
<div class="row">
|
<div class="form-body card-body">
|
||||||
{{ form.name.as_field_group }}
|
<div class="row">
|
||||||
<hr class="my-4">
|
{% include "frontend/forms/errors.html" %}
|
||||||
<h4>{% translate "Billing Information" %}</h4>
|
{% csrf_token %}
|
||||||
{{ form.billing_processing_choice.as_field_group }}
|
{{ form.name.as_field_group }}
|
||||||
<div id="existing_billing_address_section" class="mt-3">{{ form.existing_odoo_address_id.as_field_group }}</div>
|
</div>
|
||||||
<div id="new_billing_address_section" class="mt-3">
|
</div>
|
||||||
{{ form.invoice_name.as_field_group }}
|
|
||||||
{{ form.invoice_street.as_field_group }}
|
|
||||||
{{ form.invoice_street2.as_field_group }}
|
|
||||||
{{ form.invoice_city.as_field_group }}
|
|
||||||
{{ form.invoice_zip.as_field_group }}
|
|
||||||
{{ form.invoice_state_name.as_field_group }}
|
|
||||||
{{ form.invoice_country.as_field_group }}
|
|
||||||
{{ form.invoice_email.as_field_group }}
|
|
||||||
{{ form.invoice_phone.as_field_group }}
|
|
||||||
{{ form.invoice_vat.as_field_group }}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 d-flex justify-content-end">
|
</div>
|
||||||
<button class="btn btn-primary me-1 mb-1" type="submit">{% translate "Create Organization" %}</button>
|
{% if form.existing_odoo_address_id and form.existing_odoo_address_id.choices %}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">{% translate "Billing Information" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="form-body card-body">
|
||||||
|
<div class="row">
|
||||||
|
{{ form.billing_processing_choice.as_field_group }}
|
||||||
|
<div id="existing_billing_address_section" class="mt-3">{{ form.existing_odoo_address_id.as_field_group }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div id="new_billing_address_section">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">{% translate "Invoice Address" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="form-body card-body">
|
||||||
|
<div class="row">
|
||||||
|
{{ form.invoice_vat.as_field_group }}
|
||||||
|
<hr>
|
||||||
|
{{ form.invoice_street.as_field_group }}
|
||||||
|
{{ form.invoice_street2.as_field_group }}
|
||||||
|
<div class="col-md-2">{{ form.invoice_zip.as_field_group }}</div>
|
||||||
|
<div class="col-md-10">{{ form.invoice_city.as_field_group }}</div>
|
||||||
|
{{ form.invoice_country.as_field_group }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">{% translate "Invoice Contact" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="form-body card-body">
|
||||||
|
<div class="row">
|
||||||
|
{{ form.invoice_email.as_field_group }}
|
||||||
|
{{ form.invoice_phone.as_field_group }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="col-sm-12 d-flex justify-content-end">
|
||||||
|
<button class="btn btn-primary me-1 mb-1" type="submit">{% translate "Create Organization" %}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -65,8 +109,8 @@
|
||||||
} else {
|
} else {
|
||||||
// No existing addresses found, a new address has to be entered.
|
// No existing addresses found, a new address has to be entered.
|
||||||
if (existingSection) existingSection.style.display = 'none'
|
if (existingSection) existingSection.style.display = 'none'
|
||||||
newSection.style.display = ''
|
if (newSection) newSection.style.display = '' // Ensure newSection is not null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock card_content %}
|
{% endblock content %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue