Skip to main content

Content Definition: Purchase Request Content

This document elaborates on the "Content Definition" section of specification.md.

Basic Information​

ItemValue
Content NamePurchase Request Content
Content IDpurchase_request_content

Screen Definitions​

Screen Definition List​

Screen TypeScreen IDPath TypeScript PathInitial UseNotes
Application ScreenSCR-001Scripting Developmentpurchase/apply/apply○imwUserDataId is assigned a number by the function container
Resubmission ScreenSCR-001Scripting Developmentpurchase/apply/apply○Same as the application screen. Additionally displays the send-back comment
Processing ScreenSCR-002Scripting Developmentpurchase/approve/approve○Displays the request details as read-only
Processing Detail ScreenSCR-003Scripting Developmentpurchase/detail/detail○Reference only
Reference Detail ScreenSCR-004Scripting Developmentpurchase/detail/detail○Uses the same screen as the Processing Detail Screen

Screen Field Definitions​

For details on the screen fields, see specification.md - Screen Field Definitions.

User Program Definitions​

Development Model​

ItemValue
Development ModelScripting development model (SSJS)
Screen TechnologyJSSP (HTML templates + function containers)
User ProgramsServer-side JavaScript (action processing / matter end process)

Action Process List​

Program NameDeployment PathTarget NodeProcessing Content
ActionProcess1purchase/action/ActionProcess1.jsApplication NodeData saving, validation, and matter property setting on application and resubmission
ActionProcess2purchase/action/ActionProcess2.jsPurchasing Department Approval NodeRecords the order data when the approval is completed

ActionProcess1 (For the Application Node) Processing Details​

Process TypeStepProcessing ContentApplicable Rule
apply (Application)1Retrieve the screen input values (header and line items) from the user parameters-
2Validation: Number of line items is 1 to 20BR-001
3Validation: Each line item's quantity ≧ 1, unit price ≧ 1BR-002
4Validation: Desired delivery date ≧ Application date + 1 dayBR-004
5Validation: The vendor ID exists in the vendor masterBR-005
6Recalculate the subtotal and total amount for each line item on the server sideBR-006
7On a validation error, return resultFlag = false plus an error message-
8INSERT into purchase_request (key: userDataId)-
9Bulk INSERT the line items into purchase_request_item-
10Set the total amount in the matter property purchase_amountBR-003
11Set the vendor name in the matter property vendor_name-
12Return resultFlag = true-
reapply (Resubmission)1Retrieve the screen input values from the user parameters-
2-7Run the validations and recalculate the total amount (same as on application)BR-001, 002, 004, 005, 006
8UPDATE purchase_request; delete all rows in purchase_request_item and re-INSERT-
9Reset the matter properties purchase_amount and vendor_nameBR-003
10Return resultFlag = true-

ActionProcess2 (For the Purchasing Department Approval Node) Processing Details​

Process TypeStepProcessing ContentApplicable Rule
approveEnd (Complete Approval)1Retrieve the header data from purchase_request using userDataId as the key-
2INSERT the order data into purchase_orders (the orderer is the processing user ID)BR-007
3Return resultFlag = true-
Other (approve / deny / sendBack, etc.)-No business data operation needed. Return resultFlag = trueBR-008

Matter End Process​

Program NameDeployment PathProcessing Content
MatterEndProcesspurchase/action/MatterEndProcess.jsReturns whether to send an email (send if data = true)

Notification Definitions​

Notification Method​

ItemValue
Notification MethodEmail notification
Definition MethodMessage definition (recommended method)
IMBox NotificationNot used

Email List​

Send TimingNotification TypeRecipientExample Subject
On applicationProcessing requestDepartment Manager"A purchase request has arrived"
On department manager approvalProcessing requestAccounting Department / Purchasing Department"A purchase request needs your approval"
On accounting department approvalProcessing requestPurchasing Department"A purchase request needs order processing"
On approvalProcessing result notificationApplicant"Your purchase request has been approved"
On approval completionProcessing result notificationApplicant"The order for your purchase request has been placed"
On send-backProcessing result notificationApplicant"Your purchase request has been sent back"
On denialProcessing result notificationApplicant"Your purchase request has been denied"

Replacement Strings​

The following replacement strings can be used in the email body.

Replacement StringDescription
Matter property valuepurchase_amount (total amount), vendor_name (vendor name)
intra-mart URLLink to the processing screen or reference screen

Matter Properties​

Property KeySet AtPurpose
purchase_amountOn applicationTotal amount. Used for branch route determination and email replacement
vendor_nameOn applicationVendor name. Used for matter name generation and email replacement

Rule Definitions​

A rule definition is configured, since the route branches to (or skips) the accounting department approval node depending on the total amount.

Rule List​

Rule IDDetermination Key (Matter Property)Comparison ConditionCondition ValueBranch Destination
RULE-AMOUNT-LOWpurchase_amountLess than500000Skip the accounting department approval
RULE-AMOUNT-HIGHpurchase_amountGreater than or equal to500000Proceed to the accounting department approval node
  • See the route configuration diagram in route_definition.md for the branch structure
  • The rule is evaluated at the branch start node