Open Computing Ltd - North Point House, North Point Business Park, Old
Mallow Road, Cork T23 AT2P - registered in Dublin, Ireland, Reg. no. 597154
VAT ID IE3455711EH
Code
CODE
code
Code code
Code
Code
if Code
Good Code
else
No Code
More Code
Code
...
invoiceItems.each { invoiceItem ->
invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding);
invoiceItemsConv.add(invoiceItem);
// get party tax id for VAT taxes: they are required in invoices by EU
// also create a map with tax grand total amount by VAT tax: it is also required in invoices by UE
taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false);
if (taxRate && "VAT_TAX".equals(taxRate.taxAuthorityRateTypeId)) {
taxInfos = EntityUtil.filterByDate(delegator.findByAnd("PartyTaxAuthInfo",
[partyId : billingParty.partyId, taxAuthGeoId : taxRate.taxAuthGeoId, taxAuthPartyId : taxRate.taxAuthPartyId],
null, false), invoice.invoiceDate);
taxInfo = EntityUtil.getFirst(taxInfos);
if (taxInfo) {
context.billingPartyTaxId = taxInfo.partyTaxId;
}
vatTaxesByTypeAmount = vatTaxesByType[taxRate.taxAuthorityRateSeqId];
if (!vatTaxesByTypeAmount) {
vatTaxesByTypeAmount = 0.0;
}
vatTaxesByType.put(taxRate.taxAuthorityRateSeqId, vatTaxesByTypeAmount + invoiceItem.amount);
}
}
/* insert file having hardlinks into hardlink hashtable */
if ( statp.st_nlink > 1 && type != TN_DIR && type != TN_DIR_NLS ) {
if ( ! LinkFI ) {
/* first occurence - file hardlinked to */
entry = (HL_ENTRY *)tree->root->hardlinks.hash_malloc(sizeof(HL_ENTRY));
entry->key = (((uint64_t) JobId) << 32) + FileIndex;
entry->node = node;
tree->root->hardlinks.insert(entry->key, entry);
#ifdef HARDLINKS_INMEM
} else {
/* hardlink to known file index: lookup original file */
uint64_t file_key = (((uint64_t) JobId) << 32) + LinkFI;
HL_ENTRY *first_hl = (HL_ENTRY *) tree->root->hardlinks.lookup(file_key);
if ( first_hl && first_hl->node ) {
/* then add hardlink entry to linked node*/
entry = (HL_ENTRY *)tree->root->hardlinks.hash_malloc(sizeof(HL_ENTRY));
entry->key = (((uint64_t) JobId) << 32) + FileIndex;
entry->node = first_hl->node;
tree->root->hardlinks.insert(entry->key, entry);
}
#endif
}
}
Some laws require web sites to put some notifications that you need to
acknowledge in order to see what's on the site, so we added some
notifications too.
They do not serve any real purpose, as far as we can tell, because
nobody ever reads them in the first place, not even regulators.
I mean, would you really expect some bureaucrat to read what's written
over here in small letters?
Well maybe, you never know; bureaucracy does all kinds of pointless
tasks after all.
And not just them! Once I heard about a guy who was tasked with pushing
huge boulder up the hill whole day long,
only to have it roll down from the top, and then he had to do it all
over again.
If only he had piezoelectric generator embedded in that boulder, imagine
how much energy he could produce...
but without it, it was just a waste of time and energy, just as reading
this text is.
But reading it all the way through requires quite some patience and
curiosity, so congratulations are in order.