Saturday, 16 May 2015

Don't do simple things! people could do his work looks too easy!

Hello everybody!
I yesterday had another interesting day in the wonderful world of Sorax. The story starts with the quiet and marvelous girls of operations, who never use to open tickets or to come with complicated requests (I have just realized that you, lovely-and-probably-non-existent reader, are not able to get the sarcastic tone in my worlds, but in my mind there no room for doubts, I am being sarcastic, they always have the most complicated and imaginative ways to make my labour as hard as interesting. I would be nothing without them).

One of these girls, the manager indeed, had a simply-looked and nothing crazy request. Change the set up of a specific customer, she needed that, after this customer takes his fuel, to generate his invoice not this day, how is suppose to be, but 4 days after. "Ok", I think, "It's time to move some walls". But after I started my job she noticed me. "Now we are doing similar with other customers, you can do the same with this one".

Wow! My lucky day, This was going to be easy as a pie!. I just had to look for in the code (this is still kind of scaring) in which part this invoice date is generated and, hopefully find an exception to this other ones and copy and paste. In five minutes it would be done! Even there was a chance that in the customer window already exist a way to change that! (I feel the obligation to warn you, my lovely reader, that now I don't mean to be sarcastic at all. I actually thought that) My first try was this one, I look into the customer settings with the purpose to find this magic key to change the invoice configuration. Of course it wasn't, this should be kind of foresighted and in this application nothing is ready to be used. If they have needed some special configuration in a moment, they put the modification how it comes, with no taking the possibility  of apply the same change to another different item, understanding item as customer, order or whatever.

Second try, look into the code to get the point of invoice date generation. This could be easy in any application but it never is in Sorax. But I was hoping it wouldn't be harder than other complicated changes I had to do. I was wrong. There is no place on Sorax where the date is calculated. There is no exception write in Sorax, this date is shown in a report and it is created dynamically when the report is created, this date is not stored or updated in any time, just get a couple of rules, and applied them in the stored procedure (this is a command, for foreign ones, which is placed on the database instead the code, and is not the best place to put business rules, in the other way this is the best way to get raw data from the database and it never happens, life is tough).
Ok, the date is calculated on the fly and the rules to do the exceptions are the craziest rules to do anything in the world.Seriously. I'm glad to explain, I'll put all my energies to explain it in the most simple and less technical way it can be possible.

Firstly I'll explain how I would've done it, in the strange scenario that I would've done in a stored procedure, perhaps in a parallel universe where I am forever drunk. I would've put a condition to know if the customer is an exception and if it is, I would've write a simple rule like "if the customer is an exception the date is 'usual date' plus 2" or better, "if the customer is this one, date is 'usual date' plus 2, if it is this other, date is 'usual date' plus 4, any other just get the 'usual bloody date'." write this in the code is as simple as it looks, really, as my girlfriend says: easy peasy.

Now I'll explain how it is done. In some part of the code (actually in the middle of an instruction to get data) there is a condition, similar than my condition in the structure, but not in the meaning. "If the customer is any of the special ones, just change in a non-permanent way, just to the report, the delivery method to this other delivery method which is being used for other things, but we are gonna use it for this too, for the other let the delivery method as it is" (this delivery method is a little related to the generation of the date, but actually it isn't that much, just different method had different payment rules, but it does not apply in this case... or it shouldn't). In other part of the code there is another condition, the one with the dates. "If delivery method is 2, calculate as usual, but if you don't have all the data to do it (because it is possible that some bastard put a fake delivery method in here) that means that this is one of the special customers. It this is happening, just check not the unique identifier of the customer but the payment term of it, if it is X add one day to the 'usual date' because this is the special among the special ones, but if the payment term is another just add 2 days" What??? C'mon!! Are you fucking serious? I had to read it through like ten bloody times to get that was actually what i was looking for. I got quite confused, I had to talk with the requester to be sure that I was understanding everything, after I read it again and repeat this chat-read process like three times. 

Finally I changed the crazy way to a intermediate point between this one, and my drunk-parallel-universe way to make it just some kind of easy to add a new customer to the exceptions. Now, cross your fingers to haven't break any other place in this never-boring labyrinth. Maybe I have not been quite able to make you, my always lovely reader, such a crazy stuff was this, I have read the explanation like three times and looks like I am complaining about nothing. If it was the situation,  please don't trust in the appearances, it has been quite mad.

I had time to do more interesting things, but no-one of them as remarkable to this one. Even the last problem with the invoices (of course, something is always happening with invoices), though it is not quite fixed yet after a whole week looking at it, has been so regular if you compare with this thing.

Never got bored in this place!
See you around!

Tuesday, 5 May 2015

How the White Bunny would say: "I'm late!"

Hello Everybody!
How's it going? I bet your day is better than mine. Everything started at 7:20 a. m. when I woke up and realized that was exactly an hour and twenty minutes after I have to wake up to get work in time (that means half an hour before my starting time, but I'm still favouring that to expend almost six ponds taking a taxi every morning). Ok, I overslept, is not a big deal, you know, It's me, this was going to happen sooner or later, but thanks my transport routines it shouldn't be a real problem. If everything had gone properly, I could've got the office just fifteen minutes later, twenty as much. But no, mates. I had no problems with the tube, besides some minor delays because some minor stops between stations, but nothing more serious than usual. District line actually sucks, nothing new about this. Anyway I could get Waterloo at 8:00 so I was going to be able to take my train at 8:12, just one hour later than always, but without the traffic everything point to me able to get the office just at 8:50 (many times I got there at 7:50 so it was hardly possible) but no.

