$i = 0;
while ($records->have_posts()) {
    $records->the_post();
    // Calculate the percentage
    $i++;
    $percent = intval($i / $records->found_posts * 100) . "%";
    // Javascript for updating the progress bar and information
    echo '<script language="javascript" id="progress_js">
						document.getElementById("rows_progress").innerHTML="<div style=\\"width:' . $percent . ';background-color:#ddd;\\">&nbsp;</div>";
						document.getElementById("table_progress").innerHTML="' . sprintf(self::__('%o records(s) of %o added.'), $i, $records->found_posts) . '";
						document.getElementById("progress_js").remove();
						</script>';
    $table_total_estimated += si_get_estimate_total();
    $table_subtotal += si_get_estimate_subtotal();
    $invoice_name = si_get_estimate_invoice_id() ? sprintf('<a href="%s">%s</a>', get_edit_post_link(si_get_estimate_invoice_id()), get_the_title(si_get_estimate_invoice_id())) : self::__('N/A');
    $client_name = si_get_estimate_client_id() ? sprintf('<a href="%s">%s</a>', get_edit_post_link(si_get_estimate_client_id()), get_the_title(si_get_estimate_client_id())) : self::__('N/A');
    ?>
						<tr> 
							<td><?php 
    the_ID();
    ?>
</td>
							<td><span class="si_status estimate_status <?php 
    si_estimate_status();
    ?>
"><?php 
    si_estimate_status();
    ?>
</span></td>
							<td><?php 
    si_estimate_issue_date();
$i = 0;
while ($records->have_posts()) {
    $records->the_post();
    // Calculate the percentage
    $i++;
    $percent = intval($i / $records->found_posts * 100) . '%';
    // Javascript for updating the progress bar and information
    echo '<script language="javascript" id="progress_js">
						document.getElementById("rows_progress").innerHTML="<div style=\\"width:' . $percent . ';background-color:#ddd;\\">&nbsp;</div>";
						document.getElementById("table_progress").innerHTML="' . sprintf(__('%o records(s) of %o added.', 'sprout-invoices'), $i, $records->found_posts) . '";
						document.getElementById("progress_js").remove();
						</script>';
    $table_total_estimated += si_get_estimate_total();
    $table_subtotal += si_get_estimate_subtotal();
    $invoice_name = si_get_estimate_invoice_id() ? sprintf('<a href="%s">%s</a>', get_edit_post_link(si_get_estimate_invoice_id()), get_the_title(si_get_estimate_invoice_id())) : __('N/A', 'sprout-invoices');
    $client_name = si_get_estimate_client_id() ? sprintf('<a href="%s">%s</a>', get_edit_post_link(si_get_estimate_client_id()), get_the_title(si_get_estimate_client_id())) : __('N/A', 'sprout-invoices');
    ?>
						<tr> 
							<td><?php 
    echo si_get_estimate_id(get_the_id());
    ?>
</td>
							<td><span class="si_status estimate_status <?php 
    si_estimate_status();
    ?>
"><?php 
    si_estimate_status();
    ?>
</span></td>
							<td><?php 
    si_estimate_issue_date();
 /**
  * Echo the estimate client_id
  * @param  integer $id
  * @return string
  */
 function si_estimate_client_id($id = 0)
 {
     if (!$id) {
         $id = get_the_ID();
     }
     echo apply_filters('si_estimate_client_id', si_get_estimate_client_id($id), $id);
 }
											<span class="dt_heading"><?php 
    si_e('To');
    ?>
</span>
										</dt>
										<dd>
											<b><?php 
    echo get_the_title(si_get_estimate_client_id());
    ?>
											
											<?php 
    do_action('si_document_client_addy');
    ?>
</b> 
											<?php 
    si_client_address(si_get_estimate_client_id());
    ?>

										</dd>
									</dl>
								<?php 
}
?>
								<?php 
do_action('si_document_vcards');
?>
							</dl><!-- #doc_address_info -->
						</div><!-- #vcards -->
						
						<div class="doc_details clearfix">
							<?php 
 /**
  * Echo the estimate client_id
  * @param  integer $id 
  * @return string      
  */
 function si_estimate_client_id($id = 0)
 {
     if (!$id) {
         global $post;
         $id = $post->ID;
     }
     echo apply_filters('si_estimate_client_id', si_get_estimate_client_id($id), $id);
 }