TEST : Simple stock - warehouse with ConfiForms

In this example we will demo a simple setup of 2 forms, which emulate the stock / warehouse


Stock form

item

Quantity

preassure suit 2
helmet 4
boots, size 9 0
swimsuit 0
bag 12
I see 2
fun 100
bag 10
thing 5555
Item 1
Item 2
-jh-lhlh 8
Test 1
23 213213
helmet 5
vm 5
2002-1201 10
Tools 50
Tools 2 0
сасатар 1488
NewItem 9
widget1 4
widget1 2
kjhg 78
UBTHING 234
bagggg 123
第三方 1
.ö.ö 009
apple 1200
preassure suit 2
ASDASSDASD 1
agfdsasd 4
cool item 2
bildschirm 2
fggfhfhf 3
Sample 500




Salespoint / ordering form, which reduces stock

Items with 0 quantity are not shown in the ordering list

ordered item

order time

boots, size 9 Aug 22, 2018 10:19
swimsuit Aug 22, 2018 10:28
helmet Aug 30, 2018 21:38
preassure suit Aug 30, 2018 21:38
bag Sep 06, 2018 08:59
bag Sep 06, 2018 08:59
I see Sep 11, 2018 15:36
helmet Sep 12, 2018 15:43
bag Sep 14, 2018 15:08
helmet Oct 01, 2018 23:53
fun Oct 01, 2018 23:54
helmet Oct 02, 2018 22:32
fun Oct 02, 2018 22:32
helmet Oct 11, 2018 18:22
helmet Oct 22, 2018 20:11
helmet Nov 27, 2018 22:18
fun Dec 11, 2018 23:19
preassure suit Dec 11, 2018 23:19
bag Dec 11, 2018 23:20
I see Dec 11, 2018 23:45
bag Dec 15, 2018 00:30
thing Dec 15, 2018 00:32
bag Dec 15, 2018 00:32
bag Dec 15, 2018 00:32
Item Dec 15, 2018 00:34
Item Dec 15, 2018 00:34
Item Dec 15, 2018 00:35
Item Dec 15, 2018 00:35
-jh-lhlh Dec 28, 2018 18:11
helmet Jan 07, 2019 20:30
I see Jan 18, 2019 02:25
bag Jan 18, 2019 02:26
Item Jan 28, 2019 16:03
Item Jan 28, 2019 16:04
preassure suit Jan 28, 2019 19:18
I see Feb 05, 2019 14:44
helmet Feb 22, 2019 05:16
helmet Jun 03, 2019 20:07
bag Jun 03, 2019 20:08
thing Jun 03, 2019 20:08
preassure suit Aug 01, 2019 18:35
preassure suit Aug 01, 2019 18:35
vm Aug 01, 2019 18:35
2002-1201 Aug 01, 2019 18:36
helmet Aug 08, 2019 14:36
2002-1201 Aug 08, 2019 14:36
bag Aug 08, 2019 17:03
bag Sep 20, 2019 21:29
bag Oct 07, 2019 11:26
preassure suit Oct 28, 2019 18:25
Tools Oct 28, 2019 18:27
сасатар Nov 07, 2019 13:58
vm Nov 20, 2019 20:25
Tools Nov 22, 2019 14:36
helmet Dec 04, 2019 15:06
I see Jan 07, 2020 08:18
vm Jan 23, 2020 23:09
Item Jan 23, 2020 23:09
helmet Jan 30, 2020 17:33
NewItem Feb 11, 2020 16:02
widget1 Feb 11, 2020 21:54
I see Feb 12, 2020 15:45
kjhg Feb 12, 2020 15:46
kjhg Feb 12, 2020 15:46
UBTHING Feb 13, 2020 15:59
fun Feb 13, 2020 16:00
I see Feb 24, 2020 20:52
bag Mar 15, 2020 16:10
bagggg Mar 20, 2020 17:16
bagggg Mar 20, 2020 17:16
bag Mar 20, 2020 17:17
第三方 Mar 20, 2020 17:18
bag Mar 25, 2020 09:23
helmet Apr 09, 2020 19:22
helmet May 07, 2020 20:03
apple Jun 22, 2020 13:41
Jun 25, 2020 16:29
helmet Jun 25, 2020 16:29
preassure suit Jun 28, 2020 16:12
preassure suit Jun 29, 2020 05:40
helmet Jul 28, 2020 18:19
helmet Aug 11, 2020 05:47
bag Aug 11, 2020 06:08
widget1 Aug 11, 2020 06:09
cool item Aug 11, 2020 06:23
bagggg Aug 13, 2020 12:16
preassure suit Aug 17, 2020 15:32
23 Aug 17, 2020 15:32
I see Sep 04, 2020 17:00
I see Sep 09, 2020 16:49
bildschirm Oct 19, 2020 09:57
cool item Oct 19, 2020 09:57
Sample Dec 01, 2020 02:54
Sample Dec 01, 2020 02:54


