<style type="text/css">
    .amount{
        text-align: right;
    }
    
    .quantity {
        text-align: center;
    }
    
    .btn-group button {
        height:30px;}

    #content .wrap #grid_content_1 .row-fluid.scRow .row-fluid.scRow .span12.scCol #grid_block_5 .content.np #listDetails tbody #trInfos td .row-fluid .controls-row .span3 {
        font-size: 11px;
        color: #000;
        font-weight: bold;
    }
    .test {
        font-size: 10px;
    }
    .span3 {
        font-size: 10px;
    }
    tbody {
        font-size: 10px;
    }
    #content .wrap #grid_content_1 .row-fluid.scRow .row-fluid.scRow .span12.scCol #grid_block_6 .content.np #listCharge tbody #trInfos td .row-fluid .controls-row .span3 {
        font-weight: bold;
    }
</style>
<script type="application/javascript">
			
$(document).ready(function(){
});

//Tell the validator not to ignore hidden items
//var validator = $('#paymentDetail').validate({ignore: null});
//Tell the validator to only ignore inputs of type 'hidden'
//var validator = $('#paymentDetail').validate({ignore: 'input[type=hidden]'});


$( document ).ready(function() {
        $('select').select2();
        $.each($(".select2-container"), function (i, n) {
            $(n).next().show().fadeTo(0, 0).height("0px").css("left", "auto"); // make the original select visible for validation engine and hidden for us
            $(n).prepend($(n).next());
            $(n).delay(500).queue(function () {
                $(this).removeClass("validate[required]"); //remove the class name from select2 container(div), so that validation engine dose not validate it
                $(this).dequeue();
            });
        });	
                                  $("#amountpaid").dblclick(function() {
                                          $(this).val($("#totalpaid").val());
                                  });
                          });

			   
				
				
                                function getItemCode(me){
                                        $.ajax({
                                                type: "POST",
                                                data: "itemCode="+$(me).val(),
                                                url: "<?php echo base_url() ?>purchasetransaction/getItemCodes",
                                                success: function(data) {
                                                   $("#itemcode").attr("data-source", data);
                                                }
                                         });
                                }
				
			
                                function refreshProject(){
                                        $.ajax({
                                                type: "POST",
                                                url: "<?php echo base_url() ?>purchasetransaction/refreshProject",
                                                success: function(data) {
						
                                                   var resul = eval ("(" + data + ")"); 
                               var n=resul.records.length;
                               var i=0;
                               var opt='' +
                                                '<option></option>';
                                for (i=0;i<n;i++)
                                        opt=opt + '<option value="' + resul.records[i].id +'">' + resul.records[i].projectName + '</option>';
                                                        $('#project').empty();
                                $('#project').append(opt);
                                                }
                                         });
                                }
				
			
			
                                function getTermDescription(me){
                                        $.ajax({
                                                type: "POST",
                                                data: "term="+ me.value,
                                                url: "<?php echo base_url() ?>purchasetransaction/getTermDescription",
                                                success: function(data) {
                                                        $('#termDescription').html(data);
                                                }
                                         });
                                }
				
  function displaybanksInfos() {
    $("#acctNo").val($("#bank option:selected").attr("data-bankAccountNo"));
    $("#balance").val($("#bank option:selected").attr("data-currentBalance"));
  }
				
                                
