<style type="text/css">
    .amount{
        text-align: right;
    }
    .input-prepend span, btn-group, input-prepend button{
        height:18px;
        padding:3px;
    }
    #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 .span4 {
        font-size: 11px;
        color: #000;
        font-weight: bold;
    }
    .test {
        font-size: 10px;
    }
    .span4 {
        font-size: 10px;
    }
    tbody td {
        font-size:11px;
    }
    #content .wrap #grid_content_1 .row-fluid.scRow .row-fluid.scRow .span12.scCol #grid_block_6 .content.np #listCharge tbody #trInfosCharge td .row-fluid .controls-row .span4 {
        font-weight: bold;
    }
</style>

<script>

    function editRow(me){
    var tr = $(me).parent().parent();
            //  alert( $(me).parent().parent().find("td").eq(0).html()); 
            $(tr).replaceWith('<tr><td class="span1">' + $(me).parent().parent().find("td").eq(0).html() + '</td>' +
            '<td class="span2" >' +
            '<select data-numrow="' + $(me).parent().parent().find("td").eq(0).html() + '" id="itemComboList" \n\
            data-previewvalue="' + $(me).parent().parent().find("td").eq(1).html() + '" class="span12" onchange="displaysItemDefaultValue()"><option></option>' +
<?php
if ($items) {
    foreach ($items as $row) {
        ?>
            '<option data-desc= "<?php echo $row->description; ?>" data-price= "<?php echo $row->supplierPrice; ?>" value="<?php echo $row->ID; ?>"><?php
        echo str_replace("'", " ", $row->name, $count)
        . " [" . str_replace("'", " ", $row->itemCode, $count) . "]";
        ?></option>' +
    <?php
    }
}
?>
    '</select></td>' +
            '<td class="span2"><input id="itemdes" name="itemdes" class="span12" type="text" data-previewvalue="' + $(me).parent().parent().find("td").eq(2).html() + '" value="' + $(me).parent().parent().find("td").eq(2).html() + '"></td>' +
            '<td class="span1 tar"><input  id="itemunitprice" onkeyup="calculamount()" onchange="calculamount()" name="itemunitprice" class="span12 tar" type="text" data-previewvalue="' + $(me).parent().parent().find("td").eq(3).html() + '" value="' + $(me).parent().parent().find("td").eq(3).html() + '"></td>' +
            '<td class="span1 tar"><input id="itemqte"  onkeyup="calculamount()" onchange="calculamount()" name="itemqte"  class="span12 tar" type="text" data-previewvalue="' + $(me).parent().parent().find("td").eq(4).html() + '" value="' + $(me).parent().parent().find("td").eq(4).html() + '"></td>' +
            '<td class="span1 tar"> <input id="itemAmountET" name="itemAmountET" class="span12 tar" type="text" data-previewvalue="' + $(me).parent().parent().find("td").eq(5).html() + '" value="' + $(me).parent().parent().find("td").eq(5).html() + '"></td>' +
            '<td class="span1 tac">' +
            '<button data-itemid="' + $(me).attr("data-itemid") + '" data-myid="' + $(me).attr("data-myid") + '" onclick="updateRow(this)" class="btn btn-mini btn-primary" type="button"><i class="icon-ok-circle"></i></button>' +
            '<button data-itemid="' + $(me).attr("data-itemid") + '" data-myid="' + $(me).attr("data-myid") + '"  id="btnCancel"  onclick="cancelEdit(this)" class="btn btn-mini btn-danger" type="button"><i class="icon-remove-circle"></i></button></td>' +
            '</tr>'
            );
            $("#itemComboList").val($(me).attr("data-itemid"));
            $("#itemComboList").select2();
    }

    function calculamount(){

    var j_itemAmountET = accounting.unformat($("#itemunitprice").val()) * accounting.unformat($("#itemqte").val());
            $("#itemAmountET").val(accounting.formatNumber(j_itemAmountET, 2));
            var j_itemTaxAmount = j_itemAmountET * accounting.unformat($("#itemTax").val()) / 100;
            $("#itemTaxAmount").val(accounting.formatNumber(j_itemTaxAmount, 2));
            $("#itemAmountIT").val(accounting.formatNumber(j_itemTaxAmount + j_itemAmountET, 2));
    }

    function displaysItemDefaultValue(){
    $("#itemdes").val($("#itemComboList option:selected").attr("data-desc"));
            $("#itemunitprice").val(accounting.formatNumber($("#itemComboList option:selected").attr("data-price"), 2));
            $("#itemTax").val($("#itemComboList option:selected").attr("data-taxPercentage"));
            $("#itemTax").attr("data-taxid", $("#itemComboList option:selected").attr("data-taxid"));
            $("#displayTaxCode").text($("#itemComboList option:selected").attr("data-taxcode"));
    }

    function calculChargeAmount() {
    var t = accounting.unformat($("#chargeAmount").val()) * accounting.unformat($("#listTax option:selected").attr("data-tax")) / 100;
            $("#chargetaxAmount").val(t);
            $("#chargeAmountIT").val(t + $("#chargeAmount").val() * 1);
    }

    function EndEdit(me){
    var tr = $(me).parent().parent();
            $(tr).replaceWith('<tr>' +
            '<td>' + $("#itemComboList").attr("data-numrow") + '</td>' +
            '<td>' + $("#itemComboList option:selected").text() + '</td>' +
            '<td>' + $("#itemdes").val() + '</td>' +
            '<td class="amount tar">' + accounting.formatNumber($("#itemunitprice").val(), 2) + '</td>' +
            '<td class="tar">' + $("#itemqte").val() + '</td>' +
            '<td class="amounnt tar">' + accounting.formatNumber($("#itemAmountET").val(), 2) + '</td>' +
            '<td>' +
            '<button data-itemid="' + $(me).attr("data-itemid") + '" onClick="editRow(this)" data-myid="' + $(me).attr("data-myid") + '" class="btn btn-mini"><i class="icon-pencil"></i></button>' +
            ' <button onclick="deletePoDetails(this)" data-myid="' + $(me).attr("data-myid") + '" class="btn btn-mini btn-danger"><i class="icon-trash icon-white"></i></button>' +
            '</td>' +
            '</tr>'
            );
            getTotal ();
    }

    function cancelEdit(me){
    var tr = $(me).parent().parent();
            $(tr).replaceWith('<tr>' +
            '<td>' + $("#itemComboList").attr("data-numrow") + '</td>' +
            '<td>' + $("#itemComboList").attr("data-previewvalue") + '</td>' +
            '<td>' + $("#itemdes").attr("data-previewvalue") + '</td>' +
            '<td class="amounnt tar">' + accounting.formatNumber($("#itemunitprice").attr("data-previewvalue"), 2) + '</td>' +
            '<td class="tar">' + $("#itemqte").attr("data-previewvalue") + '</td>' +
            '<td class="amount tar">' + accounting.formatNumber($("#itemAmountET").attr("data-previewvalue"), 2) + '</td>' +
            '<td>' +
            '<button data-itemid="' + $(me).attr("data-itemid") + '" onClick="editRow(this)" data-myid="' + $(me).attr("data-myid") + '" class="btn btn-mini"><i class="icon-pencil"></i></button>' +
            ' <button onclick="deletePoDetails(this)" data-myid="' + $(me).attr("data-myid") + '" class="btn btn-mini btn-danger"><i class="icon-trash icon-white"></i></button>' +
            '</td>' +
            '</tr>'
            );
            getTotal ();
    }

    function getTotal (){

    var n = $("#listDetails > tbody > tr").length - 2;
            var total = 0;
            var i = 0;
            for (i = 0; i <= n; i++) {

    total = total + accounting.unformat($('#listDetails > tbody > tr:eq(' + i + ') > td:eq(5)').text()) * 1;
    }


    $("#totalpayable").val(accounting.formatNumber(total, 2));
    }

    function updateRow(me){
    // alert($(me).attr("data-myid"));
    $.ajax({
    type: "POST",
            data: {
            poID :$(me).attr("data-myid"),
                    itemID:  $("#itemComboList").val(),
                    itemdescription: $("#itemdes").val(),
                    quantity : accounting.unformat($("#itemqte").val()),
                    unitPrice: accounting.unformat($("#itemunitprice").val()),
                    amount: accounting.unformat($("#itemAmountET").val())

            },
            url: "<?php echo base_url() ?>PO_Transaction/updatePoDetail",
            success: function(data) {
            msg (1, "alert alert-success", "Details successfully updated");
                    EndEdit(me);
            } });
            getTotal();
    }

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

    function msg(n, type, message){
    $("#msg_div" + n + " p").html(message);
            $("#msg_div").attr("class", "alert " + type);
            }

    function deletePoDetails(me){

    $('#popupModal').modal('show');
            $("#_popupTitle").html("Confirm delete");
            $("#_popupContent").html("Your about to delete definively this row. <br/> Click on ok to confirm");
            $('#_popupFooter').empty();
            $('#_popupFooter').append('<button class="btn btn-danger" id="detButton">Ok</button>' +
            '<button class="btn" id="canb">Cancel</button>');
            $("#_popupTitle").html("Confirm delete");
            $("#canb").click(function() {
    $('#popupModal').modal('hide');
    });
            $("#detButton").click(function() {
    $('#popupModal').modal('hide');
            $.ajax({
            type: "POST",
                    data: {
                    invDetailsId :$(me).attr("data-myid")
                    },
                    url: "<?php echo base_url() ?>PO_Transaction/deletePoRow",
                    success: function(data) {
                    msg (1, "alert alert-success", "Details successfully deleted");
                            delRowInvoice(me);
                    }
            });
            getTotal();
    });
    }



    function  deleteCompanyCharge(me){
    $('#popupModal').modal('show');
            $("#_popupTitle").html("Confirm delete");
            $("#_popupContent").html("Your about to delete definively this row. <br/> Click on ok to confirm");
            $('#_popupFooter').empty();
            $('#_popupFooter').append('<button class="btn btn-danger" id="detButton">Ok</button>' +
            '<button class="btn" id="canb">Cancel</button>');
            $("#_popupTitle").html("Confirm delete");
            $("#canb").click(function() {
    $('#popupModal').modal('hide');
    });
            $("#detButton").click(function() {
    $('#popupModal').modal('hide');
            $.ajax({
            type: "POST",
                    data: {
                    chargeID :$(me).attr("data-myid")
                    },
                    url: "<?php echo base_url() ?>PO_Transaction/deleteCharge",
                    success: function(data) {
                    msg (1, "alert alert-success", "Details successfully deleted");
                            delRowInvoice(me);
                            getTotal();
                            $.ajax({
                            type: "POST",
                                    data: {
                                    invoiceId : $("#PO_TransactionId").val(),
                                            totalPayable : $("#totalpayable").val(),
                                            totalTaxAmount :  $("#totalamount").val()
                                    },
                                    url: "<?php echo base_url() ?>PO_Transaction/updateInvoice",
                                    success: function(data) {
                                    //update the invoice after delete
                                    }
                            });
                    } });
    });
            getTotal ();
    }
    function addnewrow(){
    if (!$("#itemComboList").length) {
    $('' +
            '<tr><td class="span1">' + ($("#trInfos").attr("data-currentRow") * 1 + 1) + '</td>' +
            '<td class="span3" >' +
            '<select id="itemComboList" class="span10" onchange="displaysItemDefaultValue()"><option></option>' +
<?php
if ($items) {
    foreach ($items as $row) {
        ?>
            '<option data-desc= "<?php echo $row->description; ?>" data-price= "<?php echo $row->supplierPrice; ?>" \n\
                                data-taxid="<?php echo $row->inputTaxID; ?>" data-taxcode="<?php echo $row->inputTaxCode; ?>" \n\
                                data-taxPercentage="<?php echo $row->inputTaxPercentage; ?>" value="<?php echo $row->ID; ?>"><?php
        echo str_replace("'", " ", $row->name, $count)
        . " [" . str_replace("'", " ", $row->itemCode, $count) . "]";
        ?></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">' +
            '<li><a target="_blank" href="<?php echo base_url() ?>icsetting/itemNew">' +
            '<i class="icon-plus-sign"></i><?php echo $this->lang->line('addNewItem') ?></a></li>' +
            '<li><a href="#" onclick="refreshItems()"><i class="icon-refresh"></i><?php echo $this->lang->line('refreshlist') ?></a>' +
            '</li> </ul></div></td>' +
            '<td class="span3"><input id="itemdes" name="itemdes" class="span12 validate[required]" type="text" placeholder="Description"></td>' +
            '<td class="span1"><input id="itemunitprice" onkeyup="calculamount()" name="itemunitprice" class="span12 amount validate[required,custom[number]]" type="text" placeholder="Unit Priece"></td>' +
            '<td class="span1"><input id="itemqte" onkeyup="calculamount()"  name="itemqte" class="span12 amount validate[required,custom[integer]]" type="text" placeholder="Qty"></td>' +
            '<td class="span1"><input id="itemAmountET" name="itemAmountET" disabled class="span12 amount validate[required]" type="text" placeholder="Amount (Exclude Tax)"></td>' +
            '<td class="span1">' +
            '<button class="btn btn-mini btn-primary" onclick="savenewrow()" type="button"><span class="icon-ok-circle"></span></button>' +
            '<button id="btnCancel" class="btn btn-mini btn-danger" onclick="delRowInvoice(this)" type="button"><span class="icon-remove-circle"></span></button>' +
            '</td>' +
            '</tr>'
            ).insertBefore("#trInfos");
            $("#itemComboList").select2();
    } else{
    msg (1, "alert", "Please, do save the current details before addind new one");
    }
    }
    
    function savenewrow(){
        $.ajax({
            type: "POST",
            data: {
            invoiceId : $("#purchaseInvoiceId").val(),

            lineNo:  $("#trInfos").attr("data-currentRow") *1 +1,
            itemID:  $("#itemComboList").val(), 
            itemdescription: $("#itemdes").val(),
            quantity : $("#itemqte").val(),
            unitPrice: accounting.unformat($("#itemunitprice").val()),
            amount: accounting.unformat($("#itemAmountET").val())
            },
            url: "<?php echo base_url() ?>PO_Transaction/saveParchaseDetail",
            success: function(data) {
            msg (1,"alert alert-success","Details successfully saved");
            var resul = eval ("(" + data + ")"); 
            $(''+
            '<tr><td>' + ( $("#trInfos").attr("data-currentRow") *1 +1) + '</td>' +
            '<td>' +  $("#itemComboList option:selected").text() + '</td>'+
            '<td>' + $("#itemdes").val() + '</td>'+
            '<td class="amount">' + accounting.formatNumber($("#itemunitprice").val(),2) + '</td>'+
            '<td>' + $("#itemqte").val() + '</td>'+
            '<td class="amount">' + accounting.formatNumber($("#itemAmountET").val(),2) + '</td>'+
            '<td>'+
             '<button data-itemid="' + $("#itemComboList").val() + '" onClick="editRow(this)" data-myid="' + resul.detailID + '" class="btn btn-mini"><i class="icon-pencil"></i></button>' +
            ' <button onclick="deletePoDetails(this)" data-myid="' + resul.detailID  + '" class="btn btn-mini btn-danger"><i class="icon-trash icon-white"></i></button>' +
           '</td>'+
            '</tr>'
            ).insertBefore( "#trInfos" );
            $("#trInfos").attr("data-currentRow", $("#trInfos").attr("data-currentRow") *1 +1);
            $("#btnCancel").trigger("click");
            $( "#calcul" ).trigger( "click" );
            getTotal();

            }
            }); //end ajax
    }

</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() . "gl/home" ?>'> <?php echo $this->lang->line('module') ?></a> <span class="divider">-</span></li>
                    <li class="active"><?php echo $this->lang->line('titlepo') ?></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">

            <div class="row-fluid">
                <div class="alert alert-info">
                    <strong><?php echo $this->lang->line('titlepo') ?></strong>
                </div>
            </div>
<?php
$memo = "";
$Purchaser = "";
if ($pInvoice) {
    foreach ($pInvoice as $rowIn) {
        $memo = $rowIn->memo;
        $Purchaser = $rowIn->employeeName;
        ?> 
                    <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('supplier'); ?></div>
                                            <div class="span8">
                                                <input type="hidden" id="purchaseInvoiceId" value="<?php echo $rowIn->poID; ?>" class="span12" />
                                                <input type="text" disabled value="<?php echo $rowIn->supplierName; ?>" class="span12" />
                                            </div>
                                        </div> <!-- row -->
                                        <div class="controls-row">
                                            <div class="span4"><?php echo $this->lang->line('formNo') ?></div>
                                            <div class="span8">
                                                <input type="text" disabled value="<?php echo $rowIn->formNo; ?>" class="span12" />
                                            </div>
                                        </div> <!-- row -->
                                        <div class="controls-row">
                                            <div class="span4"><?php echo $this->lang->line('date') ?></div>
                                            <div class="span8">
                                                <input type="text" disabled value="<?php echo date(element('dtFormat', $this->session->userdata('logged_in')), strtotime($rowIn->poDate)); ?>" class="span12" />
                                            </div>
                                        </div> <!-- row -->
                                    </div><!-- grid block 1-->
                                </div><!-- scCol -->
                                <div class="span4 scCol">
                                    <div class="block" id="grid_block_2">
                                        <div class="controls-row">
                                            <div class="span4"><?php echo $this->lang->line('terms') ?></div>
                                            <div class="span8">
                                                <input type="text" disabled value="<?php echo $rowIn->termName; ?>" class="span12" />
                                            </div>
                                        </div> <!-- row -->

                                        <div class="controls-row">
                                            <div class="span4"><?php echo $this->lang->line('termsdesc') ?></div>
                                            <div class="span8">
                                                <textarea class="span12" disabled="disabled" id="termDescription"> <?php echo $rowIn->termDescription ?></textarea>
                                            </div>
                                        </div> <!-- row -->
                                    </div><!-- grid block 1-->
                                </div><!-- scCol -->
                                <div class="span4 scCol">
                                    <div class="block ns" id="grid_block_3">
                                        <div class="controls-row">
                                            <div class="span4"><?php echo $this->lang->line('currency') ?></div>
                                            <div class="span8">
                                                <input type="text" disabled value="<?php echo $rowIn->currencyWord; ?>" class="span12" />      
                                            </div><!-- span -->
                                        </div><!-- control row -->
                                        <div class="controls-row">
                                            <div class="span4"><?php echo $this->lang->line('exchangeRate') ?></div>
                                            <div class="span8">
                                                <input type="text" disabled value="<?php echo number_format($rowIn->exchangeRate, 5); ?>" class="span12 tar" />           
                                            </div><!-- span -->
                                        </div><!-- control row -->
                                    </div><!-- content -->
                                </div><!-- content -->
                            </div><!-- grid block 1-->
                        </div><!-- scCol -->

                    </div><!-- row-fluid scRow-->
    <?php }
} ?>

            <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('items') ?></h2>
                            <ul class="buttons">
                                <li><a class="block_toggle collapsed" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                                        <span class="i-arrow-down-3"></span></a></li>
                            </ul> 
                            <ul class="buttons fr">
                                <li><a href="#" title="Add New"</a></li>
                                <li><a href="#trInfos" onclick="addnewrow()" title="Add New"><span class="i-plus-2"></span></a></li>
                            </ul>
                        </div><!-- head -->
                        <div class="content np">
                            <table id="listDetails" cellpadding="0" cellspacing="0" width="100%">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th><?php echo $this->lang->line('item') ?></th>
                                        <th><?php echo $this->lang->line('itemDesc') ?></th>
                                        <th class="tar"><?php echo $this->lang->line('unitPrice') ?></th>
                                        <th class="tar"><?php echo $this->lang->line('quantity') ?></th>
                                        <th class="tar"><?php echo $this->lang->line('amount') ?></th>
                                        <th class="tac"><?php echo $this->lang->line('action') ?></th>
                                    </tr>
                                </thead>
                                <tbody>
<?php
$t_taxAmount = 0;
$lastrow = 0;
if ($pdetails && $pInvoice) {
    foreach ($pdetails as $row) {
        if ($lastrow < $row->lineNo)
            $lastrow = $row->lineNo;
        $t_taxAmount+= $row->total;
        ?>
                                            <tr>
                                                <td><?php echo $row->lineNo; ?></td>
                                                <td><?php echo $row->name . "[" . $row->itemCode . "]"; ?></td>
                                                <td><?php echo $row->description; ?></td>
                                                <td class="tar"><?php echo number_format($row->unitPrice, 2); ?></td>
                                                <td class="tar"><?php echo $row->quantityOrder; ?></td>
                                                <td class="tar"><?php echo number_format($row->total, 2); ?></td>
                                                <td class="tac">
                                                    <button onClick="editRow(this)" data-itemid="<?php echo $row->itemid; ?>" data-myid="<?php echo $row->ID; ?>" class="btn btn-mini"><i class="icon-pencil"></i></button>
                                                    <button onClick="deletePoDetails(this)" data-myid="<?php echo $row->ID; ?>" class="btn btn-mini btn-danger"><i class="icon-trash icon-white"></i></button>
                                                </td>
                                            </tr>
    <?php }
} else {
    ?>
                                    <div class="alert alert-error">
    <?php echo $this->lang->line('message1') ?>
                                    </div>
<?php } ?>
                                <tr  data-currentRow="<?php echo $lastrow; ?>" id="trInfos">
                                    <td colspan="11">
                                        <div id="msg_div1" 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><!-- content -->
                    </div><!-- grid block 1-->
                </div><!-- scCol -->
            </div><!-- row-fluid scRow-->




            <div class="row-fluid scRow">



                <div class="span7 scCol">
                    <div class="block" id="grid_block_4">
                        <div class="content np">
                            <div class="controls-row">
                                <div class="span4"><?php echo $this->lang->line('purchaser') ?></div>
                                <div class="span8">
                                    <input  disabled="disabled" value="<?php echo $Purchaser; ?>"  class="span12" type="text"/>
                                </div>
                            </div> <!-- row -->
                            <div class="controls-row">
                                <div class="span4"><?php echo $this->lang->line('memo') ?></div>
                                <div class="span8">
                                    <textarea class="span12" id="memo"><?php echo $memo; ?></textarea>
                                </div>
                            </div> <!-- row -->
                        </div>    
                    </div><!-- grid block 1-->
                </div><!-- scCol -->               

                <div class="span5 scCol">
                    <div class="block" id="grid_block_4">
                        <div class="content np">

                            <div class="controls-row">
                                <div class="span4"><!--<?php echo $this->lang->line('importDutyPayable') ?>--></div>
                                <div class="span8">
                                    <!--<input id="impotpayable"   class="span12 amount" type="text" disabled="disabled"  placeholder="0">-->
                                </div>
                            </div><!-- row control -->
                            <div class="controls-row">
                                <div class="span4"><?php echo $this->lang->line('totalAmount') ?></div>
                                <div class="span8">
                                    <input id="totalpayable" disabled="disabled"  value="<?php echo number_format($t_taxAmount, 2); ?>" class="span12 amount" type="text" placeholder="0">
                                </div>
                            </div><!-- row control -->
                            <div class="footer">
                                <div class="side fr">
                                    <div class="btn-group">
                                        <button id="calcul" onclick="getTotal()" class="btn btn-mini btn-warning" type="button"> 
                                            <i class="icon-ok-circle"></i><?php echo $this->lang->line('calTotal') ?></button>

                                    </div><!-- btn group -->      
                                </div><!-- side fr -->      
                            </div><!-- footer -->   
                        </div>    
                    </div><!-- grid block 1-->
                </div><!-- scCol -->
            </div><!-- row-fluid scRow-->


        </div><!-- grid 1 -->
    </div><!-- wrap -->
</div><!-- content -->


