Metadata-Version: 2.1
Name: odoo-addon-purchase_deposit_company_amount
Version: 16.0.1.0.0.2
Summary: Book purchase deposits at the company-currency amount actually paid
Home-page: https://github.com/OCA/purchase-workflow
Author: Quartile, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-purchase-deposit<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

===============================
Purchase Deposit Company Amount
===============================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:e78aa3032c1c5b072a0b77f9df587d496354bf4061d339a3a4d1d10f399beab1
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
    :target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_deposit_company_amount
    :alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_deposit_company_amount
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module books a foreign-currency purchase deposit at the
company-currency amount actually paid and carries that figure through to
the final bill, so the deposit account clears to zero and the
exchange-rate difference lands in the inventory cost of the goods
instead of being stranded on the balance sheet.

In detail:

-  Adds a Company Currency Amount field to the deposit line of a deposit
   bill, which forces the line's balance to the amount entered instead
   of converting the foreign currency amount at the exchange rate.
-  Carries the company currency value of a posted deposit bill over to
   the deposit offset line of the final bill, so the deposit account
   closes out at the amount that was actually paid.
-  Books the resulting exchange rate difference into the product lines,
   and reflects it in the stock valuation of the received goods.

The field is only available on the deposit line of a deposit bill raised
in a foreign currency, and the column is hidden everywhere else.
Everything on the final bill is derived from it, and a deposit nobody
entered an amount for keeps the standard rate conversion throughout.

**Table of contents**

.. contents::
   :local:

Use Cases / Context
===================

When a purchase order is in a foreign currency, the deposit is usually
settled for an exact company currency amount that does not match the
exchange rate configured for that day. Odoo books the deposit at the
rate, so the deposit account never closes out cleanly against what was
paid.

A paid deposit is a non-monetary asset, so the goods are measured at the
deposit's own rate for the prepaid portion and at the current rate for
the remainder. The difference is part of the acquisition cost rather
than an exchange gain or loss, which is why it is booked into the
product lines.

Usage
=====

Register the deposit with the standard *Register Deposit* wizard, and
enter the company currency amount actually paid in the Company Currency
Amount column of the deposit bill before posting it. The column is
optional, and can be shown from the bill line list.

Create the final bill from the purchase order as usual. The deposit
offset line is pinned to the amount entered on the deposit bill, and the
exchange rate difference is added to the product lines.

The example below follows a purchase order of USD 100 with a 30%
deposit, where the deposit of USD 30 is settled for JPY 3900, the rate
on the deposit bill date is USD 1 = JPY 150, and the rate on the final
bill date is USD 1 = JPY 160.

**Deposit bill.** Without the module the deposit is converted at the
rate of the day; with it, the balance is forced to the amount that was
really paid.

=================== ==== ===== ================ ==== =====
Without this module            With this module      
=================== ==== ===== ================ ==== =====
Deposit (asset)     $30  4500  Deposit (asset)  $30  3900
Payable             -$30 -4500 Payable          -$30 -3900
=================== ==== ===== ================ ==== =====

**Final bill.** The offset line is read back from the posted deposit
bill, so the deposit account closes out at what was paid and the
difference lands in the goods instead.

=================== ==== ====== ================ ==== ======
Without this module             With this module      
=================== ==== ====== ================ ==== ======
Product             $100 16000  Product          $100 15100
Deposit (asset)     -$30 -4800  Deposit (asset)  -$30 -3900
Payable             -$70 -11200 Payable          -$70 -11200
=================== ==== ====== ================ ==== ======

Without the module the deposit account is left with JPY 300 that no
further document will clear, and the goods are valued at the closing
rate alone. With the module the deposit account is back to zero, and the
product line carries the 3900 paid for the deposit plus USD 70 at the
current rate; the payable is the remaining USD 70 at that rate in both
cases.

The column only appears on a deposit bill in a foreign currency, the
deposit being the one amount known outside Odoo. In the company currency
there is no conversion to override, so the field is refused there.

Everything on the final bill is derived from what was entered: the
offset line is read back from the posted deposit bill and the goods
lines take the rate difference. Leaving the field empty on the deposit
bill opts out of all of it -- the deposit, the offset and the goods are
then converted at the exchange rate exactly as Odoo does without this
module.

The bill that carries the deposit offset has to invoice the order in
full. Posting one that leaves part of the order unbilled is refused,
because the whole deposit is relieved on that first bill and its
difference would be charged to the quantities billed first alone.

Known issues / Roadmap
======================

The deposit is relieved in full on the first bill that follows it, so
the difference between the deposit as paid and the exchange rate can
only be charged to the goods without distorting them when those goods
are the whole order. Billing an order in instalments is therefore not
supported: the bill that carries the deposit offset must invoice every
line of the order.

Posting a bill that leaves part of the order unbilled is refused with an
explanation. Clearing the Company Currency Amount on the deposit bill
opts out and restores the standard exchange rate conversion throughout.

Supporting instalments would mean spreading the difference over the
whole ordered quantity and carrying the unabsorbed part forward to later
bills, which have no deposit offset line left to hold it.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_deposit_company_amount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Quartile

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-kanda999| image:: https://github.com/kanda999.png?size=40px
    :target: https://github.com/kanda999
    :alt: kanda999
.. |maintainer-Aungkokolin1997| image:: https://github.com/Aungkokolin1997.png?size=40px
    :target: https://github.com/Aungkokolin1997
    :alt: Aungkokolin1997

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kanda999| |maintainer-Aungkokolin1997| 

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_deposit_company_amount>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
