The inventory invoicing report is an important part of the inventory report. axapta comes with some inventory invoicing reports. The path is as follows:
Inventory management-> reports-> Status-> physical inventory there are two reports. You can view the number of warehouses from the product and warehouse dimension groups. however, this report has two headaches:
1. Only inventory at a certain time point can be queried
2. efficiency is enough ......
I originally wanted to add a start time to the original report and calculate the start time and end time. The two products subtract from each other, which is quite easy. It will be done soon, I didn't expect it to take a few months, and the customer complained. If I chose all the dimension groups and didn't choose any products, after the report was rewritten, he waited until the flowers thanked him again ......
The report of the warehouse dimension group is started by a runbasereport <-inventreport_dimparm <-inventreport_dimparmbase <-inventreport_dimsum <-inventreport_dimphys, in fact, this series of classes are constantly adding fields displayed in the dialog. The final query statement is constructed by the inventreport_dimsum initquery () call the static newqueryinventsum method of the inventdim table, this method has several parameters used to pass the information you select and specify on the interface.
You can use these classes to construct the dialog box, inherit invnetreport_dimsum, and add several display items you want, such as the start date.
In general, the invoicing and invoicing focus on the beginning and end of a product in a warehouse dimension group (the inventory value of the user-selected start date) and end of the period (the inventory value of the user-selected end date) and current value.
In inventsum, the table stores the values of products in each inventory dimension group. There are many fields to store the corresponding values, such as deducted and stored ed, these values correspond to the statusissue and statusreceept fields in inventtrans. These two fields are enumeration types, representing the statuses of the warehouse receiving and warehouse picking respectively. for outbound sold, deducted indicates physical warehouse picking, for inbound purchased, it indicates financial warehouse receiving, and stored ed indicates physical warehouse receiving.
Of course, the inventory status of axapta is relatively fine, and there is another situation: picked and registed. The two statuses correspond to one warehouse and one warehouse, which will affect the real physical inventory, this will reduce or increase the current available physical inventory, but will not perform the corresponding physical accounting action. The time of picked and registed will be recorded in the dateinvent field of inventtrans, many customers, picked and registed, share their bills with physical accounts at the same time, and even do not do picked and registed. Currently, the time for piced and registed customers to pass bills is almost the same as that for physical accounts, ignore this difference and use physicalinvent-picked + registed. In this way, the records in the picked and registed statuses in inventtrans are not needed during the reverse subtraction.
As I understand at present, financial transfers are bound to be physical transfers, but picked and registed are not allowed. Therefore, in inventtrans, the corresponding statusreceept and statusissue values are less than or equal to 2, datephysical must correspond to the time, But dateinvent may not. in this way, it is convenient to use the datephysical time as the time point of the physical warehouse receiving. You only need to query the data once, but if you use the dateinvent to log on to the card, since piced and registed can not be used, data must be retrieved twice. in fact, axapta's original report is divided into three parts for data collection, financial transfers, physical transfers, and physical warehouse receiving. in this way, we need to query three databases for each product in each dimension group, which is due to low efficiency, but it is indeed rigorous. for some specific customer changes, the efficiency will be improved and the effect will be much higher.
For invoicing, we are more concerned with the physical status of the warehouse, so we are concerned about the physical actions of zootrans. Of course, the transaction of financial actions must be physical actions first. therefore, we only need to pay attention to the transactions with the field statusissue <= 2 and statusreceept <= 2 in inventtrans. of course, you can also associate inventtransposting to filter records that meet the conditions, but how do I like this association.
First, obtain the current physical inventory quantity from physicalinvent + registed-picked in the inventsum table, and then retrieve the number of all transactions whose date is greater than the end date entered by the user. sum, the two minus each other, obtain the end value. Similarly, obtain the start value after obtaining the number of all transactions whose date is greater than the user input date (minus one day). The report is complete.