It is competent for the parties, when commercial necessities so require, to evade application of the ordinary rule for payment of freight on delivery, by inserting express terms into the contract of affreightment. In such cases charterparty can provide for the freight to be payable on the shipment of goods or for at least a portion of freight to be paid in advance.
In De Silvale v Kendall (1815) 4 M & S 37 per Lord Ellenborough CJ at p.42:
By the policy of the law of England freight and wages, strictly so called, do not become due until the voyage has been performed. But it is competent to the parties, to a charter-party, to covenant by express stipulations in such manner as to control the general operation of law. The question in this case is whether the parties have not so covenanted by the stipulations of this charterparty. If the charter-party be silent the law will demand a performance of the voyage, for no freight can be due until the voyage be completed. But if the parties have chosen to stipulate by express words, or by words not express but sufficiently intelligible to that end, that a part of the freight (using the word freight) should be paid by anticipation, which should not depend upon the performance of the voyage, may they not so stipulate?
In Thompson v Gillespy (1855) 5 E & B 209 per Lord Campbell CJ at p.223:
If she sailed on the voyage in a seaworthy condition, the merchant was to advance one fourth of the freight, which he could not recover back if the ship, having so sailed, should afterwards be lost by the perils of the sea, without having delivered any part of her cargo. …But [the shipowner] could not have the benefit of this indemnity unless, at the commencement of the voyage, the ship was seaworthy
Allison v Bristol Marine Insurance  AC 209, per Brett J at p.226:
I have drawn attention to all the cases, in order to shew how uniform the view has been as to what construction is to be put upon shipping documents in the form of the present charter-party, and as to the uniform, though perhaps anomalous rule, that the money to be paid in advance of freight must be paid, though the goods are before payment lost by perils of the sea, and cannot be recovered back after, if paid before the goods are lost by perils of the sea. Although I have said that this course of business may in theory be anomalous, I think its origin and existence are capable of a reasonable explanation. It arose in the case of the long Indian voyages. The length of voyage would keep the shipowner for too long a time out of money, and freight is much more difficult to pledge, as a security to third persons, than goods represented by a bill of lading. Therefore the shipper agreed to make the advance on what he would ultimately have to pay, and, for a consideration, took the risk in order to obviate a repayment, which disarranges business transactions. It seems to me, and I submit that, on a review of all the cases, the true construction of the charterparty in this case, is that the £2000, which were to be paid and were paid in advance constituted a prepayment of the freight payable under the charterparty, and no part of it could be recovered back by the charterer from the shipowner…
Compania Naviera General S.A. v Kerametal Ltd., (The Lorna I)  1 Lloyd’s Rep. 373 per Sir Donaldson MR at p.374:
… a liability to pay advance freight does not per se affect the time when freight is earned. It is simply an obligation to make a payment on account of freight at a time when it has not yet been earned. However that obligation is subject to a customary incident, capable of being varied or confirmed by express stipulation, that advance freight paid pursuant to the contract is not returnable or recoverable should the contract be frustrated before the freight can be earned.
Per Hobhouse J in The Dominique  1 Lloyd’s Rep 239 at p.246:
Advance freight is not adjustable according to what subsequently occurs, it is not repayable in whole or in part even if the voyage is never completed. It is not treated as a contractual obligation to which the rules of failure of consideration, or partial failure, apply in the same way as in other branches of the law of con¬tract. Once earned, advance freight is at the risk of the charterer and the subsequent incidents and misfortunes of the voyage do not entitle him to trans¬fer any of that risk back to the shipowner.
In Vagres Compania Maritima SA v Nissho-Iwai American Corpn, The Karin Vatis  2 Lloyd’s Rep 330, CA Lloyd LJ clarified meaning of "earned" and "deemed earned" or "considered as earned" in advance freight clause (below) and held at p.332:
Freight deemed earned as cargo loaded. Ninety-Five (95%) Percent of freight to be paid within three (3) banking days after completion of loading and surrender of signed Bills of Lading marked: "FREIGHT PREPAID", discountless and non-returnable, vessel and/or cargo lost or not lost. Balance of freight demurrage/despatch to be settled within twenty (20) days after completion of discharge and Owners' presentation of Laytime Statements from load/discharge ports.
… I do not think there is any difference between "earned" and "deemed earned" or "considered as earned". They all mean the same, namely that the shipowners have done all they have to do to earn their freight once the cargo has been loaded.
The provision that freight is deemed to be earned as cargo loaded is, to my mind, the paramount or controlling provision. It is well understood by commercial men. It casts the risk in relation to freight on to the charterers.
the concluding part of the clause is dealing with the manner of payment, not the obligation to pay. It provides a formula for ascertaining the date of payment, and for insuring that loading and discharging port demurrage or despatch, as the case may be, and the balance of freight are all settled at the same time.