Maxwell Morais A log of everyday life

Less customers can mean more profit!

Yesteday I, my boyfriend, my uncles and my cousin, we decided dinner in a small restaurant, in the North zone, of São Paulo city, because the climate was propense to eat soup, and in this place they are promoting a Soup Festival.

We leave our house around 21hrs, we take around 15 minutes to reach this place, there is a small place, but they can put up, around 35 persons!

When we reached at this place, has a small queue in the outside, of some persons waiting to dinner!

In the first table was a group with around 15 persons (40% of the capacity of this place). I and my uncles started talking about how the economy is goind bad, how are being hard to make business etc., due the crisis, we talked around 45 minutes, and in some times looking inside of the place, and other times, to the people that join or leave to the queue!

Since we reached at this place, the group in the first table, was not consuming anything, just talking about the life, the childrens, the job, some one making some jokes etc.

And some persons leaving the queue, because the time and the hunger!

The time still going, with we in the queue, taking a look into this flow, the persons talking in the first table, some persons joining, waiting and leaving the queue! We are waiting for 2 hours, to get a table free for us. But while we are in the queue, we count around 40 persons leaving the queue, because has no free places to they dinner in this place.

So, this ruled our talks, about:

Sometimes, as a good business manager do you need decide, if you want more customers or more profit!

Of course, we are in the business world, trying to look to the profit! But many times, we can have the wrong thought: “If I have more customers, of course I will have more profit!”. So do you decide start the marketing of you business.

And the customers begin to come, but do you dont have a nice place to receipt all, and do a separation between the people that only need dinner, and the people that is in your place to shoot talks in the breeze!

Each potential customer that go out of the queue at last night, probably not return, and maybe will do bad recomendations about this place!

What is sad! Because is a nice place, they have everything to make success, but the customers in this place prevent this from happening!

So before of start a new campaign, take a special look, if you will can receive all persons, and the most important, what is the target of this campaign! Because earn a new customer is much more hard than lose they in the queue!

Open-source don't means Free

I’m not the most active user of the ERPNext community, and I’m not the most apreaciated, I know it and I’m not worried!

Is really nice know that ERPNext Teams is working since 2008 to keep ERPNext stable, feature-rich and the most important open-source!

But periodically emerge in the community some developers that don’t understood yet the concept of the Open Source and the concept of Community. I fell that they think that Open Source means free, but this is not the truth! Anyone is paying in some way to it be free, putting money, time, knownledgement etc.

One community is made by persons, that have your own life, and still having time to help the others! Open source, is made by the persons in these communities!

When I faced with these developers, that think that the community is here to serve they, ti saddens me!

I do not understand how anyone can think that investing time or money on training can be a waste, even before venturing out to try a free-lance work!

It is sad that selfishness does not allow some people to see that, win together is better than competing alone! But I believe that tomorrow will be a better day than today!

Invoice as Orders resume

In the service market segment, is very common that the companies open various Orders during the month to a customer, and in the end of the month, generate a single Invoice.

Thinking about this, I made a small change for one of our customer, but that will increase a lot your productively!

How do you can see in the below image, the customer issue a various service orders in a week, to each customer

Sales Orders to Bill

The Accounts Manager, two times per month issue a invoice, to each customer, the major issue, in this case is.

The Accounts Manager, need get all Orders in a single Invoice, and in ERPNext it is very hard to get!

So, we introduced a small button called Bill Issuer in the Sales Invoice, this button opens the below Dialog.

Bill Issuer

The Accounts Manager, select the customer, and wait the list of Orders Pending to Bill, so, with this, the Accounts Manager, selects the Orders that him need in the Invoice, and click in the Bill button, and get the Invoice issued with the most important information to the customer.

This is a silly change, but for the customer, represents a lot of time earned, that him can invest in the management of they business, instead of get blocked by a bureaucratic UI.

Simplify or Die trying

Have some years that I started with ERPNext, I worked in smalls, mediuns and now in a biggest project of customization of ERPNext, and on each new project, I fell that the things should be simplified!

The major issue is: The actual cicle of development is not able to scale! Code requires humans to code, and the most important not only simple humans, code requires programmers to touch with it.