Solution for this demo in storage format (please remember to change the config for "orderItem" field in the form#2 (orderForm1) to reference the stock form on your page)

<p>In this example we will demo a simple setup of 2 forms, which emulate the stock / warehouse</p>
<p>
  <br/>
</p>
<p>Stock form</p>
<ac:structured-macro ac:macro-id="ea7db6d6-4aaa-44d4-82bb-94c487bd5913" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">stock1</ac:parameter>
  <ac:parameter ac:name="registrationFormTitle">Stock</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="abf41b82-7f09-423e-bea5-2fb2bf62abbc" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="registrationButtonLabel">Register stock item</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="16735a0c-2732-4cf8-825e-414eb2dc591d" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">item</ac:parameter>
        <ac:parameter ac:name="fieldLabel">item</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
        <ac:parameter ac:name="required">true</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="22a54919-25fd-42aa-8670-6dfbeca28705" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">quantity</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Quantity</ac:parameter>
        <ac:parameter ac:name="type">number</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="db9f48aa-06d3-4fe7-8358-c487f2415be8" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">id:[empty] AND quantity:&lt;0</ac:parameter>
        <ac:parameter ac:name="fieldName">Quantity shall be non negative</ac:parameter>
        <ac:parameter ac:name="action">Validation rule</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="7013aab1-1ea4-4594-a88e-481ed3b46a3d" ac:name="confiform-table" ac:schema-version="1">
  <ac:parameter ac:name="formName">stock</ac:parameter>
  <ac:rich-text-body>
    <p>
      <br/>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>
  <br/>
</p>
<p>Salespoint / ordering form, which reduces stock</p>
<p>Items with 0 quantity are not shown in the ordering list</p>
<ac:structured-macro ac:macro-id="5d01f7a6-37c4-4d10-8f2b-f74b9255b4b3" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">orderForm1</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="4a184218-8a09-4085-8e20-6d4177af9c8e" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="registrationButtonLabel">Order</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="3650d422-e6df-45df-9e61-ea7c82ff7443" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">orderItem</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Item to order</ac:parameter>
        <ac:parameter ac:name="values">[29393083|stock1|item|true||]</ac:parameter>
        <ac:parameter ac:name="type">smartselect2</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="86231268-91d6-46a8-b8fa-3b38fbdbd322" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">orderItem</ac:parameter>
        <ac:parameter ac:name="values">quantity:&gt;0</ac:parameter>
        <ac:parameter ac:name="action">Apply Filter on a field</ac:parameter>
      </ac:structured-macro> – show only items with quantity &gt; 0</p>
    <p>
      <ac:structured-macro ac:macro-id="f004b282-3bbc-4c67-9e86-6faea01e4ac2" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">id:[empty] AND orderItem.quantity:&lt;1</ac:parameter>
        <ac:parameter ac:name="fieldName">Sorry, we dont have this item in stock anymore</ac:parameter>
        <ac:parameter ac:name="action">Validation rule</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="5a3e3e8f-34fa-4f59-92c9-4aa320d0f1ba" ac:name="confiform-ifttt" ac:schema-version="1">
      <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
      <ac:parameter ac:name="event">onCreated</ac:parameter>
      <ac:parameter ac:name="title">entryId=[entry.orderItem]&amp;quantity=([entry.orderItem.quantity]-1)</ac:parameter>
      <ac:parameter ac:name="who">stock:this</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="6490db44-bf19-408f-bd61-d3334884a7b9" ac:name="confiform-table" ac:schema-version="1">
  <ac:parameter ac:name="formName">orderForm</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="25d125bd-27fd-4bb5-b9f9-412e3b11dcd0" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="overrideLabel">ordered item</ac:parameter>
        <ac:parameter ac:name="fieldName">orderItem</ac:parameter>
      </ac:structured-macro> <ac:structured-macro ac:macro-id="f4dcb615-2dbf-47ed-97f0-9af7b27ec775" ac:name="confiform-field" ac:schema-version="1">
        <ac:parameter ac:name="overrideLabel">order time</ac:parameter>
        <ac:parameter ac:name="fieldName">created</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>