Example #1
0
	def validate(self):
		previous_auto_inventory_accounting = cint(webnotes.conn.get_value("Global Defaults", None,
			"auto_inventory_accounting"))
		if cint(self.doc.auto_inventory_accounting) != previous_auto_inventory_accounting:
			from accounts.utils import create_stock_in_hand_jv
			create_stock_in_hand_jv(reverse = \
				cint(self.doc.auto_inventory_accounting) < previous_auto_inventory_accounting)
Example #2
0
	def make_adjustment_jv_for_auto_inventory(self):
		previous_auto_inventory_accounting = cint(webnotes.conn.get_value("Accounts Settings", 
			None, "auto_inventory_accounting"))
		if cint(self.doc.auto_inventory_accounting) != previous_auto_inventory_accounting:
			from accounts.utils import create_stock_in_hand_jv
			create_stock_in_hand_jv(reverse = \
				cint(self.doc.auto_inventory_accounting) < previous_auto_inventory_accounting)
 def make_adjustment_jv_for_auto_inventory(self):
     previous_auto_inventory_accounting = cint(
         webnotes.conn.get_value("Accounts Settings", None,
                                 "auto_inventory_accounting"))
     if cint(self.doc.auto_inventory_accounting
             ) != previous_auto_inventory_accounting:
         from accounts.utils import create_stock_in_hand_jv
         create_stock_in_hand_jv(reverse = \
          cint(self.doc.auto_inventory_accounting) < previous_auto_inventory_accounting)
Example #4
0
 def validate(self):
     previous_auto_inventory_accounting = cint(
         webnotes.conn.get_value("Global Defaults", None,
                                 "auto_inventory_accounting"))
     if cint(self.doc.auto_inventory_accounting
             ) != previous_auto_inventory_accounting:
         from accounts.utils import create_stock_in_hand_jv
         create_stock_in_hand_jv(reverse = \
          cint(self.doc.auto_inventory_accounting) < previous_auto_inventory_accounting)
Example #5
0
def execute():
    webnotes.conn.auto_commit_on_many_writes = True

    aii_enabled = cint(
        webnotes.conn.get_value("Global Defaults", None,
                                "auto_inventory_accounting"))

    if aii_enabled:
        create_stock_in_hand_jv(reverse=True)

    webnotes.conn.sql("""update `tabPurchase Invoice Item` pi_item 
		set conversion_factor = (select ifnull(if(conversion_factor=0, 1, conversion_factor), 1) 
			from `tabUOM Conversion Detail` 
			where parent = pi_item.item_code and uom = pi_item.uom limit 1
		)
		where ifnull(conversion_factor, 0)=0""")

    if aii_enabled:
        create_stock_in_hand_jv()

    webnotes.conn.auto_commit_on_many_writes = False
def execute():
	webnotes.conn.auto_commit_on_many_writes = True
	
	aii_enabled = cint(webnotes.conn.get_value("Global Defaults", None, 
		"auto_inventory_accounting"))
	
	if aii_enabled:
		create_stock_in_hand_jv(reverse = True)
	
	webnotes.conn.sql("""update `tabPurchase Invoice Item` pi_item 
		set conversion_factor = (select ifnull(if(conversion_factor=0, 1, conversion_factor), 1) 
			from `tabUOM Conversion Detail` 
			where parent = pi_item.item_code and uom = pi_item.uom limit 1
		)
		where ifnull(conversion_factor, 0)=0""")
	
	if aii_enabled:
		create_stock_in_hand_jv()
	
	webnotes.conn.auto_commit_on_many_writes = False