var count = 1;
function formgen() {
// alert("ENTERING ANOTHER SCHEDULE: Creating Second and Subsequent Forms ");
var sc = String(count);
var date = document.getElementById('date').value;
var time = document.getElementById('time').value;
var cld = document.getElementById('cid').value;
var cname = document.getElementById('cname').value;
// 28 April 2018 changed for Edge browser
var exform='';
var exform1='';
var exform2='';
var exform2edge='';
var exform3a='';
var exform3b="";
var exform3c="";
var exform4="";
var bottomadjust='';
var i =0;
exform1 = '
';
b1 = navigator.userAgent;
exform2 = '
' +
'
' +
'
SCHEDULE OF ACCOUNTS
'+
'J.O.B.E. Client ID ' +
'
This is to certify that the parties named below are indebted to the undersigned in the sums set opposite their
' +
'' +
' ' +
'
respective names, for merchandise sold and delivered or for work and labor done and accepted.
' +
' ' +
' Select method of payment - ' +
' Wire: ' +
' ACH: ' +
' Check: ' +
' Fuel: ' +
' Amount ' +
' '+
' ' +
' Do you request a reserve refund? ' +
' Yes ' +
' No ' +
' ' +
' Will support docs be attached ? Yes ' +
' ' +
' No ' +
' ' +
' ' +
'
';
exform3a =
'
' +
'
' +
' ' +
'
' +
'
Debtor's Name
' +
'
Misc.
' +
'
Ref #
' +
'
Inv#
' +
'
Inv. Date
' +
'
Load Amt
' +
'
Det
' +
'
Stop Chg
' +
'
Total Amt
' +
'
Ship Date
' +
'
Item
' +
'
Ship To Name
' +
'
Ship To City
' +
'
Ship To ST
' +
'
' +
' ' +
' ';
// Generate the 20 rows of the Table instead of hardcoding each row
numofrows = 20;
i = 0;
// first row
exform3b = exform3b + '
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
';
// Second and subsequent rows
for(i=1; i < numofrows; i++){
//sc = 1;
exform3b = exform3b + '
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
';
}
// end generation of 19 rows
exform3c =
' ' +
'
' +
'
' +
'
'+
' Schedule Total: ' +
' ' +
'
'+
'
'+
'
'+
'
Comments:
' +
' ' +
'
' +
'
Do not write in this box-J.O.B.E. Services, Inc. Use Only
' +
' Check No: ' +
'
' +
' Check Date: ' +
'
' +
' Mail: ' +
' Dep: ' +
' Wire: ' +
'
' +
' Other: ' +
' F.E: ' +
' A.C.H: ' +
'
' +
' Pickup: ' +
' Fuel: ' +
'
' +
'
' +
'
' +' '+
'
' +
' ' +
' ' +
' ' +
' ' +
'
'+
'
' +
'
' +
' Timestamp: ' +
' Do you request a reserve refund? Yes: No: ' +
'
' +
' Date: Seller: By ' +
'
';
exform4 = '
';
// 14 Sep 2018 make the formgen simpler irrespective of the browser
exform = exform1 + exform2 + exform3a + exform3b + exform3c + exform4 ;
// end changes
$('#content').append(exform);
checkboxclass();
datepicker();
tooltip();
$('html, body').animate({ scrollTop: $('.invcontainer'+sc+':first').offset().top}, 'slow');
count += 1;
}
// 14th Sept 2018
function copycomments(n){
$('.cmts').each(function (){
// alert("Copycomments function:comment value:"+n);
$(this).val(n);
});
}
function checkboxclass() {
// var mc = document.getElementById('mail0').checked;
// var dc = document.getElementById('dep0').checked;
var wc = document.getElementById('wire0').checked;
// var oc = document.getElementById('other0').checked;
// var fc = document.getElementById('fe0').checked;
var ac = document.getElementById('ach0').checked;
var pc = document.getElementById('check0').checked;
var fuc = document.getElementById('fuel0').checked;
var yc = document.getElementById('yes0').checked;
var nc = document.getElementById('no0').checked;
var comment = document.getElementById('comments0').value; // 14th Sept 2018
var fuelamount = document.getElementById('fuelamt0').value; // 13thAug2020
var sdocyes = document.getElementById('sdocyes0').checked;
var sdocno = document.getElementById('sdocno0').checked;
// 17th Aug 2018 signature removed . Following lines not required
// Instead added contact email to the signature field
// copy signature from first page to the new page
var str1 = "";
var sigcopy = "";
var contact_email = document.getElementById("sig").innerHTML;
// alert("Count:" +count);
str1 = 'sigcopy' + count;
sigcopy = document.getElementById(str1);
if(sigcopy !== null && sigcopy !== '') {
// alert("Sigcopy is NOT NULL");
sigcopy.innerHTML = contact_email;
}
//14/sept/2018 chenges
// iterate the comments textarea to be same in every invoice
$('.cmts').each(function (){
// alert("checkboxclass:comment value:"+comment);
$(this).val(comment);
});
$('.cids').each(function () {
$(this).attr('value', cld);
});
$('.cpname').each(function () {
$(this).attr('value', cname);
});
// $('.mail').each(function () {
// $(this).attr('checked', mc);
// });
// $('.dep').each(function () {
// // alert("Checkbox class: Entered dep");
// $(this).attr('checked', dc);
// });
$('.wire').each(function () {
// alert("Checkbox class: Entered wire");
$(this).attr('checked', wc);
});
// $('.other').each(function () {
// $(this).attr('checked', oc);
// });
// $('.fe').each(function () {
// $(this).attr('checked', fc);
// });
$('.ach').each(function () {
$(this).attr('checked', ac);
});
$('.check').each(function () {
$(this).attr('checked', pc);
});
// 13th Aug 2020 Set fuel checkbox and fuel amount to first page values
$('.fuel').each(function () {
$(this).attr('checked', fuc);
});
$('.fuelamount').each(function () {
// alert("Assigning fuel amount:"+fuelamount);
$(this).val(fuelamount);
});
$('.yes').each(function () {
$(this).attr('checked', yc);
});
$('.no').each(function () {
$(this).attr('checked', nc);
});
// 6th Sep 2020 Upload docs set checkbox
$('.sdocyes').each(function () {
$(this).attr('checked', sdocyes);
});
$('.sdocno').each(function () {
$(this).attr('checked', sdocno);
});
}