function savePayment(me){

    if ($("#itemcode").attr("itemID")=="")
            $("#itemname").val("");
     if( $("#paymentDetail").validationEngine('validate')){
            if ( $("#paymentId").val()=="null"){
                    getTotal();
                    $.ajax({
                    type: "POST",
                    data: {
                                    memo : $("#memo").val(),
                                    payto : $("#payto").val(),
                                    locationID : $("#location").val(), 
                                    paymentMethodID : $("#paymentmethood").val(), 
                                    amountPaid : $("#amountpaid").val(), 
                                    formNo :  $("#formNo").val(),
                                    paymentDate : $("#createdDate").val(),
                                    referenceNo: $("#createdDate").val(),
                                    bankID : $("#chargeAccount").val(),
                                    projectID : $("#project").val(),
                                    
                                    lineNo : $("#paymentDetails").attr("data-currentRow")*1+1,
                                    amountIncludedTax : accounting.unformat($("#amountIT").val()),
                                    itemAccountID : $("#accountID").val(),
                                    itemdescription: $("#itemDesc").val(),
                                    amountExcludedTax: accounting.unformat($("#amountExcludedTax").val()),
                                    taxAmount : accounting.unformat($("#taxAmount").val()),
                                    taxID: $("#listTax ").val(),
                                    taxRate: $("#listTax option:selected").attr("data-tax")

                            },
                     url: "<?php echo base_url() ?>OthersPayment/savenewpaywithOutItem",
                     success: function(data) {
                     var resul = eval ("(" + data + ")"); 
                      $("#paymentId").val(resul.paymentID);
                      $("#paymentDetails").attr("data-currentRow", $("#paymentDetails").attr("data-currentRow")*1+1);
                      $(''+
                       '<tr><td>' +  $("#paymentDetails").attr("data-currentRow") +'</td>'+
                              '<td>' +  $("#accountID option:selected").text() + '</td>'+
                              '<td>' + $("#itemDesc").val() + '</td>'+
                              '<td class="amount">' + accounting.formatNumber($("#amountExcludedTax").val(),2) + '</td>'+
                              '<td>' + $("#listTax option:selected").attr("data-tax") + ' | ' + $("#listTax option:selected").attr("data-taxcode") + '</td>'+
                              '<td class="amount">' + accounting.formatNumber($("#taxAmount").val(),2) + '</td>'+
                              '<td class="amount">' + accounting.formatNumber($("#amountIT").val(),2) + '</td>'+
                              '<td>' +
                              '</td>'+
                        '</tr>'
                            ).insertBefore( "#trInfos" );
                            $("#btnCancel").trigger("click");
                            getTotal();
                    msg (1,"alert alert-success","Details successfully saved");
                    } //end function
             });//end ajax
            }else{ //savedetailonly
                    $.ajax({
                    type: "POST",
                    data: {
                              otherPaymentID : $("#paymentId").val(),
                                    
                                    lineNo : $("#paymentDetails").attr("data-currentRow")*1+1,
                                    amountIncludedTax : accounting.unformat($("#amountIT").val()),
                                    itemAccountID : $("#accountID").val(),
                                    itemdescription: $("#itemDesc").val(),
                                    amountExcludedTax: accounting.unformat($("#amountExcludedTax").val()),
                                    taxAmount : accounting.unformat($("#taxAmount").val()),
                                    taxID: $("#listTax").val(),
                                    taxRate: $("#listTax option:selected").attr("data-tax")

                            },
                    url: "<?php echo base_url() ?>OthersPayment/savenewpaywithoutItemDetailOnly",
                    success: function(data) {
                     msg (1,"alert alert-success","Details successfully saved");
                      var resul = eval ("(" + data + ")"); 
                      $("#paymentDetails").attr("data-currentRow", $("#paymentDetails").attr("data-currentRow")*1+1);
                    $(''+
                        '<tr><td>' +  $("#paymentDetails").attr("data-currentRow") +'</td>'+
                              '<td>' +  $("#accountID option:selected").text() + '</td>'+
                              '<td>' + $("#itemDesc").val() + '</td>'+
                              '<td class="amount">' + accounting.formatNumber($("#amountExcludedTax").val(),2) + '</td>'+
                              '<td>' + $("#listTax option:selected").attr("data-tax") + ' | ' + $("#listTax option:selected").attr("data-taxcode") + '</td>'+
                              '<td class="amount">' + accounting.formatNumber($("#taxAmount").val(),2) + '</td>'+
                              '<td class="amount">' + accounting.formatNumber($("#amountIT").val(),2) + '</td>'+
                              '<td>' +
                              '</td>'+
                    '</tr>'
                ).insertBefore( "#trInfos" );
                    $("#btnCancel").trigger("click");
                    getTotal();
                    msg (1,"alert alert-success","Details successfully saved");
               }
             }); //end ajax
            } //end if data valide
            }else {
                    msg (1,"alert alert-error", "Data incorrect or invalid ...");
            }
    }





