Skip to content

Instantly share code, notes, and snippets.

@hackenbruder
Created August 30, 2015 20:17
Show Gist options
  • Save hackenbruder/9313b37361efab6391d5 to your computer and use it in GitHub Desktop.
Save hackenbruder/9313b37361efab6391d5 to your computer and use it in GitHub Desktop.
Příklad použití GovData Javascript SDK
GovData.findEntityByNumber('00006947',
function(entity) {
console.info('Název:', entity.getName());
if(entity.hasVAT()) {
console.info('Je plátcem DPH.');
var vat = entity.getVAT();
if(vat.hasAccounts()) {
var accounts = vat.getAccounts();
for(var i = 0; i < accounts.length; ++i) {
console.info('Účet:', accounts[i].toString());
}
} else {
console.info('Nemá nahlášené bankovní účty.');
}
} else {
console.info('Není plátcem DPH.');
}
},
function(error) {
console.error(error.toString());
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment