{"id":1730,"date":"2025-04-21T22:43:46","date_gmt":"2025-04-21T19:43:46","guid":{"rendered":"https:\/\/moito.com\/blog\/?p=1730"},"modified":"2025-05-07T18:27:00","modified_gmt":"2025-05-07T15:27:00","slug":"erpnext-common-party-accounting-customer-vendor-invoice-offsetting","status":"publish","type":"post","link":"https:\/\/moito.com\/blog\/erpnext-common-party-accounting-customer-vendor-invoice-offsetting\/","title":{"rendered":"ERPNext &#8211; common party accounting (customer vendor invoice offsetting)"},"content":{"rendered":"\n<p>GitHub code for common party accounting:<br><a href=\"https:\/\/github.com\/frappe\/erpnext\/blob\/develop\/erpnext\/accounts\/doctype\/party_link\/party_link.py\">https:\/\/github.com\/frappe\/erpnext\/blob\/develop\/erpnext\/accounts\/doctype\/party_link\/party_link.py<\/a><\/p>\n\n\n\n<p>Documentation: <a href=\"https:\/\/docs.frappe.io\/erpnext\/user\/manual\/en\/common_party_accounting\">https:\/\/docs.frappe.io\/erpnext\/user\/manual\/en\/common_party_accounting<\/a><\/p>\n\n\n\n<p>More documentation and examples with video: <a href=\"https:\/\/fosserp.com\/blog\/shorts\/using-common-party-accounting-in-erpnext\">https:\/\/fosserp.com\/blog\/shorts\/using-common-party-accounting-in-erpnext<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-setting-up-common-party-accounting-in-erpnext\">Short docu on setting up common party accounting in ERPNext<\/h2>\n\n\n\n<p>In practice happens that a regular vendor might purchase your services or goods (so it is becoming a customer). And vice versa &#8211; usual customer can provide goods or services to your company. In order to offset (net, netting) the invoices and track financial balances between companies you can activate and use in ERPNext the &#8220;Common Party Accounting&#8221; functionality.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In ERPNext navigate to app\/erpnext-settings -&gt; \u201cAccounts Settings\u201d and enable \u201cCommon Party Accounting\u201d in the \u2018Invoicing Features\u2019 section.<\/li>\n\n\n\n<li>Two scenarios to link the customer or supplier. Depending on what is the primary role &#8211; If the party is already created as a supplier and is usually a supplier, then create it as a customer too. Go to the \u201cSupplier\u201d, click on \u201cLink with Customer\u201d from the \u201cActions\u201d option to link. <br>Respectively if the party is already created as a customer and this is its usual role, then create a supplier. Go to the \u201cCustomer\u201d, and click on \u201cLink with Supplier\u201d from the \u201cActions\u201d option to link.<\/li>\n\n\n\n<li>Now, create a sales invoice against the customer (who usually is supplier) who was assigned as the secondary party in the previous step.<\/li>\n\n\n\n<li>Upon submission of the sales invoice, an automatic journal entry will be made against the linked supplier, creating an advance balance. Also the invoice is marked as paid.<\/li>\n\n\n\n<li>You can now reconcile this journal entry advance against a Purchase Invoice.<\/li>\n<\/ol>\n\n\n\n<p>This process allows you to adjust your purchases with the sales transactions.<\/p>\n\n\n\n<p>MariaDB table which stores the links:  <strong>tabParty Link<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">+-----------------+--------------+------+-----+---------+-------+<br>| Field           | Type         | Null | Key | Default | Extra |<br>+-----------------+--------------+------+-----+---------+-------+<br>| name            | varchar(140) | NO   | PRI | NULL    |       |<br>| creation        | datetime(6)  | YES  |     | NULL    |       |<br>| modified        | datetime(6)  | YES  | MUL | NULL    |       |<br>| modified_by     | varchar(140) | YES  |     | NULL    |       |<br>| owner           | varchar(140) | YES  |     | NULL    |       |<br>| docstatus       | int(1)       | NO   |     | 0       |       |<br>| idx             | int(8)       | NO   |     | 0       |       |<br>| primary_role    | varchar(140) | YES  |     | NULL    |       |<br>| secondary_role  | varchar(140) | YES  |     | NULL    |       |<br>| primary_party   | varchar(140) | YES  |     | NULL    |       |<br>| secondary_party | varchar(140) | YES  |     | NULL    |       |<br>| _user_tags      | text         | YES  |     | NULL    |       |<br>| _comments       | text         | YES  |     | NULL    |       |<br>| _assign         | text         | YES  |     | NULL    |       |<br>| _liked_by       | text         | YES  |     | NULL    |       |<br>+-----------------+--------------+------+-----+---------+-------+<\/pre>\n\n\n\n<p>In order to get easily from within ERPNext a list of current settings, you can create a new Query report (Report List -&gt; Add report) with the following SQL query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select name, primary_role, secondary_role, primary_party, secondary_party, creation, docstatus, idx\n  FROM\n    `tabParty Link` AS party\n    \n\n<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-red-color\">Or use \"Party Link\" in search field and choose \"Party Link List\" to get list of already existing links between Vendors and Customers.<\/mark><\/strong>\ne.g.: erpnext.yoursite.com\/app\/party-link<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GitHub code for common party accounting:https:\/\/github.com\/frappe\/erpnext\/blob\/develop\/erpnext\/accounts\/doctype\/party_link\/party_link.py Documentation: https:\/\/docs.frappe.io\/erpnext\/user\/manual\/en\/common_party_accounting More documentation and examples with video: https:\/\/fosserp.com\/blog\/shorts\/using-common-party-accounting-in-erpnext Short docu on setting up common party accounting in ERPNext In practice happens that a regular vendor might purchase your services or goods (so it is becoming a customer). And vice versa &#8211; usual customer can provide goods or services &hellip; <a href=\"https:\/\/moito.com\/blog\/erpnext-common-party-accounting-customer-vendor-invoice-offsetting\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ERPNext &#8211; common party accounting (customer vendor invoice offsetting)<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1012,10],"tags":[1014,1017,1026,1013,1024,1020,1021,1022,1025,1016,1015,1029,1030,1018,1027,1028,1019,1023],"class_list":["post-1730","post","type-post","status-publish","format-standard","hentry","category-erpnext","category-10","tag-common-party-accounting","tag-customer","tag-db","tag-erpnext","tag-invoice-offsetting","tag-invoices","tag-link-with-customer","tag-link-with-vendor","tag-mariadb","tag-offsetting","tag-offsetting-customer-vendor-invoices","tag-primary-role","tag-secondary-role","tag-supplier","tag-table","tag-tabparty-link","tag-vendor","tag-1023"],"_links":{"self":[{"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/posts\/1730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/comments?post=1730"}],"version-history":[{"count":6,"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/posts\/1730\/revisions"}],"predecessor-version":[{"id":1741,"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/posts\/1730\/revisions\/1741"}],"wp:attachment":[{"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/media?parent=1730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/categories?post=1730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/moito.com\/blog\/wp-json\/wp\/v2\/tags?post=1730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}