'Called from erpnext.stock.utils.update_bin'

def update_stock(self, args, allow_negative_stock=False, via_landed_cost_voucher=False):

    self.update_qty(args)
    if (args.get(u'actual_qty') or (args.get(u'voucher_type') == u'Stock    Reconciliation')):
        from erpnext.stock.stock_ledger import update_entries_after
        if (not args.get(u'posting_date')):
            args[u'posting_date'] = nowdate()
        if ((args.get(u'is_cancelled') == u'Yes') and via_landed_cost_voucher):
            return
        update_entries_after({u'item_code': self.item_code, u'warehouse': self.warehouse, u'posting_date': args.get(u'posting_date'), u'posting_time': args.get(u'posting_time'), u'voucher_no': args.get(u'voucher_no')}, allow_negative_stock=allow_negative_stock, via_landed_cost_voucher=via_landed_cost_voucher)