function addRow(){
    n = $("#paymentDetails").attr("data-currentRow")*1 + 1;
    if (!$("#accountID").length) {
             $(''+
             '<tr><td>' + n +'</td>'+
                            '<td class="span2"> <select name="accountID" id="accountID" class="span12" validate[required]"><option></option>' +
<?php
if ($chargeAccount) {
    foreach ($chargeAccount as $row) {
        ?>
        '<option value="<?php echo $row->ID; ?>"><?php echo $row->acctCode . " | ";
        echo str_replace("'", " ", $row->acctName, $count); ?></option>'+
    <?php }
} ?>
                             '</select></td>'+
                    '<td class="span4"><input  id="itemDesc" name="itemDesc"  type="text" class="span12 validate[required]" placeholder="Description"></td>'+
                    '<td class="span1"><input id="amountExcludedTax" onkeyup="calculAmount()" name="amountExcludedTax" class="span12 validate[required, custom[number]] amount" type="text" placeholder="Amount"></td>'+
                    '<td class="span2"><select onchange="calculAmount()" name="listTax" id="listTax"  class= "span12"><option></option>' +
<?php
if ($taxmaster) {
    foreach ($taxmaster as $row2) {
        ?>
        '<option value="<?php echo $row2->ID; ?>" data-taxcode ="<?php echo $row2->code; ?>" data-tax="<?php echo $row2->taxPercentage; ?>">' + 
                     '<?php echo $row2->code . " | " . $row2->taxPercentage;
         ?></option>'+
    <?php }
} ?>
                             '</select></td>'+
                                                                            '<td class="span1"><input id="taxAmount" disabled name="taxAmount" class="span12 amount" type="text" placeholder="Amount"></td>'+
                                                                            '<td class="span1"><input disabled  id="amountIT" name="amountIT" class="span12 amount" type="text" placeholder="Amount (Exclude Tax)"></td>'+
                    '<td class="span1">'+
                            '<button onclick = "savePayment()" class="btn btn-mini btn-primary" type="button"><i class="icon-ok-circle"></i></button>'+
                            '<button onclick="delRow(this)" id="btnCancel" class="btn btn-mini btn-danger" type="button"><i class="icon-remove-circle"></i></button>'+
                    '</td>'+
'</tr>').insertBefore( "#trInfos" );
        $('#accountID').select2();
         $('#listTax').select2();
            }else{
                    msg (2,"alert","Please, do save the current details before addind new one");
                    }
}
  

  function getTotal (){
	  
         $("#totalamount").val("");
  
        $("#impotpayable").val("");
  
        $("#totalpayable").val("");
         var n =$("#paymentDetails > tbody > tr").length-1;
         var totalAmount =0;
         var impot = 0;
         var total = 0;
         for (i=0; i<=n; i++) {
                        totalAmount= totalAmount + accounting.unformat($('#paymentDetails > tbody > tr:eq(' + i + ') > td:eq(3)').text())*1; 
                        impot= impot + accounting.unformat($('#paymentDetails > tbody > tr:eq(' + i + ') > td:eq(5)').text()) *1; 
                        total= total + accounting.unformat($('#paymentDetails > tbody > tr:eq(' + i + ') > td:eq(6)').text())*1; 
         }
	
	
	
         $("#totalallocated").val(accounting.formatNumber(totalAmount,2));
  
        $("#totaltaxamount").val(accounting.formatNumber(impot,2));
  
        $("#totalpaid").val(accounting.formatNumber(total,2));
	
        $("#outofbalance").val(accounting.formatNumber(total-impot-totalAmount,2));
	
  }
					
					
function msg(n,type, message){
	
        $("#msg_div"+n +" p").html(message);
        $("#msg_div"+n).attr("class","alert " + type);
}

function delRow(me){
        var td=me.parentNode;
        var tr=td.parentNode;
        var tBody=tr.parentNode;
        tBody.removeChild(tr);
}

function refreshLocation(){
 $.ajax({
        type: "POST",
        url: "<?php echo base_url() ?>purchasetransaction/refreshLocation",
        success: function(data) {
	
           var resul = eval ("(" + data + ")"); 
           var n=resul.records.length;
           var i=0;
           var opt='' +
                '<option></option>';
                for (i=0;i<n;i++)
                        opt=opt + '<option value="' + resul.records[i].id +'">' + resul.records[i].location + '</option>';
                $('#location').empty();
                $('#location').append(opt);
        }
   });	
}

