| Server IP : 162.214.74.102 / Your IP : 216.73.217.80 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/imobles/ui/lib/jslib/ |
Upload File : |
$(document).ready(function () {
var _url = $("#_url").val();
var $modal = $('#ajax-modal');
var sysrender = $('#application_ajaxrender');
//function store_invoice_pdf(iid){
//
// $.get( _url + "invoices/pdf/"+iid+"/store/", function() {
//
// });
//
//}
sysrender.on('click', '#add_payment', function(e){
e.preventDefault();
var iid = $("#iid").val();
$('body').modalmanager('loading');
$modal.load( _url + 'invoices/add-payment/' + iid, '', function(){
$modal.modal();
$('.amount').autoNumeric('init');
$(".datepicker").datepicker();
$("#account").select2({
theme: "bootstrap"
});
$("#cats").select2({
theme: "bootstrap"
});
$("#pmethod").select2({
theme: "bootstrap"
});
});
});
sysrender.on('click', '#mail_invoice_created', function(e){
e.preventDefault();
var iid = $("#iid").val();
$('body').modalmanager('loading');
$modal.load( _url + 'invoices/mail_invoice_/' + iid + '/created', '', function(){
$modal.modal();
$('.sysedit').summernote({
});
});
});
sysrender.on('click', '#mail_invoice_reminder', function(e){
e.preventDefault();
var iid = $("#iid").val();
$('body').modalmanager('loading');
$modal.load( _url + 'invoices/mail_invoice_/' + iid + '/reminder', '', function(){
$modal.modal();
$('.sysedit').summernote({
});
});
});
sysrender.on('click', '#mail_invoice_overdue', function(e){
e.preventDefault();
var iid = $("#iid").val();
$('body').modalmanager('loading');
$modal.load( _url + 'invoices/mail_invoice_/' + iid + '/overdue', '', function(){
$modal.modal();
$('.sysedit').summernote({
});
});
});
sysrender.on('click', '#mail_invoice_confirm', function(e){
e.preventDefault();
var iid = $("#iid").val();
$('body').modalmanager('loading');
$modal.load( _url + 'invoices/mail_invoice_/' + iid + '/confirm', '', function(){
$modal.modal();
$('.sysedit').summernote({
});
});
});
sysrender.on('click', '#mail_invoice_refund', function(e){
e.preventDefault();
var iid = $("#iid").val();
$('body').modalmanager('loading');
$modal.load( _url + 'invoices/mail_invoice_/' + iid + '/refund', '', function(){
$modal.modal();
$('.sysedit').summernote({
});
});
});
$modal.on('click', '#send', function(){
$modal.modal('loading');
var attach_pdf = 'No';
if($("#attach_pdf").prop('checked') == true){
attach_pdf = 'Yes';
}
var _url = $("#_url").val();
$.post(_url + 'invoices/send_email', {
message: $('.sysedit').code(),
subject: $('#subject').val(),
toname: $('#toname').val(),
i_cid: $('#i_cid').val(),
i_iid: $('#i_iid').val(),
toemail: $('#toemail').val(),
ccemail: $('#ccemail').val(),
bccemail: $('#bccemail').val(),
attach_pdf: attach_pdf
}).done(function (data) {
var _url = $("#_url").val();
$modal
.modal('loading')
.find('.modal-body')
.prepend(data);
});
});
$modal.on('click', '#save_payment', function(){
$modal.modal('loading');
var _url = $("#_url").val();
$.post(_url + 'invoices/add-payment-post', {
account: $('#account').val(),
date: $('#date').val(),
iid: $('#iid').val(),
amount: $('#amount').val(),
cats: $('#cats').val(),
description: $('#description').val(),
payer: $('#payer').val(),
pmethod: $('#pmethod').val()
}).done(function (data) {
var _url = $("#_url").val();
if ($.isNumeric(data)) {
location.reload();
}
else {
$modal
.modal('loading')
.find('.modal-body')
.prepend(data);
}
});
});
$("#mark_paid").click(function (e) {
e.preventDefault();
bootbox.confirm($("#_lan_msg_confirm").val(), function(result) {
if(result){
var iid = $("#iid").val();
$.post( _url + "invoices/markpaid", { iid: iid })
.done(function( data ) {
location.reload();
});
}
});
});
$("#mark_unpaid").click(function (e) {
e.preventDefault();
bootbox.confirm($("#_lan_msg_confirm").val(), function(result) {
if(result){
var iid = $("#iid").val();
$.post( _url + "invoices/markunpaid", { iid: iid })
.done(function( data ) {
location.reload();
});
}
});
});
$("#mark_cancelled").click(function (e) {
e.preventDefault();
bootbox.confirm($("#_lan_msg_confirm").val(), function(result) {
if(result){
var iid = $("#iid").val();
$.post( _url + "invoices/markcancelled", { iid: iid })
.done(function( data ) {
location.reload();
});
}
});
});
$("#mark_partially_paid").click(function (e) {
e.preventDefault();
bootbox.confirm($("#_lan_msg_confirm").val(), function(result) {
if(result){
var iid = $("#iid").val();
$.post( _url + "invoices/markpartiallypaid", { iid: iid })
.done(function( data ) {
location.reload();
});
}
});
});
$modal.on('click', '#send_bcc_to_admin', function(e){
e.preventDefault();
$("#bccemail").val($("#admin_email").val());
});
$modal.on('hidden.bs.modal', function () {
location.reload();
})
});