From a016493c03082150cfe14e9ee178607e8afe6e60 Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Thu, 11 Apr 2024 12:15:47 +0300 Subject: [PATCH 01/39] [ADD] Pezesha Changes POSAWesome --- posawesome/fixtures/custom_field.json | 885 ++++++++++-------- posawesome/hooks.py | 1 + .../posawesome/custom/pos_settings.json | 70 ++ .../doctype/pezesha_settings/__init__.py | 0 .../pezesha_settings/pezesha_settings.js | 8 + .../pezesha_settings/pezesha_settings.json | 64 ++ .../pezesha_settings/pezesha_settings.py | 80 ++ .../pezesha_settings/test_pezesha_settings.py | 9 + .../js/posapp/components/pos/Invoice.vue | 193 +++- 9 files changed, 893 insertions(+), 417 deletions(-) create mode 100644 posawesome/posawesome/custom/pos_settings.json create mode 100644 posawesome/posawesome/doctype/pezesha_settings/__init__.py create mode 100644 posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.js create mode 100644 posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.json create mode 100644 posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py create mode 100644 posawesome/posawesome/doctype/pezesha_settings/test_pezesha_settings.py diff --git a/posawesome/fixtures/custom_field.json b/posawesome/fixtures/custom_field.json index 2e00aea31..33909f1ca 100644 --- a/posawesome/fixtures/custom_field.json +++ b/posawesome/fixtures/custom_field.json @@ -1,4 +1,58 @@ [ + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "POS Profile", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_pezesha_channel_id", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "customer", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Pezesha Channel ID", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-03-26 13:01:54.453466", + "module": null, + "name": "POS Profile-custom_pezesha_channel_id", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, @@ -350,7 +404,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "company_address", + "insert_after": "custom_closing_shift_time", "is_system_generated": 0, "is_virtual": 0, "label": "POS Awesome Settings", @@ -384,16 +438,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "0", "depends_on": null, - "description": "For POS Closing Shift Payment Reconciliation", + "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Customer", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_cash_mode_of_payment", - "fieldtype": "Link", + "fieldname": "posa_discount", + "fieldtype": "Float", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -404,18 +458,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_pos_awesome_settings", + "insert_after": "lead_name", "is_system_generated": 0, "is_virtual": 0, - "label": "Cash Mode of Payment", + "label": "Discount %", "length": 0, "mandatory_depends_on": null, - "modified": "2021-03-06 00:29:24.240940", + "modified": "2021-06-04 21:02:31.784347", "module": null, - "name": "POS Profile-posa_cash_mode_of_payment", + "name": "Customer-posa_discount", "no_copy": 0, - "non_negative": 0, - "options": "Mode of Payment", + "non_negative": 1, + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, @@ -443,10 +497,10 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Customer", + "dt": "Batch", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_discount", + "fieldname": "posa_batch_price", "fieldtype": "Float", "hidden": 0, "hide_border": 0, @@ -458,17 +512,17 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "lead_name", + "insert_after": "manufacturing_date", "is_system_generated": 0, "is_virtual": 0, - "label": "Discount %", + "label": "Price", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-04 21:02:31.784347", + "modified": "2020-10-26 02:31:58.913688", "module": null, - "name": "Customer-posa_discount", + "name": "Batch-posa_batch_price", "no_copy": 0, - "non_negative": 1, + "non_negative": 0, "options": null, "permlevel": 0, "precision": "", @@ -492,16 +546,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "0", + "default": null, "depends_on": null, - "description": null, + "description": "For POS Closing Shift Payment Reconciliation", "docstatus": 0, "doctype": "Custom Field", "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_delete", - "fieldtype": "Check", + "fieldname": "posa_cash_mode_of_payment", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -512,18 +566,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_cash_mode_of_payment", + "insert_after": "posa_pos_awesome_settings", "is_system_generated": 0, "is_virtual": 0, - "label": "Auto Delete Draft Invoice", + "label": "Cash Mode of Payment", "length": 0, "mandatory_depends_on": null, - "modified": "2020-10-09 16:01:30.649938", + "modified": "2021-03-06 00:29:24.240940", "module": null, - "name": "POS Profile-posa_allow_delete", + "name": "POS Profile-posa_cash_mode_of_payment", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "Mode of Payment", "permlevel": 0, "precision": "", "print_hide": 0, @@ -551,11 +605,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Batch", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_batch_price", - "fieldtype": "Float", + "fieldname": "posa_allow_delete", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -566,15 +620,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "manufacturing_date", + "insert_after": "posa_cash_mode_of_payment", "is_system_generated": 0, "is_virtual": 0, - "label": "Price", + "label": "Auto Delete Draft Invoice", "length": 0, "mandatory_depends_on": null, - "modified": "2020-10-26 02:31:58.913688", + "modified": "2020-10-09 16:01:30.649938", "module": null, - "name": "Batch-posa_batch_price", + "name": "POS Profile-posa_allow_delete", "no_copy": 0, "non_negative": 0, "options": null, @@ -816,16 +870,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "221", + "default": null, "depends_on": null, - "description": "It is best not to use more than four numbers", + "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_scale_barcode_start", - "fieldtype": "Int", + "fieldname": "posa_pos_opening_shift", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -835,31 +889,31 @@ "in_global_search": 0, "in_list_view": 0, "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "posa_max_discount_allowed", + "in_standard_filter": 1, + "insert_after": "pos_profile", "is_system_generated": 0, "is_virtual": 0, - "label": "Scale Barcode Start With", + "label": "POS Shift", "length": 0, "mandatory_depends_on": null, - "modified": "2020-10-30 03:54:32.270370", + "modified": "2020-09-27 03:15:11.844405", "module": null, - "name": "POS Profile-posa_scale_barcode_start", - "no_copy": 0, + "name": "Sales Invoice-posa_pos_opening_shift", + "no_copy": 1, "non_negative": 0, "options": null, "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 0, + "translatable": 1, "unique": 0, "width": null }, @@ -870,16 +924,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "", "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Address", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_change_posting_date", - "fieldtype": "Check", + "fieldname": "posa_delivery_charges", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -890,18 +944,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_scale_barcode_start", + "insert_after": "is_shipping_address", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow Change Posting Date", + "label": "Delivery Charges", "length": 0, "mandatory_depends_on": null, - "modified": "2022-12-16 11:20:05.134781", + "modified": "2022-07-24 17:20:00.246026", "module": null, - "name": "POS Profile-posa_allow_change_posting_date", + "name": "Address-posa_delivery_charges", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "Delivery Charges", "permlevel": 0, "precision": "", "print_hide": 0, @@ -924,16 +978,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "221", "depends_on": null, - "description": null, + "description": "It is best not to use more than four numbers", "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_pos_opening_shift", - "fieldtype": "Data", + "fieldname": "posa_scale_barcode_start", + "fieldtype": "Int", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -943,31 +997,31 @@ "in_global_search": 0, "in_list_view": 0, "in_preview": 0, - "in_standard_filter": 1, - "insert_after": "pos_profile", + "in_standard_filter": 0, + "insert_after": "posa_max_discount_allowed", "is_system_generated": 0, "is_virtual": 0, - "label": "POS Shift", + "label": "Scale Barcode Start With", "length": 0, "mandatory_depends_on": null, - "modified": "2020-09-27 03:15:11.844405", + "modified": "2020-10-30 03:54:32.270370", "module": null, - "name": "Sales Invoice-posa_pos_opening_shift", - "no_copy": 1, + "name": "POS Profile-posa_scale_barcode_start", + "no_copy": 0, "non_negative": 0, "options": null, "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 1, + "translatable": 0, "unique": 0, "width": null }, @@ -978,16 +1032,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "", + "default": null, "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Address", + "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_delivery_charges", - "fieldtype": "Link", + "fieldname": "posa_is_printed", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -997,25 +1051,25 @@ "in_global_search": 0, "in_list_view": 0, "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "is_shipping_address", + "in_standard_filter": 1, + "insert_after": "posa_pos_opening_shift", "is_system_generated": 0, "is_virtual": 0, - "label": "Delivery Charges", + "label": "Printed", "length": 0, "mandatory_depends_on": null, - "modified": "2022-07-24 17:20:00.246026", + "modified": "2020-11-02 02:48:23.877227", "module": null, - "name": "Address-posa_delivery_charges", + "name": "Sales Invoice-posa_is_printed", "no_copy": 0, "non_negative": 0, - "options": "Delivery Charges", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -1040,7 +1094,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_default_card_view", + "fieldname": "posa_allow_change_posting_date", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -1052,15 +1106,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_allow_change_posting_date", + "insert_after": "posa_scale_barcode_start", "is_system_generated": 0, "is_virtual": 0, - "label": "Default Card View", + "label": "Allow Change Posting Date", "length": 0, "mandatory_depends_on": null, - "modified": "2023-03-12 14:03:44.088542", + "modified": "2022-12-16 11:20:05.134781", "module": null, - "name": "POS Profile-posa_default_card_view", + "name": "POS Profile-posa_allow_change_posting_date", "no_copy": 0, "non_negative": 0, "options": null, @@ -1091,10 +1145,10 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_is_printed", + "fieldname": "posa_default_card_view", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -1105,16 +1159,16 @@ "in_global_search": 0, "in_list_view": 0, "in_preview": 0, - "in_standard_filter": 1, - "insert_after": "posa_pos_opening_shift", + "in_standard_filter": 0, + "insert_after": "posa_allow_change_posting_date", "is_system_generated": 0, "is_virtual": 0, - "label": "Printed", + "label": "Default Card View", "length": 0, "mandatory_depends_on": null, - "modified": "2020-11-02 02:48:23.877227", + "modified": "2023-03-12 14:03:44.088542", "module": null, - "name": "Sales Invoice-posa_is_printed", + "name": "POS Profile-posa_default_card_view", "no_copy": 0, "non_negative": 0, "options": null, @@ -1123,7 +1177,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -1947,7 +2001,7 @@ "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 0, + "collapsible": 1, "collapsible_depends_on": null, "columns": 0, "default": null, @@ -1955,11 +2009,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Company", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_column_break_112", - "fieldtype": "Column Break", + "fieldname": "posa_referral_section", + "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -1970,15 +2024,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "hide_expected_amount", + "insert_after": "total_monthly_sales", "is_system_generated": 0, "is_virtual": 0, - "label": "", + "label": "Referral Code", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-23 22:48:40.886230", + "modified": "2021-07-29 23:04:22.290849", "module": null, - "name": "POS Profile-posa_column_break_112", + "name": "Company-posa_referral_section", "no_copy": 0, "non_negative": 0, "options": null, @@ -2012,8 +2066,8 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_sales_order", - "fieldtype": "Check", + "fieldname": "posa_column_break_112", + "fieldtype": "Column Break", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2024,15 +2078,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_column_break_112", + "insert_after": "hide_expected_amount", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow Create Sales Order", + "label": "", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-22 03:02:27.784096", + "modified": "2021-06-23 22:48:40.886230", "module": null, - "name": "POS Profile-posa_allow_sales_order", + "name": "POS Profile-posa_column_break_112", "no_copy": 0, "non_negative": 0, "options": null, @@ -2051,64 +2105,11 @@ "unique": 0, "width": null }, - { - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "doctype": "Custom Field", - "dt": "POS Profile", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "custom_allow_select_sales_order", - "fieldtype": "Check", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "posa_allow_sales_order", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Allow Select Sales Order", - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-11-13 12:16:27.784096", - "module": null, - "name": "POS Profile-custom_allow_select_sales_order", - "no_copy": 0, - "non_negative": 0, - "options": null, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 0, - "unique": 0, - "width": null -}, { "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 1, + "collapsible": 0, "collapsible_depends_on": null, "columns": 0, "default": null, @@ -2119,8 +2120,8 @@ "dt": "Company", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_referral_section", - "fieldtype": "Section Break", + "fieldname": "posa_auto_referral", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2131,15 +2132,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "total_monthly_sales", + "insert_after": "posa_referral_section", "is_system_generated": 0, "is_virtual": 0, - "label": "Referral Code", + "label": "Auto Create Referral For New Customers", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 23:04:22.290849", + "modified": "2021-07-29 23:07:08.681215", "module": null, - "name": "Company-posa_referral_section", + "name": "Company-posa_auto_referral", "no_copy": 0, "non_negative": 0, "options": null, @@ -2173,7 +2174,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_show_template_items", + "fieldname": "posa_allow_sales_order", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -2185,15 +2186,69 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_allow_sales_order", + "insert_after": "posa_column_break_112", "is_system_generated": 0, "is_virtual": 0, - "label": "Show Template Items", + "label": "Allow Create Sales Order", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-23 22:48:41.288938", + "modified": "2021-06-22 03:02:27.784096", "module": null, - "name": "POS Profile-posa_show_template_items", + "name": "POS Profile-posa_allow_sales_order", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Order", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "posa_additional_notes_section", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "items", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Additional Notes", + "length": 0, + "mandatory_depends_on": null, + "modified": "2021-06-21 16:11:59.366893", + "module": null, + "name": "Sales Order-posa_additional_notes_section", "no_copy": 0, "non_negative": 0, "options": null, @@ -2227,8 +2282,8 @@ "dt": "Company", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_auto_referral", - "fieldtype": "Check", + "fieldname": "posa_column_break_22", + "fieldtype": "Column Break", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2239,15 +2294,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_referral_section", + "insert_after": "posa_auto_referral", "is_system_generated": 0, "is_virtual": 0, - "label": "Auto Create Referral For New Customers", + "label": "", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 23:07:08.681215", + "modified": "2021-07-29 23:11:04.558635", "module": null, - "name": "Company-posa_auto_referral", + "name": "Company-posa_column_break_22", "no_copy": 0, "non_negative": 0, "options": null, @@ -2274,14 +2329,14 @@ "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": "posa_show_template_items", + "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_hide_variants_items", + "fieldname": "custom_allow_select_sales_order", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -2293,15 +2348,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_show_template_items", + "insert_after": "posa_allow_sales_order", "is_system_generated": 0, "is_virtual": 0, - "label": "Hide Variants Items", + "label": "Allow Select Sales Order", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-24 03:24:52.591942", + "modified": "2023-11-13 12:16:27.784096", "module": null, - "name": "POS Profile-posa_hide_variants_items", + "name": "POS Profile-custom_allow_select_sales_order", "no_copy": 0, "non_negative": 0, "options": null, @@ -2324,7 +2379,7 @@ "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 1, + "collapsible": 0, "collapsible_depends_on": null, "columns": 0, "default": null, @@ -2335,8 +2390,8 @@ "dt": "Sales Order", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_additional_notes_section", - "fieldtype": "Section Break", + "fieldname": "posa_notes", + "fieldtype": "Small Text", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2347,15 +2402,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "items", + "insert_after": "posa_additional_notes_section", "is_system_generated": 0, "is_virtual": 0, "label": "Additional Notes", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-21 16:11:59.366893", + "modified": "2021-06-21 16:11:59.829304", "module": null, - "name": "Sales Order-posa_additional_notes_section", + "name": "Sales Order-posa_notes", "no_copy": 0, "non_negative": 0, "options": null, @@ -2370,7 +2425,7 @@ "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 0, + "translatable": 1, "unique": 0, "width": null }, @@ -2382,15 +2437,15 @@ "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": null, + "depends_on": "posa_auto_referral", "description": null, "docstatus": 0, "doctype": "Custom Field", "dt": "Company", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_column_break_22", - "fieldtype": "Column Break", + "fieldname": "posa_customer_offer", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2401,18 +2456,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_auto_referral", + "insert_after": "posa_column_break_22", "is_system_generated": 0, "is_virtual": 0, - "label": "", + "label": "Final Customer Offer", "length": 0, - "mandatory_depends_on": null, - "modified": "2021-07-29 23:11:04.558635", + "mandatory_depends_on": "posa_auto_referral", + "modified": "2021-07-29 23:11:04.891539", "module": null, - "name": "Company-posa_column_break_22", + "name": "Company-posa_customer_offer", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "POS Offer", "permlevel": 0, "precision": "", "print_hide": 0, @@ -2443,7 +2498,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_fetch_coupon", + "fieldname": "posa_show_template_items", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -2455,15 +2510,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_hide_variants_items", + "insert_after": "custom_allow_select_sales_order", "is_system_generated": 0, "is_virtual": 0, - "label": "Auto Fetch Coupon Gifts", + "label": "Show Template Items", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 22:58:10.372543", + "modified": "2021-06-23 22:48:41.288938", "module": null, - "name": "POS Profile-posa_fetch_coupon", + "name": "POS Profile-posa_show_template_items", "no_copy": 0, "non_negative": 0, "options": null, @@ -2494,11 +2549,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Order", + "dt": "Customer", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_notes", - "fieldtype": "Small Text", + "fieldname": "posa_birthday", + "fieldtype": "Date", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2509,15 +2564,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_additional_notes_section", + "insert_after": "contact_html", "is_system_generated": 0, "is_virtual": 0, - "label": "Additional Notes", + "label": "Birthday", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-21 16:11:59.829304", + "modified": "2021-07-31 00:12:09.417519", "module": null, - "name": "Sales Order-posa_notes", + "name": "Customer-posa_birthday", "no_copy": 0, "non_negative": 0, "options": null, @@ -2532,7 +2587,7 @@ "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 1, + "translatable": 0, "unique": 0, "width": null }, @@ -2551,7 +2606,7 @@ "dt": "Company", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_customer_offer", + "fieldname": "posa_primary_offer", "fieldtype": "Link", "hidden": 0, "hide_border": 0, @@ -2563,15 +2618,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_column_break_22", + "insert_after": "posa_customer_offer", "is_system_generated": 0, "is_virtual": 0, - "label": "Final Customer Offer", + "label": "Primary Customer Offer", "length": 0, - "mandatory_depends_on": "posa_auto_referral", - "modified": "2021-07-29 23:11:04.891539", + "mandatory_depends_on": null, + "modified": "2021-07-29 23:11:05.290809", "module": null, - "name": "Company-posa_customer_offer", + "name": "Company-posa_primary_offer", "no_copy": 0, "non_negative": 0, "options": "POS Offer", @@ -2598,15 +2653,15 @@ "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": null, + "depends_on": "posa_show_template_items", "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Customer", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_birthday", - "fieldtype": "Date", + "fieldname": "posa_hide_variants_items", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2617,15 +2672,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "contact_html", + "insert_after": "posa_show_template_items", "is_system_generated": 0, "is_virtual": 0, - "label": "Birthday", + "label": "Hide Variants Items", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-31 00:12:09.417519", + "modified": "2021-06-24 03:24:52.591942", "module": null, - "name": "Customer-posa_birthday", + "name": "POS Profile-posa_hide_variants_items", "no_copy": 0, "non_negative": 0, "options": null, @@ -2648,19 +2703,19 @@ "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 0, + "collapsible": 1, "collapsible_depends_on": null, "columns": 0, - "default": "0", + "default": null, "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Customer", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_customer_purchase_order", - "fieldtype": "Check", + "fieldname": "posa_referral_section", + "fieldtype": "Section Break", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2671,15 +2726,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_fetch_coupon", + "insert_after": "posa_birthday", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow Customer Purchase Order", + "label": "Referral Code", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-16 16:27:32.300240", + "modified": "2021-07-29 23:23:04.910503", "module": null, - "name": "POS Profile-posa_allow_customer_purchase_order", + "name": "Customer-posa_referral_section", "no_copy": 0, "non_negative": 0, "options": null, @@ -2705,7 +2760,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "", "depends_on": "posa_auto_referral", "description": null, "docstatus": 0, @@ -2713,7 +2768,7 @@ "dt": "Company", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_primary_offer", + "fieldname": "posa_referral_campaign", "fieldtype": "Link", "hidden": 0, "hide_border": 0, @@ -2725,18 +2780,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_customer_offer", + "insert_after": "posa_primary_offer", "is_system_generated": 0, "is_virtual": 0, - "label": "Primary Customer Offer", + "label": "Referral Campaign", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 23:11:05.290809", + "modified": "2021-07-29 23:11:05.723688", "module": null, - "name": "Company-posa_primary_offer", + "name": "Company-posa_referral_campaign", "no_copy": 0, "non_negative": 0, - "options": "POS Offer", + "options": "Campaign", "permlevel": 0, "precision": "", "print_hide": 0, @@ -2756,7 +2811,7 @@ "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, - "collapsible": 1, + "collapsible": 0, "collapsible_depends_on": null, "columns": 0, "default": null, @@ -2764,11 +2819,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Customer", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_referral_section", - "fieldtype": "Section Break", + "fieldname": "posa_fetch_coupon", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2779,15 +2834,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_birthday", + "insert_after": "posa_hide_variants_items", "is_system_generated": 0, "is_virtual": 0, - "label": "Referral Code", + "label": "Auto Fetch Coupon Gifts", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 23:23:04.910503", + "modified": "2021-07-29 22:58:10.372543", "module": null, - "name": "Customer-posa_referral_section", + "name": "POS Profile-posa_fetch_coupon", "no_copy": 0, "non_negative": 0, "options": null, @@ -2807,22 +2862,22 @@ "width": null }, { - "allow_in_quick_entry": 0, + "allow_in_quick_entry": 1, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "0", + "default": null, "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Customer", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_print_last_invoice", - "fieldtype": "Check", + "fieldname": "posa_referral_code", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2833,16 +2888,16 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_allow_customer_purchase_order", + "insert_after": "posa_referral_section", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow Print Last Invoice", + "label": "Referral Code", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-16 18:00:40.631156", + "modified": "2021-07-29 22:42:57.772021", "module": null, - "name": "POS Profile-posa_allow_print_last_invoice", - "no_copy": 0, + "name": "Customer-posa_referral_code", + "no_copy": 1, "non_negative": 0, "options": null, "permlevel": 0, @@ -2856,7 +2911,7 @@ "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 0, + "translatable": 1, "unique": 0, "width": null }, @@ -2867,16 +2922,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "", - "depends_on": "posa_auto_referral", + "default": "0", + "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Company", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_referral_campaign", - "fieldtype": "Link", + "fieldname": "posa_allow_customer_purchase_order", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2887,18 +2942,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_primary_offer", + "insert_after": "posa_fetch_coupon", "is_system_generated": 0, "is_virtual": 0, - "label": "Referral Campaign", + "label": "Allow Customer Purchase Order", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 23:11:05.723688", + "modified": "2021-12-16 16:27:32.300240", "module": null, - "name": "Company-posa_referral_campaign", + "name": "POS Profile-posa_allow_customer_purchase_order", "no_copy": 0, "non_negative": 0, - "options": "Campaign", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, @@ -2917,7 +2972,7 @@ { "allow_in_quick_entry": 1, "allow_on_submit": 0, - "bold": 0, + "bold": 1, "collapsible": 0, "collapsible_depends_on": null, "columns": 0, @@ -2929,8 +2984,8 @@ "dt": "Customer", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_referral_code", - "fieldtype": "Data", + "fieldname": "posa_referral_company", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2941,18 +2996,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_referral_section", + "insert_after": "posa_referral_code", "is_system_generated": 0, "is_virtual": 0, - "label": "Referral Code", + "label": "Referral Company", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 22:42:57.772021", + "modified": "2021-07-29 23:24:11.207034", "module": null, - "name": "Customer-posa_referral_code", + "name": "Customer-posa_referral_company", "no_copy": 1, "non_negative": 0, - "options": null, + "options": "Company", "permlevel": 0, "precision": "", "print_hide": 0, @@ -2964,7 +3019,7 @@ "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 1, + "translatable": 0, "unique": 0, "width": null }, @@ -2980,11 +3035,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_display_additional_notes", - "fieldtype": "Check", + "fieldname": "posa_offers", + "fieldtype": "Small Text", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -2995,15 +3050,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_allow_print_last_invoice", + "insert_after": "pricing_rules", "is_system_generated": 0, "is_virtual": 0, - "label": "Display Additional Notes", + "label": "POS Offers", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-19 16:54:32.986600", + "modified": "2021-06-07 01:51:16.390447", "module": null, - "name": "POS Profile-posa_display_additional_notes", + "name": "Sales Invoice Item-posa_offers", "no_copy": 0, "non_negative": 0, "options": null, @@ -3012,33 +3067,33 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 0, + "translatable": 1, "unique": 0, "width": null }, { - "allow_in_quick_entry": 1, + "allow_in_quick_entry": 0, "allow_on_submit": 0, - "bold": 1, + "bold": 0, "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "0", "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Customer", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_referral_company", - "fieldtype": "Link", + "fieldname": "posa_allow_print_last_invoice", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -3049,18 +3104,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_referral_code", + "insert_after": "posa_allow_customer_purchase_order", "is_system_generated": 0, "is_virtual": 0, - "label": "Referral Company", + "label": "Allow Print Last Invoice", "length": 0, "mandatory_depends_on": null, - "modified": "2021-07-29 23:24:11.207034", + "modified": "2021-12-16 18:00:40.631156", "module": null, - "name": "Customer-posa_referral_company", - "no_copy": 1, + "name": "POS Profile-posa_allow_print_last_invoice", + "no_copy": 0, "non_negative": 0, - "options": "Company", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, @@ -3088,10 +3143,10 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_write_off_change", + "fieldname": "posa_offer_applied", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -3103,15 +3158,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_display_additional_notes", + "insert_after": "posa_offers", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow Write Off Change", + "label": "Offer Applied", "length": 0, "mandatory_depends_on": null, - "modified": "2022-02-12 04:26:04.003374", + "modified": "2021-06-12 00:12:28.473489", "module": null, - "name": "POS Profile-posa_allow_write_off_change", + "name": "Sales Invoice Item-posa_offer_applied", "no_copy": 0, "non_negative": 0, "options": null, @@ -3120,7 +3175,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -3142,11 +3197,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_offers", - "fieldtype": "Small Text", + "fieldname": "posa_display_additional_notes", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -3157,15 +3212,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "pricing_rules", + "insert_after": "posa_allow_print_last_invoice", "is_system_generated": 0, "is_virtual": 0, - "label": "POS Offers", + "label": "Display Additional Notes", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-07 01:51:16.390447", + "modified": "2021-12-19 16:54:32.986600", "module": null, - "name": "Sales Invoice Item-posa_offers", + "name": "POS Profile-posa_display_additional_notes", "no_copy": 0, "non_negative": 0, "options": null, @@ -3174,13 +3229,13 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 1, + "translatable": 0, "unique": 0, "width": null }, @@ -3191,15 +3246,15 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "0", + "default": null, "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_new_line", + "fieldname": "posa_is_offer", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -3208,18 +3263,18 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_allow_write_off_change", + "insert_after": "posa_offer_applied", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow add New Items on New Line", + "label": "Is Offer", "length": 0, "mandatory_depends_on": null, - "modified": "2022-05-17 01:01:52.106645", + "modified": "2021-06-12 00:14:20.894553", "module": null, - "name": "POS Profile-posa_new_line", + "name": "Sales Invoice Item-posa_is_offer", "no_copy": 0, "non_negative": 0, "options": null, @@ -3228,7 +3283,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -3250,10 +3305,10 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_offer_applied", + "fieldname": "posa_allow_write_off_change", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -3265,15 +3320,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_offers", + "insert_after": "posa_display_additional_notes", "is_system_generated": 0, "is_virtual": 0, - "label": "Offer Applied", + "label": "Allow Write Off Change", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-12 00:12:28.473489", + "modified": "2022-02-12 04:26:04.003374", "module": null, - "name": "Sales Invoice Item-posa_offer_applied", + "name": "POS Profile-posa_allow_write_off_change", "no_copy": 0, "non_negative": 0, "options": null, @@ -3282,7 +3337,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -3299,16 +3354,16 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "0", - "depends_on": null, + "default": null, + "depends_on": "", "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice Item", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_input_qty", - "fieldtype": "Check", + "fieldname": "posa_is_replace", + "fieldtype": "Data", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -3319,15 +3374,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_new_line", + "insert_after": "posa_is_offer", "is_system_generated": 0, "is_virtual": 0, - "label": "Use QTY Input", + "label": "Is Offer Replace For item Row ID", "length": 0, "mandatory_depends_on": null, - "modified": "2022-05-17 02:17:13.591004", + "modified": "2021-06-17 18:10:36.233226", "module": null, - "name": "POS Profile-posa_input_qty", + "name": "Sales Invoice Item-posa_is_replace", "no_copy": 0, "non_negative": 0, "options": null, @@ -3336,13 +3391,13 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 0, + "translatable": 1, "unique": 0, "width": null }, @@ -3353,15 +3408,15 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "0", "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_is_offer", + "fieldname": "posa_new_line", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -3370,18 +3425,18 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, - "in_list_view": 1, + "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_offer_applied", + "insert_after": "posa_allow_write_off_change", "is_system_generated": 0, "is_virtual": 0, - "label": "Is Offer", + "label": "Allow add New Items on New Line", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-12 00:14:20.894553", + "modified": "2022-05-17 01:01:52.106645", "module": null, - "name": "Sales Invoice Item-posa_is_offer", + "name": "POS Profile-posa_new_line", "no_copy": 0, "non_negative": 0, "options": null, @@ -3390,7 +3445,7 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -3407,7 +3462,7 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "0", "depends_on": null, "description": null, "docstatus": 0, @@ -3415,7 +3470,7 @@ "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_allow_print_draft_invoices", + "fieldname": "posa_input_qty", "fieldtype": "Check", "hidden": 0, "hide_border": 0, @@ -3427,15 +3482,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_input_qty", + "insert_after": "posa_new_line", "is_system_generated": 0, "is_virtual": 0, - "label": "Allow Print Draft Invoices", + "label": "Use QTY Input", "length": 0, "mandatory_depends_on": null, - "modified": "2022-07-22 11:51:07.782265", + "modified": "2022-05-17 02:17:13.591004", "module": null, - "name": "POS Profile-posa_allow_print_draft_invoices", + "name": "POS Profile-posa_input_qty", "no_copy": 0, "non_negative": 0, "options": null, @@ -3462,15 +3517,15 @@ "collapsible_depends_on": null, "columns": 0, "default": null, - "depends_on": "", + "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice Item", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_is_replace", - "fieldtype": "Data", + "fieldname": "posa_allow_print_draft_invoices", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -3481,15 +3536,15 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_is_offer", + "insert_after": "posa_input_qty", "is_system_generated": 0, "is_virtual": 0, - "label": "Is Offer Replace For item Row ID", + "label": "Allow Print Draft Invoices", "length": 0, "mandatory_depends_on": null, - "modified": "2021-06-17 18:10:36.233226", + "modified": "2022-07-22 11:51:07.782265", "module": null, - "name": "Sales Invoice Item-posa_is_replace", + "name": "POS Profile-posa_allow_print_draft_invoices", "no_copy": 0, "non_negative": 0, "options": null, @@ -3498,13 +3553,13 @@ "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, "search_index": 0, "sort_options": 0, - "translatable": 1, + "translatable": 0, "unique": 0, "width": null }, @@ -4168,11 +4223,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "posa_search_batch_no", - "fieldtype": "Check", + "dt": "Sales Invoice", + "fetch_from": "shipping_address_name.posa_delivery_charges", + "fetch_if_empty": 1, + "fieldname": "posa_delivery_charges", + "fieldtype": "Link", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -4183,18 +4238,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_search_serial_no", + "insert_after": "taxes_and_charges", "is_system_generated": 0, "is_virtual": 0, - "label": "Search by Batch Number", + "label": "Delivery Charges", "length": 0, "mandatory_depends_on": null, - "modified": "2023-06-05 23:50:13.126933", + "modified": "2022-07-25 11:49:02.312879", "module": null, - "name": "POS Profile-posa_search_batch_no", + "name": "Sales Invoice-posa_delivery_charges", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "Delivery Charges", "permlevel": 0, "precision": "", "print_hide": 0, @@ -4222,11 +4277,11 @@ "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice", - "fetch_from": "shipping_address_name.posa_delivery_charges", - "fetch_if_empty": 1, - "fieldname": "posa_delivery_charges", - "fieldtype": "Link", + "dt": "POS Profile", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "posa_search_batch_no", + "fieldtype": "Check", "hidden": 0, "hide_border": 0, "hide_days": 0, @@ -4237,18 +4292,18 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "taxes_and_charges", + "insert_after": "posa_search_serial_no", "is_system_generated": 0, "is_virtual": 0, - "label": "Delivery Charges", + "label": "Search by Batch Number", "length": 0, "mandatory_depends_on": null, - "modified": "2022-07-25 11:49:02.312879", + "modified": "2023-06-05 23:50:13.126933", "module": null, - "name": "Sales Invoice-posa_delivery_charges", + "name": "POS Profile-posa_search_batch_no", "no_copy": 0, "non_negative": 0, - "options": "Delivery Charges", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, @@ -4271,17 +4326,17 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": "1", + "default": null, "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "POS Profile", + "dt": "Sales Invoice", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_tax_inclusive", - "fieldtype": "Check", - "hidden": 0, + "fieldname": "posa_delivery_charges_rate", + "fieldtype": "Currency", + "hidden": 1, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, @@ -4291,24 +4346,24 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_search_batch_no", + "insert_after": "posa_delivery_charges", "is_system_generated": 0, "is_virtual": 0, - "label": "Tax Inclusive", + "label": "Delivery Charges Rate", "length": 0, "mandatory_depends_on": null, - "modified": "2021-09-06 16:33:33.398280", + "modified": "2022-07-25 11:49:04.797031", "module": null, - "name": "POS Profile-posa_tax_inclusive", + "name": "Sales Invoice-posa_delivery_charges_rate", "no_copy": 0, "non_negative": 0, - "options": null, + "options": "currency", "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 0, + "read_only": 1, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, @@ -4325,17 +4380,17 @@ "collapsible": 0, "collapsible_depends_on": null, "columns": 0, - "default": null, + "default": "1", "depends_on": null, "description": null, "docstatus": 0, "doctype": "Custom Field", - "dt": "Sales Invoice", + "dt": "POS Profile", "fetch_from": null, "fetch_if_empty": 0, - "fieldname": "posa_delivery_charges_rate", - "fieldtype": "Currency", - "hidden": 1, + "fieldname": "posa_tax_inclusive", + "fieldtype": "Check", + "hidden": 0, "hide_border": 0, "hide_days": 0, "hide_seconds": 0, @@ -4345,24 +4400,24 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "posa_delivery_charges", + "insert_after": "posa_search_batch_no", "is_system_generated": 0, "is_virtual": 0, - "label": "Delivery Charges Rate", + "label": "Tax Inclusive", "length": 0, "mandatory_depends_on": null, - "modified": "2022-07-25 11:49:04.797031", + "modified": "2021-09-06 16:33:33.398280", "module": null, - "name": "Sales Invoice-posa_delivery_charges_rate", + "name": "POS Profile-posa_tax_inclusive", "no_copy": 0, "non_negative": 0, - "options": "currency", + "options": null, "permlevel": 0, "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "print_width": null, - "read_only": 1, + "read_only": 0, "read_only_depends_on": null, "report_hide": 0, "reqd": 0, diff --git a/posawesome/hooks.py b/posawesome/hooks.py index 75158395d..805a77b77 100644 --- a/posawesome/hooks.py +++ b/posawesome/hooks.py @@ -257,6 +257,7 @@ "POS Profile-posa_allow_reconcile_payments", "POS Profile-column_break_uolvm", "POS Profile-posa_allow_mpesa_reconcile_payments", + "POS Profile-custom_pezesha_channel_id", ), ] ], diff --git a/posawesome/posawesome/custom/pos_settings.json b/posawesome/posawesome/custom/pos_settings.json new file mode 100644 index 000000000..aadaa7ca8 --- /dev/null +++ b/posawesome/posawesome/custom/pos_settings.json @@ -0,0 +1,70 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2023-10-16 15:52:07.916335", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "POS Settings", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_auto_close_shift", + "fieldtype": "Datetime", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 3, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "auto_close_shift", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Auto Close Shift", + "length": 0, + "mandatory_depends_on": null, + "modified": "2023-10-16 15:52:07.916335", + "modified_by": "Administrator", + "module": "POSAwesome", + "name": "POS Settings-custom_auto_close_shift", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "POS Settings", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/posawesome/posawesome/doctype/pezesha_settings/__init__.py b/posawesome/posawesome/doctype/pezesha_settings/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.js b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.js new file mode 100644 index 000000000..6ed47adf7 --- /dev/null +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.js @@ -0,0 +1,8 @@ +// Copyright (c) 2024, Youssef Restom and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Pezesha Settings', { + // refresh: function(frm) { + + // } +}); diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.json b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.json new file mode 100644 index 000000000..da359f4c8 --- /dev/null +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.json @@ -0,0 +1,64 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-03-28 12:08:55.556406", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "enable", + "client_id", + "client_secret_id", + "authorization" + ], + "fields": [ + { + "fieldname": "client_id", + "fieldtype": "Data", + "label": "Client ID", + "mandatory_depends_on": "eval:doc.enable == 1;" + }, + { + "fieldname": "client_secret_id", + "fieldtype": "Data", + "label": "Client Secret ID", + "mandatory_depends_on": "eval:doc.enable == 1;" + }, + { + "fieldname": "authorization", + "fieldtype": "Small Text", + "label": "Authorization", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "enable", + "fieldtype": "Check", + "label": "Enable" + } + ], + "index_web_pages_for_search": 1, + "issingle": 1, + "links": [], + "modified": "2024-03-28 14:27:25.725083", + "modified_by": "Administrator", + "module": "POSAwesome", + "name": "Pezesha Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py new file mode 100644 index 000000000..e5036edc2 --- /dev/null +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -0,0 +1,80 @@ +# Copyright (c) 2024, Youssef Restom and contributors +# For license information, please see license.txt + +import frappe +import requests +import json +from frappe.model.document import Document +from frappe import _ +from frappe.integrations.utils import (make_get_request, make_post_request, create_request_log) + +class PezeshaSettings(Document): + def validate(self): + if self.enable: + try: + response = make_post_request( + url="https://dev.api.pezesha.com/oauth/token", + data={ + "grant_type": "client_credentials", + "client_id": self.client_id, + "client_secret": self.client_secret_id, + "provider": "users" + }, + auth=( + self.client_id, + self.get_password(fieldname="client_secret_id", raise_exception=False), + ), + ) + self.authorization = response['access_token'] + except Exception as e: + frappe.throw(_("Seems API Key or API Secret is wrong !!!")) + + + +@frappe.whitelist() +def pezesha_loan_offer(customer, pos_profile): + pos = frappe.get_doc("POS Profile", pos_profile) + pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') + url = 'https://dev.api.pezesha.com/mfi/v1/borrowers/options' + headers = { + 'Authorization': f'Bearer {pz_st}' + } + data = { + 'channel': pos.custom_pezesha_channel_id, + 'identifier': customer + } + response = requests.post(url, headers=headers, data=data) + if response.status_code == 200: + try: + dt = response.json() + ddt = dt['data'] + return dt + except KeyError: + frappe.msgprint("Data not found in API response") + return None + else: + frappe.msgprint(f"Unable To Find Borrower {customer}") + return response.status_code + +@frappe.whitelist() +def pezesha_loan_application(data, pos_profile): + res = json.loads(data) + pos = frappe.get_doc("POS Profile", pos_profile) + pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') + + url = 'https://dev.api.pezesha.com/mfi/v1/borrowers/options' + headers = { + 'Authorization': f'Bearer {pz_st}' + } + data = { + 'channel': 'VICTORY_FARMS_KAWANGWARE', + 'identifier': 'VF-CUST-2023-10313', + 'amount': res.get('amount'), + 'duration': res.get('duration'), + 'interest': res.get('interest'), + 'rate': res.get('rate'), + 'fee': res.get('fee') + } + + response = requests.post(url, headers=headers, data=data) + return response.json() \ No newline at end of file diff --git a/posawesome/posawesome/doctype/pezesha_settings/test_pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/test_pezesha_settings.py new file mode 100644 index 000000000..39f34ace0 --- /dev/null +++ b/posawesome/posawesome/doctype/pezesha_settings/test_pezesha_settings.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Youssef Restom and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestPezeshaSettings(FrappeTestCase): + pass diff --git a/posawesome/public/js/posapp/components/pos/Invoice.vue b/posawesome/public/js/posapp/components/pos/Invoice.vue index f77948da6..c9a306028 100644 --- a/posawesome/public/js/posapp/components/pos/Invoice.vue +++ b/posawesome/public/js/posapp/components/pos/Invoice.vue @@ -1,5 +1,43 @@ - + @@ -743,6 +781,30 @@ + + + + + + + + {{ __("Apply For Pezesha Loan") }} + + { + st = r.message + dt = st.data + if(st.status == 200){ + // Populate formData with fetched values + this.formData.pezesha_customer_id = this.customer; + this.formData.pezesha_channel_id = this.pos_profile.name; + this.formData.amount = dt.amount; + this.formData.fee = dt.fee; + this.formData.interest = dt.interest; + this.formData.duration = dt.duration; + this.formData.rate = dt.rate; + // Once the server call is completed, emit an unfreeze event + evntBus.$emit("unfreeze"); + // Optionally, update dialog visibility or perform other actions + this.dialogVisible = true; + }else{ + evntBus.$emit("unfreeze"); + } + }, + }); + } + }, + closeDialog() { + this.dialogVisible = false; + }, + closeSuccessfulDialog() { + this.dialogSuccessful = false; + }, + closeNotSuccessfulDialog() { + this.dialognotSuccessful = false; + }, + submitForm() { + // Here you can handle form submission + console.log('Form submitted:', this.formData); + // Emit a freeze event to indicate that a process is in progress + evntBus.$emit("freeze", { + title: __("Please wait..."), + }); + + // Make the server call + frappe.call({ + method: "posawesome.posawesome.doctype.pezesha_settings.pezesha_settings.pezesha_loan_application", + args: { + data: this.formData, + pos_profile: this.pos_profile.name, + }, + callback: (r) => { + // Emit an unfreeze event after receiving the response + evntBus.$emit("unfreeze"); + let s = r.message; + if (s.status == 200) { + console.log("Thank you for your Loan Approval.") + this.dialogSuccessful = true; + } else { + console.log("Payment failed. Please try again.") + this.dialognotSuccessful = true; + } + } + }); + }, + closeDialog() { + this.dialogVisible = false; + }, + submitForm() { + // Here you can handle form submission + console.log('Form submitted:', this.formData); + // Emit a freeze event to indicate that a process is in progress + evntBus.$emit("freeze", { + title: __("Please wait..."), + }); + + // Make the server call + frappe.call({ + method: "posawesome.posawesome.doctype.pezesha_settings.pezesha_settings.pezesha_loan_application", + args: { + data: this.formData, + pos_profile: this.pos_profile.name, + }, + callback: (r) => { + // Emit an unfreeze event after receiving the response + evntBus.$emit("unfreeze"); + let s = r.message; + if (s.status == 200) { + console.log("Thank you for your Loan Approval.") + this.dialogSuccessful = true; + } else { + console.log("Payment failed. Please try again.") + this.dialognotSuccessful = true; + } + // Close the dialog after form submission + this.dialogVisible = false; + } + }); + }, remove_item(item) { const index = this.items.findIndex( (el) => el.posa_row_id == item.posa_row_id @@ -1450,7 +1640,6 @@ export default { return this.update_invoice_from_order(doc); } }, - async show_payment() { if (!this.customer) { evntBus.$emit("show_mesage", { From b7564f51e6a989a4fc04d7c0f12e5a5c7014d1f1 Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Wed, 17 Apr 2024 11:40:53 +0300 Subject: [PATCH 02/39] Update pezesha_settings.py --- .../posawesome/doctype/pezesha_settings/pezesha_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index e5036edc2..123d5efa2 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -13,7 +13,7 @@ def validate(self): if self.enable: try: response = make_post_request( - url="https://dev.api.pezesha.com/oauth/token", + url="https://api.pezesha.com/oauth/token", data={ "grant_type": "client_credentials", "client_id": self.client_id, @@ -77,4 +77,4 @@ def pezesha_loan_application(data, pos_profile): } response = requests.post(url, headers=headers, data=data) - return response.json() \ No newline at end of file + return response.json() From c6dfa8655577aa5f00e6f8237653c415846b5565 Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Wed, 17 Apr 2024 13:10:04 +0300 Subject: [PATCH 03/39] Update pezesha_settings.py --- .../posawesome/doctype/pezesha_settings/pezesha_settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index 123d5efa2..123613951 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -34,8 +34,9 @@ def validate(self): @frappe.whitelist() def pezesha_loan_offer(customer, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) + print("----------", pos.custom_pezesha_channel_id) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - url = 'https://dev.api.pezesha.com/mfi/v1/borrowers/options' + url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { 'Authorization': f'Bearer {pz_st}' } @@ -62,7 +63,7 @@ def pezesha_loan_application(data, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - url = 'https://dev.api.pezesha.com/mfi/v1/borrowers/options' + url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { 'Authorization': f'Bearer {pz_st}' } From 04d4837070f7caf6195a989221096eb29794690c Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Mon, 29 Apr 2024 15:54:21 +0300 Subject: [PATCH 04/39] Update pezesha_settings.py --- .../doctype/pezesha_settings/pezesha_settings.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index 123613951..016198c95 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -34,7 +34,6 @@ def validate(self): @frappe.whitelist() def pezesha_loan_offer(customer, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) - print("----------", pos.custom_pezesha_channel_id) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { @@ -62,14 +61,13 @@ def pezesha_loan_application(data, pos_profile): res = json.loads(data) pos = frappe.get_doc("POS Profile", pos_profile) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - - url = 'https://api.pezesha.com/mfi/v1/borrowers/options' + url = 'https://api.pezesha.com/mfi/v1/borrowers/loans' headers = { 'Authorization': f'Bearer {pz_st}' } data = { - 'channel': 'VICTORY_FARMS_KAWANGWARE', - 'identifier': 'VF-CUST-2023-10313', + 'channel': pos.custom_pezesha_channel_id, + 'identifier': res.get('pezesha_customer_id'), 'amount': res.get('amount'), 'duration': res.get('duration'), 'interest': res.get('interest'), From 8886db29684f99f83dacd1ba774dc7ae520ae8bf Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Mon, 29 Apr 2024 16:01:52 +0300 Subject: [PATCH 05/39] Revert "Update pezesha_settings.py" This reverts commit 04d4837070f7caf6195a989221096eb29794690c. --- .../doctype/pezesha_settings/pezesha_settings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index 016198c95..123613951 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -34,6 +34,7 @@ def validate(self): @frappe.whitelist() def pezesha_loan_offer(customer, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) + print("----------", pos.custom_pezesha_channel_id) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { @@ -61,13 +62,14 @@ def pezesha_loan_application(data, pos_profile): res = json.loads(data) pos = frappe.get_doc("POS Profile", pos_profile) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - url = 'https://api.pezesha.com/mfi/v1/borrowers/loans' + + url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { 'Authorization': f'Bearer {pz_st}' } data = { - 'channel': pos.custom_pezesha_channel_id, - 'identifier': res.get('pezesha_customer_id'), + 'channel': 'VICTORY_FARMS_KAWANGWARE', + 'identifier': 'VF-CUST-2023-10313', 'amount': res.get('amount'), 'duration': res.get('duration'), 'interest': res.get('interest'), From f7867c4369d572812c78acf67793b0d8d8bffe41 Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Mon, 29 Apr 2024 16:02:32 +0300 Subject: [PATCH 06/39] Update pezesha_settings.py --- .../posawesome/doctype/pezesha_settings/pezesha_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index 123613951..408e9ad04 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -63,7 +63,7 @@ def pezesha_loan_application(data, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - url = 'https://api.pezesha.com/mfi/v1/borrowers/options' + url = 'https://api.pezesha.com/mfi/v1/borrowers/loans' headers = { 'Authorization': f'Bearer {pz_st}' } From dbbea473c906f29f15067490ff2517097191c417 Mon Sep 17 00:00:00 2001 From: erpbox-sols Date: Mon, 29 Apr 2024 17:01:18 +0300 Subject: [PATCH 07/39] [ADD] Changes --- .../pezesha_settings/pezesha_settings.py | 23 +- .../js/posapp/components/pos/Invoice.vue | 188 +------------- .../js/posapp/components/pos/Payments.vue | 241 ++++++++++++++++-- 3 files changed, 239 insertions(+), 213 deletions(-) diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index 408e9ad04..2b50be86a 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -34,7 +34,6 @@ def validate(self): @frappe.whitelist() def pezesha_loan_offer(customer, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) - print("----------", pos.custom_pezesha_channel_id) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { @@ -62,14 +61,13 @@ def pezesha_loan_application(data, pos_profile): res = json.loads(data) pos = frappe.get_doc("POS Profile", pos_profile) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - - url = 'https://api.pezesha.com/mfi/v1/borrowers/loans' + url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { 'Authorization': f'Bearer {pz_st}' } data = { - 'channel': 'VICTORY_FARMS_KAWANGWARE', - 'identifier': 'VF-CUST-2023-10313', + 'channel': pos.custom_pezesha_channel_id, + 'identifier': res.get('pezesha_customer_id'), 'amount': res.get('amount'), 'duration': res.get('duration'), 'interest': res.get('interest'), @@ -79,3 +77,18 @@ def pezesha_loan_application(data, pos_profile): response = requests.post(url, headers=headers, data=data) return response.json() + +# @frappe.whitelist() +# def pezesha_loan_status(customer, pos_profile): +# pos = frappe.get_doc("POS Profile", pos_profile) +# pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') +# url = 'https://api.pezesha.com/mfi/v1/borrowers/latest' +# headers = { +# 'Authorization': f'Bearer {pz_st}' +# } +# data = { +# 'channel': pos.custom_pezesha_channel_id, +# 'identifier': "VF-CUST-2024-00044" +# } +# response = requests.post(url, headers=headers, data=data) +# return response.json() \ No newline at end of file diff --git a/posawesome/public/js/posapp/components/pos/Invoice.vue b/posawesome/public/js/posapp/components/pos/Invoice.vue index c9a306028..cea600808 100644 --- a/posawesome/public/js/posapp/components/pos/Invoice.vue +++ b/posawesome/public/js/posapp/components/pos/Invoice.vue @@ -1,43 +1,5 @@