The first instinct is to solve it as a normal substitution puzzle, which will quickly reach a dead end. There are simply too many variables and not enough equations to do that. So instead, I thought that there could be meaning to the color and shape of the bottles, which is where it all comes together.
There are a total of 7 different colors and 4 bottle shapes. The first 6 lines of the puzzle only use the square bottles, and are very simple. So simple in fact, that they perfectly line up with the colors of the rainbow. RedSquare=0, OrangeSquare=1, YellowSquare=2 etc.
The 7th line has VioletSquare(6)+OrangeSquare(1)=RedCircle. Since the colors wrap back to red, it indicates that the bottles work as a base 7 number system, with the colors representing the single digit, and the shape representing the tens digit. For those who don't know what I'm blabbing about here, base 7 simply means that all numbers are made out of a total of 7 different digits. For example, base 10 (decimal), is what we normally use which has all 10 digits, and base 2 (binary), has only 2 digits and is used by computers. So with a few base 7 calculations, we can reason that square=0x, circle=1x, triangle=2x and hexagon=3x, where x is any digit between 0-6.
The last part of the puzzle is what we do once we reach 40 (in base 7), since there are only 4 bottle shapes. For that we have the solution in row 11, where VioletHexagon(36)+OrangeSquare(1)=40 (in base 7)=RedSquare(0). From that it is clear that from any result over 40, we simply remove 40 to get the correct bottle.
That's it. Here is the full solution, which you can also verify:
