moved directory structure

This commit is contained in:
Rushabh Mehta
2012-09-24 19:13:42 +05:30
parent e47a6779e9
commit 2fa2f7178d
1637 changed files with 47 additions and 11450 deletions

1
sandbox/testdata/__init__.py vendored Normal file
View File

@@ -0,0 +1 @@
from __future__ import unicode_literals

71
sandbox/testdata/leaves.py vendored Normal file
View File

@@ -0,0 +1,71 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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
# 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/>.
from __future__ import unicode_literals
from webnotes.model.doc import Document
emp = Document(
fielddata = {
'doctype': 'Employee',
'name': 'emp1',
'employee_name': 'Nijil',
'status': 'Active',
'date_of_joining': '2011-01-01'
}
)
l_all = Document(
fielddata = {
'doctype' : 'Leave Allocation',
'name': 'l_all',
'employee' : 'emp1',
'leave_type' : 'Casual Leave',
'posting_date': '2011-03-01',
'fiscal_year': '2011-2012',
'total_leaves_allocated': 20,
'docstatus': 1
}
)
l_app1 = Document(
fielddata = {
'doctype' : 'Leave Application',
'name': 'l_app1',
'employee' : 'emp1',
'leave_type' : 'Casual Leave',
'posting_date': '2011-03-01',
'fiscal_year': '2011-2012',
'from_date': '2011-08-01',
'to_date': '2011-08-02',
'total_leave_days': 2
}
)
l_app2 = Document(
fielddata = {
'doctype' : 'Leave Application',
'name': 'l_app2',
'employee' : 'emp1',
'leave_type' : 'Casual Leave',
'posting_date': '2011-03-01',
'fiscal_year': '2011-2012',
'from_date': '2011-08-15',
'to_date': '2011-08-17',
'total_leave_days': 3
}
)

299
sandbox/testdata/masters.py vendored Normal file
View File

@@ -0,0 +1,299 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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
# 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/>.
from __future__ import unicode_literals
"""
All master data in one place, can be created by 1 function call
"""
import webnotes
from webnotes.model.doc import Document
master_groups = {
# Company
#----------------------------------
'company': Document(
fielddata={
'doctype':'Company',
'abbr': 'co',
'company_name' : 'comp',
'name': 'comp'
}
),
# Customer Group
#----------------------------------
'customer_group': Document(
fielddata={
'doctype':'Customer Group',
'customer_group_name' : 'cg',
'name': 'cg',
'is_group': 'No',
'parent_customer_group':'',
'lft' : 1,
'rgt': 2
}
),
# Item Group
#----------------------------------
'item_group': Document(
fielddata = {
'doctype': 'Item Group',
'item_group_name': 'ig',
'lft': 1,
'rgt': 2,
'parent_item_group' : '',
'is_group': 'No',
'name': 'ig'
}
),
# Warehouse Type
#-----------------------------
'warehouse_type' : Document(
fielddata = {
'doctype' : 'Warehouse Type',
'name': 'normal',
'warehouse_type' : 'normal'
}
),
# Supplier Type
#-----------------------------
'supplier_type' : Document(
fielddata = {
'doctype': 'Supplier Type',
'supplier_type': 'stype'
}
)
}
main_masters = {
# Customer
#----------------------------------
'customer': Document(
fielddata={
'doctype':'Customer',
'docstatus':0,
'customer_name' : 'cust',
'company' : 'comp',
'customer_group' : '',
'name': 'cust'
}
),
# Supplier
#----------------------------------
'supplier': Document(
fielddata = {
'doctype': 'Supplier',
'supplier_name': 'supp',
'name': 'supp',
'supplier_type' : 'stype'
}
),
# Customer Account
#----------------------------------
'customer_acc': Document(
fielddata={
'doctype':'Account',
'docstatus':0,
'account_name' : 'cust',
'debit_or_credit': 'Debit',
'company' : 'comp',
'lft': 1,
'rgt': 2,
'group_or_ledger' : 'Ledger',
'is_pl_account': 'No',
'name' : 'cust - co'
}
),
# Customer Account
#----------------------------------
'supplier_acc': Document(
fielddata={
'doctype':'Account',
'docstatus':0,
'account_name' : 'supp',
'debit_or_credit': 'Credit',
'company' : 'comp',
'lft': 5,
'rgt': 6,
'group_or_ledger' : 'Ledger',
'is_pl_account': 'No',
'name' : 'supp - co'
}
),
# Bank Account
#----------------------------------
'bank_acc': Document(
fielddata={
'doctype':'Account',
'docstatus':0,
'account_name' : 'icici',
'parent_account': '',
'debit_or_credit': 'Debit',
'company' : 'comp',
'lft': 3,
'rgt': 4,
'group_or_ledger' : 'Ledger',
'is_pl_account': 'No',
'name' : 'icici - co'
}
),
# Income Account
#----------------------------------
'income_acc': Document(
fielddata={
'doctype':'Account',
'docstatus':0,
'account_name' : 'income',
'debit_or_credit': 'Credit',
'company' : 'comp',
'lft': 7,
'rgt': 8,
'group_or_ledger' : 'Ledger',
'is_pl_account': 'Yes',
'name' : 'income - co'
}
),
# Expense Account
#----------------------------------
'expense_acc': Document(
fielddata={
'doctype':'Account',
'docstatus':0,
'account_name' : 'expense',
'debit_or_credit': 'Debit',
'company' : 'comp',
'lft': 9,
'rgt': 10,
'group_or_ledger' : 'Ledger',
'is_pl_account': 'Yes',
'name' : 'expense - co'
}
),
# Cost Center
#----------------------------------
'cost_center': Document(
fielddata={
'doctype':'Cost Center',
'docstatus':0,
'cost_center_name' : 'cc',
'lft': 1,
'rgt': 2,
'group_or_ledger' : 'Ledger',
'name' : 'cc'
}
),
# Item
#----------------------------------
# Stock item / non-serialized
'item': [
Document(
fielddata = {
'doctype': 'Item',
'docstatus': 0,
'name': 'it',
'item_name': 'it',
'item_code': 'it',
'item_group': 'ig',
'is_stock_item': 'Yes',
'has_serial_no': 'Yes',
'stock_uom': 'Nos',
'is_sales_item': 'Yes',
'is_purchase_item': 'Yes',
'is_service_item': 'No',
'is_sub_contracted_item': 'No',
'is_pro_applicable': 'Yes',
'is_manufactured_item': 'Yes'
}
),
Document(
fielddata = {
'doctype': 'Item Price',
'parentfield': 'ref_rate_details',
'parenttype': 'Item',
'parent' : 'it',
'price_list_name': 'pl',
'ref_currency': 'INR',
'ref_rate': 100
}
),
Document(
fielddata = {
'doctype': 'Item Tax',
'parentfield': 'item_tax',
'parenttype': 'Item',
'parent' : 'it',
'tax_type' : 'Tax1',
'tax_rate': 10
}
)
],
# Warehouse
#-----------------------------
'warehouse': [
Document(
fielddata = {
'doctype': 'Warehouse',
'name' : 'wh1',
'warehouse_name' : 'wh1',
'warehouse_type': 'normal',
'company': 'comp'
}
),
Document(
fielddata = {
'doctype': 'Warehouse',
'name' : 'wh2',
'warehouse_name' : 'wh2',
'warehouse_type': 'normal',
'company': 'comp'
}
)
]
}
# Save all master records
#----------------------------------
def create_master_records():
for m in master_groups.keys():
master_groups[m].save(1)
for m in main_masters.keys():
if type(main_masters[m]) == list:
for each in main_masters[m]:
each.save(1)
else:
main_masters[m].save(1)

