Document totals calculation

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

Hi!

I have a new question: when the document totals should be calculated what is the right beh * avior: to calculate it on each tabular section attribute change or during posting? For example I have a document with tabular section containing the following attributes: Item, Quantity, Price, Amount and overall Total attribute of the document.

And one more question: what if to store prices in the information register to update them all at a time? I’m not sure if it is useful feature…

 
#2
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

Hi, Lies Susann,

You need to add a procedure for calculating totals and use it in separate OnChange event handlers for each attribute which, if changed, influences the total values.

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

Thank you, Xin Wang!

And what if I have a document with 10-100 thousand lines and calculate totals for each change event wouldn’t it be too slow for a user?

 
#4
People who like this:0Yes/0No
Just came
Rating: 0
Joined: May 5, 2012
Company:

In standard 1C configurations(like 1C Accounting for Ukraine or 1C Trade Management for Ukraine), total amount calculates at the procedure "Before Write".

 
#5
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Nov 2, 2011
Company:

Quote
Lies Susann wrote:
I have a new question: when the document totals should be calculated what is the right beh * avior: to calculate it on each tabular section attribute change or during posting?
As the user will wish :-)
If you care about performance, you can calculate totals inside OnEditEnd event handler.
You can use local variables for storing totals and decrease totals inside "BeforeRowChange"  and increase new totals inside "OnEditEnd"

 
#6
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Jul 18, 2012
Company:

Thank you! That is interesting idea to calculate overall total incrementally.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.