Inventory of the materials to teach you how to query a date certain combination of dimensions

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);

时间: 2024-07-29 03:28:40

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

How to do Physical inventory process in Warehouse SAP仓库盘点流程

Please go with following transaction MI01>Create physical inventory document>Enter Document Date>Planned count date>Plant Code>Storage Location>Click on Enter button>you will get the separate screen>Enter material code>and click

Mongo使用

在用mongo进行查询时,$exists表示是否document是否包含这个field,即使field的value为null也算是包含. $exists Syntax: { field: { $exists: <boolean> } } When <boolean> is true, $exists matches the documents that contain the field, including documents where the field value is n

8.Query Documents-官方文档摘录

总结 1 先插入数据 db.inventory.insertMany([ { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" },

VMware vSphere常见问题汇总(二十)

190. ESXi 5.x采用软iSCSI做为存储时启动速度很慢 故障状态 1.ESXi 5.0在iSCSI软件启动器被配置的情况下,启动缓慢: 2.在sysboot.log文件里有类似如下信息: 1. [01:57:50.925338] sysboot: software-iscsi 2. [02:28:22.330320] sysboot: restore-paths 3.启动完成后,sysboot.log文件里有类似如下信息: 1. iscsid: cannot make a connec

mongodb CRUD操作 -Select

二.查询文档 方法: db.collection.find() Additional Methods db.collection.findOne In aggregation pipeline, the $match pipeline stage provides access to MongoDB queries. db.inventory.insertMany([ { item: "journal", qty: 25, size: { h: 14, w: 21, uom: &quo

MM - Physical Inventory Concept

Physical Inventory is a Process in which Company Stops all his Goods Movements and Do a Physical inventory Manually. To avoid Inconsistencies which may shut down business process. Physical Inventory Can be done in four ways : Cycle Count Periodic Cou

《Sams Teach Yourself Windows? Workflow Foundation in 24 Hours》读书笔记目录

目录 1 Part I - The Basics 1.1 Hour 1 - Understanding Windows Workflow Foundation 1.2 Hour 2 - A Spin Around Windows Workflow Foundation 1.3 Hour 3 - Learning Basic Hosting 1.4 Hour 4 - Learning Host-Workflow Data Exchange 1.5 Hour 5 - Creating an Esca

3,Ansible---动态Inventory

动态 Inventory Cobbler 外部 Inventory 脚本 AWS EC2 外部 inventory 脚本 其它 inventory 脚本 使用多个 inventory 源 动态组作为静态组的子组 使用配置管理系统经常有一种需求,可能要在其他的软件系统中保存自己的 inventory 配置信息. Ansible 本身通过基于文本的方式来记录 inventory 配置信息,这在前面已介绍过(详见 Inventory文件 ). 除此之外,Ansible 也支持用其他方式保存配置信息.

Ansible 五(inventory文件 主机清单)

Ansible 五(inventory文件  主机清单) Ansible 可同时操作属于一个组的多台主机,组和主机之间的关系通过 inventory 文件配置. 默认的文件路径为 /etc/ansible/hosts 除默认文件外,你还可以同时使用多个 inventory 文件(后面会讲到),也可以从动态源,或云上拉取 inventory 配置信息.详见 动态Inventory                   http://www.ansible.com.cn/docs/intro_dyna