WriteMeterReadingTransaction

Write Meter Reading Transaction

Minor Business Rule

Object Name: N1300210

Parent DLL: CMFG

Location: Client/Server

Language: NER

Functional Description

Purpose


The purpose of this function is to update the Asset Balances table (F1202) and write a transaction to the Account Ledger table (F0911) for a 

change in Meter Readings.


Setup Notes and Prerequisites


Special Logic



Technical Specification


If f0911 need to be updated


   // Determine fiscal year, period, and century from date passed in.

   Call X0903

Date = Input DTHRU
Company = Input CO


Return FY, PER, CTRY


   // Retrieve AAI Account 

   Call B0000046

Item Code = Input ITEM

Company = Input CO

Validate Set Up Only = "1"


Return MCU, OBJ, SUB, ANI



   // Call F1202 Update Item Balances 

   Call B1200004

NUMB = Input NUMB

MCU = B0000046 MCU

OBJ = B0000046 OBJ

SUB = B0000046 SUB

SBL = Input SBL

SBLT = Input SBLT

LT = "AU"

PN = X0903 PER

CTRY = X0903 CTRY

FY = X0903 FY

AO1OW = Input NIOWM

PID = "EP12120"

EV02 = Blank



   // Edit Asset Number for Account Ledger Transaction.

   Convert Math Numeric to String 

   Call X1202 - F1201 Validate Asset Number

               Asset Number ASII <> mnPrimaryAssetNumber

               "1" > cSymbolIdentifier

               "1">cReturnF0911Format



   // Check if record has been written. Update cache if it has, add if it hasn't.

   If BF JournalEntryLineNo not equal zero

       cRecordWritten = "1"

   else

       cRecordWritten = " "



   // Call F0911 Edit Line to write cache record

   Call B0900049 - Edit Line

Job Number = Input JOBS

Line Action = "A" 

Processing Mode = blank

Error Flag = Return to Output EV01

JournalEntryLineNo = Line Number

Type Doc = "J"

  cRecordWritten = cRecordWritten

Account Number = B0000046 ANI

Account Mode = "2"

Subledger = Input SBL

Subledger Type = Input SBLT

Units = Input NIOWM

Asset ID = Input NUMB

Posted Code = "P"

Explanation = Input VC01

Post Code Alt 009 = "P"

Batch Rear End Code = "*"


   

   // Test if F1202Update flag is set to update F1202 Balances. 

   // If set to "1", then update F1202 balances if no errors returned from F0911

   If BF F1202UpdateFlag = "1"

     If BF ErrorCode = "1" or BF ErrorCode = "0"

        Call B1200004 to Update F1202

     End if

   End if


End if

Data Structure

D1300210 - Write Meter Reading Transaction


Parameter NameData ItemData TypeReq/OptI/O/Both
mnMeterAmountNIOWMMATH_NUMERICNONENONE

Hours, Fuel, or Odometer meter reading amount that has been updated by the user. This amount is used to update the 
F1202 balances and F0911 entries.

mnAssetItemNumberNUMBMATH_NUMERICNONENONE

The piece of equipment that had it's meter changed.

szCompanyCOcharNONENONE

The company of the asset number.

jdDatePeriodThruDTHRUJDEDATENONENONE


szSubledgerSBLcharNONENONE

A code that identifies a detailed, auxiliary account within a general ledger account. A subledger can be an equipment item number or an 
address book number. If you enter a subledger, you must also specify the subledger type.

cSubledgerTypeSBLTcharNONENONE

A user defined code (00/ST) that is used with the Subledger field to identify the subledger type and how the system performs subledger 
editing. On the User Defined Codes form, the second line of the description controls how the system performs editing. This is either hard-coded 
or user defined. Valid values include: A Alphanumeric field, do not edit   N Numeric field, right justify and zero fill   C Alphanumeric field, right 
justify and blank fill  

mnJobnumberAJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

szNameRemarkExplanationEXRcharNONENONE

A name or remark that describes the purpose for using an account or conveys any other information that the user wants about the 
transaction.

cErrorCodeEV01charNONENONE

Field used to pass back the error code recieved from the F0911EditLine.


szItemNumberITEMcharNONENONE


nF0911UpdateFlagINT02integerREQNONE

Flag used to determine if the F0911 records need to be written. 

"1" = Update F0911 records.

"0" = Do not update F0911 records.

mnJournalEntryLineNoJELNMATH_NUMERICOPTNONE

Line Number used to determine the entry to the F0911 cache.

nF1202UpdateFlagINT01integerREQNONE

Flag used to determine if the F1202 records need to be written. 

"1" = Update F1202 records.

"0" = Do not update F1202 records.

cEditFlagF0911_EV01EV01charOPTNONE

This parameter tells the business function whether or not to do editing on the F0911 transactions. The following are 
valid values:

1 = Full Editing

0 = No Editing

cBypassCacheAddition_EV01EV01charOPTNONE

An option that specifies the type of processing for an event.

szProgramIdPIDcharOPTNONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

Related Functions

None

Related Tables

None