Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
I
invoice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kb
invoice
Commits
ef1e6b79
Commit
ef1e6b79
authored
Sep 12, 2019
by
Patrick Kimber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invoice detail to invoice issue form
parent
2fc41a2d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
37 deletions
+141
-37
invoice/templates/invoice/_invoice_issue_description.html
invoice/templates/invoice/_invoice_issue_description.html
+17
-0
invoice/templates/invoice/_invoice_issue_list.html
invoice/templates/invoice/_invoice_issue_list.html
+10
-23
invoice/templates/invoice/invoiceissue_form.html
invoice/templates/invoice/invoiceissue_form.html
+87
-5
invoice/views.py
invoice/views.py
+27
-9
No files found.
invoice/templates/invoice/_invoice_issue_description.html
0 → 100644
View file @
ef1e6b79
{% for description in issue.lines %}
{% if not forloop.first %}
<br>
{% endif %}
{% if forloop.first and forloop.last %}
{{ description }}
{% else %}
{{ forloop.counter }}. {{ description }}
{% endif %}
{% endfor %}
{% if issue.comment %}
<br>
<strong>
Comment:
</strong>
{{ issue.comment|truncatewords_html:10 }}
{% endif %}
invoice/templates/invoice/_invoice_issue_list.html
View file @
ef1e6b79
<thead>
<tr>
<td
colspan=
"3"
>
Issues
<i
class=
"fa fa-info-circle"
></i>
</td>
</tr>
<tr
valign=
"top"
>
<th>
Status
</th>
<th>
Invoice / Credit
</th>
<th>
Invoice / Credit
Note
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
{% for issue in invoiceissue_list %}
<tr>
<td
colspan=
"3"
>
Issues
</td>
</tr>
<tr
valign=
"top"
>
<td>
<a
href=
"{% url 'invoice.issue.update' issue.pk %}"
>
<a
href=
"{% url 'invoice.issue.update' issue.pk %}
?next={{ request.get_full_path|urlencode }}
"
>
{% if issue.confirmed %}
Confirmed
<i
class=
"fa fa-check"
></i>
{% else %}
<i
class=
"fa fa-edit"
></i>
Resolve
Resolve
#{{ issue.pk }}
{% endif %}
</a>
</td>
...
...
@@ -28,23 +31,7 @@
</a>
</td>
<td>
{% for description in issue.lines %}
{% if not forloop.first %}
<br>
{% endif %}
{% if forloop.first and forloop.last %}
{{ description }}
{% else %}
{{ forloop.counter }}. {{ description }}
{% endif %}
{% endfor %}
{% if issue.comment %}
<br>
<strong>
Comment:
</strong>
{{ issue.comment|truncatewords_html:10 }}
{% endif %}
{% include 'invoice/_invoice_issue_description.html' %}
</td>
</tr>
{% endfor %}
...
...
invoice/templates/invoice/invoiceissue_form.html
View file @
ef1e6b79
{% extends "invoice/base.html" %} {% block sub_title %} Invoice Issue {{ object.pk }} {% endblock sub_title %} {% block sub_heading %} Invoice issue {{ object.pk }} {% endblock sub_heading %} {% block content %}
<div
class=
"pure-g"
>
<div
class=
"pure-u-1"
>
{% include '_form.html' with inline_checkbox=True %}
{% extends "invoice/base.html" %}
{% block sub_title %}
Invoice Issue {{ object.pk }}
{% endblock sub_title %}
{% block sub_heading %}
Invoice issue {{ object.pk }}
{% endblock sub_heading %}
{% block content %}
<div
class=
"pure-menu pure-menu-horizontal"
>
<ul
class=
"pure-menu-list"
>
<li
class=
"pure-menu-item"
>
{% if next %}
<a
href=
"{{ next }}"
class=
"pure-menu-link"
>
<i
class=
"fa fa-reply"
></i>
</a>
{% else %}
<a
href=
"{% url 'project.dash' %}"
class=
"pure-menu-link"
>
<i
class=
"fa fa-reply"
></i>
Dashboard
</a>
{% endif %}
</li>
</ul>
</div>
<div
class=
"pure-g"
>
<div
class=
"pure-u-1"
>
<table
class=
"pure-table pure-table-bordered"
>
<tbody>
<tr
valign=
"top"
>
<td>
<strong>
Issue
</strong>
</td>
<td>
#{{ invoiceissue.pk }}
</td>
</tr>
<tr
valign=
"top"
>
<td>
<strong>
{% if invoiceissue.invoice.is_credit %}
Credit Note
{% else %}
Invoice
{% endif %}
</strong>
</td>
<td>
<a
href=
"{% url 'invoice.detail' invoiceissue.invoice.pk %}"
>
{{ invoiceissue.invoice.invoice_number }}
</a>
</td>
</tr>
<tr
valign=
"top"
>
<td>
<strong>
{% if invoiceissue.invoice.is_credit %}
Credit Note
{% else %}
Invoice
{% endif %}
Date
</strong>
</td>
<td>
{{ invoiceissue.invoice.invoice_date|date:'d/m/Y' }}
</td>
</tr>
<tr
valign=
"top"
>
<td>
<strong>
Description
</strong>
</td>
<td>
{% include 'invoice/_invoice_issue_description.html' with issue=invoiceissue %}
</td>
</tr>
</tbody>
</table>
<br>
{% include '_form.html' with inline_checkbox=True submit='Resolve...' %}
</div>
</div>
</div>
{% endblock content %}
invoice/views.py
View file @
ef1e6b79
...
...
@@ -524,21 +524,39 @@ class InvoiceDraftCreateView(
class
InvoiceIssueUpdateView
(
LoginRequiredMixin
,
StaffuserRequiredMixin
,
BaseMixin
,
UpdateView
LoginRequiredMixin
,
StaffuserRequiredMixin
,
RedirectNextMixin
,
BaseMixin
,
UpdateView
,
):
form_class
=
InvoiceIssueForm
model
=
InvoiceIssue
def
form_valid
(
self
,
form
):
result
=
super
().
form_valid
(
form
)
if
self
.
object
.
confirmed
:
caption
=
(
"credit note"
if
self
.
object
.
invoice
.
is_credit
else
"Invoice"
)
messages
.
info
(
self
.
request
,
"Resolved issue #{} for {} {} dated {}"
.
format
(
self
.
object
.
pk
,
caption
,
self
.
object
.
invoice
.
invoice_number
,
self
.
object
.
invoice
.
invoice_date
.
strftime
(
"%d/%m/%Y"
),
),
)
return
result
def
get_success_url
(
self
):
return
reverse
(
"invoice.reconcile.day"
,
args
=
[
self
.
object
.
invoice
.
invoice_date
.
year
,
self
.
object
.
invoice
.
invoice_date
.
month
,
self
.
object
.
invoice
.
invoice_date
.
day
,
],
)
next_url
=
self
.
request
.
POST
.
get
(
REDIRECT_FIELD_NAME
)
if
next_url
:
return
next_url
else
:
return
reverse
(
"project.dash"
)
class
InvoiceLineCreateView
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment