Please correct me if any omission or error

From the Inventory Management-> journals-> Item Counting> Counting can enter the inventory:

Lines can create a new inventory record, click into the inventory:

Need to be aware that disk Points: changes in the respective fields, will be updated in real time.

Basically every field modified method of the corresponding field in the data source will triggerto update disk Points:

The inventory part by class: InventMov_Jour_Loss_SumUp, control, it is a subclass ofinventmov_journal InventMovement subclass inventmov_journal.

InventMov_Jour_Loss_SumUp use: InventQty   dateOnHandPhysical (InventDim _inventDim) disc calculatorspoints,

Which in turn calls a static method of InventSumDatePhysicalDim:

server static InventQty   onHandQty (

TransDate        _transDate

ItemId           _itemId

InventDim        _inventDim

InventDimParm    _inventDimParm

)

To calculate the static method to invoke class: InventSumDatePhysicalDim this class inherits fromInventSumDatePhysical, which is responsible for the combined dimension to query the amount of materials.

Declare a the class inventmov_journal statement:

InventJournalTrans inventJournalTrans;

When entering the inventory row will operate the inventJournalTrans

First of all:

When you create a new inventory record is triggered to calculate the plate number of points, then used inventDim inventDim InventMovement declared InventMovement:

InventDim inventdim (InventDim _inventDim = inventDim)

{

;

inventDim = _inventDim;

if (! inventDim)

inventDim = InventDim :: find (this.inventDimId ());

return inventDim;

}

To get inventDim! inventDim will call table: find inventDim:

static public InventDim find (InventDimId inventDimId, boolean _forupdate = false)

{

InventDim inventDim;

;

if (inventDimId)

{

if (_forupdate)

inventDim.selectForUpdate (_forupdate);

select firstonly inventDim

index hint DimIdIdx

where inventDim.InventDimId   The == inventDimId;

}

return inventDim;

}

In this way, you will know:

InventQty   dateOnHandPhysical (InventDim _inventDim)

The parameters from there, you get your new a new definition inventdim, you add two records record the actual modify this inventdim.

Then:

InventQty   dateOnHandPhysical (InventDim _inventDim)

{

InventDimParm    _inventDimParm;

;

/ / Lower sentence based on previous inventDim construct a _InventDimParm of

_inventDimParm.initFromInventDim (_inventDim);

_inventDimParm = InventDimParm :: orParms (_inventDimParm, InventJournalTable :: journalId2inventDimParm (inventJournalTrans.JournalId));

return InventSumDatePhysicalDim :: onHandQty (inventJournalTrans.TransDate, inventJournalTrans.ItemId, _inventDim, _inventDimParm);

}

This code: InventJournalTable :: journalId2inventDimParm:

static InventDimParm journalId2inventDimParm (InventJournalId inventJournalId)

{

InventDimParm inventDimParm;

;

InventDimFixedClass :: inventDimFixed2InventDimParm (InventJournalTable :: find (inventJournalId). InventDimFixed, inventDimParm);

return inventDimParm;

}

The based of the field InventDimFixed inventJournalTable to construct a inventDimParm.

This field is derived from this:

When you create a new record will pop up:

InventDimFixed is an integer of 0 to 255, on eight dimensions, respectively, corresponding to 8bits in a byte, if the dimension is selected, this bit is:

Color

Size

Config

Serial

Pallet

Location

Batch

warehouse

128

64

32

16

8

4

2

1

InventJournalTable the call InventDimFixedClass class to initial this field, the core of the code is:

InventDimFixed inventDimFixed ()

{

InventDimFixed inventDimFixed;

;

# InventDimDevelop

if (inventDimParm.inventLocationIdFlag)      inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # INVENTLOCATIONID_IDX);

if (inventDimParm.inventBatchIdFlag)         inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # BATCH_IDX);

if (inventDimParm.WMSLocationIdFlag)         inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # LOCATION_IDX);

if (inventDimParm.WMSPalletIdFlag)           inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # PALLET_IDX);

if (inventDimParm.inventSerialIdFlag)        inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # SERIALID_IDX);

if (inventDimParm.configIdFlag)              inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # CONFIGID_IDX);

if (inventDimParm.inventSizeIdFlag)          inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # INVENTSIZEID_IDX);

if (inventDimParm.inventColorIdFlag)         inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # INVENTCOLORID_IDX);

return inventDimFixed;

}

View the class declaration you can see:

public class InventDimFixedClass

{

InventDimParm                     inventDimParm;

# DEFINE.INVENTLOCATIONID_IDX (0)

# DEFINE.BATCH_IDX ??(1)

# DEFINE.LOCATION_IDX (2)

# DEFINE.PALLET_IDX (3)

# DEFINE.SERIALID_IDX (4)

# DEFINE.CONFIGID_IDX (5)

# DEFINE.INVENTSIZEID_IDX (6)

# DEFINE.INVENTCOLORID_IDX (7)

/ / Indexes 0 .. 15 reserved for the SYS layer

/ / Indexes 16 .. 30 reserved for distributors, vars and customers

# INVENTDIMDEVELOP

}

SetField performed:

static InventDimFixed setField (InventDimFixed inventDimFixed, Integer idx)

{

;

inventDimFixed   = InventDimFixed | (1 << idx);

return inventDimFixed;

}

That is, with the 1-bit or a result.

Continue to look at the code:

InventQty   dateOnHandPhysical (InventDim _inventDim)

{

InventDimParm    _inventDimParm;

;

/ / Lower sentence based on previous inventDim construct a _InventDimParm of

_inventDimParm.initFromInventDim (_inventDim);

_inventDimParm = InventDimParm :: orParms (_inventDimParm, InventJournalTable :: journalId2inventDimParm (inventJournalTrans.JournalId));

return InventSumDatePhysicalDim :: onHandQty (inventJournalTrans.TransDate, inventJournalTrans.ItemId, _inventDim, _inventDimParm);

}

Two inventDimParm by bit or get a inventDimParm of, and then use the Enter dates onHandQty starta dimension materials knot stock:

server static InventQty   onHandQty (

TransDate        _transDate

ItemId           _itemId

InventDim        _inventDim

InventDimParm    _inventDimParm

)

{

InventSumDatePhysicalDim    inventSumDatePhysicalDim = InventSumDatePhysicalDim :: newParameters (_transDate, _itemId, _inventDim, _inventDimParm);

;

the return inventSumDatePhysicalDim.postedQty ()      +

inventSumDatePhysicalDim.receivedQty ()    -

inventSumDatePhysicalDim.deductedQty ()    -

inventSumDatePhysicalDim.pickedQty ()      +

inventSumDatePhysicalDim.registeredQty ();

}

To construct a class InventSumDatePhysicalDim to calculate balances.

Final first InventSumDatePhysicalDim selectInventTransPicked selectInventTransPostingFinancial selectInventTransPostingPhysical selectInventTransRegistered

These four methods will be combined with the two macro statements to query the transaction records the various date is greater than the selected dates, stock from the InventSum table query to the current node, then the middle of the current date and query date the number of transactions according to the actual access to addition and subtraction, the The Query Date junction stock.

These two macros: # InventDimSelect,

# InventDimExistsJoin:

exists join tableId from% 2

where (% 2.InventDimId        == 1) &&

(% 2.ConfigId           ==% 3.ConfigId               | |!% 4.ConfigIdFlag of)            &&

(% 2.InventSizeId        ==% 3.InventSizeId           | |!% 4.InventSizeIdFlag of)        &&

(% 2.InventColorId      ==% 3.InventColorId          | |!% 4.InventColorIdFlag of)       &&

(% 2.InventLocationId   ==% 3.InventLocationId       | |!% 4.InventLocationIdFlag of)    &&

(% 2.InventBatchId      ==% 3.InventBatchId          | |!% 4.InventBatchIdFlag of)       &&

(% 2.WMSLocationId      ==% 3.WMSLocationId          | |!% 4.WMSLocationIdFlag of)       &&

(% 2.WMSPalletId        ==% 3.WMSPalletId            | |!% 4.WMSPalletIdFlag of)         &&

(% 2.InventSerialId     ==% 3.InventSerialId         | |!% 4.InventSerialIdFlag of)

# InventDimDevelop

This macro realized: If you choose a certain dimension, then it must be with you to your dimensions to match the dimension table in the database to find the corresponding data if you do not choose this dimension, this dimension all match.

Finally, we talk about how to use it:

An example:

If you want to query material B-Pack1 dimensions: Warehouse: GW, SIZE: 5, Color: red 4/22/2008junction stock

Can do:

InventDim inventDim;

InventDimParm    _inventDimParm;

Date          _date;

ItemId itemId;

;

inventDim.inventColorId = "red";

inventDim.inventSizeId = 5;

inventDim.inventLocationId = "gw";

_inventDimParm.initFromInventDim (_inventDim);

_date = 22/4/2008;

itemId = "b-pack1";

return InventSumDatePhysicalDim :: onHandQty (_date, iItemId, inventDim, _inventDimParm);

