Farseer

导航

Axapta3.0库存盘点的问题

Axapta3.0中的库存盘点存在如下三个问题,按严重性从重到轻依次如下:
1.在同一个Counting Journal中如果对同一个料品的不同Location或pallet或配置(总之让一个料品在一个Journal中出现两次或两次以上就好了),进行盘点,过账后该料品的盘点状态始终为started(过账后应该不是Started状态了.可以通过Inventory Management->item->setup->Warehouse Items->Journal->Counting Started查看).
2.在通过On-hand创建盘点行时,当前库存维组中库存量为零的行也会添加到盘点行中,很不方便.
3.在大多数情形下,盘点后的数量跟当前的库存量应该是一致的,如果盘点行过多,用户可能不愿意每行都输入,而是希望把盘点后的数量默认为当前的库存量.
上述三个问题中的1,2已经在4.0中修复了,真搞不清楚第一个问题为什么要等到4.0才修复,以前的axapta用户是怎么用盘点功能的?
Couting Started对应于物理表InventItemLocation的CountingStarted字段,修改其状态的方法为表InventItemLocation的updateStopCountingJournal方法,Axapta3.0的代码如下:
 if (inventItemLocation && inventItemLocation.countingStarted && inventItemLocation.countingJournalId == inventJournalTrans.journalId)
    
{
        
while select otherTrans
            where otherTrans.journalId      
== inventJournalTrans.journalId     &&
                  otherTrans.itemId         
== inventJournalTrans.itemId        &&
                  otherTrans.recId          
!= inventJournalTrans.recId
        
{
            otherInventItemLocation  
= InventItemLocation::find(inventJournalTrans.itemId, otherTrans.inventDimId);
            
if (otherInventItemLocation.recId == inventItemLocation.recId)
            
{
                doStop 
= false;
                
break;
            }

        }


        
if (doStop)
        
{
            inventItemLocation.countingStarted      
= NoYes::No;
            inventItemLocation.countingJournalId    
= '';
            inventItemLocation.update();
        }

    }

其中while的一段代码,原来coder的意思,可能是想实现这样的功能:当前Journal中如果有对同一料品进行多次盘点,在更新前面的inventJournalTrans记录的时候不更新InventItemLocation的CountingStarted,而实际上也是不应该更新的,因为后面还有待更新的盘点记录,直到该料品最后一条盘点记录更新时再更新CountingStarted字段.但是这段代码造成了永远都不会更新CoutingStarted字段的值了,无从得知哪条记录是最后一条,传说中的bug......
我想到的解决办法就是把这段代码注释掉,眼不见心不烦,倒是work得挺不错的,后来查看4.0 的代码,用了类似的方法,只不过增加了一个boolean类型的参数,然后将这段代码屏蔽掉,倒是以后还可以复用这段代码,不过想不到还有哪里会用到这个代码......

第二个问题,在创建的时候是零行就不插入到InventJournalTrans表中,我原来是直接在InventCountCreate_Base的createInventJournalTrans方法中判断,如果当前的库存为零就直接return.Axapta4.0增加了一个参数控制,供用户选择是否包含零行,这个比俺的那个修改严谨和方便些.
第三个问题,见仁见智,可能有人觉得既然是盘点就应该一行行输入盘点值,可有的客户不想输入那么多的数据,只想输入盘点数跟当前的库存量不同的数量.这个修改倒也简单,也是修改问题二同样的方法,把当前库存量赋值给盘点后的数量就可以了.

posted on 2006-09-11 18:30  佛西亚  阅读(585)  评论(0编辑  收藏  举报