Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
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
e3814b95
Commit
e3814b95
authored
Dec 18, 2019
by
Patrick Kimber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check, tidy - "resolve" credit notes with issues.
https://www.kbsoftware.co.uk/crm/ticket/4705/
parent
0bd9e607
Pipeline
#104056304
failed with stage
in 1 minute and 55 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
8 deletions
+78
-8
invoice/templates/invoice/_invoice_issue_description.html
invoice/templates/invoice/_invoice_issue_description.html
+1
-1
invoice/templates/invoice/_invoice_issue_list.html
invoice/templates/invoice/_invoice_issue_list.html
+7
-3
invoice/templates/invoice/invoiceissue_form.html
invoice/templates/invoice/invoiceissue_form.html
+2
-3
invoice/templates/invoice/invoiceissue_list.html
invoice/templates/invoice/invoiceissue_list.html
+31
-0
invoice/tests/test_view.py
invoice/tests/test_view.py
+13
-0
invoice/tests/test_view_perm.py
invoice/tests/test_view_perm.py
+6
-0
invoice/urls.py
invoice/urls.py
+7
-1
invoice/views.py
invoice/views.py
+11
-0
No files found.
invoice/templates/invoice/_invoice_issue_description.html
View file @
e3814b95
...
...
@@ -11,7 +11,7 @@
{% if issue.comment %}
<br>
<strong>
Comment
:
Resolution
:
</strong>
{{ issue.comment|truncatewords_html:10 }}
{% endif %}
invoice/templates/invoice/_invoice_issue_list.html
View file @
e3814b95
<thead>
<tr>
<td
colspan=
"
4
"
>
<td
colspan=
"
5
"
>
Issues
<i
class=
"fa fa-info-circle"
></i>
</td>
</tr>
<tr
valign=
"top"
>
<th>
ID
</th>
<th>
Status
</th>
<th>
Date
</th>
<th>
Invoice / Credit
Note
</th>
<th>
Invoice / Credit
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
{% for issue in invoiceissue_list %}
<tr
valign=
"top"
>
<td>
{{ issue.pk }}
</td>
<td>
<a
href=
"{% url 'invoice.issue.update' issue.pk %}?next={{ request.get_full_path|urlencode }}"
>
{% if issue.confirmed %}
...
...
@@ -22,7 +26,7 @@
<i
class=
"fa fa-check"
></i>
{% else %}
<i
class=
"fa fa-edit"
></i>
Resolve
#{{ issue.pk }}
Resolve
{% endif %}
</a>
</td>
...
...
invoice/templates/invoice/invoiceissue_form.html
View file @
e3814b95
...
...
@@ -27,7 +27,7 @@
</div>
<div
class=
"pure-g"
>
<div
class=
"pure-u-1"
>
<table
class=
"pure-table pure-table-bordered"
>
<table
class=
"pure-table pure-table-bordered"
width=
"100%"
>
<tbody>
<tr
valign=
"top"
>
<td>
...
...
@@ -82,8 +82,7 @@
</tr>
</tbody>
</table>
<br>
{% include '_form.html' with inline_checkbox=True submit='Resolve...' %}
{% include '_form.html' with inline_checkbox=True %}
</div>
</div>
{% endblock content %}
invoice/templates/invoice/invoiceissue_list.html
0 → 100644
View file @
e3814b95
{% extends 'dash/base.html' %}
{% load humanize %}
{% load static %}
{% block sub_heading %}
Invoice Issues
{% endblock sub_heading %}
{% block content %}
<div
class=
"pure-g"
>
<div
class=
"pure-u-1"
>
<div
class=
"pure-menu pure-menu-horizontal"
>
<ul
class=
"pure-menu-list"
>
<li
class=
"pure-menu-item"
>
<a
href=
"{% url 'project.dash' %}"
class=
"pure-menu-link"
>
<i
class=
"fa fa-reply"
></i>
</a>
</li>
{% include 'base/_paginate_with_parameters.html' %}
</ul>
</div>
</div>
</div>
<div
class=
"pure-g"
>
<div
class=
"pure-u-1"
>
<table
class=
"pure-table pure-table-bordered"
width=
"100%"
>
{% include 'invoice/_invoice_issue_list.html' %}
</table>
</div>
</div>
{% endblock content %}
invoice/tests/test_view.py
View file @
e3814b95
...
...
@@ -213,6 +213,19 @@ def test_invoice_user_update(client):
assert
True
==
obj
.
mail_time_summary
@
pytest
.
mark
.
django_db
def
test_issue_list
(
client
):
user
=
UserFactory
(
is_staff
=
True
)
assert
client
.
login
(
username
=
user
.
username
,
password
=
TEST_PASSWORD
)
is
True
InvoiceIssueFactory
(
comment
=
"a"
)
InvoiceIssueFactory
(
comment
=
"b"
)
response
=
client
.
get
(
reverse
(
"invoice.issue.list"
))
assert
HTTPStatus
.
OK
==
response
.
status_code
assert
"invoiceissue_list"
in
response
.
context
invoice_issue_list
=
response
.
context
[
"invoiceissue_list"
]
assert
[
"b"
,
"a"
]
==
[
x
.
comment
for
x
in
invoice_issue_list
]
@
pytest
.
mark
.
django_db
def
test_issue_update
(
client
):
user
=
UserFactory
(
is_staff
=
True
)
...
...
invoice/tests/test_view_perm.py
View file @
e3814b95
...
...
@@ -110,6 +110,12 @@ def test_invoice_credit_list(perm_check):
perm_check
.
staff
(
url
)
@
pytest
.
mark
.
django_db
def
test_invoice_issue_list
(
perm_check
):
url
=
reverse
(
"invoice.issue.list"
)
perm_check
.
staff
(
url
)
@
pytest
.
mark
.
django_db
def
test_invoice_list
(
perm_check
):
url
=
reverse
(
"invoice.list"
)
...
...
invoice/urls.py
View file @
e3814b95
...
...
@@ -4,8 +4,8 @@ from django.urls import path
from
.views
import
(
BatchListView
,
BatchlessInvoiceListView
,
BatchListView
,
ContactInvoiceListView
,
ContactReportUpdateView
,
ContactTicketTimeRecordListView
,
...
...
@@ -15,6 +15,7 @@ from .views import (
InvoiceContactUpdateView
,
InvoiceCreditListView
,
InvoiceDraftCreateView
,
InvoiceIssueListView
,
InvoiceIssueUpdateView
,
InvoiceLineCreateView
,
InvoiceLineUpdateView
,
...
...
@@ -150,6 +151,11 @@ urlpatterns = [
view
=
InvoiceUpdateView
.
as_view
(),
name
=
"invoice.update"
,
),
url
(
regex
=
r
"^issue/$"
,
view
=
InvoiceIssueListView
.
as_view
(),
name
=
"invoice.issue.list"
,
),
# quick time record
url
(
regex
=
r
"^quick/time/record/$"
,
...
...
invoice/views.py
View file @
e3814b95
...
...
@@ -523,6 +523,17 @@ class InvoiceDraftCreateView(
return
kwargs
class
InvoiceIssueListView
(
LoginRequiredMixin
,
StaffuserRequiredMixin
,
RedirectNextMixin
,
BaseMixin
,
ListView
,
):
model
=
InvoiceIssue
paginate_by
=
20
class
InvoiceIssueUpdateView
(
LoginRequiredMixin
,
StaffuserRequiredMixin
,
...
...
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