Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
bd0277f4d2
@ -20,8 +20,7 @@ class DocType(BuyingController):
|
|||||||
|
|
||||||
def is_item_table_empty(self, obj):
|
def is_item_table_empty(self, obj):
|
||||||
if not len(obj.doclist.get({"parentfield": obj.fname})):
|
if not len(obj.doclist.get({"parentfield": obj.fname})):
|
||||||
msgprint(_("Hey there! You need to put at least one item in \
|
msgprint(_("You need to put at least one item in the item table."), raise_exception=True)
|
||||||
the item table."), raise_exception=True)
|
|
||||||
|
|
||||||
def get_supplier_details(self, name = ''):
|
def get_supplier_details(self, name = ''):
|
||||||
details = sql("select supplier_name,address from `tabSupplier` where name = '%s' and docstatus != 2" %(name), as_dict = 1)
|
details = sql("select supplier_name,address from `tabSupplier` where name = '%s' and docstatus != 2" %(name), as_dict = 1)
|
||||||
|
@ -110,6 +110,11 @@ wn.module_page["Buying"] = [
|
|||||||
right: true,
|
right: true,
|
||||||
icon: "icon-list",
|
icon: "icon-list",
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
"label":wn._("Items To Be Requested"),
|
||||||
|
route: "query-report/Items To Be Requested",
|
||||||
|
doctype: "Item"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label":wn._("Requested Items To Be Ordered"),
|
"label":wn._("Requested Items To Be Ordered"),
|
||||||
route: "query-report/Requested Items To Be Ordered",
|
route: "query-report/Requested Items To Be Ordered",
|
||||||
|
@ -143,6 +143,12 @@ def get_item_details(item):
|
|||||||
def make_stock_entry(production_order_id, purpose):
|
def make_stock_entry(production_order_id, purpose):
|
||||||
production_order = webnotes.bean("Production Order", production_order_id)
|
production_order = webnotes.bean("Production Order", production_order_id)
|
||||||
|
|
||||||
|
# validate already existing
|
||||||
|
ste = webnotes.conn.get_value("Stock Entry", {
|
||||||
|
"production_order":production_order_id,
|
||||||
|
"purpose": purpose
|
||||||
|
}, "name")
|
||||||
|
|
||||||
stock_entry = webnotes.new_bean("Stock Entry")
|
stock_entry = webnotes.new_bean("Stock Entry")
|
||||||
stock_entry.doc.purpose = purpose
|
stock_entry.doc.purpose = purpose
|
||||||
stock_entry.doc.production_order = production_order_id
|
stock_entry.doc.production_order = production_order_id
|
||||||
|
@ -38,7 +38,8 @@ $.extend(erpnext, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setup_serial_no: function(grid_row) {
|
setup_serial_no: function(grid_row) {
|
||||||
if(grid_row.fields_dict.serial_no.get_status()!=="Write") return;
|
if(!grid_row.fields_dict.serial_no ||
|
||||||
|
grid_row.fields_dict.serial_no.get_status()!=="Write") return;
|
||||||
|
|
||||||
var $btn = $('<button class="btn btn-sm btn-default">Add Serial No</button>')
|
var $btn = $('<button class="btn btn-sm btn-default">Add Serial No</button>')
|
||||||
.appendTo($("<div>")
|
.appendTo($("<div>")
|
||||||
|
@ -51,10 +51,9 @@ class DocType(BuyingController):
|
|||||||
msgprint("You can raise indent of maximum qty: %s for item: %s against sales order: %s\n Anyway, you can add more qty in new row for the same item." % (actual_so_qty - already_indented, item, so_no), raise_exception=1)
|
msgprint("You can raise indent of maximum qty: %s for item: %s against sales order: %s\n Anyway, you can add more qty in new row for the same item." % (actual_so_qty - already_indented, item, so_no), raise_exception=1)
|
||||||
|
|
||||||
def validate_schedule_date(self):
|
def validate_schedule_date(self):
|
||||||
#:::::::: validate schedule date v/s indent date ::::::::::::
|
|
||||||
for d in getlist(self.doclist, 'indent_details'):
|
for d in getlist(self.doclist, 'indent_details'):
|
||||||
if d.schedule_date < self.doc.transaction_date:
|
if d.schedule_date < self.doc.transaction_date:
|
||||||
msgprint("Expected Schedule Date cannot be before Material Request Date")
|
msgprint("Expected Date cannot be before Material Request Date")
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
# Validate
|
# Validate
|
||||||
|
@ -20,6 +20,7 @@ sql = webnotes.conn.sql
|
|||||||
class NotUpdateStockError(webnotes.ValidationError): pass
|
class NotUpdateStockError(webnotes.ValidationError): pass
|
||||||
class StockOverReturnError(webnotes.ValidationError): pass
|
class StockOverReturnError(webnotes.ValidationError): pass
|
||||||
class IncorrectValuationRateError(webnotes.ValidationError): pass
|
class IncorrectValuationRateError(webnotes.ValidationError): pass
|
||||||
|
class DuplicateEntryForProductionOrderError(webnotes.ValidationError): pass
|
||||||
|
|
||||||
from controllers.stock_controller import StockController
|
from controllers.stock_controller import StockController
|
||||||
|
|
||||||
@ -146,21 +147,32 @@ class DocType(StockController):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if self.doc.purpose == "Manufacture/Repack":
|
if self.doc.purpose == "Manufacture/Repack":
|
||||||
if not flt(self.doc.fg_completed_qty):
|
# check for double entry
|
||||||
msgprint(_("Manufacturing Quantity") + _(" is mandatory"), raise_exception=1)
|
self.check_duplicate_entry_for_production_order()
|
||||||
|
|
||||||
if flt(pro_obj.doc.qty) < (flt(pro_obj.doc.produced_qty)
|
|
||||||
+ flt(self.doc.fg_completed_qty)):
|
|
||||||
# do not allow manufacture of qty > production order qty
|
|
||||||
msgprint(_("For Item ") + pro_obj.doc.production_item
|
|
||||||
+ _("Quantity already manufactured")
|
|
||||||
+ " = %s." % flt(pro_obj.doc.produced_qty)
|
|
||||||
+ _("Hence, maximum allowed Manufacturing Quantity")
|
|
||||||
+ " = %s." % (flt(pro_obj.doc.qty) - flt(pro_obj.doc.produced_qty)),
|
|
||||||
raise_exception=1)
|
|
||||||
elif self.doc.purpose != "Material Transfer":
|
elif self.doc.purpose != "Material Transfer":
|
||||||
self.doc.production_order = None
|
self.doc.production_order = None
|
||||||
|
|
||||||
|
def check_duplicate_entry_for_production_order(self):
|
||||||
|
other_ste = [t[0] for t in webnotes.conn.get_values("Stock Entry", {
|
||||||
|
"production_order": self.doc.production_order,
|
||||||
|
"purpose": self.doc.purpose,
|
||||||
|
"docstatus": ["!=", 2]
|
||||||
|
}, "name")]
|
||||||
|
|
||||||
|
if other_ste:
|
||||||
|
production_item, qty = webnotes.conn.get_value("Production Order",
|
||||||
|
self.doc.production_order, ["production_item", "qty"])
|
||||||
|
args = other_ste + [production_item]
|
||||||
|
fg_qty_already_entered = webnotes.conn.sql("""select sum(actual_qty)
|
||||||
|
from `tabStock Entry Detail`
|
||||||
|
where parent in (%s)
|
||||||
|
and item_code = %s
|
||||||
|
and ifnull(s_warehouse,'')='' """ % (", ".join(["%s" * len(other_ste)]), "%s"), args)[0][0]
|
||||||
|
|
||||||
|
if fg_qty_already_entered >= qty:
|
||||||
|
webnotes.throw(_("Stock Entries already created for Production Order ")
|
||||||
|
+ self.doc.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError)
|
||||||
|
|
||||||
def set_total_amount(self):
|
def set_total_amount(self):
|
||||||
self.doc.total_amount = sum([flt(item.amount) for item in self.doclist.get({"parentfield": "mtn_details"})])
|
self.doc.total_amount = sum([flt(item.amount) for item in self.doclist.get({"parentfield": "mtn_details"})])
|
||||||
|
|
||||||
|
@ -180,6 +180,11 @@ wn.module_page["Stock"] = [
|
|||||||
route: "query-report/Purchase Order Items To Be Received",
|
route: "query-report/Purchase Order Items To Be Received",
|
||||||
doctype: "Purchase Receipt"
|
doctype: "Purchase Receipt"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label":wn._("Item Shortage Report"),
|
||||||
|
route: "Report/Bin/Item Shortage Report",
|
||||||
|
doctype: "Purchase Receipt"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label":wn._("Serial No Service Contract Expiry"),
|
"label":wn._("Serial No Service Contract Expiry"),
|
||||||
route: "Report/Serial No/Serial No Service Contract Expiry",
|
route: "Report/Serial No/Serial No Service Contract Expiry",
|
||||||
|
0
stock/report/item_shortage_report/__init__.py
Normal file
0
stock/report/item_shortage_report/__init__.py
Normal file
22
stock/report/item_shortage_report/item_shortage_report.txt
Normal file
22
stock/report/item_shortage_report/item_shortage_report.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"creation": "2013-08-20 13:43:30",
|
||||||
|
"docstatus": 0,
|
||||||
|
"modified": "2013-08-20 13:46:15",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"owner": "Administrator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Report",
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
|
||||||
|
"name": "__common__",
|
||||||
|
"ref_doctype": "Bin",
|
||||||
|
"report_name": "Item Shortage Report",
|
||||||
|
"report_type": "Report Builder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Report",
|
||||||
|
"name": "Item Shortage Report"
|
||||||
|
}
|
||||||
|
]
|
0
stock/report/items_to_be_requested/__init__.py
Normal file
0
stock/report/items_to_be_requested/__init__.py
Normal file
22
stock/report/items_to_be_requested/items_to_be_requested.txt
Normal file
22
stock/report/items_to_be_requested/items_to_be_requested.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"creation": "2013-08-20 15:08:10",
|
||||||
|
"docstatus": 0,
|
||||||
|
"modified": "2013-08-20 15:10:43",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"owner": "Administrator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Report",
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"name": "__common__",
|
||||||
|
"query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Item:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabItem.is_purchase_item = \"Yes\"\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC",
|
||||||
|
"ref_doctype": "Item",
|
||||||
|
"report_name": "Items To Be Requested",
|
||||||
|
"report_type": "Query Report"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "Report",
|
||||||
|
"name": "Items To Be Requested"
|
||||||
|
}
|
||||||
|
]
|
@ -1,37 +1,50 @@
|
|||||||
Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
Table:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
Table:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
DocType:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
DocType:,Item,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-,Item Reorder,item_reorder,,,,-,UOM Conversion Detail,uom_conversion_details,,-,Item Supplier,item_supplier_details,,-,Item Customer Detail,item_customer_details,,-,Item Tax,item_tax,,-,Item Price,ref_rate_details,,,,-,Item Quality Inspection Parameter,item_specification_details,,-,Website Item Group,website_item_groups,-,Item Website Specification,item_website_specifications,
|
||||||
Column Labels:,ID,Item Name,Item Group,Default Unit of Measure,Description,Is Stock Item,Is Asset Item,Has Batch No,Has Serial No,Is Purchase Item,Is Sales Item,Is Service Item,Allow Samples,Inspection Required,Allow Bill of Materials,Allow Production Order,Is Sub Contracted Item,Document Numbering Series,Item Code,Brand,Barcode,Image,Description HTML,Default Warehouse,Allowance Percent,Valuation Method,Minimum Order Qty,Warranty Period (in days),End of Life,Net Weight,Weight UOM,Re-Order Level,Re-Order Qty,Default Supplier,Lead Time Days,Default Expense Account,Default Cost Center,Last Purchase Rate,Standard Rate,Manufacturer,Manufacturer Part Number,Max Discount (%),Default Income Account,Cost Center,Default BOM,Show in Website,Page Name,Weightage,Slideshow,Image,Website Warehouse,Website Description
|
Column Labels:,ID,Last Updated On,Item Name,Item Group,Default Unit of Measure,Description,Is Stock Item,Is Asset Item,Has Batch No,Has Serial No,Is Purchase Item,Is Sales Item,Is Service Item,Allow Samples,Inspection Required,Allow Bill of Materials,Allow Production Order,Is Sub Contracted Item,Document Numbering Series,Item Code,Brand,Barcode,Image,Description HTML,Default Warehouse,Allowance Percent,Valuation Method,Minimum Order Qty,Serial Number Series,Warranty Period (in days),End of Life,Net Weight,Weight UOM,Re-Order Level,Re-Order Qty,Default Supplier,Lead Time Days,Default Expense Account,Default Cost Center,Last Purchase Rate,Standard Rate,Manufacturer,Manufacturer Part Number,Max Discount (%),Default Income Account,Cost Center,Default BOM,Show in Website,Page Name,Weightage,Slideshow,Image,Website Warehouse,Website Description,-,ID,Warehouse,Re-order Level,Material Request Type,Re-order Qty,-,ID,UOM,Conversion Factor,-,ID,Supplier,Supplier Part Number,-,ID,Customer Name,Ref Code,-,ID,Tax,Tax Rate,-,ID,Price List Name,Ref Rate,Valid for Buying or Selling?,Currency,-,ID,Parameter,Acceptance Criteria,-,ID,Item Group,-,ID,Label,Description
|
||||||
Column Name:,name,item_name,item_group,stock_uom,description,is_stock_item,is_asset_item,has_batch_no,has_serial_no,is_purchase_item,is_sales_item,is_service_item,is_sample_item,inspection_required,is_manufactured_item,is_pro_applicable,is_sub_contracted_item,naming_series,item_code,brand,barcode,image,description_html,default_warehouse,tolerance,valuation_method,min_order_qty,warranty_period,end_of_life,net_weight,weight_uom,re_order_level,re_order_qty,default_supplier,lead_time_days,purchase_account,cost_center,last_purchase_rate,standard_rate,manufacturer,manufacturer_part_no,max_discount,default_income_account,default_sales_cost_center,default_bom,show_in_website,page_name,weightage,slideshow,website_image,website_warehouse,web_long_description
|
Column Name:,name,modified,item_name,item_group,stock_uom,description,is_stock_item,is_asset_item,has_batch_no,has_serial_no,is_purchase_item,is_sales_item,is_service_item,is_sample_item,inspection_required,is_manufactured_item,is_pro_applicable,is_sub_contracted_item,naming_series,item_code,brand,barcode,image,description_html,default_warehouse,tolerance,valuation_method,min_order_qty,serial_no_series,warranty_period,end_of_life,net_weight,weight_uom,re_order_level,re_order_qty,default_supplier,lead_time_days,purchase_account,cost_center,last_purchase_rate,standard_rate,manufacturer,manufacturer_part_no,max_discount,default_income_account,default_sales_cost_center,default_bom,show_in_website,page_name,weightage,slideshow,website_image,website_warehouse,web_long_description,-,name,warehouse,warehouse_reorder_level,material_request_type,warehouse_reorder_qty,-,name,uom,conversion_factor,-,name,supplier,supplier_part_no,-,name,customer_name,ref_code,-,name,tax_type,tax_rate,-,name,price_list,ref_rate,buying_or_selling,ref_currency,-,name,specification,value,-,name,item_group,-,name,label,description
|
||||||
Mandatory:,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No
|
Mandatory:,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,-,Yes,Yes,Yes,Yes,No,-,Yes,No,No,-,Yes,No,No,-,Yes,Yes,Yes,-,Yes,Yes,No,-,Yes,Yes,Yes,Yes,No,-,Yes,Yes,No,-,Yes,No,-,Yes,No,No
|
||||||
Type:,Data (text),Data,Link,Link,Small Text,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Data,Link,Data,Select,Small Text,Link,Float,Select,Float,Data,Date,Float,Link,Float,Float,Link,Int,Link,Link,Float,Float,Data,Data,Float,Link,Link,Link,Check,Data,Int,Link,Select,Link,Text Editor
|
Type:,Data (text),Data,Data,Link,Link,Small Text,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Select,Data,Link,Data,Select,Small Text,Link,Float,Select,Float,Data,Data,Date,Float,Link,Float,Float,Link,Int,Link,Link,Float,Float,Data,Data,Float,Link,Link,Link,Check,Data,Int,Link,Select,Link,Text Editor,-,Data,Link,Float,Select,Float,-,Data,Link,Float,-,Data,Link,Data,-,Data,Link,Data,-,Data,Link,Float,-,Data,Link,Currency,Select,Link,-,Data,Data,Data,-,Data,Link,-,Data,Data,Text
|
||||||
Info:,,,Valid Item Group,Valid UOM,,"One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No",One of: ITEM,,Valid Brand,,One of: attach_files:,,Valid Warehouse,,"One of: FIFO, Moving Average",,,,,Valid UOM,,,Valid Supplier,Integer,Valid Account,Valid Cost Center,,,,,,Valid Account,Valid Cost Center,Valid BOM,0 or 1,,Integer,Valid Website Slideshow,One of: attach_files:,Valid Warehouse,
|
Info:,,Don't change!,,Valid Item Group,Valid UOM,,"One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No","One of: Yes, No",One of: ITEM,,Valid Brand,,One of: attach_files:,,Valid Warehouse,,"One of: FIFO, Moving Average",,,,,,Valid UOM,,,Valid Supplier,Integer,Valid Account,Valid Cost Center,,,,,,Valid Account,Valid Cost Center,Valid BOM,0 or 1,,Integer,Valid Website Slideshow,One of: attach_files:,Valid Warehouse,,-,Leave blank for new records,Valid Warehouse,,"One of: Purchase, Transfer",,-,Leave blank for new records,Valid UOM,,-,Leave blank for new records,Valid Supplier,,-,Leave blank for new records,Valid Customer,,-,Leave blank for new records,Valid Account,,-,Leave blank for new records,Valid Price List,,"One of: Buying, Selling",Valid Currency,-,Leave blank for new records,,,-,Leave blank for new records,Valid Item Group,-,Leave blank for new records,,
|
||||||
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
,Base Bearing Plate,Base Bearing Plate,Raw Material,Nos,1/4 in. x 6 in. x 6 in. Mild Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Base Bearing Plate,,,,,Stores - WP,,,,,,,,,,Eagle Hardware,,,,,,,,,,,,,,,,,,
|
,Base Bearing Plate,"""2013-08-20 11:11:53""",Base Bearing Plate,Raw Material,Nos,1/4 in. x 6 in. x 6 in. Mild Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Base Bearing Plate,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,15.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00001,Nos,1.0,,,,,,,,,,,,,,RFD/00001,Standard Buying,15.0,Buying,USD,,,,,,,,,,,
|
||||||
,Base Plate,Base Plate,Raw Material,Nos,3/4 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Base Plate,,,,,Stores - WP,,,,,,,,,,HomeBase,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00017,Standard Selling,21.0,Selling,USD,,,,,,,,,,,
|
||||||
,Bearing Assembly,Bearing Assembly,Sub Assemblies,Nos,Bearing Assembly,Yes,No,No,No,No,Yes,No,No,No,Yes,Yes,No,,Bearing Assembly,,,,,Stores - WP,,,0.0,,,,,,,Asiatic Solutions,,,,,,,,,,,,,,,,,,
|
,Base Plate,"""2013-08-20 11:11:53""",Base Plate,Raw Material,Nos,3/4 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Base Plate,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,20.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00002,Nos,1.0,,,,,,,,,,,,,,RFD/00002,Standard Buying,20.0,Buying,USD,,,,,,,,,,,
|
||||||
,Bearing Block,Bearing Block,Raw Material,Nos,"CAST IRON, MCMASTER PART NO. 3710T13",Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Bearing Block,,,,,Stores - WP,,,,,,,,,,Nan Duskin,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00018,Standard Selling,28.0,Selling,USD,,,,,,,,,,,
|
||||||
,Bearing Collar,Bearing Collar,Raw Material,Nos,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Bearing Collar,,,,,Stores - WP,,,,,,,,,,Eagle Hardware,,,,,,,,,,,,,,,,,,
|
,Bearing Assembly,"""2013-08-20 11:11:55""",Bearing Assembly,Sub Assemblies,Nos,Bearing Assembly,Yes,No,No,No,No,Yes,No,No,No,Yes,Yes,No,,Bearing Assembly,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Asiatic Solutions,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00003,Nos,1.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
,Bearing Pipe,Bearing Pipe,Raw Material,Nos,1.5 in. Diameter x 36 in. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Bearing Pipe,,,,,Stores - WP,,,,,,,,,,HomeBase,,,,,,,,,,,,,,,,,,
|
,Bearing Block,"""2013-08-20 11:11:54""",Bearing Block,Raw Material,Nos,"CAST IRON, MCMASTER PART NO. 3710T13",Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Bearing Block,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Nan Duskin,0,,,10.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00004,Nos,1.0,,,,,,,,,,,,,,RFD/00003,Standard Buying,10.0,Buying,USD,,,,,,,,,,,
|
||||||
,Blade Rib,Blade Rib,Raw Material,Nos,1/2 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Blade Rib,,,,,Stores - WP,,,,,,,,,,Ks Merchandise,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00019,Standard Selling,14.0,Selling,USD,,,,,,,,,,,
|
||||||
,Disc Collars,Disc Collars,Raw Material,Nos,For Upper Bearing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Disc Collars,,,,,Stores - WP,,,,,,,,,,Asiatic Solutions,,,,,,,,,,,,,,,,,,
|
,Bearing Collar,"""2013-08-20 11:11:54""",Bearing Collar,Raw Material,Nos,1 in. x 3 in. x 1 ft. Multipurpose Al Alloy Bar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Bearing Collar,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,20.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00005,Nos,1.0,,,,,,,,,,,,,,RFD/00004,Standard Buying,20.0,Buying,USD,,,,,,,,,,,
|
||||||
,External Disc,External Disc,Raw Material,Nos,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,External Disc,,,,,Stores - WP,,,,,,,,,,HomeBase,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00020,Standard Selling,28.0,Selling,USD,,,,,,,,,,,
|
||||||
,Internal Disc,Internal Disc,Raw Material,Nos,For Bearing Collar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Internal Disc,,,,,Stores - WP,,,,,,,,,,HomeBase,,,,,,,,,,,,,,,,,,
|
,Bearing Pipe,"""2013-08-20 11:11:54""",Bearing Pipe,Raw Material,Nos,1.5 in. Diameter x 36 in. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Bearing Pipe,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,15.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00006,Nos,1.0,,,,,,,,,,,,,,RFD/00005,Standard Buying,15.0,Buying,USD,,,,,,,,,,,
|
||||||
,Shaft,Shaft,Raw Material,Nos,1.25 in. Diameter x 6 ft. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Shaft,,,,,Stores - WP,,,,,,,,,,Eagle Hardware,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00021,Standard Selling,21.0,Selling,USD,,,,,,,,,,,
|
||||||
,Stand,Stand,Raw Material,Nos,N/A,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Stand,,,,,Stores - WP,,,,,,,,,,Scott Ties,,,,,,,,,,,,,,,,,,
|
,Blade Rib,"""2013-08-20 11:11:54""",Blade Rib,Raw Material,Nos,1/2 in. x 2 ft. x 4 ft. Pine Plywood,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Blade Rib,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Ks Merchandise,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00007,Nos,1.0,,,,,,,,,,,,,,RFD/00006,Standard Buying,10.0,Buying,USD,,,,,,,,,,,
|
||||||
,Upper Bearing Plate,Upper Bearing Plate,Raw Material,Nos,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Upper Bearing Plate,,,,,Stores - WP,,,,,,,,,,Eagle Hardware,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00022,Standard Selling,14.0,Selling,USD,,,,,,,,,,,
|
||||||
,Wind Mill A Series,Wind Mill A Series,Products,Nos,Wind Mill A Series for Home Use 9ft,Yes,No,No,Yes,Yes,Yes,Yes,No,No,Yes,Yes,No,,Wind Mill A Series,,,,,Finished Goods - WP,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
,Disc Collars,"""2013-08-20 11:11:54""",Disc Collars,Raw Material,Nos,For Upper Bearing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Disc Collars,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Asiatic Solutions,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00008,Nos,1.0,,,,,,,,,,,,,,RFD/00007,Standard Buying,74.0,Buying,USD,,,,,,,,,,,
|
||||||
,Wind MIll C Series,Wind MIll C Series,Products,Nos,Wind Mill C Series for Commercial Use 18ft,Yes,No,No,Yes,Yes,Yes,Yes,No,No,Yes,Yes,No,,Wind MIll C Series,,,,,Finished Goods - WP,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00023,Standard Selling,103.6,Selling,USD,,,,,,,,,,,
|
||||||
,Wind Turbine,Wind Turbine,Products,Nos,Small Wind Turbine for Home Use,Yes,No,No,No,Yes,Yes,Yes,No,No,Yes,Yes,No,,Wind Turbine,,,,,Finished Goods - WP,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
,External Disc,"""2013-08-20 11:11:54""",External Disc,Raw Material,Nos,15/32 in. x 4 ft. x 8 ft. 3-Ply Rtd Sheathing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,External Disc,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,45.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00009,Nos,1.0,,,,,,,,,,,,,,RFD/00008,Standard Buying,45.0,Buying,USD,,,,,,,,,,,
|
||||||
,Wing Sheet,Wing Sheet,Raw Material,Nos,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Wing Sheet,,,,,Stores - WP,,,,,,,,,,New World Realty,,,,,,,,,,,,,,,,,,
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00024,Standard Selling,63.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Internal Disc,"""2013-08-20 11:11:54""",Internal Disc,Raw Material,Nos,For Bearing Collar,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Internal Disc,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,HomeBase,0,,,33.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00010,Nos,1.0,,,,,,,,,,,,,,RFD/00009,Standard Buying,33.0,Buying,USD,,,,,,,,,,,
|
||||||
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00025,Standard Selling,46.2,Selling,USD,,,,,,,,,,,
|
||||||
|
,Shaft,"""2013-08-20 11:11:54""",Shaft,Raw Material,Nos,1.25 in. Diameter x 6 ft. Mild Steel Tubing,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Shaft,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,30.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00011,Nos,1.0,,,,,,,,,,,,,,RFD/00010,Standard Buying,30.0,Buying,USD,,,,,,,,,,,
|
||||||
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00026,Standard Selling,42.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Stand,"""2013-08-20 11:11:54""",Stand,Raw Material,Nos,N/A,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Stand,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Scott Ties,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00012,Nos,1.0,,,,,,,,,,,,,,RFD/00011,Standard Buying,40.0,Buying,USD,,,,,,,,,,,
|
||||||
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00027,Standard Selling,56.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Upper Bearing Plate,"""2013-08-20 11:11:54""",Upper Bearing Plate,Raw Material,Nos,3/16 in. x 6 in. x 6 in. Low Carbon Steel Plate,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Upper Bearing Plate,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,Eagle Hardware,0,,,50.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00013,Nos,1.0,,,,,,,,,,,,,,RFD/00012,Standard Buying,50.0,Buying,USD,,,,,,,,,,,
|
||||||
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00028,Standard Selling,70.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Wind Mill A Series,"""2013-08-20 11:27:46""",Wind Mill A Series,Products,Nos,Wind Mill A Series for Home Use 9ft,Yes,No,No,Yes,No,Yes,Yes,No,No,Yes,Yes,No,,Wind Mill A Series,,,,,Finished Goods - WP,0.0,,0.0,WMA,,,0.0,,0.0,0.0,,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00014,Nos,1.0,,,,,,,,,,,,,,RFD/00015,Standard Selling,340.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Wind MIll C Series,"""2013-08-20 11:27:27""",Wind MIll C Series,Products,Nos,Wind Mill C Series for Commercial Use 18ft,Yes,No,No,Yes,No,Yes,Yes,No,No,Yes,Yes,No,,Wind MIll C Series,,,,,Finished Goods - WP,0.0,,0.0,WMC,,,0.0,,0.0,0.0,,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00015,Nos,1.0,,,,,,,,,,,,,,RFD/00016,Standard Selling,400.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Wind Turbine,"""2013-08-20 11:29:26""",Wind Turbine,Products,Nos,Small Wind Turbine for Home Use,Yes,No,No,Yes,No,Yes,Yes,No,No,Yes,Yes,No,,Wind Turbine,,,,,Finished Goods - WP,0.0,,0.0,WTU,,,0.0,,0.0,0.0,,0,,,0.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00016,Nos,1.0,,,,,,,,,,,,,,RFD/00014,Standard Selling,300.0,Selling,USD,,,,,,,,,,,
|
||||||
|
,Wing Sheet,"""2013-08-20 11:11:55""",Wing Sheet,Raw Material,Nos,1/32 in. x 24 in. x 47 in. HDPE Opaque Sheet,Yes,No,No,No,Yes,Yes,Yes,No,No,No,No,No,,Wing Sheet,,,,,Stores - WP,0.0,,0.0,,,,0.0,,0.0,0.0,New World Realty,0,,,22.0,0.0,,,0.0,,,,0,,0,,,,,,,,,,,,UCDD/00017,Nos,1.0,,,,,,,,,,,,,,RFD/00013,Standard Buying,22.0,Buying,USD,,,,,,,,,,,
|
||||||
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RFD/00029,Standard Selling,30.8,Selling,USD,,,,,,,,,,,
|
|
@ -14,14 +14,15 @@ from core.page.data_import_tool.data_import_tool import upload
|
|||||||
# fix fiscal year
|
# fix fiscal year
|
||||||
|
|
||||||
company = "Wind Power LLC"
|
company = "Wind Power LLC"
|
||||||
|
country = "United States"
|
||||||
|
currency = "USD"
|
||||||
|
time_zone = "America/New York"
|
||||||
start_date = '2010-01-01'
|
start_date = '2010-01-01'
|
||||||
runs_for = 20
|
runs_for = 20
|
||||||
prob = {
|
prob = {
|
||||||
"Quotation": { "make": 0.5, "qty": (1,5) },
|
"default": { "make": 0.6, "qty": (1,5) },
|
||||||
"Sales Order": { "make": 0.5, "qty": (1,4) },
|
"Purchase Order": { "make": 0.7, "qty": (1,15) },
|
||||||
"Purchase Order": { "make": 0.7, "qty": (1,4) },
|
"Purchase Receipt": { "make": 0.7, "qty": (1,15) },
|
||||||
"Purchase Receipt": { "make": 0.7, "qty": (1,4) },
|
|
||||||
"Supplier Quotation": { "make": 0.5, "qty": (1, 3) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def make(reset=False):
|
def make(reset=False):
|
||||||
@ -46,12 +47,18 @@ def setup():
|
|||||||
def simulate():
|
def simulate():
|
||||||
current_date = None
|
current_date = None
|
||||||
for i in xrange(runs_for):
|
for i in xrange(runs_for):
|
||||||
print i
|
|
||||||
if not current_date:
|
if not current_date:
|
||||||
current_date = webnotes.utils.getdate(start_date)
|
# get last stock ledger posting date or use default
|
||||||
|
last_posting = webnotes.conn.sql("""select max(posting_date) from `tabStock Ledger Entry`""")
|
||||||
|
if last_posting[0][0]:
|
||||||
|
current_date = webnotes.utils.add_days(last_posting[0][0], 1)
|
||||||
|
else:
|
||||||
|
current_date = webnotes.utils.getdate(start_date)
|
||||||
else:
|
else:
|
||||||
current_date = webnotes.utils.add_days(current_date, 1)
|
current_date = webnotes.utils.add_days(current_date, 1)
|
||||||
|
|
||||||
|
print current_date.strftime("%Y-%m-%d")
|
||||||
|
|
||||||
if current_date.weekday() in (5, 6):
|
if current_date.weekday() in (5, 6):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -85,17 +92,48 @@ def run_stock(current_date):
|
|||||||
# make delivery notes (if possible)
|
# make delivery notes (if possible)
|
||||||
if can_make("Delivery Note"):
|
if can_make("Delivery Note"):
|
||||||
from selling.doctype.sales_order.sales_order import make_delivery_note
|
from selling.doctype.sales_order.sales_order import make_delivery_note
|
||||||
|
from stock.stock_ledger import NegativeStockError
|
||||||
|
from stock.doctype.stock_ledger_entry.stock_ledger_entry import SerialNoRequiredError, SerialNoQtyError
|
||||||
report = "Ordered Items To Be Delivered"
|
report = "Ordered Items To Be Delivered"
|
||||||
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Delivery Note")]:
|
for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Delivery Note")]:
|
||||||
dn = webnotes.bean(make_delivery_note(so))
|
dn = webnotes.bean(make_delivery_note(so))
|
||||||
dn.doc.posting_date = current_date
|
dn.doc.posting_date = current_date
|
||||||
dn.doc.fiscal_year = "2010"
|
dn.doc.fiscal_year = "2010"
|
||||||
dn.insert()
|
dn.insert()
|
||||||
dn.submit()
|
try:
|
||||||
webnotes.conn.commit()
|
dn.submit()
|
||||||
|
webnotes.conn.commit()
|
||||||
|
except NegativeStockError: pass
|
||||||
|
except SerialNoRequiredError: pass
|
||||||
|
except SerialNoQtyError: pass
|
||||||
|
|
||||||
|
# try submitting existing
|
||||||
|
for dn in webnotes.conn.get_values("Delivery Note", {"docstatus": 0}, "name"):
|
||||||
|
b = webnotes.bean("Delivery Note", dn[0])
|
||||||
|
b.submit()
|
||||||
|
webnotes.conn.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run_purchase(current_date):
|
def run_purchase(current_date):
|
||||||
|
# make material requests for purchase items that have negative projected qtys
|
||||||
|
if can_make("Material Request"):
|
||||||
|
report = "Items To Be Requested"
|
||||||
|
for row in query_report.run(report)["result"][:how_many("Material Request")]:
|
||||||
|
mr = webnotes.new_bean("Material Request")
|
||||||
|
mr.doc.material_request_type = "Purchase"
|
||||||
|
mr.doc.transaction_date = current_date
|
||||||
|
mr.doc.fiscal_year = "2010"
|
||||||
|
mr.doclist.append({
|
||||||
|
"doctype": "Material Request Item",
|
||||||
|
"parentfield": "indent_details",
|
||||||
|
"schedule_date": webnotes.utils.add_days(current_date, 7),
|
||||||
|
"item_code": row[0],
|
||||||
|
"qty": -row[-1]
|
||||||
|
})
|
||||||
|
mr.insert()
|
||||||
|
mr.submit()
|
||||||
|
|
||||||
# make supplier quotations
|
# make supplier quotations
|
||||||
if can_make("Supplier Quotation"):
|
if can_make("Supplier Quotation"):
|
||||||
from stock.doctype.material_request.material_request import make_supplier_quotation
|
from stock.doctype.material_request.material_request import make_supplier_quotation
|
||||||
@ -124,7 +162,7 @@ def run_purchase(current_date):
|
|||||||
|
|
||||||
def run_manufacturing(current_date):
|
def run_manufacturing(current_date):
|
||||||
from stock.stock_ledger import NegativeStockError
|
from stock.stock_ledger import NegativeStockError
|
||||||
from stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError
|
from stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError, DuplicateEntryForProductionOrderError
|
||||||
|
|
||||||
ppt = webnotes.bean("Production Planning Tool", "Production Planning Tool")
|
ppt = webnotes.bean("Production Planning Tool", "Production Planning Tool")
|
||||||
ppt.doc.company = company
|
ppt.doc.company = company
|
||||||
@ -137,14 +175,14 @@ def run_manufacturing(current_date):
|
|||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
# submit production orders
|
# submit production orders
|
||||||
for pro in webnotes.conn.get_values("Production Order", {"docstatus": 0}):
|
for pro in webnotes.conn.get_values("Production Order", {"docstatus": 0}, "name"):
|
||||||
b = webnotes.bean("Production Order", pro[0])
|
b = webnotes.bean("Production Order", pro[0])
|
||||||
b.doc.wip_warehouse = "Work in Progress - WP"
|
b.doc.wip_warehouse = "Work in Progress - WP"
|
||||||
b.submit()
|
b.submit()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
# submit material requests
|
# submit material requests
|
||||||
for pro in webnotes.conn.get_values("Material Request", {"docstatus": 0}):
|
for pro in webnotes.conn.get_values("Material Request", {"docstatus": 0}, "name"):
|
||||||
b = webnotes.bean("Material Request", pro[0])
|
b = webnotes.bean("Material Request", pro[0])
|
||||||
b.submit()
|
b.submit()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
@ -160,31 +198,32 @@ def run_manufacturing(current_date):
|
|||||||
make_stock_entry_from_pro(pro[0], "Manufacture/Repack", current_date)
|
make_stock_entry_from_pro(pro[0], "Manufacture/Repack", current_date)
|
||||||
|
|
||||||
# try posting older drafts (if exists)
|
# try posting older drafts (if exists)
|
||||||
for st in webnotes.conn.get_values("Stock Entry", {"docstatus":0}):
|
for st in webnotes.conn.get_values("Stock Entry", {"docstatus":0}, "name"):
|
||||||
try:
|
try:
|
||||||
webnotes.bean("Stock Entry", st[0]).submit()
|
webnotes.bean("Stock Entry", st[0]).submit()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
except NegativeStockError: pass
|
except NegativeStockError: pass
|
||||||
except IncorrectValuationRateError: pass
|
except IncorrectValuationRateError: pass
|
||||||
|
except DuplicateEntryForProductionOrderError: pass
|
||||||
|
|
||||||
def make_stock_entry_from_pro(pro_id, purpose, current_date):
|
def make_stock_entry_from_pro(pro_id, purpose, current_date):
|
||||||
from manufacturing.doctype.production_order.production_order import make_stock_entry
|
from manufacturing.doctype.production_order.production_order import make_stock_entry
|
||||||
from stock.stock_ledger import NegativeStockError
|
from stock.stock_ledger import NegativeStockError
|
||||||
from stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError
|
from stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError, DuplicateEntryForProductionOrderError
|
||||||
|
|
||||||
st = webnotes.bean(make_stock_entry(pro_id, purpose))
|
st = webnotes.bean(make_stock_entry(pro_id, purpose))
|
||||||
st.run_method("get_items")
|
|
||||||
st.doc.posting_date = current_date
|
st.doc.posting_date = current_date
|
||||||
st.doc.fiscal_year = "2010"
|
st.doc.fiscal_year = "2010"
|
||||||
st.doc.expense_adjustment_account = "Stock in Hand - WP"
|
st.doc.expense_adjustment_account = "Stock in Hand - WP"
|
||||||
try:
|
try:
|
||||||
|
st.run_method("get_items")
|
||||||
st.insert()
|
st.insert()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
st.submit()
|
st.submit()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
except NegativeStockError: pass
|
except NegativeStockError: pass
|
||||||
except IncorrectValuationRateError: pass
|
except IncorrectValuationRateError: pass
|
||||||
|
except DuplicateEntryForProductionOrderError: pass
|
||||||
|
|
||||||
def make_quotation(current_date):
|
def make_quotation(current_date):
|
||||||
b = webnotes.bean([{
|
b = webnotes.bean([{
|
||||||
@ -253,10 +292,10 @@ def get_random(doctype, filters=None):
|
|||||||
return out and out[0][0] or None
|
return out and out[0][0] or None
|
||||||
|
|
||||||
def can_make(doctype):
|
def can_make(doctype):
|
||||||
return random.random() < prob.get(doctype, {"make": 0.5})["make"]
|
return random.random() < prob.get(doctype, prob["default"])["make"]
|
||||||
|
|
||||||
def how_many(doctype):
|
def how_many(doctype):
|
||||||
return random.randrange(*prob.get(doctype, {"qty": (1, 3)})["qty"])
|
return random.randrange(*prob.get(doctype, prob["default"])["qty"])
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
print "Creating Fresh Database..."
|
print "Creating Fresh Database..."
|
||||||
@ -273,15 +312,15 @@ def complete_setup():
|
|||||||
"industry": "Manufacturing",
|
"industry": "Manufacturing",
|
||||||
"company_name": company,
|
"company_name": company,
|
||||||
"company_abbr": "WP",
|
"company_abbr": "WP",
|
||||||
"currency": "USD",
|
"currency": currency,
|
||||||
"timezone": "America/New York",
|
"timezone": time_zone,
|
||||||
"country": "United States"
|
"country": country
|
||||||
})
|
})
|
||||||
|
|
||||||
import_data("Fiscal_Year")
|
import_data("Fiscal_Year")
|
||||||
|
|
||||||
def make_items():
|
def make_items():
|
||||||
import_data(["Item", "Item_Price"])
|
import_data("Item")
|
||||||
import_data("BOM", submit=True)
|
import_data("BOM", submit=True)
|
||||||
|
|
||||||
def make_customers_suppliers_contacts():
|
def make_customers_suppliers_contacts():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user