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

Commit 53fdb10

Browse files
Merge pull request #413 from openstudioproject/development
Development
2 parents c22939c + b746a3d commit 53fdb10

File tree

9 files changed

+49
-18
lines changed

9 files changed

+49
-18
lines changed

controllers/finance_cashbook.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,12 @@ def cash_count_get(date, count_type):
530530
),
531531
_class='box-body no-padding')
532532

533+
note = ""
534+
if row.Note:
535+
note = XML(row.Note.replace('\n', '<br>'))
536+
533537
box_footer = DIV(
534-
XML(row.Note.replace('\n', '<br>')),
538+
note,
535539
_class='box-footer text-muted'
536540
)
537541
else:

controllers/pos.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,9 +1265,9 @@ def get_product_categories():
12651265
return dict(data=rows.as_dict())
12661266

12671267

1268-
#TODO make read PoS permission
1269-
# @auth.requires(auth.has_membership(group_id='Admins'))
1270-
# auth.has_permission('read', 'shop_products'))
1268+
# TODO make read PoS permission
1269+
# @auth.requires(auth.has_membership(group_id='Admins') or
1270+
# auth.has_permission('read', 'shop_products'))
12711271
def validate_cart():
12721272
"""
12731273
Process shopping cart
@@ -1590,6 +1590,8 @@ def get_cash_counts():
15901590
def set_cash_count():
15911591
set_headers()
15921592

1593+
print request.vars
1594+
15931595
# Clean up input of amount
15941596
if 'amount' in request.vars:
15951597
if ',' in request.vars['amount']:

modules/openstudio/os_invoice.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ def item_add_product_variant(self,
458458
quantity,
459459
price,
460460
tax_rates_id,
461-
glaccount):
461+
accounting_glaccounts_id,
462+
accounting_costcenters_id):
462463
"""
463464
:param product_name: string
464465
:param description: string
@@ -479,7 +480,8 @@ def item_add_product_variant(self,
479480
Price=price,
480481
Sorting=next_sort_nr,
481482
tax_rates_id=tax_rates_id,
482-
GLAccount=glaccount
483+
accounting_glaccounts_id=accounting_glaccounts_id,
484+
accounting_costcenters_id=accounting_costcenters_id
483485
)
484486

485487
# This calls self.on_update()

modules/openstudio/os_reports.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ def get_class_revenue_summary(self, clsID, date, quick_stats=True):
251251
if not row.school_classcards.Unlimited:
252252
amount = row.school_classcards.Price / row.school_classcards.Classes
253253
else:
254-
revenue = get_class_revenue_classcard(row)
255-
amount = revenue['total_revenue_in_vat']
254+
amount = row.school_classcards.QuickStatsAmount
256255
if data['classcards'].get(name, False):
257256
data['classcards'][name]['count'] += 1
258257
data['classcards'][name]['total'] = \
@@ -558,6 +557,9 @@ def get_class_revenue_classcard(self, row):
558557
:param row: row from db.classes_attendance with left join on db.customers_subscriptions
559558
:return: Revenue for class taken on a card
560559
"""
560+
db = current.db
561+
562+
from os_customer_classcard import CustomerClasscard
561563
from os_invoice import Invoice
562564

563565
ccdID = row.classes_attendance.customers_classcards_id
@@ -588,12 +590,12 @@ def get_class_revenue_classcard(self, row):
588590
# Divide by classes taken on card
589591
if classcard.unlimited:
590592
# Count all classes taken on card
591-
query = (db.classes_attendance.customers_classcards_id == ccdID)
592-
count_classes = db(query).count()
593+
query = (db.classes_attendance.customers_classcards_id == ccdID)
594+
count_classes = db(query).count()
593595

594-
revenue_in_vat = price_in_vat / count_classes
595-
revenue_ex_vat = price_ex_vat / count_classes
596-
revenue_vat = revenue_in_vat - revenue_ex_vat
596+
revenue_in_vat = price_in_vat / count_classes
597+
revenue_ex_vat = price_ex_vat / count_classes
598+
revenue_vat = revenue_in_vat - revenue_ex_vat
597599
else:
598600
revenue_in_vat = price_in_vat / classcard.classes
599601
revenue_ex_vat = price_ex_vat / classcard.classes

react_frontend_src/pos/data/initialState.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@
8686
"camera_app_snap_saved": false,
8787
"notes_loading": false,
8888
"notes_loaded": false,
89-
"notes": {},
89+
"notes": {
90+
"data": {}
91+
},
9092
"notes_checkin_check": false,
9193
"has_unprocessed_notes": false,
9294
"create_note": false,

react_frontend_src/pos/src/app/customers/list/CustomerDisplay.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,26 @@ class CustomerDisplay extends Component {
149149
e.preventDefault()
150150
console.log('checkin clicked')
151151

152-
this.props.setNotesCheckinCheck()
152+
const notes = this.props.customers.notes.data
153+
let has_unprocessed_note = false
154+
if (notes) {
155+
var i;
156+
for (i = 0; i < notes.length; i++) {
157+
console.log(notes[i])
158+
if (notes[i].Processed === false) {
159+
console.log('unprocessed note found')
160+
has_unprocessed_note = true
161+
break
162+
}
163+
}
164+
}
165+
166+
if (has_unprocessed_note) {
167+
this.props.setNotesCheckinCheck()
168+
} else {
169+
const customerID = this.props.customerID
170+
this.props.history.push("/classes/" + customerID)
171+
}
153172
}
154173

155174

react_frontend_src/pos/src/app/customers/list/CustomerDisplayNoteForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CustomerDisplayNoteForm extends Component {
3535

3636
if (create) {
3737
defaultValue = ""
38-
this.textarea.current.value = defaultValue
38+
// this.textarea.current.value = defaultValue
3939
}
4040

4141
// set initial value on update

static/plugin_os_pos/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/plugin_os_pos/main.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)