Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #413 from openstudioproject/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
edwinvandeven authored Jun 15, 2019
2 parents c22939c + b746a3d commit 53fdb10
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 18 deletions.
6 changes: 5 additions & 1 deletion controllers/finance_cashbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,12 @@ def cash_count_get(date, count_type):
),
_class='box-body no-padding')

note = ""
if row.Note:
note = XML(row.Note.replace('\n', '<br>'))

box_footer = DIV(
XML(row.Note.replace('\n', '<br>')),
note,
_class='box-footer text-muted'
)
else:
Expand Down
8 changes: 5 additions & 3 deletions controllers/pos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,9 +1265,9 @@ def get_product_categories():
return dict(data=rows.as_dict())


#TODO make read PoS permission
# @auth.requires(auth.has_membership(group_id='Admins'))
# auth.has_permission('read', 'shop_products'))
# TODO make read PoS permission
# @auth.requires(auth.has_membership(group_id='Admins') or
# auth.has_permission('read', 'shop_products'))
def validate_cart():
"""
Process shopping cart
Expand Down Expand Up @@ -1590,6 +1590,8 @@ def get_cash_counts():
def set_cash_count():
set_headers()

print request.vars

# Clean up input of amount
if 'amount' in request.vars:
if ',' in request.vars['amount']:
Expand Down
6 changes: 4 additions & 2 deletions modules/openstudio/os_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ def item_add_product_variant(self,
quantity,
price,
tax_rates_id,
glaccount):
accounting_glaccounts_id,
accounting_costcenters_id):
"""
:param product_name: string
:param description: string
Expand All @@ -479,7 +480,8 @@ def item_add_product_variant(self,
Price=price,
Sorting=next_sort_nr,
tax_rates_id=tax_rates_id,
GLAccount=glaccount
accounting_glaccounts_id=accounting_glaccounts_id,
accounting_costcenters_id=accounting_costcenters_id
)

# This calls self.on_update()
Expand Down
16 changes: 9 additions & 7 deletions modules/openstudio/os_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ def get_class_revenue_summary(self, clsID, date, quick_stats=True):
if not row.school_classcards.Unlimited:
amount = row.school_classcards.Price / row.school_classcards.Classes
else:
revenue = get_class_revenue_classcard(row)
amount = revenue['total_revenue_in_vat']
amount = row.school_classcards.QuickStatsAmount
if data['classcards'].get(name, False):
data['classcards'][name]['count'] += 1
data['classcards'][name]['total'] = \
Expand Down Expand Up @@ -558,6 +557,9 @@ def get_class_revenue_classcard(self, row):
:param row: row from db.classes_attendance with left join on db.customers_subscriptions
:return: Revenue for class taken on a card
"""
db = current.db

from os_customer_classcard import CustomerClasscard
from os_invoice import Invoice

ccdID = row.classes_attendance.customers_classcards_id
Expand Down Expand Up @@ -588,12 +590,12 @@ def get_class_revenue_classcard(self, row):
# Divide by classes taken on card
if classcard.unlimited:
# Count all classes taken on card
query = (db.classes_attendance.customers_classcards_id == ccdID)
count_classes = db(query).count()
query = (db.classes_attendance.customers_classcards_id == ccdID)
count_classes = db(query).count()

revenue_in_vat = price_in_vat / count_classes
revenue_ex_vat = price_ex_vat / count_classes
revenue_vat = revenue_in_vat - revenue_ex_vat
revenue_in_vat = price_in_vat / count_classes
revenue_ex_vat = price_ex_vat / count_classes
revenue_vat = revenue_in_vat - revenue_ex_vat
else:
revenue_in_vat = price_in_vat / classcard.classes
revenue_ex_vat = price_ex_vat / classcard.classes
Expand Down
4 changes: 3 additions & 1 deletion react_frontend_src/pos/data/initialState.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
"camera_app_snap_saved": false,
"notes_loading": false,
"notes_loaded": false,
"notes": {},
"notes": {
"data": {}
},
"notes_checkin_check": false,
"has_unprocessed_notes": false,
"create_note": false,
Expand Down
21 changes: 20 additions & 1 deletion react_frontend_src/pos/src/app/customers/list/CustomerDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,26 @@ class CustomerDisplay extends Component {
e.preventDefault()
console.log('checkin clicked')

this.props.setNotesCheckinCheck()
const notes = this.props.customers.notes.data
let has_unprocessed_note = false
if (notes) {
var i;
for (i = 0; i < notes.length; i++) {
console.log(notes[i])
if (notes[i].Processed === false) {
console.log('unprocessed note found')
has_unprocessed_note = true
break
}
}
}

if (has_unprocessed_note) {
this.props.setNotesCheckinCheck()
} else {
const customerID = this.props.customerID
this.props.history.push("/classes/" + customerID)
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CustomerDisplayNoteForm extends Component {

if (create) {
defaultValue = ""
this.textarea.current.value = defaultValue
// this.textarea.current.value = defaultValue
}

// set initial value on update
Expand Down
2 changes: 1 addition & 1 deletion static/plugin_os_pos/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/plugin_os_pos/main.map

Large diffs are not rendered by default.

0 comments on commit 53fdb10

Please sign in to comment.