
    Chester Tube and Iron Company versus Whittington.
    1. In an action upon a book-account for goods sold from time to time, where general payments had been made on account, the defendant claimed deductions for bad workmanship and materials, embracing the earlier as well as the later items of the account, especially the earlier, but the court excluded the claim as to the earlier items, so far as they were covered by payments made and applied under the general rule of law governing appropriation of payments, and instructed the jury that there could be no such deductions upon any of the items thus paid for: Held, that this was error; that the ordinary rule as to the appropriation of payments had no application in such a case.
    2. The defendant was not precluded by reason of the general payments from showing bad workmanship and defective materials as to any of the items of the account, and claiming reasonable deductions therefor.
    March 24th 1880.
    Before Sharswood, C. J., Mercur, Gordon, Paxson, Trunkey, Sterrett and Green, JJ.
    Error to the Court of Common Pleas of Delaware county: Of January Term 1879, No. 256.
    Assumpsit by Joseph Whittington against the Chester Tube and Iron Company, to recover the balance of a book-account for certain iron castings sold to defendant. '
    At the trial, before Clayton, P. J., it appeared that the defendant company built a,tube works at Chester, Pennsylvania, and purchased from the plaintiff, who was an iron founder, a number of castings, including rolls and wheels, which were set up in defendant’s shops. The purchases and the work done upon them extended from July 24th 1877 to April 3d 1878, and the plaintiff’s aggregate bill was $9949.04 Payments on account were made from time to time, leaving a balance of $1506.82, which was the plaintiff’s claim in the suit. These payments were made on general account.
    The defendants gave evidence to show that some of the castings were of so poor a quality that they rvere unfit for use, and could only be sold -for old iron, and that these castings had been furnished in the earlier portion of the work which were covered by the payments made, if these payments were appropriated to the articles furnished in the order of time. The amount charged for these defective castings, less their value as old iron, was $1713, and this amount the defendant contended should be offset to the plaintiff’s claim.
    The plaintiff submitted, inter alia, the following points, all of which the court affirmed.
    4. That the payments made on account, without direction from the defendant to particularly appropriate, are payments generally, and by law are appropriated to the oldest part of the claim.
    
      May 3d 1880.
    5. That the payments made were voluntary, and that there can be no deduction for bad workmanship or materials upon any of the rolls or items thus paid for.
    6. That, even if the jury should find that the defendant is entitled to any deduction from the claim of the plaintiff for bad workmanship, it is only entitled to such deduction in the sum of $1506.82 worth of the work, the part of the claim unpaid.
    Verdict for $1506.82. Defendant took this writ and alleged that the court erred in affirming the above points.
    
      Theodore F. Jenkins, for plaintiff in error.
    The doctrine of voluntary payments does not apply to this case, as the plaintiff in error by its claim of set-off was not seeking to recover money voluntarily paid, but the damage it had sustained by the breach of the defendant’s warranty. This was a proper matter for a set-off: Phillips v. Laurance, 6 W. & S. 150; Deen v. Herrold, 1 Wright 150; Wright v. Cumpsty, 5 Id. 102; Hunt v. Gilmore, 9 P. F. Smith 450; Halfpenny v. Bell, 1 Norris 128.
    
      W. H. Dickinson, for defendant in error.
    The charge of the court below was, in effect, that if the defendant paid for the work knowing it was not properly done, it could not recover that money back; so far as that went, it was an acceptance of the machinery. Money voluntarily paid and received under a claim of right, though not strictly demandable, cannot be recovered back: Morris v. Tarin, 1 Dall. 147; Kennedy v. Hughey, 3 Watts 265; Keener v. Bank of the United States, 2 Barr 237; Natcher v. Natcher, 11 Wright 496.
    The general rule is well settled, that one who voluntarily pays money with full knowledge, or means of knowledge of all the facts, without any fraud having been practiced upon him, cannot recover it back by reason of the payment having been made in ignorance of law : Real Estate Saving Ins. v. Linder, 24 P. F. Smith 371; Natcher v. Natcher, supra; Appeals of King, Dunning and Miller, 1 Harris 224; Boas v. Updegrove, 5 Barr 516; Espy v. Allison, 9 Watts 462; Irvine v. Hanlin, 10 S. & R. 219.
   Mr. Justice Sterrett

delivered the opinion of the court,

The fourth point of the plaintiff below, the affirmance of which forms the subject of complaint in the first assignment, is correct, and as an abstract proposition there was no error in affirming it. It is well settled that when a payment is made on an open account composed of various items of different dates, and no specific application is made at the time by either debtor or creditor, the law will appropriate it to the oldest items of the account. It is the right of the debtor in the first place, when he makes a payment, to direct how it shall be applied. If he waives his right, the creditor may make the application; but if neither of them exercises the privilege, the law, as a general rule, will' appropriate the payment to the oldest items in their order as above stated. While the principle thus recognised is undoubtedly correct, it was erroneously applied in this case. The plaintiff in error claimed deductions for bad workmanship and materials, embracing the earlier as well as the later items, especially the former, but the court excluded the claim as to all the earlier items of the account, so far as they were covered by payments made and applied under the general rule of law above stated, and instructed the jury, as complained of in the second specification, “that there could be no deduction for bad workmanship or materials upon any of the rolls or items thus paid for.” In this there was error. If the defendant was able to prove bad workmanship or defective materials in any of the articles embraced in the earlier items of the account, entitling him to a deduction from the price charged therefor, he had as much right to the benefit of such deduction as he would have had if the general payments made on account had not been sufficient to cover those items. In other words, he was not precluded by reason of the general payments from showing bad workmanship and defective materials as to any items of the account, and claiming reasonable deductions therefor. The third assignment involves a repetition of the same error. In affirming the plaintiff’s point, the jury were instructed that if the defendant was entitled to any deduction from the claims of the plaintiff, on account of bad workmanship, he was restricted to the later items of the account not covered by the general payments.

Judgment reversed, and a venire facias de novo awarded.  