End of Service Gratuity based on 2004 Qatar Labour Law

How to Compute End of Service Gratuity based on 2004 Qatar Labour Law. As detailed explanation and with proof under 2004 Qatar Labour Law, the better.
I am Working Here in Qatar for More than 6 years with basic salary of QAR. 2,500 including FOOD ALLOWANCE, TRANSPORTATION, ACCOMMODATION, LAUNDRY, MEDICAL BENEFITS, ROUND TRIP TICKET.
Read more: http://www.qatarliving.com/node/18286021#ixzz2gBlKDlxh
1.Total days Service = Last date service - Joining date
2.Gratuity Days=Total days of services/365*21
3.Paid = Basic salary x 12/365 x Gratuity Days.
Hope you will Get accurate End of service Pay.
BASIC Salary
/
30
*
21
*
Number of years completed
EOSB law is effective from 01-01-2005, even if you joined prior to that. 21 days basic salary (current) per completed year provided you successfully completed probation/1 year. Allowances will not compute.