ok
Direktori : /home2/selectio/public_html/mm-tailor-billing/themes/default/views/purchases/ |
Current File : /home2/selectio/public_html/mm-tailor-billing/themes/default/views/purchases/add.php |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?> <section class="content"> <div class="row"> <div class="col-xs-12"> <div class="box box-primary"> <div class="box-header"> <h3 class="box-title"><?= lang('enter_info'); ?></h3> </div> <div class="box-body"> <div class="col-lg-12"> <?php echo form_open_multipart("purchases/add", 'class="validation"'); ?> <div class="row"> <div class="col-md-6"> <div class="form-group"> <?= lang('date', 'date'); ?> <input type="date" name="date" class="form-control tip" value="<?php echo date('Y-m-d');?>" required="required"> <?//= form_input('datee', set_value('datee', date('Y-m-d')), 'class="form-control tip" id="date" required="required"'); ?> </div> </div> <div class="col-md-6"> <div class="form-group"> <?= lang('reference', 'reference'); ?> <?= form_input('reference', set_value('reference'), 'class="form-control tip" id="reference"'); ?> </div> </div> </div> <div class="form-group"> <input type="text" placeholder="<?= lang('search_product_by_name_code'); ?>" id="add_item" class="form-control"> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive"> <table id="poTable" class="table table-striped table-bordered"> <thead> <tr class="active"> <th><?= lang('product'); ?></th> <th class="col-xs-2"><?= lang('quantity'); ?></th> <th class="col-xs-2"><?= lang('units'); ?></th> <th class="col-xs-2"><?= lang('unit_cost'); ?></th> <th class="col-xs-2"><?= lang('subtotal'); ?></th> <th style="width:25px;"><i class="fa fa-trash-o"></i></th> </tr> </thead> <tbody> <tr> <td colspan="6"><?= lang('add_product_by_searching_above_field'); ?></td> </tr> </tbody> <tfoot> <tr class="active"> <th><?= lang('total'); ?></th> <th class="col-xs-2"></th> <th class="col-xs-2"></th> <th class="col-xs-2"></th> <th class="col-xs-2 text-right"><span id="gtotal">0.00</span></th> <th style="width:25px;"></th> </tr> </tfoot> </table> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <?= lang('supplier', 'supplier'); ?> <?php $sp[''] = lang("select")." ".lang("supplier"); foreach($suppliers as $supplier) { $sp[$supplier->id] = $supplier->name; } ?> <?= form_dropdown('supplier', $sp, set_value('supplier'), 'class="form-control select2 tip" id="supplier" required="required" style="width:100%;"'); ?> </div> </div> <div class="col-md-6"> <div class="form-group"> <?= lang('received', 'received'); ?> <?php $sts = array(1 => lang('received'), 0 => lang('not_received_yet')); ?> <?= form_dropdown('received', $sts, set_value('received'), 'class="form-control select2 tip" id="received" required="required" style="width:100%;"'); ?> </div> </div> </div> <div class="row"> <div class="col-md-3"> <div class="form-group"> <label>Paid Amount</label> <b style="color: red; float:right;">Balance Amount: <span id="balance_amount"></b></span> <input type="number" name="paid_amount" id="paid_amount" class="form-control tip"> <input type="hidden" name="balance_amount" id="balance" class="form-control tip"> <input type="hidden" name="total_amount" id="total_amount" class="form-control tip"> </div> </div> <div class="col-md-3"> <div class="form-group"> <label>Payment Type</label> <select name="payment_type" id="payment_type" class="form-control select2" required="required"> <option value="">Select Payment Type</option> <option value="1">Cash</option> <option value="2">Acc Transfer</option> <option value="3">Online</option> <option value="4">UPI</option> <option value="5">Debit Card</option> <option value="6">Credit Card</option> </select> </div> </div> <div class="col-md-3"> <div class="form-group"> <label>Payment Status</label> <select name="payment_status" id="payment_status" class="form-control" required="required"> <option value="">Select Payment Status</option> <option value="Not Paid">Not Paid</option> <option value="Partial">Partial</option> <option value="Fully Paid">Fully Paid</option> </select> </div> </div> <div class="col-md-3"> <div class="form-group"> <label>Payment Done Date</label> <input type="date" name="payment_done_date" id="payment_done_date" class="form-control"> </div> </div> </div> <div class="form-group"> <?= lang('attachment', 'attachment'); ?> <input type="file" name="userfile" class="form-control tip" id="attachment"> </div> <!--<div class="form-group"> <?= lang('category', 'category'); ?> <select name="category" id="category" class="form-control select2"> <?php $f=1; foreach($purchase_category as $category){ ?> <option value="<?=$category->id?>"><?=$category->name?></option> <?php $f++; } ?> </select> </div>--> <div class="form-group"> <?= lang("note", 'note'); ?> <?= form_textarea('note', set_value('note'), 'class="form-control redactor" id="note"'); ?> </div> <div class="form-group"> <?= form_submit('add_purchase', lang('add_purchase'), 'class="btn btn-primary"'); ?> <button type="button" id="reset" class="btn btn-danger"><?= lang('reset'); ?></button> </div> <?php echo form_close();?> </div> <div class="clearfix"></div> </div> </div> </div> </div> </section> <script type="text/javascript"> var spoitems = {}; if (localStorage.getItem('remove_spo')) { if (localStorage.getItem('spoitems')) { localStorage.removeItem('spoitems'); } localStorage.removeItem('remove_spo'); } </script> <script> $(document).ready(function(){ /*var total=$("#gtotal").text(); $("#total_amount").val(total);*/ $(".content").mouseover(function(){ var total=$("#total_amount").val(); var paid_amount=$("#paid_amount").val(); console.log("Grand Total"+total); console.log("Paid Amount"+paid_amount); calculate=total-paid_amount; $("#balance_amount").text(calculate); $("#balance").val(total-paid_amount); }); }); </script> <script src="<?= $assets ?>dist/js/purchases.min.js" type="text/javascript"></script> <script> function loadItems() { get("spoitems") && (total = 0, $("#poTable tbody").empty(), spoitems = JSON.parse(get("spoitems")), $.each(spoitems, function() { var t = this, e = 1 == Settings.item_addition ? t.item_id : t.id, o = (spoitems[e] = t).row.id, s = t.row.cost, i = t.row.qty, a = t.row.code, n = t.row.name.replace(/"/g, """).replace(/'/g, "'"), d = (new Date).getTime(), m = $('<tr id="' + d + '" class="' + e + '" data-item-id="' + e + '"></tr>'); tr_html = '<td style="min-width:100px;"><input name="product_id[]" type="hidden" class="rid" value="' + o + '"><span class="sname" id="name_' + d + '">' + n + " (" + a + ")</span></td>", tr_html += '<td style="padding:2px;"><input class="form-control input-sm kb-pad text-center rquantity" name="quantity[]" type="text" value="' + i + '" data-id="' + d + '" data-item="' + e + '" id="quantity_' + d + '" onClick="this.select();"></td>', tr_html += '<td style="padding:2px; text-align:center;"><span>'+t.row.unit_name+'</span></td>', tr_html += '<td style="padding:2px; min-width:80px;"><input class="form-control input-sm kb-pad text-center rcost" name="cost[]" type="text" value="' + s + '" data-id="' + d + '" data-item="' + e + '" id="cost_' + d + '" onClick="this.select();"></td>', tr_html += '<td class="text-right"><span class="text-right ssubtotal" id="subtotal_' + d + '">' + formatMoney(parseFloat(s) * parseFloat(i)) + "</span></td>", tr_html += '<td class="text-center"><i class="fa fa-trash-o tip pointer spodel" id="' + d + '" title="Remove"></i></td>', m.html(tr_html), m.prependTo("#poTable"), total += parseFloat(s) * parseFloat(i) }), grand_total = formatMoney(total), $("#gtotal").text(grand_total), $("#total_amount").val(total), $("#add_item").focus()) } function add_order_item(t) { var e = 1 == Settings.item_addition ? t.item_id : t.id; return spoitems[e] ? spoitems[e].row.qty = parseFloat(spoitems[e].row.qty) + 1 : spoitems[e] = t, store("spoitems", JSON.stringify(spoitems)), loadItems(), !0 } $(document).ready(function() { loadItems(), $("#date").inputmask("yyyy-mm-dd hh:mm", { placeholder: "yyyy-mm-dd hh:mm" }), $(document).on("click", ".spodel", function() { var t = $(this).closest("tr"), e = t.attr("data-item-id"); if (delete spoitems[e], t.remove(), !spoitems.hasOwnProperty(e)) return localStorage.setItem("spoitems", JSON.stringify(spoitems)), void loadItems() }), $("#add_item").autocomplete({ source: base_url + "purchases/suggestions", minLength: 1, autoFocus: !1, delay: 200, response: function(t, e) { 16 <= $(this).val().length && 0 == e.content[0].id ? (bootbox.alert(lang.no_match_found, function() { $("#add_item").focus() }), $(this).val("")) : 1 == e.content.length && 0 != e.content[0].id ? (e.item = e.content[0], $(this).data("ui-autocomplete")._trigger("select", "autocompleteselect", e), $(this).autocomplete("close")) : 1 == e.content.length && 0 == e.content[0].id && (bootbox.alert(lang.no_match_found, function() { $("#add_item").focus() }), $(this).val("")) }, select: function(t, e) { (t.preventDefault(), 0 !== e.item.id) ? add_order_item(e.item) && $(this).val(""): bootbox.alert(lang.no_match_found) } }), $("#add_item").bind("keypress", function(t) { 13 == t.keyCode && (t.preventDefault(), $(this).autocomplete("search")) }), $("#add_item").focus(), $("#reset").click(function(t) { bootbox.confirm(lang.r_u_sure, function(t) { t && (get("spoitems") && remove("spoitems"), window.location.reload()) }) }), $(document).on("change", ".rquantity", function() { var t = $(this).closest("tr"), e = parseFloat($(this).val()), o = t.attr("data-item-id"); spoitems[o].row.qty = e, store("spoitems", JSON.stringify(spoitems)), loadItems() }), $(document).on("change", ".rcost", function() { var t = $(this).closest("tr"), e = parseFloat($(this).val()), o = t.attr("data-item-id"); spoitems[o].row.cost = e, store("spoitems", JSON.stringify(spoitems)), loadItems() }) }); //# sourceMappingURL=maps/purchases.min.js.map </script>