I walk to the ticket machines, as every day. More people than usual was queued to use them and I was kinda hurry, but that didn't worry me, because I know that people are stupid enough to don't realize that there are more machines at the back of the first ones you can see when got exit from the tube. So I walk round the line of machines to see how mostly of those at th
e back were free. Therefore, while most of people was waiting their time to use the busy machines, the few ones who were able to use our eyes to see around were using the free ones. Great!

I select my travel options in a quite automatically way (I could do it with my eyes being shut) and put my card into the card reader. 

"Please remove your card"

Those scary words were printed in the display. I obeyed and tried again. Same. In the proper screen the message was more discomforting if possible "Your card cant be read". Shit. If this had happened at my usual hour, it wouldn't be quite bad. I could go with my oyster to my manager place and beg him for a ride, but he should be already in the office and I was losing time whit the bloody machine. Don't panic. I can try to get some cash in an ATM Machine.

These machines use to be free at 7, I use them sometimes to get cash for the bus, or even take a coffee in my favourite coffee shop at the station, where the girl put my coffee before I had to ask for it. But it wasn't 7, it was 8, ant there was a queue to use them. I checked my phone to know the time, watches are from the past, and I was about to lost the 8:12 train, but there is a slower one at 8:20 make me able to get the office at Not-Too-Much-Later-Than 9. Perfect, my turn to use the ATM. put my card and fantastic! it requested my pin number. I put it, selected the option to get cash, and.., "Sorry, we cannot provide that amount at this moment"

What??! I should have money, shouldn't I? I called my girlfriend (she should be sleeping, but thankfully she is off today) and asked her about the money. Yes, there are money in the account. So the bloody machine gave to me a bloody and nothing accurate message about my situation. Indeed, it requested my pin but I was thinking that probably it didn't even check whether or not the number was right. Apparently I had an actual problem in my hands. I text my manager to let him know about my  particular series of unfortunate events and put myself to look for a bank office near me. 

The closest one was next to Aldwych, not too long walk, but I wasn't in the mood, you know? I took a bus just to cross Waterloo Bridge and walk to the office. Closed, of course. It was 8:30 in that moment and the bank would be open at 9. Relax, I said to myself, you can get some breakfast in somewhere meanwhile...  but no, I had no card so I could do nothing but wait till the bank was open.

They open, I got in, I talk with the workers, they quickly ordered a new card to me (two bloody weeks I have to wait) and dispensed some cash to me. I got back to the train station (by bus) bought my tickets and waited till the next train departs, exactly at 9:42 because I couldn't even take the 9:20 train. This train, indeed, got delayed 5 minutes, but it didn't bother me, anyway I was bloody late this morning.

That point I couldn't help but compare my like Ulysses in my own odyssey, just a couple of differences with the original. He was looking forward to get home, where his loyal wife was unconditionally waiting for him; and he was coming from the war, where nobody should like to be. I was coming from my bed, with my girlfriend warming it up; and I wasn't really looking forward to get anywhere else, mainly to work with (and probably get lost in) my maze. And it is in this exact point, indeed, when I realize that I don't really like my life as similar to a Greek tragedy as it is lately.

With all my luck I was wondering if the train was going to blow up, or maybe some terrorist'd hijack it (there was a passenger with a pony tail style like Steven Seagal in flesh,so I wasn't worry at all) but there were no more incidents. I take my taxi without problems and got the office to see I had my box full of tickets, because if something gotta go wrong in the labyrinth, it gotta be when I'm not in time, thereby everyone can notice my absence.

It the rest of my life things are not bad, I'm still looking forward to moving closer, probably we'll move in to Surbiton, this way we are between my workplace and my girlfriend's. Last week one of the workmates whom I feel more comfortable with, specially 'cause she was on the team what tears more walls down in the maze, leaved the company and most of us went to take some drinks and say goodbye to her. I felt a little sorry because someone was missing, her very best friend in here, but I got over it quickly when I thought she wasn't there just because she was in a paradisical holidays and not dealing with regular people problems, like got overslept, lost her train and got broken her bank card... however, we had some fun, although I finished early because my girlfriend was waiting for me at home and I could fit in a little more with all my work mates. Even one of then what I thought she didn't like me, sent a request to be friends in Facebook, so I have a new potential reader of this (I know, I'm a dreamer)

Anyway, I'm expecting the next one, bigger and better.