Every consignee or commission agent who has made advances on goods consigned to him, or placed in his hands to be sold for account of the consignor, has a privilege for the amount of these advances, with interest and charges on the value of the goods, if they are at his disposal in his stores, or in a public warehouse, or if, before their arrival, he can show, by a bill of lading or letter of advice, that they have been dispatched to him.
This privilege extends to the unpaid price of the goods which the consignee or agent shall have thus received and sold.
Every consignee, commission agent or factor shall have a privilege, preferred to any attaching creditor, on the goods consigned to him for any balance due him, whether specially advanced on such goods or not; provided they have been received by him, or an invoice or bill of lading has been received by him previous to the attachment; provided, that the privilege established by this article shall not have a preference over a privilege pre-existing on the goods aforesaid in behalf of a resident creditor of this State.