If the checkbox is for the user to check at, then you may have another field called check_payment
which can be used as follows:
<input type="checkbox" name="check_payment" class="payment-received" data-id="{{_id}}" checked="
{{#if author}}
checked
{{/if}}
">
Another approach:
Since I don't know the full data structure or platforms of your application, I am going to make a few assumptions and thus pseudo-codes.
The core point is that at what time a record is inserted in the database corresponding to a customer and a date. As soon as the customer pays, then the customer or the application will itself will tick the checkbox (true value) or else the default value is false.
1) Server-side operation:
Handlebars.registerHelper('check_present', function(obj,list, options) {
for(var i=0,j=list.length; i<j; i++) {
if(obj==list[i])return true;
}
return false;
});
{{#each Customers}}
<tr>
<td id="{{nextpayment}}">{{nextpayment}}</td>
<td>{{name}}</td>
<td>{{subscription_amount}}</td>
<td>
<input type="checkbox" class="payment-received" data-id="{{_id}}"
{{if check_present(_id,customer_list) }} //User-defined Handlebar function
checked="checked"
{{/if}}></td>
</tr>
{{/each}}
2) Client-side operation: Use JS library for utilities functions like Underscore.js, Prototype.js, Backbone.js etc.
Using underscore.js and jQuery,
$('.payment_received').each(function(){
if(_.contains(customer_list, $(this).attr('data-id'))){
$(this).attr("checked","checked");
}else{
$(this).removeAttr("checked");
}
})
3) Database-level operation: Perform operations at database level for fetching who has paid and who has not paid and the complete list of customers. Then do intersection operation among themselves. You can now use handlebars straightforwardly.