[rename] Sales/Purchase Taxes and Charges Master > Sales/Purchase Taxes and Charges Template
This commit is contained in:
parent
0e1540b3b7
commit
bcdea3ea51
@ -167,7 +167,7 @@
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "charge",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"read_only": 0
|
||||
},
|
||||
@ -226,7 +226,7 @@
|
||||
],
|
||||
"icon": "icon-cog",
|
||||
"idx": 1,
|
||||
"modified": "2015-02-05 05:11:42.344180",
|
||||
"modified": "2015-02-05 05:11:42.344181",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "POS Setting",
|
||||
|
@ -314,7 +314,7 @@
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "purchase_other_charges",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Purchase Taxes and Charges Master",
|
||||
"options": "Purchase Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 0
|
||||
@ -938,7 +938,7 @@
|
||||
"icon": "icon-file-text",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-04-30 03:05:13.790265",
|
||||
"modified": "2015-04-30 03:05:13.790267",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice",
|
||||
|
@ -1 +0,0 @@
|
||||
Template for tax structure in purchase transactions.
|
@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
@ -71,10 +71,10 @@
|
||||
],
|
||||
"icon": "icon-money",
|
||||
"idx": 1,
|
||||
"modified": "2015-04-16 01:15:24.620310",
|
||||
"modified": "2015-05-06 08:52:01.499434",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Taxes and Charges Master",
|
||||
"name": "Purchase Taxes and Charges Template",
|
||||
"owner": "wasim@webnotestech.com",
|
||||
"permissions": [
|
||||
{
|
@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
@ -5,7 +6,7 @@ from __future__ import unicode_literals
|
||||
from frappe.model.document import Document
|
||||
from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax
|
||||
|
||||
class PurchaseTaxesandChargesMaster(Document):
|
||||
class PurchaseTaxesandChargesTemplate(Document):
|
||||
def validate(self):
|
||||
for tax in self.get("taxes"):
|
||||
validate_taxes_and_charges(tax)
|
@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Purchase Taxes and Charges Template')
|
||||
|
||||
class TestPurchaseTaxesandChargesTemplate(unittest.TestCase):
|
||||
pass
|
@ -394,7 +394,7 @@
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "charge",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 0
|
||||
@ -1243,7 +1243,7 @@
|
||||
"icon": "icon-file-text",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-04-27 20:31:51.966964",
|
||||
"modified": "2015-04-27 20:31:51.966965",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice",
|
||||
|
@ -1 +0,0 @@
|
||||
Template for tax structure in sales transactions.
|
@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
@ -1,7 +0,0 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
import frappe
|
||||
test_records = frappe.get_test_records('Sales Taxes And Charges Master')
|
@ -5,6 +5,6 @@ cur_frm.cscript.tax_table = "Sales Taxes and Charges";
|
||||
|
||||
{% include "public/js/controllers/accounts.js" %}
|
||||
|
||||
frappe.ui.form.on("Sales Taxes and Charges Master", "onload", function(frm) {
|
||||
frappe.ui.form.on("sales Taxes and Charges Template", "onload", function(frm) {
|
||||
erpnext.add_applicable_territory();
|
||||
});
|
@ -80,10 +80,10 @@
|
||||
],
|
||||
"icon": "icon-money",
|
||||
"idx": 1,
|
||||
"modified": "2015-02-05 05:11:46.282418",
|
||||
"modified": "2015-05-06 08:51:54.662853",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Taxes and Charges Master",
|
||||
"name": "Sales Taxes and Charges Template",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
@ -6,11 +6,13 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax
|
||||
|
||||
class SalesTaxesandChargesMaster(Document):
|
||||
class SalesTaxesandChargesTemplate(Document):
|
||||
def validate(self):
|
||||
if self.is_default == 1:
|
||||
frappe.db.sql("""update `tabSales Taxes and Charges Master` set is_default = 0
|
||||
where ifnull(is_default,0) = 1 and name != %s and company = %s""",
|
||||
frappe.db.sql("""update `tabSales Taxes and Charges Template`
|
||||
set is_default = 0
|
||||
where ifnull(is_default,0) = 1
|
||||
and name != %s and company = %s""",
|
||||
(self.name, self.company))
|
||||
|
||||
# at least one territory
|
@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Sales Taxes and Charges Master",
|
||||
"doctype": "Sales Taxes and Charges Template",
|
||||
"taxes": [
|
||||
{
|
||||
"account_head": "_Test Account VAT - _TC",
|
||||
@ -20,7 +20,7 @@
|
||||
"rate": 6.36
|
||||
}
|
||||
],
|
||||
"title": "_Test Sales Taxes and Charges Master",
|
||||
"title": "_Test Sales Taxes and Charges Template",
|
||||
"territories": [
|
||||
{
|
||||
"doctype": "Applicable Territory",
|
||||
@ -36,7 +36,7 @@
|
||||
},
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Sales Taxes and Charges Master",
|
||||
"doctype": "Sales Taxes and Charges Template",
|
||||
"taxes": [
|
||||
{
|
||||
"account_head": "_Test Account Shipping Charges - _TC",
|
||||
@ -126,7 +126,7 @@
|
||||
},
|
||||
{
|
||||
"company": "_Test Company",
|
||||
"doctype": "Sales Taxes and Charges Master",
|
||||
"doctype": "Sales Taxes and Charges Template",
|
||||
"taxes": [
|
||||
{
|
||||
"account_head": "_Test Account VAT - _TC",
|
||||
@ -145,7 +145,7 @@
|
||||
"rate": 4
|
||||
}
|
||||
],
|
||||
"title": "_Test Sales Taxes and Charges Master - Rest of the World",
|
||||
"title": "_Test Sales Taxes and Charges Template - Rest of the World",
|
||||
"territories": [
|
||||
{
|
||||
"doctype": "Applicable Territory",
|
@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
test_records = frappe.get_test_records('Sales Taxes and Charges Template')
|
||||
|
||||
class TestSalesTaxesandChargesTemplate(unittest.TestCase):
|
||||
pass
|
@ -308,14 +308,14 @@
|
||||
"print_hide": 0
|
||||
},
|
||||
{
|
||||
"description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
|
||||
"description": "If you have created a standard template in Purchase Taxes and Charges Template, select one and click on the button below.",
|
||||
"fieldname": "taxes_and_charges",
|
||||
"fieldtype": "Link",
|
||||
"label": "Taxes and Charges",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "purchase_other_charges",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Purchase Taxes and Charges Master",
|
||||
"options": "Purchase Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
@ -873,7 +873,7 @@
|
||||
"icon": "icon-file-text",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-04-28 15:27:28.755816",
|
||||
"modified": "2015-04-28 15:27:28.755819",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Purchase Order",
|
||||
|
@ -128,7 +128,7 @@
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
"label": "Taxes and Charges",
|
||||
"options": "Purchase Taxes and Charges Master",
|
||||
"options": "Purchase Taxes and Charges Template",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@ -172,7 +172,7 @@
|
||||
],
|
||||
"icon": "icon-user",
|
||||
"idx": 1,
|
||||
"modified": "2015-02-24 17:35:03.821318",
|
||||
"modified": "2015-02-24 17:35:03.821319",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Supplier",
|
||||
|
@ -289,14 +289,14 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
|
||||
"description": "If you have created a standard template in Purchase Taxes and Charges Template, select one and click on the button below.",
|
||||
"fieldname": "taxes_and_charges",
|
||||
"fieldtype": "Link",
|
||||
"label": "Taxes and Charges",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "purchase_other_charges",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Purchase Taxes and Charges Master",
|
||||
"options": "Purchase Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
@ -660,7 +660,7 @@
|
||||
"icon": "icon-shopping-cart",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-03-23 14:47:07.225608",
|
||||
"modified": "2015-03-23 14:47:07.225609",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Supplier Quotation",
|
||||
|
@ -103,12 +103,12 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Sales Taxes and Charges Master",
|
||||
"name": "Sales Taxes and Charges Template",
|
||||
"description": _("Tax template for selling transactions.")
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Purchase Taxes and Charges Master",
|
||||
"name": "Purchase Taxes and Charges Template",
|
||||
"description": _("Tax template for buying transactions.")
|
||||
},
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Purchase Taxes and Charges Master",
|
||||
"name": "Purchase Taxes and Charges Template",
|
||||
"description": _("Tax template for buying transactions.")
|
||||
},
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Sales Taxes and Charges Master",
|
||||
"name": "Sales Taxes and Charges Template",
|
||||
"description": _("Tax template for selling transactions.")
|
||||
},
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ doc_events = {
|
||||
"validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
|
||||
"on_update": "erpnext.hr.doctype.employee.employee.update_user_permissions"
|
||||
},
|
||||
"Sales Taxes and Charges Master": {
|
||||
"Sales Taxes and Charges Template": {
|
||||
"on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
|
||||
},
|
||||
"Price List": {
|
||||
|
@ -148,3 +148,4 @@ erpnext.patches.v5_0.project_costing
|
||||
erpnext.patches.v5_0.update_temporary_account
|
||||
erpnext.patches.v5_0.update_advance_paid
|
||||
erpnext.patches.v5_0.link_warehouse_with_account
|
||||
erpnext.patches.v5_0.rename_taxes_and_charges_master
|
||||
|
@ -67,7 +67,7 @@ rename_map = {
|
||||
["other_charges", "taxes"],
|
||||
["valid_for_territories", "territories"]
|
||||
],
|
||||
"Purchase Taxes and Charges Master": [
|
||||
"Purchase Taxes and Charges Template": [
|
||||
["other_charges", "taxes"]
|
||||
],
|
||||
"Shipping Rule": [
|
||||
|
13
erpnext/patches/v5_0/rename_taxes_and_charges_master.py
Normal file
13
erpnext/patches/v5_0/rename_taxes_and_charges_master.py
Normal file
@ -0,0 +1,13 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
if frappe.db.table_exists("Sales Taxes and Charges Master"):
|
||||
frappe.rename_doc("DocType", "Sales Taxes and Charges Master",
|
||||
"Sales Taxes and Charges Template")
|
||||
frappe.delete_doc("DocType", "Sales Taxes and Charges Master")
|
||||
|
||||
if frappe.db.table_exists("Purchase Taxes and Charges Master"):
|
||||
frappe.rename_doc("DocType", "Purchase Taxes and Charges Master",
|
||||
"Purchase Taxes and Charges Template")
|
||||
frappe.delete_doc("DocType", "Purchase Taxes and Charges Master")
|
@ -196,7 +196,7 @@
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
"label": "Taxes and Charges",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
@ -269,7 +269,7 @@
|
||||
],
|
||||
"icon": "icon-user",
|
||||
"idx": 1,
|
||||
"modified": "2015-02-24 17:32:36.065246",
|
||||
"modified": "2015-02-24 17:32:36.065248",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Customer",
|
||||
|
@ -379,7 +379,7 @@
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "charge",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 0
|
||||
@ -858,7 +858,7 @@
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"max_attachments": 1,
|
||||
"modified": "2015-03-23 14:45:49.596355",
|
||||
"modified": "2015-03-23 14:45:49.596357",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Quotation",
|
||||
|
@ -389,7 +389,7 @@
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "charge",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
@ -1080,7 +1080,7 @@
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"modified": "2015-04-28 15:27:40.852414",
|
||||
"modified": "2015-04-28 15:27:40.852417",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order",
|
||||
|
@ -35,8 +35,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
this.frm.set_query("taxes_and_charges", function() {
|
||||
return {
|
||||
filters: [
|
||||
['Sales Taxes and Charges Master', 'company', '=', me.frm.doc.company],
|
||||
['Sales Taxes and Charges Master', 'docstatus', '!=', 2]
|
||||
['sales Taxes and Charges Template', 'company', '=', me.frm.doc.company],
|
||||
['sales Taxes and Charges Template', 'docstatus', '!=', 2]
|
||||
]
|
||||
}
|
||||
});
|
||||
|
@ -52,14 +52,14 @@ class TestShoppingCartSettings(unittest.TestCase):
|
||||
"sales_taxes_and_charges_master": tax_master
|
||||
})
|
||||
|
||||
for tax_master in ("_Test Sales Taxes and Charges Master", "_Test India Tax Master"):
|
||||
for tax_master in ("_Test Sales Taxes and Charges Template", "_Test India Tax Master"):
|
||||
_add_tax_master(tax_master)
|
||||
|
||||
controller = cart_settings
|
||||
controller.validate_overlapping_territories("sales_taxes_and_charges_masters",
|
||||
"sales_taxes_and_charges_master")
|
||||
|
||||
_add_tax_master("_Test Sales Taxes and Charges Master - Rest of the World")
|
||||
_add_tax_master("_Test Sales Taxes and Charges Template - Rest of the World")
|
||||
|
||||
controller = cart_settings
|
||||
self.assertRaises(ShoppingCartSetupError, controller.validate_overlapping_territories,
|
||||
|
@ -8,7 +8,7 @@
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Tax Master",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"reqd": 1
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ class TestShoppingCart(unittest.TestCase):
|
||||
{"doctype": "Shopping Cart Taxes and Charges Master", "parentfield": "sales_taxes_and_charges_masters",
|
||||
"sales_taxes_and_charges_master": "_Test India Tax Master"},
|
||||
{"doctype": "Shopping Cart Taxes and Charges Master", "parentfield": "sales_taxes_and_charges_masters",
|
||||
"sales_taxes_and_charges_master": "_Test Sales Taxes and Charges Master - Rest of the World"},
|
||||
"sales_taxes_and_charges_master": "_Test Sales Taxes and Charges Template - Rest of the World"},
|
||||
])
|
||||
settings.set("shipping_rules", {"doctype": "Shopping Cart Shipping Rule", "parentfield": "shipping_rules",
|
||||
"shipping_rule": "_Test Shipping Rule - India"})
|
||||
@ -205,5 +205,5 @@ class TestShoppingCart(unittest.TestCase):
|
||||
quotation.save(ignore_permissions=True)
|
||||
|
||||
|
||||
test_dependencies = ["Sales Taxes and Charges Master", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
|
||||
test_dependencies = ["Sales Taxes and Charges Template", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
|
||||
"Customer Group", "Lead", "Customer", "Contact", "Address", "Item"]
|
||||
|
@ -402,13 +402,13 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"description": "If you have created a standard template in Sales Taxes and Charges Master, select one and click on the button below.",
|
||||
"description": "If you have created a standard template in Sales Taxes and Charges Template, select one and click on the button below.",
|
||||
"fieldname": "taxes_and_charges",
|
||||
"fieldtype": "Link",
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "charge",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Sales Taxes and Charges Master",
|
||||
"options": "Sales Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 0
|
||||
@ -1070,7 +1070,7 @@
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-04-24 00:12:12.119039",
|
||||
"modified": "2015-04-24 00:12:12.119033",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Note",
|
||||
|
@ -300,13 +300,13 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
|
||||
"description": "If you have created a standard template in Purchase Taxes and Charges Template, select one and click on the button below.",
|
||||
"fieldname": "taxes_and_charges",
|
||||
"fieldtype": "Link",
|
||||
"label": "Taxes and Charges",
|
||||
"oldfieldname": "purchase_other_charges",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Purchase Taxes and Charges Master",
|
||||
"options": "Purchase Taxes and Charges Template",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
@ -852,7 +852,7 @@
|
||||
"icon": "icon-truck",
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"modified": "2015-03-23 14:47:44.335392",
|
||||
"modified": "2015-03-23 14:47:44.335393",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt",
|
||||
|
Loading…
x
Reference in New Issue
Block a user