Inventory of the materials to teach you how to query a date certain combination of dimensions的更多相关文章

  1. 11.Query an Array of Embedded Documents-官方文档摘录

    总结 1.插入数据 db.inventory.insertMany( [ { item: "journal", instock: [ { warehouse: "A&qu ...

  2. 9.Query on Embedded/Nested Documents-官方文档摘录

    1.插入案例 db.inventory.insertMany( [ { item: "journal", qty: 25, size: { h: 14, w: 21, uom: & ...

  3. 8.Query Documents-官方文档摘录

    总结 1 先插入数据 db.inventory.insertMany([ { item: "journal", qty: 25, size: { h: 14, w: 21, uom ...

  4. Mongo使用

    在用mongo进行查询时,$exists表示是否document是否包括这个field,即使field的value为null也算是包括. $exists Syntax: { field: { $exi ...

  5. spring jdbcTemplate query 返回值为null

    spring jdbcTemplate query 返回值为null 今天使用以下方法从数据库中查询数据,返回列表 public List<BookBean> getBooks(){ St ...

  6. VUE自定义(有限)库存日历插件

    开发过程中遇到一个令人发指的,一个element-ui无法满足的日历需求, 改造其日历插件的代价太大,于是索性自己手写一个,需求如下: 1. 根据开始.结束时间计算时间覆盖的月份,渲染有限的可选择日期 ...

  7. Mongodb的基本使用及对接多数据源

    mongodb介绍 MongoDB(来自于英文单词"Humongous",中文含义为"庞大")是可以应用于各种规模的企业.各个行业以及各类应用程序的开源数据库. ...

  8. 《Ansible权威指南》笔记(2)——Inventory配置

    四.Inventory配置ansible通过Inventory来定义主机和组,使用时通过-i指定读取,默认/etc/ansible/hosts.可以存在多个Inventory,支持动态生成.1.定义主 ...

  9. [转]Teach Yourself Programming in Ten Years——用十年教会自己编程

    作者:Peter Norvig 译者:刘海粟 本文原文为:http://norvig.com/21-days.html 该翻译文档的PDF版可以在这里获得:http://download.csdn.n ...

随机推荐

  1. VisualSvn server 权限配置

    库上,配置 EveryOne 有读写权限. 下面的文件夹,再根据情况,取消 EveryOne 的读写权限,添加另一个用户组的读写权限. 它的规则是: 子目录权限覆盖父目录权限.

  2. MyEclipse 8.5 优化实例

    在用[MyEclipse] 写代码很容易卡死机,尤其是在对JSP文件的<%%>之间写代码的时候,只要一弹出智能提示就立刻卡死,程序失去响应,我以为是MyEclipse版本的问题,结果换了6 ...

  3. 学习WPF——WPF布局——了解布局容器

    WPF布局工作内部原理 WPF渲染布局时主要执行了两个工作:测量和排列 测量阶段,容器遍历所有子元素,并询问子元素所期望的尺寸 排列阶段,容器在合适的位置放置子元素,并设置元素的最终尺寸 这是一个递归 ...

  4. 使用Nito.AsyncEx实现异步锁

    Lock是常用的同步锁,但是我们无法在Lock的内部实现异步调用,比如我们无法使用await. 以下面的代码为例,当你在lock内部使用await时,VS会报错提醒. 最简单的解决办法就是使用第三方的 ...

  5. JavaScript原生DOM操作API总结

    最近面试的时候被这个问题给卡了,所以抽时间好好复习一下. 原文:http://www.cnblogs.com/liuxianan/p/javascript-dom-api.html 几种对象 Node ...

  6. php闭包函数简析

    闭包函数(closures)也叫匿名函数,使用js的童鞋应该比较熟悉.PHP5.3开始引入了闭包的特性. 声明一个匿名函数是: $func = function() { }; //带结束符 匿名函数因 ...

  7. C语言实现二叉树-利用二叉树统计单词数目

    昨天刚参加了腾讯2015年在线模拟考: 四道大题的第一题就是单词统计程序的设计思想: 为了记住这一天,我打算今天通过代码实现一下: 我将用到的核心数据结构是二叉树: (要是想了解简单二叉树的实现,可以 ...

  8. paip.最省内存的浏览器评测 cah

    paip.最省内存的浏览器评测 cah 作者Attilax  艾龙,  EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:http://blog.csdn.net/at ...

  9. atitit.提升软件开发效率大的总结O5

    atitit.提升软件开发效率大的总结O5 #---平台化.组件化 1 #--cbb公用模块的建设 1 #---内部最佳流程方法跟实践的总结 2 #---内部知识体系的建设 2 #---问题Qa库的建 ...

  10. iOS开发-友盟分享使用(2)

    1.友盟SDK提供功能:分享喜欢的东西到新浪微博.qq空间.为微信朋友圈等等等等社交圈. 2.友盟分享前期准备 (1)注册账号 去官网 (2)创建应用获取appkey 类似5556a53667e*** ...