|
|
|
|
@ -61,7 +61,6 @@ $(document).ready(function() { |
|
|
|
|
function changeDataInInputs(data) { |
|
|
|
|
|
|
|
|
|
if (data.type === "LEGAL"|| data.type === "INDIVIDUAL" ) { |
|
|
|
|
// console.log(data);
|
|
|
|
|
if (data.name) { |
|
|
|
|
clientName.val(join([data.opf && data.opf.short || "", data.name.short || data.name.full], " ")); |
|
|
|
|
clientNameShort.val(data.name.short); |
|
|
|
|
@ -94,7 +93,11 @@ $(document).ready(function() { |
|
|
|
|
clientKpp.val(data.kpp); |
|
|
|
|
clientOqrn.val(data.ogrn); |
|
|
|
|
if (data.address) { |
|
|
|
|
clientAddress.val(data.address.value); |
|
|
|
|
if (data.address.data.postal_code) { |
|
|
|
|
clientAddress.val(data.address.data.postal_code +', ' + data.address.value); |
|
|
|
|
} else { |
|
|
|
|
clientAddress.val(data.address.value); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
console.log(data); |
|
|
|
|
@ -145,7 +148,6 @@ $(document).ready(function() { |
|
|
|
|
if (inputErrors) {inputErrors.removeClass('ui-state-error')} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO: edd clear button
|
|
|
|
|
bankSearch.on('keyup',(function () { |
|
|
|
|
|
|
|
|
|
if (bankSearch.val().length === 0) { |
|
|
|
|
@ -154,14 +156,6 @@ $(document).ready(function() { |
|
|
|
|
} |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
// TODO: edd clear button
|
|
|
|
|
// clientSearch.on('keyup',(function () {
|
|
|
|
|
//
|
|
|
|
|
// if (clientSearch.val().length === 0) {
|
|
|
|
|
// clearSearchInputs([clientName, clientInn, clientKpp, clientOqrn, clientAddress, clientNameShort, clientNameShortD, contactName]);
|
|
|
|
|
// }
|
|
|
|
|
// }));
|
|
|
|
|
|
|
|
|
|
clientSearch.on('keyup',(function () { |
|
|
|
|
cleanFormErrors(); |
|
|
|
|
})); |
|
|
|
|
|