ERPNext – common party accounting (customer vendor invoice offsetting)

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 – 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 “Common Party Accounting” functionality.

  1. In ERPNext navigate to app/erpnext-settings -> “Accounts Settings” and enable “Common Party Accounting” in the ‘Invoicing Features’ section.
  2. Two scenarios to link the customer or supplier. Depending on what is the primary role – If the party is already created as a supplier and is usually a supplier, then create it as a customer too. Go to the “Supplier”, click on “Link with Customer” from the “Actions” option to link.
    Respectively if the party is already created as a customer and this is its usual role, then create a supplier. Go to the “Customer”, and click on “Link with Supplier” from the “Actions” option to link.
  3. Now, create a sales invoice against the customer (who usually is supplier) who was assigned as the secondary party in the previous step.
  4. 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.
  5. You can now reconcile this journal entry advance against a Purchase Invoice.

This process allows you to adjust your purchases with the sales transactions.

MariaDB table which stores the links: tabParty Link

+-----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| name | varchar(140) | NO | PRI | NULL | |
| creation | datetime(6) | YES | | NULL | |
| modified | datetime(6) | YES | MUL | NULL | |
| modified_by | varchar(140) | YES | | NULL | |
| owner | varchar(140) | YES | | NULL | |
| docstatus | int(1) | NO | | 0 | |
| idx | int(8) | NO | | 0 | |
| primary_role | varchar(140) | YES | | NULL | |
| secondary_role | varchar(140) | YES | | NULL | |
| primary_party | varchar(140) | YES | | NULL | |
| secondary_party | varchar(140) | YES | | NULL | |
| _user_tags | text | YES | | NULL | |
| _comments | text | YES | | NULL | |
| _assign | text | YES | | NULL | |
| _liked_by | text | YES | | NULL | |
+-----------------+--------------+------+-----+---------+-------+

In order to get easily from within ERPNext a list of current settings, you can create a new Query report (Report List -> Add report) with the following SQL query:

select name, primary_role, secondary_role, primary_party, secondary_party, creation, docstatus, idx
  FROM
    `tabParty Link` AS party
    

Dr Bret Weinstein – интервюто в DOAC

Интересно видео за АЕЦ-овете, сигурността на електрическата мрежа, COVID, Фаучи, как “студенти” на които не е преподавал и не познава го принуждават да напусне университета, в който работи (а полицията се крие и не взема мерки), и още много неща в интервюто с Dr Bret Weinstein в DOAC (The Diary Of A CEO):

Много интересно и полезно интервю / подкаст.

Чип за преминаване през ТОЛ пунктовете в Гърция

Вариант да си спестите чакането пред бариерите за плащане на таксите е ако използвате чип за преминаване, който предварително се зарежда със сума, от която се тегли таксата на всяко преминаване.

Попълва се формата: https://docs.myegnatiapass.gr/custdatanewapp/NewCustomer.aspx?AspxAutoDetectCookieSupport=1

Има версия на английски на сайта.

Получават се и се подписват документи онлайн.

После те изпращат по куриер (безплатно за сега) въпросният чип на който си зареждате сума и си я ползвате при пътуване.

Apple TV 3rd generation A1469 tech specifications and drive storage capacity

I had to check recently what is the storage capacity of an Apple TV 3rd generation device identified as model Apple TV A1469. Strangely NOWHERE in the About and Settings is shown the capacity. It seems that officially for this device there is no storage available and stated!!!

Apple TV (3rd Generation, Early 2013) Specs
Identifiers: 3rd Gen – MD199LL/A – AppleTV3,2 – A1469 – 2633

Apple TV (3rd Generation) has 512 MB of RAM and is capable of supporting 1080p video.

Processor Speed: 1 GHz* Processor Type: Apple A5

Apple does not specify the amount of RAM onboard. However, by third-parties it was confirmed that it has 512 MB of RAM.

Standard Storage: 8 GB SSD Storage. Officially, the third generation Apple TV models have no internal storage. However, third-parties have determined that they actually have 8 GB of flash memory to cache content, just like the second generation Apple TV.

Delete Mac OS local TimeMachine backup

To delete specific local Time Machine backups from the Terminal:

  1. List the available backups with:
    tmutil listlocalsnapshots /
  2. Delete backup with from the list:
    sudo tmutil deletelocalsnapshots 2024-xxxxxxx

    You should get confirmation of deletion like: “Delete local snapshot ‘2024-xxxxxx’

More info on how to clear space on Mac OS will be published later…

But generally you can first check this official document:
Free up storage space on Mac
https://support.apple.com/en-us/102624

How to set default date in ToolJet.com app

Target: Create a variable which has the default date as value. Then use this value as default for date picker component in ToolJet app.

Steps:

  1. Add new query of type “Run JavaScript code”
  2. In the code section paste the following code:
    const currentDate = new Date();

    const year = currentDate.getFullYear();
    const month = String(currentDate.getMonth() + 1).padStart(2,'0'); // Months are 0-indexed
    const day = String(currentDate.getDate()).padStart(2, '0');  

    today = `${year}-${month}-${day}`;

    actions.setVariable('dt', today);
    return actions.getVariable('dt');
  3. Below the code make sure to switch ON in Settings “Run this query on application load?”
  4. Now you can use the created value in the variable “dt” in any Date picker component by simply putting the following text in “Default value” property: “{{variables.dt}}

Permission denied while getting drive credentials from BigQuery table in Cloud Functions via SQL

If you have a BigQuery external table which uses for example a Google Sheets file as source, AND you try to read / join this table in BigQuery SQL you may get the error in BigQuery job failure log:

google.api_core.exceptions.Forbidden: 403 Access Denied: BigQuery BigQuery: Permission denied while getting Drive credentials.

Seems like no drive scope is the default, so BQ clients that need these scopes should be passing it in via the client_options.

So in this original solution post: https://github.com/googleapis/google-auth-library-python/issues/1204

This is the solution which worked for me too:

EricSeastrand commented on May 27, 2024• 
For anyone else facing this, here's the exact code that worked for me:

from google.cloud import bigquery
client = bigquery.Client(client_options={
    "scopes": ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/cloud-platform']
})
results = client.query_and_wait(sql)

During the bigquery.Client connection I had to pass the above scopes and there is no problem with authorizations in Sheets/Drive access anymore.

2025 April update:

Some more settings found recently:

 "oauthScopes": [
          "https://www.googleapis.com/auth/spreadsheets.readonly",
          "https://www.googleapis.com/auth/userinfo.email"

Source: https://stackoverflow.com/questions/76076016/forbidden-403-access-denied-bigquery-bigquery-permission-denied-while-getting

Or better (if applicable), create a view based on the table which accesses the Sheet 😉

Some day I may post more on the topic …..