Commit da0160bb authored by Patrick Kimber's avatar Patrick Kimber

Update 'invoice' app

parent 4d3d10cf
Pipeline #135875490 passed with stage
in 5 minutes and 18 seconds
--ignore-dir=.cache
--ignore-dir=.pytest_cache
--ignore-dir=assets
--ignore-dir=kb_invoice.egg-info
--ignore-dir=venv-invoice
--ignore-file=ext:1
......@@ -14,4 +15,5 @@
--ignore-file=ext:log
--ignore-file=is:logger
--ignore-file=is:MANIFEST
--ignore-file=is:report.html
--ignore-file=is:tags
......@@ -2,7 +2,7 @@ source venv-invoice/bin/activate.fish
set -x KUBECONFIG (k3d get-kubeconfig)
set -x DATABASE_HOST (kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
set -x DATABASE_NAME "dev_test_invoice_app_$USER"
set -x DATABASE_NAME "dev_app_invoice_$USER"
set -x DATABASE_PASS "postgres"
set -x DATABASE_PORT (kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services kb-dev-db-postgresql)
set -x DATABASE_USER "postgres"
......
......@@ -40,11 +40,13 @@ nosetests.xml
# dev
.pytest_cache/
.vscode/
assets/
export_to_r.csv
kb.py
logger.*
media
media-private
report.html
report_time_by_user_by_week_date.csv
tags
temp.csv
......
services:
- postgres:9.5
- postgres:10.5
test:
script:
......@@ -9,3 +9,6 @@ test:
- export DATABASE_USER=postgres
- pip3 install -r requirements/ci.txt -i https://pypi.kbsoftware.co.uk/kb/dev/+simple/
- pytest --create-db --cov-report term --cov=invoice
variables:
POSTGRES_HOST_AUTH_METHOD: trust
......@@ -2,10 +2,11 @@
from .base import *
DATABASE_NAME = get_env_variable("DATABASE_NAME")
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": get_env_variable("DATABASE_NAME"),
"NAME": DATABASE_NAME,
"USER": get_env_variable("DATABASE_USER"),
"PASSWORD": get_env_variable("DATABASE_PASS"),
"HOST": get_env_variable("DATABASE_HOST"),
......
......@@ -2,10 +2,11 @@
from example_invoice.base import *
DATABASE_NAME = "test_app_invoice"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "dev_test_app_invoice",
"NAME": DATABASE_NAME,
"USER": get_env_variable("DATABASE_USER"),
"PASSWORD": get_env_variable("DATABASE_PASS"),
"HOST": get_env_variable("DATABASE_HOST"),
......
{% extends "base/base.html" %}
{% load staticfiles %}
{% load static %}
{% block title %}
CMS
Invoice
{% endblock title %}
{% block heading %}
CMS
Invoice
{% endblock heading %}
{% block sub_heading %}
......
#!/bin/bash
# treat unset variables as an error when substituting.
set -u
# exit immediately if a command exits with a nonzero exit status.
set -e
# treat unset variables as an error when substituting.
set -u
echo Drop database: $DATABASE_NAME
PGPASSWORD=$DATABASE_PASS psql --host $DATABASE_HOST --port $DATABASE_PORT -U $DATABASE_USER -c "DROP DATABASE IF EXISTS $DATABASE_NAME;"
PGPASSWORD=$DATABASE_PASS psql --host $DATABASE_HOST --port $DATABASE_PORT -U $DATABASE_USER -c "CREATE DATABASE $DATABASE_NAME TEMPLATE=template0 ENCODING='utf-8';"
py.test -x
touch temp.db && rm temp.db
django-admin.py migrate --noinput
django-admin.py init_app_invoice
django-admin.py init_app_crm
django-admin.py demo_data_login
django-admin.py demo_data_crm
django-admin.py demo_data_invoice
django-admin.py runserver
......@@ -1051,9 +1051,10 @@ class ReconcileDayView(
batches = self._batches()
batch_net, batch_gross = self.batch_net_and_gross()
invoices = self._unbatched_invoices()
invoice_net_total, invoice_gross_total = (
self.unbatched_invoice_net_and_gross()
)
(
invoice_net_total,
invoice_gross_total,
) = self.unbatched_invoice_net_and_gross()
issues = self._issues()
credit_notes = self._credit_notes()
context.update(
......
attrs==19.3.0
beautifulsoup4==4.8.1
bleach==3.1.0
beautifulsoup4==4.9.0
bleach==3.1.4
celery==4.3.0
django-braces==1.13.0
django-extensions==2.2.3
django-mptt==0.10.0
django-reversion==3.0.5
django-braces==1.14.0
django-extensions==2.2.5
django-mptt==0.11.0
django-reversion==3.0.7
django-sendfile==0.3.11
django-taggit==1.2.0
Django==2.2.8
Django==3.0.5
djangorestframework==3.11.0
easy-thumbnails==2.7
elasticsearch==6.4.0
google-api-python-client==1.7.9
google-auth==1.6.3
psycopg2==2.8.4
psycopg2==2.8.5
python-dateutil==2.8.1
pytz==2019.3
redis==3.3.8
reportlab==3.5.32
reportlab==3.5.42
sparkpost==1.3.6
......@@ -21,3 +21,4 @@ GitPython
pytest-cov
pytest-django
pytest-flakes
semantic-version
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment