请教一个关于lifo转fifo与FIFO的问题

lifo|LOFTER(乐乎) - 记录生活,发现同好
LOFTER for ipad —— 记录生活,发现同好
&nbsp&nbsp被喜欢
&nbsp&nbsp被喜欢
{list posts as post}
{if post.type==1 || post.type == 5}
{if !!post.title}${post.title|escape}{/if}
{if !!post.digest}${post.digest}{/if}
{if post.type==2}
{if post.type == 3}
{if !!post.image}
{if post.type == 4}
{if !!post.image}
{if !!photo.labels && photo.labels.length>0}
{var wrapwidth = photo.ow < 500?photo.ow:500}
{list photo.labels as labs}
{var lbtxtwidth = Math.floor(wrapwidth*(labs.ort==1?labs.x:(100-labs.x))/100)-62}
{if lbtxtwidth>12}
{if !!labs.icon}
{list photos as photo}
{if photo_index==0}{break}{/if}
品牌${make||'-'}
型号${model||'-'}
焦距${focalLength||'-'}
光圈${apertureValue||'-'}
快门速度${exposureTime||'-'}
ISO${isoSpeedRatings||'-'}
曝光补偿${exposureBiasValue||'-'}
镜头${lens||'-'}
{if data.msgRank == 1}{/if}
{if data.askSetting == 1}{/if}
{if defined('posts')&&posts.length>0}
{list posts as post}
{if post_index < 3}
{if post.type == 1 || post.type == 5}
{if !!post.title}${post.title|escape}{/if}
{if !!post.digest}${post.digest}{/if}
{if post.type == 2}
{if post.type == 3}
{if post.type == 4}
{if post.type == 6}
{if drlist.length>0}
更多相似达人:
{list drlist as dr}{if drlist.length === 3 && dr_index === 0}、{/if}{if drlist.length === 3 && dr_index === 1}、{/if}{if drlist.length === 2 && dr_index === 0}、{/if}{/list}
暂无相似达人,
{if defined('posts')&&posts.length>0}
{list posts as post}
{if post.type == 2}
{if post.type == 3}
{if post.type == 4}
{if post.type == 6}
this.p={ currentPage:1,pageNewMode:true,isgooglead3:false,ishotrecompost:false,visitorId:0, first:'',tag:'lifo',recommType:'new',recommenderRole:0,offset:1,type:0,isUserEditor:0,};SQL语句练习实例之五 WMS系统中的关于LIFO或FIFO的问题分析_错新网
当前位置: →
→ SQL语句练习实例之五 WMS系统中的关于LIFO或FIFO的问题分析
SQL语句练习实例之五 WMS系统中的关于LIFO或FIFO的问题分析
&SQL语句练习实例之五 WMS系统中的关于LIFO或FIFO的问题分析,需要的朋友可以参考下。
---在仓储管理中经常会碰到的一个问题&
一、关于LIFO与FIFO的简单说明& ---FIFO: First in, First out.先进先出。& ---LIFO: Last in, First out.后进先出。&
--如货物A:本月1日购买10件,单价10元/件,3日购买20件,单价15元/件;10日购买10件,单价8元/件。& --本月15日发货35件。&
--按FIFO先进先出,就是先购入的存货先发出,所以,先发1日进货的10件,再发3日进货的20件,最后发10日进货的5件,发出成本共为:10*10+20*15+5*8=440元。&
--按LIFO后进先出,就是后购入的存货先发出,所以,先发10日进货的10件,再发3日进货的20件,最后发1日进货的5件,发出成本共为:10*8+20*15+5*10=430元&&
--------& Create table stock& (Id int not null primary key,& articleno varchar(20) not null,& rcvdate datetime not null,& qty int not null,& unitprice money not null& )& go& ----& insert stock& select 1,'','',15,10 union& select 2,'','',25,12 union& select 3,'','',35,15 union& select 4,'','',45,20 union& select 5,'','',55,10 union& select 6,'','',65,30 union& select 7,'','',75,17 union& select 8,'','',110,8&
go& ----此时如果在卖出300件产品,那么应该如何计算库存销售的价值呢?& ----1使用当前的替换成本,时每件产品的成本为8,就是说你这300件产品,成本价值为2400& ----2使用当前的平均成本单价,一共有420,总成本为6530,平均每件的成本为15.55& ----1.LIFO (后进先出)& ---- 110 *8& ---- 75*17& ---- 65*30& ---- 50*10& -----总成本为 4605& -----2.FIFO(先进先出)& ---- '',15*10& --- '',25*12& -----'',35*15& -----'',45*20& -----'',55*10& -----'',65*30& -----'',65*17& ----总成本为5480&
---成本视图& create view costLIFO& as& select unitprice from stock& where rcvdate= (select MAX(rcvdate) from stock)& go& create view costFIFO& as& select sum(unitprice*qty)/SUM(qty) as unitprice from stock&
go& -----找出满足订单的、足够存货的最近日期。如果运气好的话,某一天的库存数量正好与订单要求的数字完全一样& -----就可以将总成本作为答案返回。如果订单止的数量比库存的多,什么也不返回。如果某一天的库存数量比订单数量多& ---则看一下当前的单价,乘以多出来的数量,并减去它。& ---下面这些查询和视图只是告诉我们库存商品的库存价值,注意,这些查询与视图并没有实际从库存中向外发货。& create view LIFO& as& select s1.rcvdate,s1.unitprice,sum(s2.qty) as qty,sum(s2.qty*s2.unitprice) as totalcost& from stock s1 ,stock s2& where s2.rcvdate&=s1.rcvdate& group by s1.rcvdate,s1.unitprice&
go& select (totalcost-((qty-300)*unitprice )) as cost& from lifo as l& where rcvdate=(select max(rcvdate) from lifo as l2 where qty&=300)& go&
create view FIFO& as& select s1.rcvdate,s1.unitprice,sum(s2.qty) as qty,sum(s2.qty*s2.unitprice) as totalcost& from stock s1 ,stock s2& where s2.rcvdate&=s1.rcvdate& group by s1.rcvdate,s1.unitprice&
go& select (totalcost-((qty-300)*unitprice )) as cost& from fifo as l& where rcvdate=(select min(rcvdate) from lifo as l2 where qty&=300)& --------& go& -----& -----在发货之后,实时更新库存表& create view CurrStock& as& select s1.rcvdate,SUM(case when s2.rcvdate&s1.rcvdate then s2.qty else 0 end) as PrvQty& ,SUM(case when s2.rcvdate&=s1.rcvdate then s2.qty else 0 end) as CurrQty& from stock s1 ,stock s2& where s2.rcvdate&=s1.rcvdate& group by s1.rcvdate,s1.unitprice& go& create proc RemoveQty& @orderqty int& as& if(@orderqty&0)& begin& update stock set qty =case when @orderqty&=(select currqty from CurrStock as c where c.rcvdate=stock.rcvdate)& then 0& when @orderqty&(select prvqty from CurrStock c2 where c2.rcvdate=stock.rcvdate)& then stock.qty& else (select currqty from CurrStock as c3 where c3.rcvdate=stock.rcvdate)&
end& end& --& delete from stock where qty=0& ---& go& exec RemoveQty 20& go&
---------------&&
三、使用&贪婪算法&进行订单配货&
-------还有一个问题,如何使用空间最小或最大的仓库中的货物来满足订单,假设仓库不是顺序排列,你可以按钮希望的顺序任意选择满足订单。& ---使用最小的仓库可以为订单的装卸工人带来最小的工作量,使用最大的仓库,则可以在仓库中清理出更多的空间& -------例如:对于这组数据,你可以使用(1,2,3,4,5,6,7)号仓库也可以使用(5,6,7,8)号仓库中的货物来满足订单的需求。& ----这个就是装箱问题,它属于NP完全系统问题。对于一般情况来说,这种问题很难解决,因为要尝试所有的组合情况,而且如果数据量大的话,& ----计算机也很难很快处理。& ---所以有了&贪婪算法&,这个算法算出来的常常是近乎最优的。这个算法的核心就是&咬最大的一口&直到达到或超越目标。& ---& --1. 第一个技巧,要在表中插入一些空的哑仓库,如果你最多需要n次挑选,则增加n-1个哑仓库& insert stock& select -1,'','',0,0 union& select -2,'','',0,0& --select -3,'',0,0& ----& go& create view pickcombos& as& select distinct (w1.qty+w2.qty+w3.qty) as totalpick& ,case when w1.id&0 then 0 else w1.id end as bin1 ,w1.qty as qty1,& case when w2.id&0 then 0 else w2.id end as bin2,w2.qty as qty2& ,case when w3.id&0 then 0 else w3.id end as bin3 ,w3.qty as qty3& from stock w1,stock w2, stock w3& where w1.id not in (w2.id,w3.id)& and w2.id not in (w1.id,w3.id)& and w1.qty&=w2.qty& and w2.qty&=w3.qty& ----& ---1.使用存储过程来找出满足或接近某一数量的挑选组合& --------& go& create proc OverPick& @pickqty int& as& if(@pickqty&0)& begin& select @pickqty,totalpick,bin1,qty1,bin2,qty2,bin3,qty3& from pickcombos& where totalpick=(select MIN(totalpick) from pickcombos where totalpick&)& end& go& exec OverPick 180&
----------& select * from stock& drop table stock& drop view lifo& drop view fifo& drop view costfifo& drop view costlifo& drop view CurrStock& drop proc OverPick& drop proc RemoveQty&
drop view pickcombos&&
本文引用网址:
在下列搜索引擎中搜索“SQL语句练习实例之五 WMS系统中的关于LIFO或FIFO的问题分析”的相关信息:
你可能还喜欢以下文章
?上一篇文章:
?下一篇文章:涉案的三个来自德阳中江的95后女孩,家境都不算差。
他们刚执行完任务准备返回,还穿着厚重的消防服。
声明:本文由入驻搜狐公众平台的作者撰写,除搜狐官方账号外,观点仅代表作者本人,不代表搜狐立场。
  CFA一级考试内容广泛,为初涉金融知识的第一步。全而广泛的考核方法,令许多非金融背景考生措手不及。在知晓一级考试的结构知识点和考试比重之后,考生也应根据自身的情况,调整好各科目的复习时间。掌握好全面的基础知识,为备战CFA一级考试更加一分底气。
  CFA一级考试各科目考试比重和难度比重:
  数理方法(比重12%,难度B)
  2经济学(比重10%,难度B-)
  3财务报表分析(比重20%,难度E)
  4.公司金融(比重8%,难度C)
  5.投资组合管理(比重5%,难度C+)
  6.权益投资(比重10%,难度C+)
  7.固定收益证券(比重10%,难度C+)
  8.衍生品投资(比重5%,难度D)
  9.其它类投资(比重5%,难度E)
  10.道德(比重15%,难度D)
  CFA一级考试难点总结:
  在一级考试中,经过参加过CFA考试学员总结:其中难点不乏各种计价方法,LIFO和FIFO,2个lease,资本化和费用化,回购和分股利,折旧和摊销,存货,无形资产,长期资产revaluation model,折旧方法,tax rate的变化,折价和溢价债券,funded status,几种改变现金流的方法,3种security的会计处理,GAAP和IFRS的区别,这些都是财报的重中之重,在做题和考试当中也需要常常把这些东西的变化和替换与财报上的科目和比率的变化联系起来。
  根据上述难点,高顿财经CFA研究中心将LIFO和FIFO的概念在此详细分析了一下。
  CFA一级考试概念:FIFO、LIFO的基本概念:
  FIFO真实反映了存货价值,对B/S更适用。LIFO真实反映了COGS,对I/S更合适。
  两种方法的差异是考试重点。假设存货价格上升(inflation)且存货数量稳定或上升,LIFO将导致生产成本上升,所得税下降,现金流上升,净利润(税前&税后收益)下降,期末存货余额。简而言之,明确LIFO计价下,生产成本和现金流是存货价格同向变化,其他指标反向变化。FIFO的各项影响是与LIFO相反。
  考生应该明确认识存货价格上升时,LIFO因COGS较高而享受tax advantage,以低估存货资产作为代价。而一旦收入不佳,还可以采用LIFO liquidation遮掩颓势,其舞弊原理在于使用老久存货降低COGS,从而操作net income上升,粉饰损益表。存货价格上升时,FIFO因COGS较低同事唱红B/S,I/S表,即使近期存货成本上升短期内也不一定影响I/S表美观,但长期可能悄悄将利润掏空。
  考生要从时点、持续经营的会计期间的角度比较和理解LIFO和FIFO的财务影响,到底谁才是真正的保守计量存货方式,洞穿存货计价这点事儿。
  看完了上述的讲解概念,考生是否也已有些基础概念?高顿网校CFA小编准备了一道题目,希望考生可以练一练手。
  CFA一级习题:LIFO和FIFO下inventory cost的调整问题
  Assume U.S. GAAP applies unless otherwise noted.?Sipex Corporation uses the LIFO inventory method, but most of the other companies in Sipex industry use FIFO. Which of the following?best?describes one of the adjustments that would be made to Sipex's financial statements to?compare that company with other companies in the industry? To adjust Sipex's ending inventory to the FIFO method, the amount reported for Sipex's ending inventory should be:
  A.increased by the ending balance in Sipex's LIFO reserve.
  B.decreased by the ending balance in Sipex's LIFO reserve.
  C.increased by the change in Sipex's LIFO reserve for that period.
  Solution: A
  Adding the ending balance in the LIFO reserve to the LIFO inventory would equal the ending balance for inventory on FIFO basis.
  至此,关于这道LIFO和FIFO的问题你是否答对了呢?还希望各位尚要参加CFA一级考试的考生们能积极备考,掌握好每一门CFA考试的重点科目。
  申明:本文由Yuyu汇集整理,系高顿网校编辑团队汇编作品,转载请注明作者及出处。更多内容推荐关注:gaoduncfa,打造全球最专业的VC/PE、IB、融资、证券、金融资讯在线分享平台!为各界有志于投资投行、顶级券商等领域的在校学生、社会精英提供最快、最专业的业内资讯和财经培训,同时定期举办线下活动、实习推荐。汇聚全球财经人士,为你全面指导职业发展。
欢迎举报抄袭、转载、暴力色情及含有欺诈和虚假信息的不良文章。
请先登录再操作
请先登录再操作
微信扫一扫分享至朋友圈
搜狐公众平台官方账号
生活时尚&搭配博主 /生活时尚自媒体 /时尚类书籍作者
搜狐网教育频道官方账号
全球最大华文占星网站-专业研究星座命理及测算服务机构
高顿网校是高顿教育旗下网络教育品牌,专注于财经网络教育。
主演:黄晓明/陈乔恩/乔任梁/谢君豪/吕佳容/戚迹
主演:陈晓/陈妍希/张馨予/杨明娜/毛晓彤/孙耀琦
主演:陈键锋/李依晓/张迪/郑亦桐/张明明/何彦霓
主演:尚格?云顿/乔?弗拉尼甘/Bianca Bree
主演:艾斯?库珀/ 查宁?塔图姆/ 乔纳?希尔
baby14岁写真曝光
李冰冰向成龙撒娇争宠
李湘遭闺蜜曝光旧爱
美女模特教老板走秀
曝搬砖男神奇葩择偶观
柳岩被迫成赚钱工具
大屁小P虐心恋
匆匆那年大结局
乔杉遭粉丝骚扰
男闺蜜的尴尬初夜
客服热线:86-10-
客服邮箱:

我要回帖

更多关于 fifo和lifo 的文章

 

随机推荐