function refreshPayMethod(){
        $.ajax({
        type: "POST",
        url: "<?php echo base_url() ?>OthersPayment/refreshPayMethod",
        success: function(data) {
	
           var resul = eval ("(" + data + ")"); 
           var n=resul.records.length;
           var i=0;
           var opt='' +
                '<option></option>';
                for (i=0;i<n;i++)
                        opt=opt + '<option value="' + resul.records[i].id +'">' + resul.records[i].name + '</option>';
                $('#paymentmethood').empty();
                $('#paymentmethood').append(opt);
        }
   });	
}


        function calculAmount(){
                var am = accounting.unformat($("#listTax option:selected").attr("data-tax"))*accounting.unformat($("#amountExcludedTax").val())/100;
                 $("#taxAmount").val("0.00");
                 $("#amountIT").val("0.00");
                 if  (!isNaN(am)){
                        $("#taxAmount").val(accounting.formatNumber(am,2));
                        $("#amountIT").val(accounting.formatNumber(am*1 + 1*accounting.unformat($("#amountExcludedTax").val()),2));
                 }
        }

</script>



<div id="content"> 
    <div class="wrap">
        <div class="head">
            <div class="info">
                <h1><?php echo element('compName', $this->session->userdata('logged_in')) ?> [ 
<?php echo element('compNo', $this->session->userdata('logged_in')) ?> ]</h1>
                <ul class="breadcrumb">
                    <li><a href='<?php echo base_url() . "home" ?>'><?php echo $this->lang->line('dashboard') ?></a> <span class="divider">-</span></li>
                    <li><a href='<?php echo base_url() . "AccountPayables/home" ?>'> <?php echo $this->lang->line('module') ?></a> <span class="divider">-</span></li>
                    <li class="active"><?php echo $this->lang->line('titlewithout') ?></li>
                </ul>
            </div>

            <div class="search">
                <form action="<?php echo base_url() ?>admin/search" method="post">
                    <input name="search_text" type="text" placeholder="search..."/>                                
                    <button type="submit"><span class="i-magnifier"></span></button>
                </form>
            </div>        

        </div><!-- head --> 
        <div class="content" id="grid_content_1">
            <form id="paymentDetail" action="#">
                <input type="hidden" name="paymentId" id="paymentId" value="null" />   
                <div class="row-fluid">
                    <div class="alert alert-info">
                        <strong><?php echo $this->lang->line('titlewithout') ?></strong>
                    </div>
                </div>
                <div class="block">
                    <div class="content">
                        <div class="row-fluid scRow">                            
                            <div class="span4 scCol">
                                <div class="block ns" id="grid_block_1">
                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('formno') ?></div>
                                        <div class="span5">
                                            <input class="span12 validate[required]" id="formNo" name="formNo" value='<?php echo "$formNo"; ?>' style="color:red;"   type="text" placeholder="Form number ...">
                                        </div>
                                        <div class="span3">
                                            <input  class="span11"   type="text" placeholder="Serial" disabled="disabled">
                                        </div>
                                    </div> <!-- row -->
                                    
                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('date') ?></div>
                                        <div class="span8">
                                            <div class="input-prepend span12"><span class="add-on span2"><i class="i-calendar"></i></span>
                                                <?php
                                                $data = array(
                                                    'name' => 'createdDate',
                                                    'id' => 'createdDate',
                                                    'type' => 'text',
                                                    'onkeydown' => 'return false',
                                                    'class' => 'span10 datepicker validate[required]',);
                                                echo form_input($data, date(element('dtFormat', $this->session->userdata('logged_in'))));
                                                ?>
                                            </div>
                                        </div>
                                    </div> <!-- row -->
                                    
                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('payto') ?></div>
                                        <div class="span8">
                                            <textarea style="min-height:85px;" id="payto" class="span12 validate[required]" placeholder="<?php echo $this->lang->line('payto') ?>"></textarea>
                                        </div><!-- span -->
                                    </div> <!-- row -->


                                    
                                </div><!-- grid block 1-->
                            </div><!-- scCol -->

                            <div class="span4 scCol">
                                <div class="block" id="grid_block_3">
                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('bank') ?></div>
                                        <div class="span8">
                                            <select onchange="displaybanksInfos()" name="bank" id="bank" class="span12 validate[required]"><option></option>' +
                                                <?php
                                                if ($bankaccount) {
                                                    foreach ($bankaccount as $row) {
                                                        ?>
                                                        '<option data-currentBalance="<?php echo $row->currentBalance; ?>" data-bankAccountNo="<?php echo $row->bankAccountNo; ?>"  value="<?php echo $row->ID; ?>"><?php echo $row->bankShortName . " | ";
                                                        echo str_replace("'", " ", $row->branch, $count); ?></option>'+
    <?php }
} ?>
                                            </select>
                                        </div>
                                    </div> <!-- row -->

                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('acctno') ?></div>
                                        <div class="span8">
                                            <input id="acctNo" class="span12 tar" disabled type="text" placeholder="0">
                                        </div><!-- span -->
                                    </div> <!-- row -->

                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('balance') ?></div>
                                        <div class="span8">
                                            <input id="balance" disabled class="span12 validate[required] tar" type="text" placeholder="0.00">
                                        </div><!-- span -->
                                    </div> <!-- row -->

                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('project') ?></div>
                                        <div class="span8">
                                            <select id="project" class="span10">
                                                <option></option>
