Live data from Hacker News

Billing systems are a nightmare for engineers

getlago.com

351–360 of 372 posts

Re: Billing systems are a nightmare for engineers

#351
post #48

Just wait until you meet billing's angry roommate: invoicing. In the US, an invoice is just a weird PDF that you might glance at before sending off to your accounts payable team. But in other countries, especially those that use VAT style taxing systems, an invoice can be a legal document that expresses costs and taxes in a legally prescribed way for accounting purposes. Many countries have prescriptive rules over ho…

Yeah - and simply creating an invoice is creating taxable income in EU - if customer drags their feet you still owe VAT to the taxman. If you want to change invoice you have to make a special "correction invoice" because changing "real invoice" is a criminal offense - fun things :)

To spell that out: if you made a mistake in an invoice or negotiated a new total or an extra item (or had to drop an item) after creating the invoice, you now need to first create a correction invoice cancelling out the invoice you created and then create a new invoice. All three documents must have different numbers. Oh, and invoice numbers must be sequential and continuous.

Re: Billing systems are a nightmare for engineers

#352

Earlier quoted context omitted.

The US tax system is the legislative equivalent of spaghetti code / big ball of mud.

Nah it’s not a US thing; tax codes are the same most everywhere.

It is a combinatorial explosion problem. Each taxing authority probably isn't too different from the norm, but in the US you are more likely to encounter many different taxing authorities that overlap.

Re: Billing systems are a nightmare for engineers

#353
post #251

Basically everything about enterprise is a nightmare for engineers. What amazes me (after having worked at some of the most profitable companies in the world) is just how little intelligence the leadership has about their own revenue or costs, beyond "wow huge amounts of money is coming in or going out". And how many critical processes are implemented manually, by individuals, with personal spreadsheets, on their lap…

I have a SaaS idea I’ve been sleeping in solely because building the billing, authentication, & marketing are each an additional 96% of the work that is not building the actual functionality of what I’d want to sell.

Re: Billing systems are a nightmare for engineers

#354
post #102

Earlier quoted context omitted.

They're trivial... when you make the same change to add something, remove it, add it, remove it and hear that it's all being done "because X" and "X" never stops, it's clearly not working and the changes are trivial.

No, the changes aren't trivial. It sounds like you simply don't understand why they're doing it and you just assume that they're trivial because you have no knowledge of the domain. Off the top of my head, I can thing of a dozen reasons for why they'd require something to be added, then removed, then added, etc., from one invoice to the next.

> dozens of reasons

Then why not list them right here, right now?

Re: Billing systems are a nightmare for engineers

#355

I've had to deal with subscription based billing, and in my experience it wasn't a nightmare. There are some corner cases, but, those exist in every domain. And the stakes are definitely raised since you're dealing with people's money. Usage based billing sounds like a nightmare though. Taxes in the USA are a nightmare too. I have a friend that lives on a street, and for one side the tax rate is 7.5%, and the other s…

How often to neighbors on that street ship their deliveries to one another to cheat on taxes?

Re: Billing systems are a nightmare for engineers

#356
post #18

My very first startup (wayyyy back in 2000) built a billing SaaS. I fully agree that rating, billing, invoicing, and all of the related things are hard. I learned a lot in that role about dealing with complexity...and date/time.

What are the top 3 things you learned that every company should be aware of? Could be interesting to have an experienced view on this :)

Wow, that's a tough one. Just spitballing, I'd say:

  1). Don't try to build it yourself, no matter how simple your case.  Your needs will ALWAYS evolve to be more complex AND keeping up with the thousands (or more) of individual regulatory regimes in the world is a massive task.


  2). At any given point in time, you need to know the state of everything required to rate, bill, and invoice at any other point in time. (i.e. bitemporal).  As a consequence, critical data effectively becomes immutable, auditing is possible, and allows pre/post views of things after corrections. 


  3).  Once you start to get into tiered/volume discount, combo discounts, providing multiple services, etc. complexity rapidly increases, so observability into how exactly things are calculated is of paramount importance. This one is probably pretty obvious, but missed a lot.  How many times have you received a bill with little to now information about how things were calculated?  It's possibly a business decision, but just as likely the process is a black box and not readily observable.

Re: Billing systems are a nightmare for engineers

#357
post #170

I was working on a billing system for utility company and it was a nightmare but not for the reasons from the article. Dates are no problem, everything is billed at the end of month, quarter or year. Upgrades are downgrades are simplified, customer can legally change tariff only on predefined dates/events. Usage - yes, but exampled in the article do not even scratch the complexity of this Idempotency is not really ne…

I work in a closely related space: parent's comments are accurate. Some of these items can be solved with better forecasting models, but the issue is that almost no-one actually cares about 'better' forecasting at inidividual meter levels. Sysytem-wide (or at least substation level) forecasts are well studied for supply/demand considerations (at a minimum). Also, the variability in consumption patterns at an individual level are large. IOW, one might be able to generate forecasts accurately for 'typical' residential consumption (at a per-household level), but commercials can be very different. Ideally, IF (and this is a BIG if), forecasts for "most" premises was accurate enough, then one could make the claim that the missing data shouldnt really cause a recalculation of bill once the actual consumption data comes thru, except in cases where the error is large. Guess that means that the error check/correct process needs to continue to exist.

The meter being replaced shouldnt be a major issue, this is relational (at least we treat this all as relational) data that should be captured (by the customer information 'CIS' system), and should be available with a 1-2 day delay. Similar argument applies to other relational aspects of the premise under consideration. Not saying that those are easy (more ways for this process to have gaps).

Re: Billing systems are a nightmare for engineers

#358

Earlier quoted context omitted.

Yes literally impossible to take something in a format legal in the US, that doesn't match the foreign requirements, based on European testimony above (the exact truth of which IDK). Informal tax-evading (when the seller isn't evading, just the buyer) doesn't require personal contacts. This is just naïve thoughtless statement. It happens all the time. Example: business owner goes to Panama where they know no one. Buy…

> Buys a pallet of llama wool, seller gives a non-conforming receipt. Buyer goes back to France, imports the pallet as "cotton" Customs catches him (distinguishing cotton from non-cotton is surprisingly easy, so is forged documents for invoicing and freight papers, especially given that Panama is an unusual country to export raw cotton - or raw wool - from), he is now in prison for 5 years for tax fraud and document…

Maybe you can come up with a better example then :) Here in the US pallets of cocaine regularly make it through customs. Our customs officers are generally one rung above high-school dropout. They'd generally be lucky to distinguish heroin from a pallet of sand, let alone cotton from wool.

Not in the export/import business myself, just passed through customs enough to see just how truly stupid and vapid these officers are, combined with the truly insane amount of import/export volume each one is responsible for. In the US distinguishing types of fabrics and ensuring various legal substances that look vaguely similar actually are what they say they are is near the bottom of the priorities list. I don't have a lot of experience with EU customs (except see last paragraph).

I know people want to believe customs is some highly intelligent caring group of individuals who are sleeplessly guarding the country and the purse in a carefully planned and executed manner with a fine-toothed comb. Anyone with this belief has probably never crossed an international border. In practice it's more like the mental equivalent of a 4 year old set loose with a completely unreliable "drug dog" that alerts on a grandma who is ruthlessly interrogated while one guy with llama wool and 10 pablo escabars pass on the other side.

I can recall one occasion where I stepped directly from fucking IRAQ into EU and not a single customs officer even looked at me. Not one. Just a stamp without a single question. I could have been carrying literally anything and no one cared. I could have been coming from Iraq for any reason and no one gave a fuck what that reason might be.

Re: Billing systems are a nightmare for engineers

#359
post #259

Wait until you get into the complexities of taxation. If you think you know them, pay attention to https://twitter.com/aotearoa_ben/status/1526786701750050817 . That's a law that changes the tax rate if 1. The purchase happens in Texas. 2. The payment cleared in a specific 2 day period. 3. The item cost Seriously, calling out just one example, https://comptroller.texas.gov/taxes/publications/98-490/scho... points out…

* Cries in brazilian *

Re: Billing systems are a nightmare for engineers

#360
post #259

Wait until you get into the complexities of taxation. If you think you know them, pay attention to https://twitter.com/aotearoa_ben/status/1526786701750050817 . That's a law that changes the tax rate if 1. The purchase happens in Texas. 2. The payment cleared in a specific 2 day period. 3. The item cost Seriously, calling out just one example, https://comptroller.texas.gov/taxes/publications/98-490/scho... points out…

No post body was provided.
Post reply on HN