mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
[enhancement] Int, Currency, Float, Percent as not null and default to 0
This commit is contained in:
@@ -39,12 +39,12 @@ def load_country_and_currency(bootinfo):
|
||||
bootinfo.docs += [frappe.get_doc("Country", country)]
|
||||
|
||||
bootinfo.docs += frappe.db.sql("""select * from tabCurrency
|
||||
where ifnull(enabled,0)=1""", as_dict=1, update={"doctype":":Currency"})
|
||||
where enabled=1""", as_dict=1, update={"doctype":":Currency"})
|
||||
|
||||
def get_letter_heads():
|
||||
import frappe
|
||||
ret = frappe.db.sql("""select name, content from `tabLetter Head`
|
||||
where ifnull(disabled,0)=0""")
|
||||
where disabled=0""")
|
||||
return dict(ret)
|
||||
|
||||
def update_page_info(bootinfo):
|
||||
|
||||
@@ -78,7 +78,7 @@ data_map = {
|
||||
"Stock Ledger Entry": {
|
||||
"columns": ["name", "posting_date", "posting_time", "item_code", "warehouse",
|
||||
"actual_qty as qty", "voucher_type", "voucher_no", "project",
|
||||
"ifnull(incoming_rate,0) as incoming_rate", "stock_uom", "serial_no",
|
||||
"incoming_rate as incoming_rate", "stock_uom", "serial_no",
|
||||
"qty_after_transaction", "valuation_rate"],
|
||||
"order_by": "posting_date, posting_time, name",
|
||||
"links": {
|
||||
@@ -100,10 +100,10 @@ data_map = {
|
||||
},
|
||||
"Production Order": {
|
||||
"columns": ["name", "production_item as item_code",
|
||||
"(ifnull(qty, 0) - ifnull(produced_qty, 0)) as qty",
|
||||
"(qty - produced_qty) as qty",
|
||||
"fg_warehouse as warehouse"],
|
||||
"conditions": ["docstatus=1", "status != 'Stopped'", "ifnull(fg_warehouse, '')!=''",
|
||||
"ifnull(qty, 0) > ifnull(produced_qty, 0)"],
|
||||
"qty > produced_qty"],
|
||||
"links": {
|
||||
"item_code": ["Item", "name"],
|
||||
"warehouse": ["Warehouse", "name"]
|
||||
@@ -111,10 +111,10 @@ data_map = {
|
||||
},
|
||||
"Material Request Item": {
|
||||
"columns": ["item.name as name", "item_code", "warehouse",
|
||||
"(ifnull(qty, 0) - ifnull(ordered_qty, 0)) as qty"],
|
||||
"(qty - ordered_qty) as qty"],
|
||||
"from": "`tabMaterial Request Item` item, `tabMaterial Request` main",
|
||||
"conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
|
||||
"ifnull(warehouse, '')!=''", "ifnull(qty, 0) > ifnull(ordered_qty, 0)"],
|
||||
"ifnull(warehouse, '')!=''", "qty > ordered_qty"],
|
||||
"links": {
|
||||
"item_code": ["Item", "name"],
|
||||
"warehouse": ["Warehouse", "name"]
|
||||
@@ -122,10 +122,10 @@ data_map = {
|
||||
},
|
||||
"Purchase Order Item": {
|
||||
"columns": ["item.name as name", "item_code", "warehouse",
|
||||
"(ifnull(qty, 0) - ifnull(received_qty, 0)) as qty"],
|
||||
"(qty - received_qty) as qty"],
|
||||
"from": "`tabPurchase Order Item` item, `tabPurchase Order` main",
|
||||
"conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
|
||||
"ifnull(warehouse, '')!=''", "ifnull(qty, 0) > ifnull(received_qty, 0)"],
|
||||
"ifnull(warehouse, '')!=''", "qty > received_qty"],
|
||||
"links": {
|
||||
"item_code": ["Item", "name"],
|
||||
"warehouse": ["Warehouse", "name"]
|
||||
@@ -133,10 +133,10 @@ data_map = {
|
||||
},
|
||||
|
||||
"Sales Order Item": {
|
||||
"columns": ["item.name as name", "item_code", "(ifnull(qty, 0) - ifnull(delivered_qty, 0)) as qty", "warehouse"],
|
||||
"columns": ["item.name as name", "item_code", "(qty - delivered_qty) as qty", "warehouse"],
|
||||
"from": "`tabSales Order Item` item, `tabSales Order` main",
|
||||
"conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
|
||||
"ifnull(warehouse, '')!=''", "ifnull(qty, 0) > ifnull(delivered_qty, 0)"],
|
||||
"ifnull(warehouse, '')!=''", "qty > delivered_qty"],
|
||||
"links": {
|
||||
"item_code": ["Item", "name"],
|
||||
"warehouse": ["Warehouse", "name"]
|
||||
|
||||
Reference in New Issue
Block a user