...
 
Commits (7)
......@@ -475,10 +475,10 @@ $(document).ready(function() {
} else if (event.which == 190 && event.ctrlKey) {
event.preventDefault();
$('#invoice_product_table_gst tbody tr:eq(' + curindex + ') td:eq(2) input').focus().select();
} else if (event.which == 27) {
event.preventDefault();
$("#chkcash").focus().click();
}
else if (event.which == 27) {
$("#accountno").focus().select();
}
});
$(document).off('change', '.product_name_gst').on('change', '.product_name_gst', function(event) {
......@@ -613,7 +613,7 @@ $(document).ready(function() {
}
else if (event.which == 27) {
$("#accountno").focus().select();
}
}
});
$(document).off('change', '.invoice_product_quantity_vat').on('change', '.invoice_product_quantity_vat', function(event) {
......@@ -992,7 +992,7 @@ else {
}
else if (previndex == -1) {
if ($("#taxapplicable").val() == 7) {
$(".invoice_product_discount_gst:last").focus().select();
$("#chkcash").focus().select();
}
else {
$(".invoice_product_discount_vat:last").focus().select();
......@@ -1220,7 +1220,18 @@ $(document).off("keyup").on("keyup", function(event) {
form_data.append("orgstategstin",$("#orggstin").text() );
form_data.append("freeqty", JSON.stringify(freeqty));
form_data.append("discount", JSON.stringify(discount));
form_data.append("bankdetails", JSON.stringify(bankdetails));
//Code for sending data to the database based on which radio button is checked i.e."cash" or "bank".
if ($("#chkcash").is(":checked")) {
//Checking which radio button is clicked. if cash is selected then paymentmode is set to 3 (i.e. cash transaction)
form_data.append("paymentmode",3);
} else {
//If bank is selected then append both bankdetails and paymentmode = 2 (i.e. bank transaction).
form_data.append("bankdetails", JSON.stringify(bankdetails));
form_data.append("paymentmode",2);
}
$('.modal-backdrop').remove();
$('.modal').modal('hide');
$('#confirm_yes').modal('show').one('click', '#tn_save_yes', function(e) {
......@@ -1555,7 +1566,7 @@ $(document).off("keyup").on("keyup", function(event) {
event.preventDefault();
}
else if (event.which == 27) {
$("#accountno").focus().select();
$("#chkcash").focus().click();
}
});
......@@ -1619,7 +1630,7 @@ $(document).off("keyup").on("keyup", function(event) {
} else if (event.which == 27) {
event.preventDefault();
$("#accountno").focus().select();
$("#chkcash").focus().click();
}
});
......@@ -1664,7 +1675,7 @@ $(document).off("keyup").on("keyup", function(event) {
$('#invoice_product_table_gst tbody tr:eq(' + curindex + ') td:eq(3) input').focus().select();
}
else if (event.which == 27) {
$("#accountno").focus().select();
$("#chkcash").focus().click();
}
});
......@@ -1777,7 +1788,7 @@ $(document).off("keyup").on("keyup", function(event) {
} else if (event.which == 27) {
event.preventDefault();
$("#accountno").focus().select();
$("#chkcash").focus().click();
}
});
......@@ -1787,7 +1798,34 @@ $(document).off("keyup").on("keyup", function(event) {
}
});
$(document).off('keydown', '#chkcash').on('keydown', '#chkcash', function(event) {
if(event.which==13){
$("#invoice_save").focus();
}
});
$(document).off('keydown', '#chkbank').on('keydown', '#chkbank', function(event) {
if(event.which==13){
$("#accountno").focus().select();
}
});
//Code for radio buttons to show and hide "bankdetails fields" and "cash received"
$("input[name='chkpaymentmode']").click(function () {
//Checking which radio button is selected.
if ($("#chkcash").is(":checked")) {
//If cash is selected then bankdetails fields are hide and 'CASH RECEIVED' is shown.
$("#cash").show();
$("#bank").hide();
} else {
//If bank is selected then bankdetails fields are shown and 'CASH RECEIVED' is hide.
$("#cash").hide();
$("#bank").show();
}
});
});
This diff is collapsed.
......@@ -279,52 +279,56 @@
<label for="totalinvoicevalue" style="font-size:120%">{% trans %}Total Amount{% endtrans %} :</label>
<label id="totalinvoicevalue">{{ gkresult["invoicetotal"] }}</label>
</div>
<br>
<br>
<!-- code for show or hide bankdetails based on paymentmode,if paymentmode is 2 then show bankdetails or if paymentmode is 3 then show "Cash received"-->
{% if gkresult["paymentmode"] == 2 %}
<div class="row">
<div class="col-xs-6 nopadding">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th colspan="4">
Bank Details
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<label for="accountno">{% trans %}Account No.{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["accountno"] %}{{ gkresult["bankdetails"]["accountno"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="bankname">{% trans %}Bank Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["bankname"] %}{{ gkresult["bankdetails"]["bankname"] }}{% else %}N/A{% endif %}
</td>
</tr>
<tr>
<td>
<label for="branch">{% trans %}Branch Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["branch"] %}{{ gkresult["bankdetails"]["branch"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="ifsc">{% trans %}IFSC code{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["ifsc"] %}{{ gkresult["bankdetails"]["ifsc"] }}{% else %}N/A{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-6 nopadding">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th colspan="4">
Bank Details
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<label for="accountno">{% trans %}Account No.{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["accountno"] %}{{ gkresult["bankdetails"]["accountno"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="bankname">{% trans %}Bank Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["bankname"] %}{{ gkresult["bankdetails"]["bankname"] }}{% else %}N/A{% endif %}
</td>
</tr>
<tr>
<td>
<label for="branch">{% trans %}Branch Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["branchname"] %}{{ gkresult["bankdetails"]["branchname"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="ifsc">{% trans %}IFSC code{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["ifsc"] %}{{ gkresult["bankdetails"]["ifsc"] }}{% else %}N/A{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% else %}
<div class="row">
<strong>CASH RECEIVED</strong>
</div>
{% endif %}
<br>
<div class="row">
<div class="col-xs-6">
......
......@@ -419,48 +419,49 @@
</div>
<br>
<br>
<div class="row">
<div class="col-xs-6 nopadding">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th colspan="4">
Bank Details
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<label for="accountno">{% trans %}Account No.{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["accountno"] %}{{ gkresult["bankdetails"]["accountno"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="bankname">{% trans %}Bank Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["bankname"] %}{{ gkresult["bankdetails"]["bankname"] }}{% else %}N/A{% endif %}
</td>
</tr>
<tr>
<td>
<label for="branch">{% trans %}Branch Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["branch"] %}{{ gkresult["bankdetails"]["branch"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="ifsc">{% trans %}IFSC code{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["ifsc"] %}{{ gkresult["bankdetails"]["ifsc"] }}{% else %}N/A{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-6 nopadding">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th colspan="4">
Bank Details
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<label for="accountno">{% trans %}Account No.{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["accountno"] %}{{ gkresult["bankdetails"]["accountno"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="bankname">{% trans %}Bank Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["bankname"] %}{{ gkresult["bankdetails"]["bankname"] }}{% else %}N/A{% endif %}
</td>
</tr>
<tr>
<td>
<label for="branch">{% trans %}Branch Name{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["branch"] %}{{ gkresult["bankdetails"]["branch"] }}{% else %}N/A{% endif %}
</td>
<td>
<label for="ifsc">{% trans %}IFSC code{% endtrans %} :</label>
</td>
<td>
{% if gkresult["bankdetails"]["ifsc"] %}{{ gkresult["bankdetails"]["ifsc"] }}{% else %}N/A{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-6 nopadding">
<table class="table table-bordered table-condensed">
<tbody>
......
......@@ -219,13 +219,16 @@
</div>
<div class="col-sm-12">
<div class="form-group form-inline col-sm-4 pull-right">
<label for="totalinvoicevalue" style="font-size:120%">{% trans %}Total Amount{% endtrans %} :</label>
<label for="totalinvoicevalue" style="font-size:120% !important">{% trans %}Total Amount{% endtrans %} :</label>
<label id="totalinvoicevalue">{{ gkresult["invoicetotal"] }}</label>
</div>
</div>
<div class="col-sm-12">
<h4>Bank Details :</h4>
<div class="col-sm-6 nopadding">
<!-- code for show or hide bankdetails based on paymentmode,if paymentmode is 2 then show bankdetails or if paymentmode is 3 then show "Cash received"-->
{% if gkresult["paymentmode"] == 2 %}
<div class="col-sm-12">
<label>Bank Details :</label>
</div>
<div class="col-sm-6 ">
<div class="row">
<div class="form-group form-inline col-sm-6 nopadding">
<label for="accountno" class="col-sm-5">{% trans %}Account No.{% endtrans %} :</label>
......@@ -240,7 +243,7 @@
<div class="row">
<div class="form-group form-inline col-sm-6 nopadding">
<label for="branch" class="col-sm-5">{% trans %}Branch Name{% endtrans %} :</label>
{% if gkresult["bankdetails"]["branch"] %}{{ gkresult["bankdetails"]["branch"] }}{% else %}N/A{% endif %}
{% if gkresult["bankdetails"]["branchname"] %}{{ gkresult["bankdetails"]["branchname"] }}{% else %}N/A{% endif %}
</div>
<div class="form-group form-inline col-sm-6 nopadding">
<label for="ifsc" class="col-sm-5">{% trans %}IFSC code{% endtrans %} :</label>
......@@ -248,5 +251,7 @@
</div>
</div>
</div>
</div>
</div>
{% else %}
<div class="col-sm-6"><label style="font-size:120% !important">CASH RECEIVED</label></div>{% endif %}
</form>
......@@ -71,14 +71,12 @@ def getproducts(request):
@view_config(route_name="cashmemos",request_param="action=save",renderer="json")
def savecashmemo(request):
header={"gktoken":request.headers["gktoken"]}
cashmemodata = {"invoiceno":request.params["invoiceno"],"invoicetotal":request.params["invoicetotal"],"icflag":3,"taxstate":request.params["taxstate"],"sourcestate":request.params["sourcestate"],"invoicedate":request.params["invoicedate"],"tax":json.loads(request.params["tax"]), "cess":json.loads(request.params["cess"]), "contents":json.loads(request.params["contents"]),"freeqty":json.loads(request.params["freeqty"]),"taxflag":request.params["taxflag"],"orgstategstin":request.params["orgstategstin"]}
cashmemodata = {"invoiceno":request.params["invoiceno"],"invoicetotal":request.params["invoicetotal"],"icflag":3,"taxstate":request.params["taxstate"],"sourcestate":request.params["sourcestate"],"invoicedate":request.params["invoicedate"],"tax":json.loads(request.params["tax"]), "cess":json.loads(request.params["cess"]), "contents":json.loads(request.params["contents"]),"freeqty":json.loads(request.params["freeqty"]),"taxflag":request.params["taxflag"],"orgstategstin":request.params["orgstategstin"],"paymentmode":request.params["paymentmode"]}
if request.params.has_key("discount"):
cashmemodata["discount"]=json.loads(request.params["discount"])
if request.params.has_key("bankdetails"):
cashmemodata["bankdetails"]=json.loads(request.params["bankdetails"])
stock = json.loads(request.params["stock"])
invoicewholedata = {"invoice":cashmemodata,"stock":stock}
......