<?php
if ($project != '') {
    foreach ($project as $row) {
        ?>
                                                        <option value="<?php echo $row->ID; ?>"><?php echo $row->project_name; ?></option>
    <?php }
} ?>
                                            </select>
                                            <div class="btn-group span1">
                                                <button class="btn btn-mini btn-primary  dropdown-toggle" data-toggle="dropdown">
                                                    <span class="i-arrow-down-2"></span>
                                                </button>
                                                <ul class="dropdown-menu">
                                                    <!-- dropdown menu links -->
                                                    <li><a target="_blank" href="<?php echo base_url() ?>project/new"  id="btnNewPro">
                                                            <i class="icon-plus-sign"></i><?php echo $this->lang->line('addnewproject') ?></a></li>
                                                    <li><a href="#" onclick="refreshProject()"><i class="icon-refresh"></i><?php echo $this->lang->line('refreshlist') ?></a>
                                                    </li>
                                                </ul>
                                            </div> <!-- btn group -->
                                        </div><!-- span -->

                                    </div> <!-- row control -->
                                </div><!-- grid block 1-->
                            </div><!-- scCol -->
                            
                                                        <div class="span4 scCol">
                                <div class="block ns" id="grid_block_2">
                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('amountpaid') ?></div>
                                        <div class="span8">
                                            <input id="amountpaid" class="span12 validate[required] tar" type="text" placeholder="0.00">
                                        </div><!-- span -->
                                    </div> <!-- row -->



                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('refno') ?></div>
                                        <div class="span8">
                                            <input id="amountpaid" class="span12 validate[required]" type="text" placeholder="Ref no">
                                        </div><!-- span -->
                                    </div> <!-- row -->
                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('paymentmethood') ?></div>
                                        <div class="span8">
                                            <select class="span10 validate[required]" id="paymentmethood">
                                                <option></option>
                                                <?php
                                                if ($paymentmethod != '') {
                                                    foreach ($paymentmethod as $row) {
                                                        ?>
                                                        <option value="<?php echo $row->ID; ?>"><?php echo $row->name ?></option>
    <?php }
} ?>
                                            </select>
                                            <div class="btn-group span1">
                                                <button class="btn btn-small btn-primary dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu">
                                                    <!-- dropdown menu links -->
                                                    <li><a target="_blank" href="<?php echo base_url() ?>setting/masterCodeSetup"  id="btnLocation">
                                                            <i class="icon-plus-sign"></i><?php echo $this->lang->line('addpaymethod') ?></a></li>
                                                    <li><a href="#" onclick="refreshPayMethod()"><i class="icon-refresh"></i><?php echo $this->lang->line('refreshlist') ?></a></li>
                                                </ul>
                                            </div> <!-- btnn group -->
                                        </div>
                                    </div>

                                    <div class="controls-row">
                                        <div class="span4"><?php echo $this->lang->line('location') ?></div>
                                        <div class="span8">
                                            <select class="span10" id="location">
                                                <option></option>
                                                <?php
                                                if ($location != '') {
                                                    foreach ($location as $row) {
                                                        ?>
                                                        <option value="<?php echo $row->fldid; ?>"><?php echo $row->city . " | " . $row->address; ?></option>
    <?php }
} ?>
                                            </select>
                                            <div class="btn-group span1">
                                                <button class="btn btn-small btn-primary dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu">
                                                    <!-- dropdown menu links -->
                                                    <li><a target="_blank" href="<?php echo base_url() ?>setting/location"  id="btnLocation">
                                                            <i class="icon-plus-sign"></i><?php echo $this->lang->line('addLocation') ?></a></li>
                                                    <li><a href="#" onclick="refreshLocation()"><i class="icon-refresh"></i><?php echo $this->lang->line('refreshlist') ?></a></li>
                                                </ul>
                                            </div> <!-- btnn group -->
                                        </div>
                                    </div>
                                    
                                    
                                </div><!-- grid block 1-->
                            </div><!-- scCol -->
                            
                        </div><!-- row-fluid scRow-->
                    </div><!-- content -->
                </div><!-- bloc -->


                <div class="row-fluid scRow">                            
                    <div class="span12 scCol">
                        <div class="block" id="grid_block_4">
                            <div class="head">
                                <h2><?php echo $this->lang->line('paymentdetails') ?></h2>
                                <ul class="buttons">
                                    <li><a class="block_toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                                            <span class="i-arrow-down-3"></span></a></li>
                                </ul>                                        
                            </div><!-- head -->
                            <div class="content np">
                                <table data-currentRow="0" id="paymentDetails" cellpadding="0" cellspacing="0" width="100%">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th><?php echo $this->lang->line('account') ?></th>
                                            <th><?php echo $this->lang->line('description') ?></th>
                                            <th><?php echo $this->lang->line('amount') ?></th>
                                            <th><?php echo $this->lang->line('tax') ?></th>
                                            <th><?php echo $this->lang->line('taxAmount') ?></th>
                                            <th><?php echo $this->lang->line('amountIncludeTax') ?></th>
                                            <th class="tac"><?php echo $this->lang->line('action') ?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr id="trInfos">
                                            <td colspan="8">
                                                <div id="msg_div2" class="alert alert-info">
                                                    <h4><?php echo $this->lang->line('lastMessage') ?></h4>
                                                    <p style="padding-top:10px;"><?php echo $this->lang->line('noMessage') ?></p>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="footer">
                                    <div class="side fr">
                                        <div class="btn-group">
                                            <button style="margin-right:6px;" onclick="$('#paymentDetail').validationEngine('hide');" class="btn btn-mini" type="button" name="validat">Hide prompts</button>
                                            <button id="addRowCharge" onclick="addRow()" class="btn btn-mini btn-primary" type="button">
                                                <i class="icon-plus-sign"></i><?php echo $this->lang->line('addNewCharge') ?></button>

                                        </div><!-- btn group -->      
                                    </div><!-- side fr -->      
                                </div><!-- footer -->      
                            </div><!-- content -->

                        </div><!-- grid block 1-->
                    </div><!-- scCol -->




                </div><!-- row-fluid scRow-->

                <div class="row-fluid scRow"> 
                    <div class="span6 scCol">
                        <div class="block" id="grid_block_4">
                            <div class="content np">
                                <div class="controls-row">
                                    <div class="span12">
                                        <textarea placeholder="<?php echo $this->lang->line('memo') ?>" style="height: 170px;" id="memo" class="span12"></textarea>
                                    </div><!-- span -->
                                </div><!-- row control -->

                            </div>    
                        </div><!-- grid block 1-->
                    </div><!-- scCol -->        
                    <div class="span6 scCol">
                        <div class="block" id="grid_block_4">
                            <div class="content np">
                                <div class="controls-row">

                                    <div class="span4"><?php echo $this->lang->line('totalallocated') ?></div>
                                    <div class="span8">
                                        <input id="totalallocated" class="span12 tar" type="text" placeholder="0.00" disabled="disabled" >
                                    </div>
                                </div><!-- row control -->
                                <div class="controls-row">
                                    <div class="span4"><?php echo $this->lang->line('totaltaxamount') ?></div>
                                    <div class="span8">
                                        <input id="totaltaxamount" class="span12 tar" type="text" disabled="disabled"  placeholder="0.00">
                                    </div>
                                </div><!-- row control -->
                                <div class="controls-row">
                                    <div class="span4"><?php echo $this->lang->line('totalpaid') ?></div>
                                    <div class="span8">
                                        <input id="totalpaid" disabled="disabled"  class="span12 tar" type="text" placeholder="0.00">
                                    </div>
                                </div><!-- row control -->
                                <div class="controls-row">
                                    <div class="span4"><?php echo $this->lang->line('outofbalance') ?></div>
                                    <div class="span8">
                                        <input id="outofbalance" disabled="disabled"  class="span12 tar" type="text" placeholder="0.00">
                                    </div>
                                </div><!-- row control -->

                            </div>    
                        </div><!-- grid block 1-->
                    </div><!-- scCol -->
                </div><!-- row-fluid scRow-->
            </form>
        </div><!-- grid 1 -->
    </div><!-- wrap -->
</div><!-- content -->



