fixes to taxes and charges master and naming_series
This commit is contained in:
parent
5faf37f312
commit
4feae61b62
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:35:46',
|
||||
'creation': '2012-07-03 13:30:49',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:35:46',
|
||||
'modified': '2012-07-12 14:08:27',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'wasim@webnotestech.com'
|
||||
},
|
||||
@ -24,7 +24,7 @@
|
||||
'section_style': u'Tray',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 13
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -42,34 +42,6 @@
|
||||
'name': u'Purchase Taxes and Charges'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'category',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Category',
|
||||
'oldfieldname': u'category',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nFor Total\nFor Valuation\nFor Both',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'default': u'Add',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'add_deduct_tax',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Add or Deduct',
|
||||
'oldfieldname': u'add_deduct_tax',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'\nAdd\nDeduct',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@ -84,46 +56,6 @@
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'row_id',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
'label': u'Enter Row',
|
||||
'oldfieldname': u'row_id',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'item_wise_tax_detail',
|
||||
'fieldtype': u'Small Text',
|
||||
'hidden': 1,
|
||||
'label': u'Item Wise Tax Detail ',
|
||||
'oldfieldname': u'item_wise_tax_detail',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'description',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Description',
|
||||
'oldfieldname': u'description',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'width': u'300px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@ -151,6 +83,19 @@
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'description',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Description',
|
||||
'oldfieldname': u'description',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'width': u'300px'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@ -182,12 +127,70 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'total',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Aggregate Total',
|
||||
'label': u'Total',
|
||||
'oldfieldname': u'total',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'row_id',
|
||||
'fieldtype': u'Data',
|
||||
'hidden': 0,
|
||||
'label': u'Enter Row',
|
||||
'oldfieldname': u'row_id',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'For Both',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'category',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Consider Tax or Charge for',
|
||||
'oldfieldname': u'category',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'Valuation and Total\nValuation\nTotal',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'default': u'Add',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'add_deduct_tax',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Add or Deduct',
|
||||
'oldfieldname': u'add_deduct_tax',
|
||||
'oldfieldtype': u'Select',
|
||||
'options': u'Add\nDeduct',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'trigger': u'Client'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'item_wise_tax_detail',
|
||||
'fieldtype': u'Small Text',
|
||||
'hidden': 1,
|
||||
'label': u'Item Wise Tax Detail ',
|
||||
'oldfieldname': u'item_wise_tax_detail',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
|
@ -22,7 +22,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.set_footnote(wn.markdown(cur_frm.meta.description));
|
||||
}
|
||||
|
||||
cur_frm.pformat.purchase_tax_details= function(doc){
|
||||
@ -74,7 +74,7 @@ cur_frm.cscript.add_deduct_tax = function(doc, cdt, cdn) {
|
||||
alert("Please select Category first");
|
||||
d.add_deduct_tax = '';
|
||||
}
|
||||
else if(d.category != 'For Total' && d.add_deduct_tax == 'Deduct'){
|
||||
else if(d.category != 'Total' && d.add_deduct_tax == 'Deduct'){
|
||||
alert("You cannot Deduct when category is for valuation or for both(i.e total and valuation)");
|
||||
d.add_deduct_tax = '';
|
||||
}
|
||||
@ -91,8 +91,8 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
|
||||
alert("You cannot select Charge Type as 'On Previous Row Amount' or 'On Previous Row Total' for first row");
|
||||
d.charge_type = '';
|
||||
}
|
||||
else if((d.category == 'For Valuation' || d.category == 'For Both') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
|
||||
alert("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'For Total' option for previous row amount or previous row total")
|
||||
else if((d.category == 'Valuation' || d.category == 'Valuation and Total') && (d.charge_type == 'On Previous Row Amount' || d.charge_type == 'On Previous Row Total')){
|
||||
alert("You cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for valuation. You can select only 'Total' option for previous row amount or previous row total")
|
||||
d.charge_type = '';
|
||||
}
|
||||
validated = false;
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:35:51',
|
||||
'creation': '2012-07-03 13:30:50',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:35:51',
|
||||
'modified': '2012-07-12 14:10:35',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'wasim@webnotestech.com'
|
||||
},
|
||||
@ -17,6 +17,7 @@
|
||||
'autoname': u'field:title',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like "Shipping", "Insurance", "Handling" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on "Previous Row Total" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Accounts',
|
||||
@ -24,7 +25,7 @@
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 18
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -106,17 +107,6 @@
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'company',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': u'Company',
|
||||
'options': u'Company',
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@ -126,5 +116,16 @@
|
||||
'oldfieldname': u'purchase_tax_details',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Purchase Taxes and Charges'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'company',
|
||||
'fieldtype': u'Link',
|
||||
'in_filter': 1,
|
||||
'label': u'Company',
|
||||
'options': u'Company',
|
||||
'reqd': 1
|
||||
}
|
||||
]
|
||||
]
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-05-15 12:14:34',
|
||||
'creation': '2012-07-04 16:40:13',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-07-04 13:27:05',
|
||||
'modified': '2012-07-12 13:50:43',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -113,7 +113,7 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'tax_amount',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Amount*',
|
||||
'label': u'Amount',
|
||||
'oldfieldname': u'tax_amount',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 0,
|
||||
@ -126,7 +126,7 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'total',
|
||||
'fieldtype': u'Currency',
|
||||
'label': u'Total*',
|
||||
'label': u'Total',
|
||||
'oldfieldname': u'total',
|
||||
'oldfieldtype': u'Currency',
|
||||
'permlevel': 1
|
||||
|
@ -19,9 +19,9 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
//
|
||||
}
|
||||
|
||||
/*cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
}*/
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
cur_frm.set_footnote(wn.markdown(cur_frm.meta.description));
|
||||
}
|
||||
|
||||
// For customizing print
|
||||
cur_frm.pformat.net_total = function(doc) {
|
||||
|
@ -8,43 +8,25 @@
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, getchildren, make_autoname
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
# Get Tax Rate if account type is Tax
|
||||
# ===================================================================
|
||||
def get_rate(self, arg):
|
||||
get_obj('Sales Common').get_rate(arg, self)
|
||||
def get_rate(self, arg):
|
||||
from webnotes.model.code import get_obj
|
||||
return get_obj('Sales Common').get_rate(arg, self)
|
||||
|
||||
def update_other_default_charges(self):
|
||||
sql("update `tabSales Taxes and Charges Master` set is_default = 0 where ifnull(is_default,0) = 1 and name != '%s' and company = '%s'" % (self.doc.name, self.doc.company))
|
||||
def update_other_default_charges(self):
|
||||
webnotes.conn.sql("update `tabSales Taxes and Charges Master` set is_default = 0 where ifnull(is_default,0) = 1 and name != '%s' and company = '%s'" % (self.doc.name, self.doc.company))
|
||||
|
||||
def on_update(self):
|
||||
self.update_other_default_charges()
|
||||
def on_update(self):
|
||||
self.update_other_default_charges()
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:22',
|
||||
'creation': '2012-07-03 13:30:46',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:22',
|
||||
'modified': '2012-07-12 13:43:32',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -17,6 +17,7 @@
|
||||
'autoname': u'field:title',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like "Shipping", "Insurance", "Handling" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on "Previous Row Total" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Accounts',
|
||||
@ -24,7 +25,7 @@
|
||||
'section_style': u'Tabbed',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 57
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -33,7 +34,8 @@
|
||||
'name': '__common__',
|
||||
'parent': u'Sales Taxes and Charges Master',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
'parenttype': u'DocType',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
@ -52,6 +54,42 @@
|
||||
'name': u'Sales Taxes and Charges Master'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Master Manager',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
@ -86,63 +124,6 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Master Manager',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'trash_reason',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Trash Reason',
|
||||
'oldfieldname': u'trash_reason',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'other_charges_details',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Other Charges Details',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@ -152,7 +133,6 @@
|
||||
'label': u'Title',
|
||||
'oldfieldname': u'title',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 0
|
||||
},
|
||||
@ -162,8 +142,20 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'is_default',
|
||||
'fieldtype': u'Check',
|
||||
'label': u'Default',
|
||||
'permlevel': 0
|
||||
'label': u'Default'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'* Will be calculated in the transaction.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'other_charges',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Sales Taxes and Charges Master',
|
||||
'oldfieldname': u'other_charges',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Sales Taxes and Charges'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@ -176,20 +168,7 @@
|
||||
'oldfieldname': u'company',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Company',
|
||||
'permlevel': 0,
|
||||
'reqd': 1,
|
||||
'search_index': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'other_charges',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Sales Taxes and Charges Master',
|
||||
'oldfieldname': u'other_charges',
|
||||
'oldfieldtype': u'Table',
|
||||
'options': u'Sales Taxes and Charges',
|
||||
'permlevel': 0
|
||||
}
|
||||
]
|
||||
]
|
@ -1,3 +1,9 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("""update tabAccount set freeze_account='No' where freeze_account is null""")
|
||||
webnotes.conn.sql("""update `tabPurchase Taxes and Charges`
|
||||
set category='Valuation and Total' where category='For Both'""")
|
||||
webnotes.conn.sql("""update `tabPurchase Taxes and Charges`
|
||||
set category='Valuation' where category='For Valuation'""")
|
||||
webnotes.conn.sql("""update `tabPurchase Taxes and Charges`
|
||||
set category='Total' where category='For Total'""")
|
8
erpnext/patches/july_2012/update_purchase_tax.py
Normal file
8
erpnext/patches/july_2012/update_purchase_tax.py
Normal file
@ -0,0 +1,8 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
webnotes.conn.sql("""update `tabPurchase Taxes and Charges`
|
||||
set category='Valuation and Total' where category='For Both'""")
|
||||
webnotes.conn.sql("""update `tabPurchase Taxes and Charges`
|
||||
set category='Valuation' where category='For Valuation'""")
|
||||
webnotes.conn.sql("""update `tabPurchase Taxes and Charges`
|
||||
set category='Total' where category='For Total'""")
|
@ -492,4 +492,9 @@ patch_list = [
|
||||
'patch_file': 'default_freeze_account',
|
||||
'description': "set default freeze_account as 'No' where NULL"
|
||||
},
|
||||
{
|
||||
'patch_module': 'patches.july_2012',
|
||||
'patch_file': 'update_purchase_tax',
|
||||
'description': "rename options in purchase taxes and charges"
|
||||
},
|
||||
]
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:07',
|
||||
'creation': '2012-07-03 13:30:38',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:07',
|
||||
'modified': '2012-07-12 13:21:52',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -17,6 +17,7 @@
|
||||
'autoname': u'field:campaign_name',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Selling',
|
||||
@ -24,7 +25,7 @@
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 7
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -54,6 +55,56 @@
|
||||
'name': u'Campaign'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Master Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 1,
|
||||
@ -64,56 +115,6 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Master Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
|
@ -8,33 +8,47 @@
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Settings
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn){
|
||||
var callback = function(r, rt){
|
||||
set_field_options('select_doc_for_series', r.message);
|
||||
}
|
||||
$c_obj(make_doclist(doc.doctype, doc.name),'get_transactions','',callback);
|
||||
cur_frm.cscript.refresh();
|
||||
// add page head
|
||||
//var ph = new PageHeader(cur_frm.fields_dict['head_html'].wrapper, 'Setup Series', 'Set prefix for numbering series on your transactions');
|
||||
cur_frm.call_server('get_transactions', '', cur_frm.cscript.update_selects);
|
||||
|
||||
cur_frm.cscript.select_doc_for_series(doc);
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
// hide buttons
|
||||
$('.appframe-toolbar').toggle(false);
|
||||
cur_frm.cscript.update_selects = function(r) {
|
||||
set_field_options('select_doc_for_series', r.message.transactions);
|
||||
set_field_options('prefix', r.message.prefixes);
|
||||
}
|
||||
|
||||
|
||||
cur_frm.cscript.select_doc_for_series = function(doc, cdt, cdn) {
|
||||
var callback = function(r, rt){
|
||||
locals[cdt][cdn].set_options = r.message;
|
||||
refresh_field('set_options');
|
||||
}
|
||||
cur_frm.toggle_fields(['help_html','set_options', 'user_must_always_select', 'update'],
|
||||
doc.select_doc_for_series)
|
||||
|
||||
$c_obj(make_doclist(doc.doctype, doc.name),'get_options','',callback)
|
||||
var callback = function(r, rt){
|
||||
locals[cdt][cdn].set_options = r.message;
|
||||
refresh_field('set_options');
|
||||
if(r.message && r.message.split('\n')[0]=='') {
|
||||
cur_frm.set_value('user_must_always_select', 1)
|
||||
}
|
||||
}
|
||||
|
||||
if(doc.select_doc_for_series)
|
||||
$c_obj(make_doclist(doc.doctype, doc.name),'get_options','',callback)
|
||||
}
|
||||
|
||||
cur_frm.cscript.update = function() {
|
||||
cur_frm.call_server('update_series', '', cur_frm.cscript.update_selects)
|
||||
}
|
||||
|
||||
cur_frm.cscript.prefix = function(doc) {
|
||||
cur_frm.call_server('get_current', '', function(r) {
|
||||
refresh_field('current_value');
|
||||
})
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import cint, cstr
|
||||
@ -22,23 +21,37 @@ from webnotes import msgprint, errprint
|
||||
import webnotes.model.doctype
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def get_transactions(self):
|
||||
return "\n".join([''] + [i[0] for i in sql("SELECT `tabDocField`.`parent` FROM `tabDocField`, `tabDocType` WHERE `tabDocField`.`fieldname` = 'naming_series' and `tabDocType`.name=`tabDocField`.parent order by `tabDocField`.parent")])
|
||||
def get_transactions(self, arg=None):
|
||||
return {
|
||||
"transactions": "\n".join([''] + [i[0] for i in sql("""select `tabDocField`.`parent`
|
||||
FROM `tabDocField`, `tabDocType` WHERE `tabDocField`.`fieldname` = 'naming_series'
|
||||
and `tabDocType`.name=`tabDocField`.parent order by `tabDocField`.parent""")]),
|
||||
"prefixes": "\n".join([''] + [i[0] for i in sql("""select name from tabSeries""")])}
|
||||
|
||||
def scrub_options_list(self, ol):
|
||||
options = filter(lambda x: x, [cstr(n.upper()).strip() for n in ol])
|
||||
return options
|
||||
|
||||
def update_series(self, arg=None):
|
||||
"""update series list"""
|
||||
self.check_duplicate()
|
||||
series_list = self.doc.set_options.split("\n")
|
||||
|
||||
# set in doctype
|
||||
self.set_series_for(self.doc.select_doc_for_series, series_list)
|
||||
|
||||
# create series
|
||||
map(self.insert_series, series_list)
|
||||
|
||||
msgprint('Series Updated')
|
||||
|
||||
return self.get_transactions()
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def set_series_for(self, doctype, ol):
|
||||
options = self.scrub_options_list(ol)
|
||||
|
||||
@ -78,14 +91,7 @@ class DocType:
|
||||
|
||||
from webnotes.utils.cache import CacheItem
|
||||
CacheItem(doctype).clear()
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def update_series(self):
|
||||
self.check_duplicate()
|
||||
self.set_series_for(self.doc.select_doc_for_series, self.doc.set_options.split("\n"))
|
||||
msgprint('Series Updated')
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def check_duplicate(self):
|
||||
from core.doctype.doctype.doctype import DocType
|
||||
dt = DocType()
|
||||
@ -100,27 +106,31 @@ class DocType:
|
||||
if series in i[0].split("\n"):
|
||||
msgprint("Oops! Series name %s is already in use in %s. Please select a new one" % (series, i[1]), raise_exception=1)
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def validate_series_name(self, n):
|
||||
import re
|
||||
if not re.match('[a-zA-Z0-9]+(([-/][a-zA-Z0-9])?[-/][a-zA-Z0-9]*)*',n):
|
||||
msgprint('Special Characters except "-" and "/" not allowed in naming series')
|
||||
raise Exception
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def get_options(self, arg=''):
|
||||
sr = webnotes.model.doctype.get_property(self.doc.select_doc_for_series, 'options', 'naming_series')
|
||||
sr = webnotes.model.doctype.get_property(self.doc.select_doc_for_series,
|
||||
'options', 'naming_series')
|
||||
return sr
|
||||
|
||||
def get_current(self, arg=None):
|
||||
"""get series current"""
|
||||
self.doc.current_value = webnotes.conn.sql("""select current from tabSeries where name=%s""",
|
||||
self.doc.prefix)[0][0]
|
||||
|
||||
def insert_series(self, series):
|
||||
"""insert series if missing"""
|
||||
if not webnotes.conn.exists('Series', series):
|
||||
sql("insert into tabSeries (name, current) values (%s,0)", (series))
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
def update_series_start(self):
|
||||
if self.doc.prefix:
|
||||
ser_det = sql("select name from `tabSeries` where name = %s", self.doc.prefix)
|
||||
if ser_det:
|
||||
sql("update `tabSeries` set current = '%s' where name = '%s'" % (self.doc.starts_from-1,self.doc.prefix))
|
||||
else:
|
||||
sql("insert into tabSeries (name, current) values (%s,%s)",(cstr(self.doc.prefix),cint(self.doc.starts_from)-1))
|
||||
self.insert_series(self.doc.prefix)
|
||||
sql("update `tabSeries` set current = '%s' where name = '%s'" % (self.doc.current_value,self.doc.prefix))
|
||||
msgprint("Series Updated Successfully")
|
||||
else:
|
||||
msgprint("Please select prefix first")
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-04-10 13:01:16',
|
||||
'creation': '2012-07-03 13:30:54',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-10 18:45:34',
|
||||
'modified': '2012-07-12 15:59:52',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -16,7 +16,7 @@
|
||||
'description': u'Set prefix for numbering series on your transactions',
|
||||
'doctype': 'DocType',
|
||||
'hide_heading': 0,
|
||||
'hide_toolbar': 0,
|
||||
'hide_toolbar': 1,
|
||||
'issingle': 1,
|
||||
'module': u'Setup',
|
||||
'name': '__common__',
|
||||
@ -24,7 +24,7 @@
|
||||
'section_style': u'Tray',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 66
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -123,7 +123,7 @@
|
||||
'fieldname': u'help_html',
|
||||
'fieldtype': u'HTML',
|
||||
'label': u'Help HTML',
|
||||
'options': u'<div style="padding: 8px; background-color: #FFD; margin: 8px 0px;">\nWrite the list of series options in the list below. Each on a new line<br>\nAllowed special characters are "/" and "-"<br>\nExamples:<br>\nINV-<br>\nINV-10-<br>\nINVK-<br>\n</div>'
|
||||
'options': u'<div class="help-box">\nEdit list of Series in the box below. Each Series Prefix on a new line.<br><br>\nAllowed special characters are "/" and "-"<br>\nExamples:<br>\nINV-<br>\nINV-10-<br>\nINVK-<br>\n</div>'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@ -131,7 +131,7 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'set_options',
|
||||
'fieldtype': u'Text',
|
||||
'label': u'Set Series'
|
||||
'label': u'Series List for this Transaction'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@ -146,16 +146,17 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'update',
|
||||
'fieldtype': u'Button',
|
||||
'label': u'Update',
|
||||
'options': u'update_series'
|
||||
'label': u'Update'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'description': u'Set starting number for series of your transactions',
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Change the starting / current sequence number of an existing series.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'update_series',
|
||||
'fieldtype': u'Section Break',
|
||||
@ -166,24 +167,27 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'prefix',
|
||||
'fieldtype': u'Data',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Prefix'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'This is the number of the last created transaction with this prefix',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'starts_from',
|
||||
'fieldname': u'current_value',
|
||||
'fieldtype': u'Int',
|
||||
'label': u'Starts From'
|
||||
'label': u'Current Value'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'update_series_start',
|
||||
'fieldtype': u'Button',
|
||||
'label': u'Update Series Start',
|
||||
'label': u'Update Series Number',
|
||||
'options': u'update_series_start'
|
||||
}
|
||||
]
|
@ -14,14 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
// ONLOAD
|
||||
// ===================================================================================
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.refresh = function(doc) {
|
||||
cur_frm.set_intro(doc.__islocal ? "" : "There is nothing to edit.")
|
||||
}
|
@ -3,9 +3,9 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-03-27 14:36:25',
|
||||
'creation': '2012-07-03 13:30:54',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-03-27 14:36:25',
|
||||
'modified': '2012-07-12 11:37:56',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@ -17,6 +17,7 @@
|
||||
'autoname': u'field:title',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'description': u'Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.',
|
||||
'doctype': 'DocType',
|
||||
'document_type': u'Master',
|
||||
'module': u'Setup',
|
||||
@ -24,7 +25,7 @@
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 11
|
||||
'version': 1
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -52,6 +53,42 @@
|
||||
'name': u'Terms and Conditions'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Master Manager',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales Master Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
@ -91,42 +128,6 @@
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales Master Manager',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': u'Sales Master Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': u'DocPerm',
|
||||
'permlevel': 1,
|
||||
'role': u'Sales User',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
|
@ -57,7 +57,7 @@
|
||||
<div class="section-item">
|
||||
<a class="section-link"
|
||||
title = "Readings of incoming quality inspections"
|
||||
href="#!List/Quality Inspection">Incoming Inspection</a>
|
||||
href="#!List/Quality Inspection">Quality Inspection</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link"
|
||||
|
@ -49,7 +49,7 @@
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.layout-main {
|
||||
.todo-layout {
|
||||
background-color: #FFFDC9;
|
||||
min-height: 300px;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
<div class="appframe-area"></div>
|
||||
<div class="layout-main">
|
||||
<div class="layout-main todo-layout">
|
||||
<div>
|
||||
<div id="todo-list">
|
||||
<h4>My List</h4><br>
|
||||
|
@ -2309,12 +2309,15 @@ div.notice {
|
||||
|
||||
.help_box, .help-box {
|
||||
background-color: #ffe;
|
||||
color: #874;
|
||||
padding: 9px 9px 9px 9px;
|
||||
border: 1px dashed #fc7;
|
||||
margin: 11px 0px;
|
||||
}
|
||||
|
||||
.help-box, .help-box p, .help-box h1, .help-box h2, .help-box h3, .help-box h4 {
|
||||
color: #643;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* lib/css/legacy/forms.css
|
||||
|
@ -2170,12 +2170,15 @@ div.notice {
|
||||
|
||||
.help_box, .help-box {
|
||||
background-color: #ffe;
|
||||
color: #874;
|
||||
padding: 9px 9px 9px 9px;
|
||||
border: 1px dashed #fc7;
|
||||
margin: 11px 0px;
|
||||
}
|
||||
|
||||
.help-box, .help-box p, .help-box h1, .help-box h2, .help-box h3, .help-box h4 {
|
||||
color: #643;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* lib/css/legacy/dialog.css
|
||||
|
@ -608,7 +608,7 @@ document.body.appendChild(temp);temp.submit();return temp;}
|
||||
var msg_dialog;function msgprint(msg,title){if(!msg)return;if(typeof(msg)!='string')
|
||||
msg=JSON.stringify(msg);if(msg.substr(0,8)=='__small:'){show_alert(msg.substr(8));return;}
|
||||
if(!msg_dialog){msg_dialog=new wn.ui.Dialog({title:"Message",onhide:function(){msg_dialog.msg_area.empty();}});msg_dialog.msg_area=$('<div class="msgprint">').appendTo(msg_dialog.body);}
|
||||
if(msg.search(/<br>|<p>/)==-1)
|
||||
if(msg.search(/<br>|<p>|<li>/)==-1)
|
||||
msg=replace_newlines(msg);msg_dialog.set_title(title||'Message')
|
||||
msg_dialog.msg_area.append(msg);msg_dialog.show();}
|
||||
var growl_area;function show_alert(txt,id){if(!growl_area){if(!$('#dialog-container').length){$('<div id="dialog-container">').appendTo('body');}
|
||||
@ -1701,7 +1701,8 @@ this.$w=this.appframe.$w;},refresh:function(){if(cur_frm.cscript.set_breadcrumbs
|
||||
this.refresh_labels();this.refresh_toolbar();},refresh_labels:function(){var labinfo={0:['Saved','label-success'],1:['Submitted','label-info'],2:['Cancelled','label-important']}[cint(cur_frm.doc.docstatus)];if(labinfo[0]=='Saved'&&cur_frm.meta.is_submittable){labinfo[0]='Saved, to Submit';}
|
||||
if(cur_frm.doc.__unsaved||cur_frm.doc.__islocal){labinfo[0]='Not Saved';labinfo[1]='label-warning'}
|
||||
this.set_label(labinfo);if(cur_frm.doc.__unsaved&&cint(cur_frm.doc.docstatus)==1&&this.appframe.buttons['Update']){this.appframe.buttons['Update'].toggle(true);}},set_label:function(labinfo){this.$w.find('.label').remove();$(repl('<span class="label %(lab_class)s">\
|
||||
%(lab_status)s</span>',{lab_status:labinfo[0],lab_class:labinfo[1]})).insertBefore(this.$w.find('.breadcrumb-area'))},refresh_toolbar:function(){this.appframe.clear_buttons();var p=cur_frm.get_doc_perms();if(cur_frm.meta.read_only_onload&&!cur_frm.doc.__islocal){if(!cur_frm.editable)
|
||||
%(lab_status)s</span>',{lab_status:labinfo[0],lab_class:labinfo[1]})).insertBefore(this.$w.find('.breadcrumb-area'))},refresh_toolbar:function(){if(cur_frm.meta.hide_toolbar){$('.appframe-toolbar').toggle(false);return;}
|
||||
this.appframe.clear_buttons();var p=cur_frm.get_doc_perms();if(cur_frm.meta.read_only_onload&&!cur_frm.doc.__islocal){if(!cur_frm.editable)
|
||||
this.appframe.add_button('Edit',function(){cur_frm.edit_doc();},'icon-pencil');else
|
||||
this.appframe.add_button('Print View',function(){cur_frm.is_editable[cur_frm.docname]=0;cur_frm.refresh();},'icon-print');}
|
||||
var docstatus=cint(cur_frm.doc.docstatus);if(docstatus==0&&p[WRITE]){this.appframe.add_button('Save',function(){cur_frm.save('Save');},'');this.appframe.buttons['Save'].addClass('btn-info');}
|
||||
@ -1749,6 +1750,8 @@ _f.Frm.prototype.setup_footer=function(){var me=this;var f=this.page_layout.foot
|
||||
f.hide_save=function(){$dh(me.page_layout.footer.save_area);}}
|
||||
_f.Frm.prototype.set_intro=function(txt){if(!this.intro_area){this.intro_area=$('<div class="help-box form-intro-area">').insertBefore(this.page_layout.body.firstChild);}
|
||||
if(txt){if(txt.search(/<p>/)==-1)txt='<p>'+txt+'</p>';this.intro_area.html(txt);}else{this.intro_area.remove();this.intro_area=null;}}
|
||||
_f.Frm.prototype.set_footnote=function(txt){if(!this.footnote_area){this.footnote_area=$('<div class="help-box form-intro-area">').insertAfter(this.page_layout.body.lastChild);}
|
||||
if(txt){if(txt.search(/<p>/)==-1)txt='<p>'+txt+'</p>';this.footnote_area.html(txt);}else{this.footnote_area.remove();this.footnote_area=null;}}
|
||||
_f.Frm.prototype.setup_fields_std=function(){var fl=wn.meta.docfield_list[this.doctype];fl.sort(function(a,b){return a.idx-b.idx});if(fl[0]&&fl[0].fieldtype!="Section Break"||get_url_arg('embed')){this.layout.addrow();if(fl[0].fieldtype!="Column Break"){var c=this.layout.addcell();$y(c.wrapper,{padding:'8px'});}}
|
||||
var sec;for(var i=0;i<fl.length;i++){var f=fl[i];if(f.fieldtype=='Section Break'&&fl[i+1]&&fl[i+1].fieldtype=='Section Break')
|
||||
continue;var fn=f.fieldname?f.fieldname:f.label;var fld=make_field(f,this.doctype,this.layout.cur_cell,this);this.fields[this.fields.length]=fld;this.fields_dict[fn]=fld;if(sec&&['Section Break','Column Break'].indexOf(f.fieldtype)==-1){fld.parent_section=sec;sec.fields.push(fld);}
|
||||
@ -1859,6 +1862,7 @@ _f.Frm.prototype.toggle_fields=function(fields,show){if(show){unhide_field(field
|
||||
else{hide_field(fields)}}
|
||||
_f.Frm.prototype.enable_fields=function(fields,enable){if(typeof fields=='string')fields=[fields];$.each(fields,function(i,f){var field=cur_frm.fields_dict[f];if(field){field.disabled=enable?false:true;field.refresh&&field.refresh();};})}
|
||||
_f.Frm.prototype.call_server=function(method,args,callback){$c_obj(cur_frm.get_doclist(),method,args,callback);}
|
||||
_f.Frm.prototype.set_value=function(field,value){cur_frm.get_doc()[field]=value;cur_frm.fields_dict[field].refresh();}
|
||||
/*
|
||||
* lib/js/legacy/widgets/form/form_fields.js
|
||||
*/
|
||||
@ -2178,7 +2182,7 @@ CommentItem.prototype.cmt_delete=function(cell,ri,ci,d){var me=this;if(d[ri][2]=
|
||||
/*
|
||||
* lib/js/legacy/wn/widgets/form/sidebar.js
|
||||
*/
|
||||
wn.widgets.form.sidebar={Sidebar:function(form){var me=this;this.form=form;this.opts={sections:[{title:'Actions',items:[{type:'link',label:'New',icon:'icon-plus',display:function(){return in_list(profile.can_create,form.doctype)},onclick:function(){new_doc(me.form.doctype)}},{type:'link',label:'List',icon:'icon-list',display:function(){return!me.form.meta.issingle&&!me.form.meta.read_only;},onclick:function(){window.location.href="#!List/"+me.form.doctype}},{type:'link',label:'Refresh',icon:'icon-refresh',onclick:function(){me.form.reload_doc()}},{type:'link',label:'Print',display:function(){return!(me.form.doc.__islocal||me.form.meta.allow_print);},icon:'icon-print',onclick:function(){me.form.print_doc()}},{type:'link',label:'Email',display:function(){return!(me.form.doc.__islocal||me.form.meta.allow_email);},icon:'icon-envelope',onclick:function(){me.form.email_doc()}},{type:'link',label:'Copy',display:function(){return in_list(profile.can_create,me.form.doctype)&&!me.form.meta.allow_copy},icon:'icon-file',onclick:function(){me.form.copy_doc()}},{type:'link',label:'Delete',display:function(){return(cint(me.form.doc.docstatus)!=1)&&!me.form.doc.__islocal&&wn.model.can_delete(me.form.doctype);},icon:'icon-remove-sign',onclick:function(){me.form.savetrash()}}]},{title:'Assign To',render:function(wrapper){me.form.assign_to=new wn.widgets.form.sidebar.AssignTo(wrapper,me,me.form.doctype,me.form.docname);},display:function(){if(me.form.doc.__local)return false;else return true;}},{title:'Attachments',render:function(wrapper){me.form.attachments=new wn.widgets.form.sidebar.Attachments(wrapper,me,me.form.doctype,me.form.docname);},display:function(){return me.form.meta.allow_attach}},{title:'Comments',render:function(wrapper){new wn.widgets.form.sidebar.Comments(wrapper,me,me.form.doctype,me.form.docname);},display:function(){return!me.form.doc.__islocal}},{title:'Tags',render:function(wrapper){me.form.taglist=new TagList(wrapper,me.form.doc._user_tags?me.form.doc._user_tags.split(','):[],me.form.doctype,me.form.docname,0,function(){});},display:function(){return!me.form.doc.__islocal}},{title:'Users',render:function(wrapper){var doc=cur_frm.doc;var scrub_date=function(d){if(d)t=d.split(' ');else return'';return dateutil.str_to_user(t[0])+' '+t[1];}
|
||||
wn.widgets.form.sidebar={Sidebar:function(form){var me=this;this.form=form;this.opts={sections:[{title:'Actions',items:[{type:'link',label:'New',icon:'icon-plus',display:function(){return in_list(profile.can_create,form.doctype)},onclick:function(){new_doc(me.form.doctype)}},{type:'link',label:'List',icon:'icon-list',display:function(){return!me.form.meta.issingle&&!me.form.meta.read_only;},onclick:function(){window.location.href="#!List/"+me.form.doctype}},{type:'link',label:'Refresh',icon:'icon-refresh',onclick:function(){me.form.reload_doc()}},{type:'link',label:'Print',display:function(){return!(me.form.doc.__islocal||me.form.meta.allow_print);},icon:'icon-print',onclick:function(){me.form.print_doc()}},{type:'link',label:'Email',display:function(){return!(me.form.doc.__islocal||me.form.meta.allow_email);},icon:'icon-envelope',onclick:function(){me.form.email_doc()}},{type:'link',label:'Copy',display:function(){return in_list(profile.can_create,me.form.doctype)&&!me.form.meta.allow_copy},icon:'icon-file',onclick:function(){me.form.copy_doc()}},{type:'link',label:'Delete',display:function(){return(cint(me.form.doc.docstatus)!=1)&&!me.form.doc.__islocal&&wn.model.can_delete(me.form.doctype);},icon:'icon-remove-sign',onclick:function(){me.form.savetrash()}}],display:function(){return me.form.meta.hide_toolbar?false:true;}},{title:'Assign To',render:function(wrapper){me.form.assign_to=new wn.widgets.form.sidebar.AssignTo(wrapper,me,me.form.doctype,me.form.docname);},display:function(){if(me.form.doc.__local)return false;else return true;}},{title:'Attachments',render:function(wrapper){me.form.attachments=new wn.widgets.form.sidebar.Attachments(wrapper,me,me.form.doctype,me.form.docname);},display:function(){return me.form.meta.allow_attach}},{title:'Comments',render:function(wrapper){new wn.widgets.form.sidebar.Comments(wrapper,me,me.form.doctype,me.form.docname);},display:function(){return!me.form.doc.__islocal}},{title:'Tags',render:function(wrapper){me.form.taglist=new TagList(wrapper,me.form.doc._user_tags?me.form.doc._user_tags.split(','):[],me.form.doctype,me.form.docname,0,function(){});},display:function(){return!me.form.doc.__islocal}},{title:'Users',render:function(wrapper){var doc=cur_frm.doc;var scrub_date=function(d){if(d)t=d.split(' ');else return'';return dateutil.str_to_user(t[0])+' '+t[1];}
|
||||
$(wrapper).html(repl('<p>Created:<br> <span class="avatar-small">\
|
||||
<img title="%(created_by)s" src="%(avatar_created)s" /></span> \
|
||||
<span class="help small">%(creation)s</span></p>\
|
||||
|
@ -495,7 +495,7 @@ document.body.appendChild(temp);temp.submit();return temp;}
|
||||
var msg_dialog;function msgprint(msg,title){if(!msg)return;if(typeof(msg)!='string')
|
||||
msg=JSON.stringify(msg);if(msg.substr(0,8)=='__small:'){show_alert(msg.substr(8));return;}
|
||||
if(!msg_dialog){msg_dialog=new wn.ui.Dialog({title:"Message",onhide:function(){msg_dialog.msg_area.empty();}});msg_dialog.msg_area=$('<div class="msgprint">').appendTo(msg_dialog.body);}
|
||||
if(msg.search(/<br>|<p>/)==-1)
|
||||
if(msg.search(/<br>|<p>|<li>/)==-1)
|
||||
msg=replace_newlines(msg);msg_dialog.set_title(title||'Message')
|
||||
msg_dialog.msg_area.append(msg);msg_dialog.show();}
|
||||
var growl_area;function show_alert(txt,id){if(!growl_area){if(!$('#dialog-container').length){$('<div id="dialog-container">').appendTo('body');}
|
||||
|
Loading…
x
Reference in New Issue
Block a user