Is very hard turn ideas in a real product, and in the major of times, the customer is not sure about what him really need! And the most important, code is not able of do everything! Alan Turing describe what is computable and what is not, so basically, we have goals that are unreacheable by code!

Is because these issues, and the fact that code, takes too much of my time, that I started developing a project to save my professional life!

I started this project a year ago, I touch in the code too many times, without success to go ahead, and XKCD, have a nice visual description about why:

Where I'm failling

The automation of code development, is not a simply task! It requires months of research, years of thoughts, a bit of luck and really patience! Too much patience!

CoreFlow is the result of my last 8 years coding, after too much time, taking my focus in the code, and never changing my coding language (except from VB6 to Python 6 years ago) after these time, I fell that I’m full able to formulate some theories about the process of coding!

In my basic theory, I observed that:

1 - Code is too much inflexible to represent the real world!

Yes, this is a truth, being active in the process of development and customization of ERPNext, I understood that the code, is not the best way of represent the real world, this is because the code is inflexible! This is the nature of the code, of a computer, of a program! You never can expect that a ERP made in India, will understand how the things are in Brazil, but you ever expect that a calculator returns 2 if you enter 1+1!

In fact Accounting is accounting everywhere, but the real world affects directly the accounting! Since Accouting is a Applied Social Science, it will be directly affected by the society!

2 - Code affects the real world, as the same way that the real world affects the code!

Do you can imagine a world without Internet, Google, Youtube, Wikipedia? If the code had never existed, the digital revolution never would have happened, so in the same manner that we try to represent the real world in lines of code, these lines of code, are current in our lives in the real world - This is recursion issue!

3 - The nature of inflexibility of the code is in the bit!

How do you know, computers are ruled by sets of bits, each bit only can represent one of two states (on-off, true-false, 0-1 etc) and daily we talk about things that Maybe, Will it, Yes, will! , No will, Never will, Sometimes will, Everytime will, etc . Each of these sentences have a contextual weight, that is impossible to represent in a computer due the nature of the math and for the fact that the weight change for each person, in each phase of life or from one society to another!

4 - I never will automate the code!

Another truth, that is a complement of the last observations! Due the code is inflexible, and the real world change on every minute, we never will be able of automate the code to generate complex programs that are able to do a full representation the real world! Because the real world change the code, and the code will change the real world!


A code can be segmented by:

  • Variables: Anything that change due a context
  • Actions: Anything that is capable of cause changes
  • Events: Anything that flag that something will occur or happened
  • Operations: The action of observe something

Returning to the principle of this article, that I started talking about Alan Turing, another important basis from him, are the Finite State Machines (FSM).

FSM are the most simple, and most powerfull computers in the world! In fact a computer only runs, because it is a FSM, and the information is computable.

Given that a FSM is a basic programable computer, CoreFlow is a Finite state machine, that observe variables to do actions!

The events only exists to determine what is going on!

In the next weeks I’ll start talking more and more about CoreFlow, because this is cause of all my actual headaches, and the solution for that!

Comissions - Managing the Complexity

In the last post, I started talking about my actual work to simplify the management of Sales Comissions in ERPNext. After some ours of work, I presented the result to the customer. His answer was

  • That’s amazing! But I fell that this don’t can be able of cover all of my reality!

We started discussing about what the Sales Comission project can’t cover. So I understood that in some cases the the customer, will split the Sales Comission to multiple members of the Team, in other cases, the comission is directly affected by the qty placed in the transaction. This seen a giant change, but in fact is only a small extension of the actual scenario! After 2 changes and 1 new field, this new reality can be covered by the Sales Comission project

Sales Comission with Fractionator

The new field fractionator indicated the field that is used as based to split the comission to the members of the Team.

The market segment of the customer is Services and these comissions are to Sales Orders placed as Service Orders where the service is directly connected with a Team that execute the Service Order. For some companies manage the Services as a Project is unreacheable or unmanageable.

So, at the end of this post all requirements of the customer was covered, and the most important, if we think a bit out of the box a single field can do a biggest change, and improve directly the management.

At final result, the comissions can be presented like the below image:

Advanced comissions