Help : Sum of same client name from portal
New here..need some help..i am creating one project management database..which has tables like -Project Manager-Project Manager Contractor-Projects-Accounts-Debit Portal Lines-Credit Portal Lines..
the basic idea of this database is..user create new projects in project manager layout-where he add details about project-like start date-end date-agreed amount..balance amount..on same layout i have one portal which is linked to project manager-contractor-which has fields-category-account name-agreed contractor amount-paid amount-balance amount
in accounts layout- user can create accounts like client contractor..there is simple value list option used for it, to create account category..
and in projects-i have portal with two parts..debit portal lines and credit portal lines-where user can add dr or cr entrys to projects..
now problem is :
in my project management layout i have portal to add and get contractos payment details..user here can add agreed amount to contractor..user makes entrys in cr portal lines for contractor..sum all entrys of that contractor and should minus from agreed amount of that contractor and give balance amount..but its not working that way..i dont know how to use or create script which can add only for same contractors entrys from same project..pls guide..i am trying to attach detailed screen shot..
thanx in advance..