Hi,
you could do several calculations;

``````@FieldWithNumberOfA + @FieldWithNumberOfB
``````

Result would be e.g. 5. With that number you can do further calculations. If you only want to show the numbers as a kind of report you can use for a case like A= 2, B = 3, C= empty:

``````var a = @FieldWithNumberOfA;
var b = @FieldWithNumberOfB;
var c = @FieldWithNumberOfB;

var aNum = a != "" ? "Number of A: " + a + "\n" : "";
var bNum = b != "" ? "Number of B: " + b + "\n" : "";
var cNum = c != "" ? "Number of C: " + c  + "\n" : "";
var total = a + b + c;

aNum + bNum + cNum + total
``````

You would get:
Number of A: 2
Number of B: 3
Total: 5

Rainer

Rainer,
Thank you for replay.

But, if I am not a programmer, how could I make it?
*Maybe I posted at the wrong section here...

I am using the 'sales' application.
https://podio.com/market/apps/17104-sales

In my image, just need a quantity text box besides each product.
And the amount of each product with its quantity would be calculated.
Finally, it comes out with the total amount automatically(as a calculation field).

--
Jingle

Yes, you need an own quantity field for each product where you have to enter the amount of each product manually. But if you want to do it that way, I would also recommend a second relationship field for the second product. Besides that you'll need a new title field, because in the current app setup the first product would be the title (you could move e.g. the customer field to the top of the template as new title field).

And you need a calculation field to sum all quantity fields, like in my first example. Create a calculation field and type the @-sign. A list opens with your app fields. Click quantity field 1, than + , than @ for selecting quantity field 2 and so on. So that you have a calculation like

``````@quantity1 + @quantity2
``````

In the app there is already a calculation field "Total sale value" which calculates the number of the existing Quantity field * Price of this product (Price is stored in the Products App). If you add another Quantity field you have to change that calculation field too. How is should be changed depends on what you want to see in this field "Total sale value" - the total sales value of all products or the sales value for each product.

I don't understand what you mean by "And the amount of each product with its quantity would be calculated."

Rainer
rg@delos-consulting.com

What I mean is right here;)
https://flic.kr/p/rNp6bh

A sale is dynamic as its products would be decrease or increase before one transaction being completed.

For what you want to have you need another app setup, you can't do that in one app.
1. Rename your Sales App to e.g. "Ordered Products" . Each item should be for one product only.
2. Rename field "Total Sale Value" to "Sale value this Product"
3. Maybe a Relationship Field to new "Sales" (depends on your workflow).
4. Create a new App and call it "Sales". In this app you collect all ordered products for this order.

New Sales App should have the following fields:
1. Relationship Field to Customer
2. Calculation Field: Total quantity (@sum of quantity)
3. Calculation Field: Total sales value this order (@sum of Sale Value this Product)
4. Maybe Relationship Field to "Ordered Products" (depends on your workflow).

You have to connect the two apps, either from "Ordered Products" to "Sales" or vice versa. If you can share a description of your workflow(how orders come in, how order dates will be entered into Podio etc.) I maybe can recommend what's the best way.

Rainer

Hi, Rainer,
Thank you response me time and time again;)

I think two apps is not my case(waste of time even when using it but not design it).

The workflow is described following(actually, just like any shopping flow):
1. A customer's order is coming.(Maybe he/she has more than one orders, but just consider one for present)
2. There is at least one product(A), but there are more than one(B,C...) usually.
3. There is at least one for each product(A:1, B:1, C:1), but there are more than one for each product(A:2, B:3, C:4) usually.
*I described as an image posted in one of my reply at this topic.
4. Each product has its default price, but I want to adjust the price some time(discount, but not always).
5. Each product's sale value(quantity included) is calculated, and total sale value should be calculated too.

I am a free account now, if it came true, I consider to pay PODIO monthly;)

Hi Jingle,

as I said: you need another setup with one more app. And in my recommended app "Ordered Products" you would need another number field for a possible discount, the Sales value calculation field you have to change too
@sum of price - @discount * @quantity.

Podio would sure be glad to get another paying customer if you upgrade. But that's not my business, I'm just a customer and user. :)

Rainer
rg@delos-consulting.com

Hi, Rainer

I am sorry, I though you are a support at PODIO;)

I will consider your advice even though it would be a time expensive thing.
And I am still look for other alternative method to work with POIDO more effectively.

--
Jingle

Actually, I am a senior engineer work at a SI company;)
Below is my code.

var sum = 0;
for (i = 0; i < @All of Price.length; i++) {
sum += @All of Price[i] * @All of Quantity[i];
}

The additional thing is that, I add an extra app 'Counter' which is just pure number '1,2,3,4...'.
Use this app within Sales app, which combining Products app, they work like a charm!

Hi Jingle,

looks good, but that's not what you said you want. Now you'll get the prices of all products linked to one order - but from where do you get `@all of quantity"? You would need a field "Quantity" in your Products Database App so you don't have the ordered quantity for every product in your sales app (where you wanted it according to your screenshot - and where it should be). If you have a "Quantity" field in "Products" you have to change it for every order - and if you change it the former orders values would also be changed.

Rainer

Hi Rainer,
Here, it is, the images:
https://flic.kr/p/s6Vgg3
https://flic.kr/p/rRBLnm

I add an extra app which is named 'Counter' including a field named 'Quantity'.
Then, I connect the 'Counter' into my 'Sales'.

And the 'Total sale value' is where my script works.

As there is no direct way to implement my need, I just do some alternative tricks;)

Additional, yes, I have to pay attention to those sequence.

If you only want the Total Sales Value for this one order it could work. But you can't do any further reporting and statistics with this setup (like inventory check or sales value for each product) besides a sum of Total Sales Value of all orders
Good luck :)
Rainer

But you can't do any further reporting and statistics with this setup (like inventory check or sales value for each product)
It is not the matter.

In fact, I have another third-party inventory & sales system which are lack of monthly settlement.
So I use PODIO just want to calculate the sale value for each order, and sum up all of those for total sale value monthly.