102
sandbox/testdata/sle_data.py vendored Normal file
View File

@@ -0,0 +1,102 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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
# 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/>.
from __future__ import unicode_literals
from webnotes.model.doc import Document
# Existing SLE data
#---------------------------
sle = [
Document(
fielddata = {
'doctype': 'Stock Ledger Entry',
'name': 'sle1',
'posting_date': '2011-09-01',
'posting_time': '12:00',
'item_code': 'it',
'warehouse': 'wh1',
'actual_qty': 10,
'incoming_rate': 100,
'bin_aqat': 10,
'valuation_rate': 100,
'fcfs_stack': '',
'stock_value': 1000,
'is_cancelled': 'No'
}
),
Document(
fielddata = {
'doctype': 'Stock Ledger Entry',
'name': 'sle2',
'posting_date': '2011-09-01',
'posting_time': '12:00',
'item_code': 'it',
'warehouse': 'wh1',
'actual_qty': -5,
'incoming_rate': 100,
'bin_aqat': 5,
'valuation_rate': 100,
'fcfs_stack': '',
'stock_value': 500,
'is_cancelled': 'No'
}
),
Document(
fielddata = {
'doctype': 'Stock Ledger Entry',
'name': 'sle3',
'posting_date': '2011-09-10',
'posting_time': '15:00',
'item_code': 'it',
'warehouse': 'wh1',
'actual_qty': 20,
'incoming_rate': 200,
'bin_aqat': 25,
'valuation_rate': 180,
'fcfs_stack': '',
'stock_value': 4500,
'is_cancelled': 'No'
}
),
Document(
fielddata = {
'doctype': 'Stock Ledger Entry',
'name': 'sle4',
'posting_date': '2011-09-15',
'posting_time': '09:30',
'item_code': 'it',
'warehouse': 'wh1',
'actual_qty': -5,
'incoming_rate': 180,
'bin_aqat': 20,
'valuation_rate': 180,
'fcfs_stack': '',
'stock_value': 3600,
'is_cancelled': 'No'
}
)
]
bin = Document(
fielddata = {
'doctype': 'Bin',
'name': 'bin01',
'item_code': 'it',
'warehouse': 'wh1',
'actual_qty': 20,
}
)

