From 879cb6ebee9f56573460595ebe513328c099df9a Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 31 Aug 2016 13:04:05 +0530 Subject: [PATCH 1/2] [POS] Fixed POS Sales Invoice when Payment Table is Empty --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index b28911edef..a5028c5ee5 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -89,6 +89,8 @@ class SalesInvoice(SellingController): set_account_for_mode_of_payment(self) def on_submit(self): + self.validate_pos_paid_amount() + if not self.recurring_id: frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self) @@ -121,6 +123,10 @@ class SalesInvoice(SellingController): self.update_time_sheet(self.name) + def validate_pos_paid_amount(self): + if len(self.payments) == 0 and self.is_pos: + frappe.throw(_("At least one mode of payment is required for POS invoice.")) + def before_cancel(self): self.update_time_sheet(None) @@ -248,7 +254,7 @@ class SalesInvoice(SellingController): from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile pos = get_pos_profile(self.company) - if not self.get('payments'): + if not self.get('payments') and not for_validate: pos_profile = frappe.get_doc('POS Profile', pos.name) if pos else None update_multi_mode_option(self, pos_profile) From 774ce63b754f3e601d68f3d67b5b878a892ffbd8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 31 Aug 2016 15:45:05 +0530 Subject: [PATCH 2/2] remove mode of payment, migrate mode of payment from v6 to v7 --- .../doctype/sales_invoice/sales_invoice.json | 172 +++++++++++++++--- erpnext/patches.txt | 3 +- .../v7_0/migrate_mode_of_payments_v6_to_v7.py | 20 ++ 3 files changed, 166 insertions(+), 29 deletions(-) create mode 100644 erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index a2e930c820..562eaaac53 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -16,6 +16,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "customer_section", "fieldtype": "Section Break", "hidden": 0, @@ -41,6 +42,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "default": "{customer_name}", "fieldname": "title", "fieldtype": "Data", @@ -67,6 +69,7 @@ "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "fieldname": "naming_series", "fieldtype": "Select", "hidden": 0, @@ -94,6 +97,7 @@ "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "fieldname": "customer", "fieldtype": "Link", "hidden": 0, @@ -121,6 +125,7 @@ "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "depends_on": "customer", "fieldname": "customer_name", "fieldtype": "Data", @@ -148,6 +153,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "is_pos", "fieldtype": "Check", "hidden": 0, @@ -174,6 +180,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_return", "fieldname": "is_return", "fieldtype": "Check", @@ -200,6 +207,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "offline_pos_name", "fieldtype": "Data", "hidden": 1, @@ -225,6 +233,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break1", "fieldtype": "Column Break", "hidden": 0, @@ -249,6 +258,7 @@ "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "default": "Today", "fieldname": "posting_date", "fieldtype": "Date", @@ -276,6 +286,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "due_date", "fieldtype": "Date", "hidden": 0, @@ -302,33 +313,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Mode of Payment", - "length": 0, - "no_copy": 0, - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Select", - "options": "Mode of Payment", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, + "columns": 0, "fieldname": "company", "fieldtype": "Link", "hidden": 0, @@ -356,6 +341,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "amended_from", "fieldtype": "Link", "hidden": 0, @@ -383,6 +369,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_return", "fieldname": "return_against", "fieldtype": "Link", @@ -410,6 +397,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 1, + "columns": 0, "depends_on": "", "fieldname": "address_and_contact", "fieldtype": "Section Break", @@ -436,6 +424,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "customer_address", "fieldtype": "Link", "hidden": 0, @@ -461,6 +450,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "address_display", "fieldtype": "Small Text", "hidden": 0, @@ -485,6 +475,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "contact_person", "fieldtype": "Link", "hidden": 0, @@ -510,6 +501,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "contact_display", "fieldtype": "Small Text", "hidden": 0, @@ -534,6 +526,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "contact_mobile", "fieldtype": "Small Text", "hidden": 1, @@ -558,6 +551,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "contact_email", "fieldtype": "Data", "hidden": 1, @@ -583,6 +577,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "col_break4", "fieldtype": "Column Break", "hidden": 0, @@ -607,6 +602,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "shipping_address_name", "fieldtype": "Link", "hidden": 0, @@ -633,6 +629,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "shipping_address", "fieldtype": "Small Text", "hidden": 0, @@ -658,6 +655,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "", "fieldname": "customer_group", "fieldtype": "Link", @@ -684,6 +682,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "territory", "fieldtype": "Link", "hidden": 0, @@ -710,6 +709,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 1, + "columns": 0, "depends_on": "customer", "fieldname": "currency_and_price_list", "fieldtype": "Section Break", @@ -736,6 +736,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "currency", "fieldtype": "Link", "hidden": 0, @@ -763,6 +764,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "Rate at which Customer Currency is converted to customer's base currency", "fieldname": "conversion_rate", "fieldtype": "Float", @@ -791,6 +793,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break2", "fieldtype": "Column Break", "hidden": 0, @@ -815,6 +818,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "selling_price_list", "fieldtype": "Link", "hidden": 0, @@ -842,6 +846,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "price_list_currency", "fieldtype": "Link", "hidden": 0, @@ -867,6 +872,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "Rate at which Price list currency is converted to customer's base currency", "fieldname": "plc_conversion_rate", "fieldtype": "Float", @@ -893,6 +899,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "ignore_pricing_rule", "fieldtype": "Check", "hidden": 0, @@ -917,6 +924,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "items_section", "fieldtype": "Section Break", "hidden": 0, @@ -943,6 +951,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "update_stock", "fieldtype": "Check", "hidden": 0, @@ -969,6 +978,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "items", "fieldtype": "Table", "hidden": 0, @@ -996,6 +1006,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "packing_list", "fieldtype": "Section Break", "hidden": 0, @@ -1021,6 +1032,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "packed_items", "fieldtype": "Table", "hidden": 0, @@ -1046,6 +1058,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "product_bundle_help", "fieldtype": "HTML", "hidden": 0, @@ -1071,6 +1084,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "eval:doc.total_billing_amount > 0", + "columns": 0, "depends_on": "", "fieldname": "time_sheet_list", "fieldtype": "Section Break", @@ -1097,6 +1111,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "timesheets", "fieldtype": "Table", "hidden": 0, @@ -1123,6 +1138,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "0", "fieldname": "total_billing_amount", "fieldtype": "Currency", @@ -1149,6 +1165,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_30", "fieldtype": "Section Break", "hidden": 0, @@ -1172,6 +1189,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_total", "fieldtype": "Currency", "hidden": 0, @@ -1198,6 +1216,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_net_total", "fieldtype": "Currency", "hidden": 0, @@ -1225,6 +1244,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_32", "fieldtype": "Column Break", "hidden": 0, @@ -1248,6 +1268,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "net_total", "fieldtype": "Currency", "hidden": 0, @@ -1273,6 +1294,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "total", "fieldtype": "Currency", "hidden": 0, @@ -1299,6 +1321,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "taxes_section", "fieldtype": "Section Break", "hidden": 0, @@ -1325,6 +1348,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "taxes_and_charges", "fieldtype": "Link", "hidden": 0, @@ -1352,6 +1376,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_38", "fieldtype": "Column Break", "hidden": 0, @@ -1375,6 +1400,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "shipping_rule", "fieldtype": "Link", "hidden": 0, @@ -1401,6 +1427,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_40", "fieldtype": "Section Break", "hidden": 0, @@ -1424,6 +1451,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "taxes", "fieldtype": "Table", "hidden": 0, @@ -1451,6 +1479,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "other_charges_calculation", "fieldtype": "HTML", "hidden": 0, @@ -1476,6 +1505,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_43", "fieldtype": "Section Break", "hidden": 0, @@ -1499,6 +1529,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_total_taxes_and_charges", "fieldtype": "Currency", "hidden": 0, @@ -1526,6 +1557,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_47", "fieldtype": "Column Break", "hidden": 0, @@ -1550,6 +1582,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "total_taxes_and_charges", "fieldtype": "Currency", "hidden": 0, @@ -1576,6 +1609,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "discount_amount", + "columns": 0, "fieldname": "section_break_49", "fieldtype": "Section Break", "hidden": 0, @@ -1601,6 +1635,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "Grand Total", "fieldname": "apply_discount_on", "fieldtype": "Select", @@ -1628,6 +1663,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_discount_amount", "fieldtype": "Currency", "hidden": 0, @@ -1654,6 +1690,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_51", "fieldtype": "Column Break", "hidden": 0, @@ -1677,6 +1714,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "additional_discount_percentage", "fieldtype": "Float", "hidden": 0, @@ -1702,6 +1740,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "discount_amount", "fieldtype": "Currency", "hidden": 0, @@ -1727,6 +1766,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "totals", "fieldtype": "Section Break", "hidden": 0, @@ -1753,6 +1793,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_grand_total", "fieldtype": "Currency", "hidden": 0, @@ -1780,6 +1821,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_rounded_total", "fieldtype": "Currency", "hidden": 0, @@ -1807,6 +1849,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "In Words will be visible once you save the Sales Invoice.", "fieldname": "base_in_words", "fieldtype": "Data", @@ -1834,6 +1877,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break5", "fieldtype": "Column Break", "hidden": 0, @@ -1859,6 +1903,7 @@ "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "fieldname": "grand_total", "fieldtype": "Currency", "hidden": 0, @@ -1886,6 +1931,7 @@ "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "fieldname": "rounded_total", "fieldtype": "Currency", "hidden": 0, @@ -1913,6 +1959,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "in_words", "fieldtype": "Data", "hidden": 0, @@ -1939,6 +1986,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "total_advance", "fieldtype": "Currency", "hidden": 0, @@ -1966,6 +2014,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "outstanding_amount", "fieldtype": "Currency", "hidden": 0, @@ -1994,6 +2043,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "advances", + "columns": 0, "fieldname": "advances_section", "fieldtype": "Section Break", "hidden": 0, @@ -2020,6 +2070,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "get_advances", "fieldtype": "Button", "hidden": 0, @@ -2046,6 +2097,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "advances", "fieldtype": "Table", "hidden": 0, @@ -2074,6 +2126,7 @@ "bold": 0, "collapsible": 0, "collapsible_depends_on": "", + "columns": 0, "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)", "fieldname": "payments_section", "fieldtype": "Section Break", @@ -2100,6 +2153,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_pos", "fieldname": "cash_bank_account", "fieldtype": "Link", @@ -2128,6 +2182,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "payments", "fieldtype": "Table", "hidden": 0, @@ -2154,6 +2209,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_84", "fieldtype": "Section Break", "hidden": 0, @@ -2178,6 +2234,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_paid_amount", "fieldtype": "Currency", "hidden": 0, @@ -2204,6 +2261,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_86", "fieldtype": "Column Break", "hidden": 0, @@ -2228,6 +2286,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_pos", "fieldname": "paid_amount", "fieldtype": "Currency", @@ -2256,6 +2315,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "section_break_88", "fieldtype": "Section Break", "hidden": 0, @@ -2280,6 +2340,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_change_amount", "fieldtype": "Currency", "hidden": 0, @@ -2306,6 +2367,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_90", "fieldtype": "Column Break", "hidden": 0, @@ -2330,6 +2392,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "change_amount", "fieldtype": "Currency", "hidden": 0, @@ -2356,6 +2419,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "account_for_change_amount", "fieldtype": "Link", "hidden": 0, @@ -2383,6 +2447,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "write_off_amount", + "columns": 0, "depends_on": "grand_total", "fieldname": "column_break4", "fieldtype": "Section Break", @@ -2409,6 +2474,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "", "fieldname": "write_off_amount", "fieldtype": "Currency", @@ -2435,6 +2501,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "base_write_off_amount", "fieldtype": "Currency", "hidden": 0, @@ -2461,6 +2528,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_pos", "fieldname": "write_off_outstanding_amount_automatically", "fieldtype": "Check", @@ -2486,6 +2554,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "", "fieldname": "column_break_74", "fieldtype": "Column Break", @@ -2511,6 +2580,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "", "fieldname": "write_off_account", "fieldtype": "Link", @@ -2537,6 +2607,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "", "fieldname": "write_off_cost_center", "fieldtype": "Link", @@ -2564,6 +2635,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "terms", + "columns": 0, "fieldname": "terms_section_break", "fieldtype": "Section Break", "hidden": 0, @@ -2590,6 +2662,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "tc_name", "fieldtype": "Link", "hidden": 0, @@ -2617,6 +2690,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "terms", "fieldtype": "Text Editor", "hidden": 0, @@ -2643,6 +2717,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 1, + "columns": 0, "fieldname": "edit_printing_settings", "fieldtype": "Section Break", "hidden": 0, @@ -2668,6 +2743,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "letter_head", "fieldtype": "Link", "hidden": 0, @@ -2695,6 +2771,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "language", "fieldtype": "Data", "hidden": 0, @@ -2720,6 +2797,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break_84", "fieldtype": "Column Break", "hidden": 0, @@ -2744,6 +2822,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "select_print_heading", "fieldtype": "Link", "hidden": 0, @@ -2771,6 +2850,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 1, + "columns": 0, "depends_on": "customer", "fieldname": "more_information", "fieldtype": "Section Break", @@ -2797,6 +2877,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "project", "fieldtype": "Link", "hidden": 0, @@ -2824,6 +2905,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "col_break23", "fieldtype": "Column Break", "hidden": 0, @@ -2848,6 +2930,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.source == 'Campaign'", "fieldname": "campaign", "fieldtype": "Link", @@ -2876,6 +2959,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "source", "fieldtype": "Select", "hidden": 0, @@ -2903,6 +2987,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 1, + "columns": 0, "fieldname": "more_info", "fieldtype": "Section Break", "hidden": 0, @@ -2929,6 +3014,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "description": "", "fieldname": "debit_to", "fieldtype": "Link", @@ -2957,6 +3043,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "party_account_currency", "fieldtype": "Link", "hidden": 1, @@ -2983,6 +3070,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "default": "No", "description": "", "fieldname": "is_opening", @@ -3012,6 +3100,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "c_form_applicable", "fieldtype": "Select", "hidden": 0, @@ -3037,6 +3126,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "c_form_no", "fieldtype": "Link", "hidden": 0, @@ -3062,6 +3152,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break8", "fieldtype": "Column Break", "hidden": 0, @@ -3086,6 +3177,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "posting_time", "fieldtype": "Time", "hidden": 0, @@ -3112,6 +3204,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "remarks", "fieldtype": "Small Text", "hidden": 0, @@ -3139,6 +3232,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "sales_partner", + "columns": 0, "fieldname": "sales_team_section_break", "fieldtype": "Section Break", "hidden": 0, @@ -3165,6 +3259,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "sales_partner", "fieldtype": "Link", "hidden": 0, @@ -3192,6 +3287,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break10", "fieldtype": "Column Break", "hidden": 0, @@ -3217,6 +3313,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "commission_rate", "fieldtype": "Float", "hidden": 0, @@ -3243,6 +3340,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "total_commission", "fieldtype": "Currency", "hidden": 0, @@ -3271,6 +3369,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "sales_team", + "columns": 0, "fieldname": "section_break2", "fieldtype": "Section Break", "hidden": 0, @@ -3295,6 +3394,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "sales_team", "fieldtype": "Table", "hidden": 0, @@ -3323,6 +3423,7 @@ "bold": 0, "collapsible": 1, "collapsible_depends_on": "is_recurring", + "columns": 0, "depends_on": "eval:doc.docstatus<2", "fieldname": "recurring_invoice", "fieldtype": "Section Break", @@ -3349,6 +3450,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break11", "fieldtype": "Column Break", "hidden": 0, @@ -3374,6 +3476,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.docstatus<2", "description": "", "fieldname": "is_recurring", @@ -3400,6 +3503,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_recurring", "description": "", "fieldname": "recurring_id", @@ -3427,6 +3531,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", "description": "", "fieldname": "recurring_type", @@ -3454,6 +3559,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", "description": "", "fieldname": "repeat_on_day_of_month", @@ -3480,6 +3586,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", "description": "", "fieldname": "end_date", @@ -3506,6 +3613,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", "fieldname": "submit_on_creation", "fieldtype": "Check", @@ -3532,6 +3640,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.recurring_id === doc.name", "description": "", "fieldname": "notify_by_email", @@ -3559,6 +3668,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name", "description": "", "fieldname": "notification_email_address", @@ -3586,6 +3696,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "eval:doc.is_recurring && doc.notify_by_email && doc.recurring_id === doc.name", "fieldname": "recurring_print_format", "fieldtype": "Link", @@ -3613,6 +3724,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "column_break12", "fieldtype": "Column Break", "hidden": 0, @@ -3638,6 +3750,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_recurring", "description": "", "fieldname": "from_date", @@ -3664,6 +3777,7 @@ "allow_on_submit": 1, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_recurring", "description": "", "fieldname": "to_date", @@ -3690,6 +3804,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "depends_on": "is_recurring", "description": "", "fieldname": "next_date", @@ -3716,6 +3831,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "against_income_account", "fieldtype": "Small Text", "hidden": 1, @@ -3751,7 +3867,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-08-17 15:12:39.357372", + "modified": "2016-08-31 15:47:32.064861", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 76a2409351..9fbf26189e 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -9,7 +9,7 @@ erpnext.patches.v4_0.move_warehouse_user_to_restrictions erpnext.patches.v4_0.global_defaults_to_system_settings erpnext.patches.v4_0.update_incharge_name_to_sales_person_in_maintenance_schedule execute:frappe.reload_doc('stock', 'doctype', 'warehouse') -execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2014-01-29 +execute:frappe.reload_doc('accounts', 'doctype', 'sales_invoice') # 2016-08-31 execute:frappe.reload_doc('selling', 'doctype', 'sales_order') # 2014-01-29 execute:frappe.reload_doc('selling', 'doctype', 'quotation') # 2014-01-29 execute:frappe.reload_doc('stock', 'doctype', 'delivery_note') # 2014-01-29 @@ -276,6 +276,7 @@ execute:frappe.db.sql('update tabQuotation set status="Cancelled" where docstatu execute:frappe.rename_doc("DocType", "Payments", "Sales Invoice Payment", force=True) erpnext.patches.v7_0.update_mins_to_first_response erpnext.patches.v6_20x.repost_valuation_rate_for_negative_inventory +erpnext.patches.v7_0.migrate_mode_of_payments_v6_to_v7 erpnext.patches.v7_0.system_settings_setup_complete erpnext.patches.v7_0.set_naming_series_for_timesheet #2016-07-27 execute:frappe.reload_doc('projects', 'doctype', 'project') diff --git a/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py b/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py new file mode 100644 index 0000000000..e2d2c89437 --- /dev/null +++ b/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py @@ -0,0 +1,20 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.reload_doc('accounts', 'doctype', 'sales_invoice_timesheet') + frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment') + + for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount from + `tabSales Invoice` where is_pos = 1 and docstatus < 2 and cash_bank_account is not null""", as_dict=1): + si_doc = frappe.get_doc('Sales Invoice', data.name) + si_doc.append('payments', { + 'mode_of_payment': data.mode_of_payment or 'Cash', + 'account': data.cash_bank_account, + 'type': frappe.db.get_value('Mode of Payment', data.mode_of_payment, 'type') or 'Cash', + 'amount': data.paid_amount + }) + + si_doc.set_paid_amount() + si_doc.flags.ignore_validate_update_after_submit = True + si_doc.save() \ No newline at end of file