Skip to main content

Search

Creating a Purchase Order Form - Allowing a user to enter multiple items on a form

Comments

6 comments

  • ArdeviaForum

    Original Post by Liliia (Imported from Ardevia Forum)

    Hi Sean,

     

    You can configure your form with Sub List.

     

    For example, add two lists: Orders and Purchases.
    In Purchases list add columns: Qty, Description, Unit Price, Unit, Item Total and a lookup to Orders.
    In Orders list add columns: Sub Total, Sales Tax and Total.

     

    Customize a new form of Orders with Rich Forms, add the Purchases sub list, and Sub Total, Sales Tax and Total fields on the form:

     

    01.12.2016-11.58.png

     

     

     

    And add Calculated values on Item Total, Sub Total, Sales Tax, and Total fields, e.g.:

     

    01.12.2016-12.00.png

     

     

     

    Hope this helps.

    0
  • ArdeviaForum

    Original Post by Sean Docherty (Imported from Ardevia Forum)

    Hello,

     

    Thank you for your reply.

     

    I have created the two lists as you have suggested in your post.
    A couple of questions for you about this.

     

    1. When you mention create a lookup to the Orders list, what field or fields are you linking to the Purchases list from the Orders list?
    2. How do you remove the title Purchases when you add it as a sub list to the Orders form?
    3. The Item Total is a calculated field in the Purchases list. Should this just be a number or currency field and then do the calculation in the form?

     

    Thank you

     

    UPDATE - UPDATE - UPDATE

     

    I have added the Item Total as a calculation through the forms product as you have suggested. When I enter multiple entries on the Purchases sub list the Item Total for the second and third item generates an error.

    0
  • ArdeviaForum

    Original Post by Liliia (Imported from Ardevia Forum)

    Hello,

     

    1. None of the additional fields are linked to the Orders list:

    01.13.2016-10.11.png

     

     

    2. Rename "Title" column to "Description" and make it non-required:

     

     

    01.13.2016-10.29.png

     

     

     

     

    3. Calculated values for:
      - Item Total: [[@SubListCurrentRow.Purchases.Qty]]*[[@SubListCurrentRow.Purchases.Unit_x0020_Price]]
      - Sub Total:  [[@SubLists.Purchases.Item_x0020_Total.Sum]]
      - Sales Tax:  [[Sub_x0020_Total]]*1.2  (replace by your coefficient)
      - Total:      [[Sales_x0020_Tax]]+[[Sub_x0020_Total]]
    Also you can disable all this fields.

     

    You can watch video  how it works.

    0
  • ArdeviaForum

    Original Post by Sean Docherty (Imported from Ardevia Forum)

    Thank you for the update to this question.

     

    I have the totals working fine in the fields now. I am running into one issue in the fields that do the calculations. After the decimal place the formula puts at least 10 characters behind the decimal place.

     

    Is there a way to limit the amount of decimal places?

     

    Thank you

    0
  • ArdeviaForum

    Original Post by Liliia (Imported from Ardevia Forum)

    Hi Sean,

     

    To format a number using fixed-point notation, you can simply use the toFixed(n) method, e.g.
    Code:

     

    return ([[@SubListCurrentRow.Purchases.Qty]]*
    [[@SubListCurrentRow.Purchases.Unit_x0020_Price]]).toFixed(2);
    

     

     

     

    Do not forget to change expression type to 'Function code':
    01.22.2016-17.20.png

    0
  • ArdeviaForum

    Original Post by Sean Docherty (Imported from Ardevia Forum)

    Hello Liliia,

     

    Thank you for the information to resolve this problem.
    It worked perfectly!!!

    0

Please sign in to leave a comment.