Ah... of course! payslip.sum()

Thanks Mustafa, very helpful.

On 2012-10-12, at 12:49 AM, Mustufa Rangwala <[email protected]> wrote:

> Hello John,
> 
> To calculate YTD Income you can use sum method on available objects in your 
> expression.
> 
> sum() method available for three objects/variables i.e.payslip, worked_days, 
> inputs.
> 
> They are :
> payslip.sum(code, from_date, to_date)
> worked_days.sum(code, from_date, to_date),
> inputs.sum(code, from_date, to_date)
> 
> Where Code is Salary rule code and Dates are begin and Ending Date (Start 
> Period and Current Period dates.)
> 
> For example: If you want to sum all gross amount between Jan to Dec 2012. You 
> can just create one salary rule with expression payslip.sum('GROSS', 
> 01/01/2012, 31/12/2012).
> 
> Regards,
> 
> On Fri 12 Oct 2012 06:37:46 AM IST, John Boyle wrote:
>> Hi folks,
>> 
>> Guessing someone has figured out a more clever approach to do this....
>> 
>> Anyone with a large employee base (>100) need to do YTD calc's for payroll? 
>> I have a few complex calc's that require the input, and the employee base is 
>> too large to calculate and enter them manually. I realize I could use an 
>> action, but I'd rather have access directly to the value from the salary 
>> rule.
>> 
>> I've put together a module that accesses the values (and some other values 
>> that can be tied to the contract) directly but I had to overwrite a key 
>> function to do so. From the Salary Rule I can call contract_rule.ytd_amount, 
>> contract_rule.ytd_max which is associated with a rule on the contract 
>> itself. I need to enhance it a bit to be able to reference a specific year 
>> rather than just the current YTD though.
>> 
>> My 2 cents on payroll is that it should include a way to reference simple 
>> values either tied to the contract or the employee. The HR folks I've talked 
>> to were a little intimidated by the salary rules and felt there should be a 
>> small set of them maintained by a Business Analyst and they should have 
>> access to a simple way just to enter input values.
>> 
>> We also needed to do Non-Salaried employees by attendances so I put together 
>> a module for that borrowing some work from Mihai, but everything is 
>> inherited so it works happily as a stand alone.
>> 
>> So... is there a better way to do this? Or is this approach something that 
>> might be handy as part of the hr_payroll module? Thanks for your feedback!
>> 
>> John
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openerp-community
>> Post to     : [email protected]
>> Unsubscribe : https://launchpad.net/~openerp-community
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> 
> --
> Thanks,
> Mustufa Rangwala


_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

Reply via email to