153
sandbox/testdata/stock_entry.py vendored Normal file
View File

@@ -0,0 +1,153 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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
# 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/>.
from __future__ import unicode_literals
from webnotes.model.doc import Document
# Material Receipt
#-----------------------
mr = [
Document(
fielddata = {
'doctype': 'Stock Entry',
'posting_date': '2011-09-01',
'transfer_date': '2011-09-01',
'posting_time': '12:00',
'company': 'comp',
'fiscal_year' : '2011-2012',
'purpose': 'Material Receipt',
'name': 'mr'
}
),
Document(
fielddata ={
'doctype': 'Stock Entry Detail',
'parenttype': 'Stock Entry',
'parentfield' : 'mtn_details',
'parent' : 'mr',
'item_code' : 'it',
't_warehouse' : 'wh1',
'qty' : 10,
'transfer_qty' : 10,
'incoming_rate': 100,
'stock_uom': 'Nos',
'conversion_factor': 1,
'serial_no': 'srno1, srno2, srno3, srno4, srno5, srno6, srno7, srno8, srno9, srno10'
}
)
]
mr1 = [
Document(
fielddata = {
'doctype': 'Stock Entry',
'posting_date': '2011-09-01',
'transfer_date': '2011-09-01',
'posting_time': '12:00',
'company': 'comp',
'fiscal_year' : '2011-2012',
'purpose': 'Material Receipt',
'name': 'mr1'
}
),
Document(
fielddata ={
'doctype': 'Stock Entry Detail',
'parenttype': 'Stock Entry',
'parentfield' : 'mtn_details',
'parent' : 'mr1',
'item_code' : 'it',
't_warehouse' : 'wh1',
'qty' : 5,
'transfer_qty' : 5,
'incoming_rate': 400,
'stock_uom': 'Nos',
'conversion_factor': 1,
'serial_no': 'srno11, srno12, srno13, srno14, srno15'
}
)
]
# Material Transfer
#--------------------
mtn = [
Document(
fielddata = {
'doctype': 'Stock Entry',
'posting_date': '2011-09-01',
'transfer_date': '2011-09-01',
'posting_time': '12:00',
'company': 'comp',
'fiscal_year' : '2011-2012',
'purpose': 'Material Transfer',
'name': 'mtn'
}
),
Document(
fielddata ={
'doctype': 'Stock Entry Detail',
'parenttype': 'Stock Entry',
'parentfield' : 'mtn_details',
'parent' : 'mtn',
'item_code' : 'it',
's_warehouse' : 'wh1',
't_warehouse' : 'wh2',
'qty' : 5,
'transfer_qty' : 5,
'incoming_rate': 100,
'stock_uom': 'Nos',
'conversion_factor': 1,
'serial_no': 'srno1, srno2, srno3, srno4, srno5'
}
)
]
# Material Issue
#--------------------
mi = [
Document(
fielddata = {
'doctype': 'Stock Entry',
'posting_date': '2011-09-01',
'transfer_date': '2011-09-01',
'posting_time': '14:00',
'company': 'comp',
'fiscal_year' : '2011-2012',
'purpose': 'Material Issue',
'name': 'mi'
}
),
Document(
fielddata ={
'doctype': 'Stock Entry Detail',
'parenttype': 'Stock Entry',
'parentfield' : 'mtn_details',
'parent' : 'mi',
'item_code' : 'it',
's_warehouse' : 'wh1',
'qty' : 4,
'transfer_qty' : 4,
'incoming_rate': 100,
'stock_uom': 'Nos',
'conversion_factor': 1,
'serial_no': 'srno1, srno2, srno3, srno4'
}
)
]

60
sandbox/testdata/stock_reco.py vendored Normal file
View File

@@ -0,0 +1,60 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 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
# 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/>.
from __future__ import unicode_literals
from webnotes.model.doc import Document
# Stock Reconciliation
#---------------------------
sreco = Document(
fielddata = {
'doctype': 'Stock Reconciliation',
'name': 'sreco',
'reconciliation_date': '2011-09-08',
'reconciliation_time': '20:00',
}
)
# diff in both
csv_data1 = [
['Item', 'Warehouse', 'Quantity', 'Rate'],
['it', 'wh1', 20, 150]
]
# diff in qty, no rate
csv_data2 = [
['Item', 'Warehouse', 'Quantity'],
['it', 'wh1', 20]
]
# diff in rate, no qty
csv_data3 = [
['Item', 'Warehouse', 'Rate'],
['it', 'wh1', 200]
]
# diff in rate, same qty
csv_data4 = [
['Item', 'Warehouse', 'Quantity', 'Rate'],
['it', 'wh1', 5, 200]
]
# no diff
csv_data1 = [
['Item', 'Warehouse', 'Quantity', 'Rate'],
['it', 'wh1', 5, 100]
]