Skip to content

Commit

Permalink
Feat/POS Extend (#110)
Browse files Browse the repository at this point in the history
* try: duplicate page and js

* fix: move public fodlder, include

* feat: add table input save

* feat: add show table in invoice

* feat: move bundle and add table to print receipt

* fix: add bill print

* fix: show table in edit recent order

* feat: add tracking items

* feat: print table, captain

* fix: print will printing old order fix

* fix: print captain will save as draft first

* feat: add print bill

* feat: clean table when checkout

* fix: allow guest removed

* feat: add card api
  • Loading branch information
anhilmy authored Feb 15, 2024
1 parent 193459c commit 1de49f1
Show file tree
Hide file tree
Showing 35 changed files with 1,343 additions and 7 deletions.
13 changes: 6 additions & 7 deletions inn/hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version

app_name = "inn"
app_title = "Inn Hotels"
app_publisher = "Core Initiative"
Expand All @@ -15,11 +11,11 @@
# ------------------

# include js, css files in header of desk.html
# app_include_css = "/assets/inn/css/inn.css"
app_include_css = "inn.bundle.css"
# app_include_js = "/assets/inn/js/inn.js"

# include js, css files in header of web template
# web_include_css = "/assets/inn/css/inn.css"
web_include_css = "inn.bundle.css"
# web_include_js = "/assets/inn/js/inn.js"

# include js in page
Expand Down Expand Up @@ -135,6 +131,9 @@
jinja = {
"methods": [
"inn.inn_hotels.doctype.inn_reservation.inn_reservation.get_total_deposit",
"inn.inn_hotels.doctype.inn_reservation.inn_reservation.get_date"
"inn.inn_hotels.doctype.inn_reservation.inn_reservation.get_date",

"inn.inn_hotels.doctype.inn_pos_usage.inn_pos_usage.print_list_order",
"inn.inn_hotels.page.pos_extended.pos_extended.get_table_number"
]
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024, Core Initiative and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Inn Point Of Sale Table", {
// refresh(frm) {

// },
// });
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "field:table_name",
"creation": "2024-02-05 14:06:01.644083",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"table_name",
"status"
],
"fields": [
{
"fieldname": "table_name",
"fieldtype": "Data",
"label": "Table Name",
"unique": 1
},
{
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Empty\nReserved\nOccupied"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-02-05 14:09:01.664573",
"modified_by": "Administrator",
"module": "Inn Hotels",
"name": "Inn Point Of Sale Table",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Core Initiative and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class InnPointOfSaleTable(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Core Initiative and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestInnPointOfSaleTable(FrappeTestCase):
pass
Empty file.
8 changes: 8 additions & 0 deletions inn/inn_hotels/doctype/inn_pos_usage/inn_pos_usage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024, Core Initiative and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Inn POS Usage", {
// refresh(frm) {

// },
// });
76 changes: 76 additions & 0 deletions inn/inn_hotels/doctype/inn_pos_usage/inn_pos_usage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-02-12 11:06:40.509746",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"table",
"pos_invoice",
"print_status",
"processed_item",
"new_item"
],
"fields": [
{
"fieldname": "table",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Table",
"options": "Inn Point Of Sale Table",
"reqd": 1
},
{
"fieldname": "pos_invoice",
"fieldtype": "Link",
"in_list_view": 1,
"label": "POS Invoice",
"options": "POS Invoice",
"reqd": 1
},
{
"default": "0",
"fieldname": "print_status",
"fieldtype": "Int",
"hidden": 1,
"label": "Print Status",
"reqd": 1
},
{
"fieldname": "processed_item",
"fieldtype": "Table",
"label": "Processed Item",
"options": "Inn POS Usage Item"
},
{
"fieldname": "new_item",
"fieldtype": "Table",
"label": "New Item",
"options": "Inn POS Usage Item"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-02-13 12:38:30.114825",
"modified_by": "Administrator",
"module": "Inn Hotels",
"name": "Inn POS Usage",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
28 changes: 28 additions & 0 deletions inn/inn_hotels/doctype/inn_pos_usage/inn_pos_usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2024, Core Initiative and contributors
# For license information, please see license.txt

import frappe
from frappe.model.document import Document


class InnPOSUsage(Document):
pass


@frappe.whitelist()
def print_list_order(pos_invoice):
order_dict = frappe.get_last_doc('Inn POS Usage', filters={'pos_invoice': pos_invoice})
res = {
"table": order_dict.table,
"items": order_dict.new_item
}
return res

@frappe.whitelist()
def get_table_order(pos_invoice):
order_dict = frappe.get_value('POS Invoice', filters={'pos_invoice': pos_invoice}, fields=['new_item'])
order_list = []
for item in order_dict:
order_list.append(item.item)

return order_list
9 changes: 9 additions & 0 deletions inn/inn_hotels/doctype/inn_pos_usage/test_inn_pos_usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Core Initiative and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestInnPOSUsage(FrappeTestCase):
pass
Empty file.
40 changes: 40 additions & 0 deletions inn/inn_hotels/doctype/inn_pos_usage_item/inn_pos_usage_item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-02-13 12:37:13.404550",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"item_name",
"quantity"
],
"fields": [
{
"fieldname": "item_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Item Name",
"reqd": 1
},
{
"fieldname": "quantity",
"fieldtype": "Int",
"in_list_view": 1,
"label": "Quantity",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-02-13 12:38:42.267641",
"modified_by": "Administrator",
"module": "Inn Hotels",
"name": "Inn POS Usage Item",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Core Initiative and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class InnPOSUsageItem(Document):
pass
Loading

0 comments on commit 1de49f1

Please sign in to comment.