How to create Invoice Transaction from Scratch
How to create Invoice Transaction from Scratch by OSOE Project.
This visual guide is part of a collection of documents created by the One
Student One ERP (OSOE) project in collaboration with Institut Mines Telecom,
Telecom Bretagne, Dresden University of Technology and the South Westfalia
University of Applied Sciences. It can be used to teach modern ERP theory and
practice to undergraduate students or professionals.
From the tutorials in the session "Packing Lists", you know that a Sale Invoice
Transaction can be created directly from a Sale Packing List , as you can see
from the above workflow of Invoice, after "Ship Packing List", a new Invoice
will be created in "Confirmed" state, which the method we recommend as
everything is automated, and it will be almost impossible to make an error.
But you might need sometimes to create sale or purchase invoice transactions
from scratch . If so, this tutorial will help you!
Copyright: You are free to copy, distribute, display, and perform the work
under the following conditions: you must attribute the work in the manner
specified by the author or licensor; you may not use this work for any
commercial purposes including training, consulting, advertising,
self-advertising, publishing, etc.; you may not alter, transform, or build upon
this work. For any reuse or distribution, you must make clear to others the
license terms of this work. Any of these conditions can be waived if you get
permission from the copyright holder through a commercial license or an
educational license. For more information, contact info@nexedi.com
init
openAndWait ${base_url}/Zuite_createFunctionalTestUser
verifyTextPresent Done.
Wait for activities
openAndWait ${base_url}/Zuite_setUpSaleOrderTest
verifyTextPresent Init Ok
Wait for activities
Agenda
• How to create a Purchase Invoice Transaction from the Accounting module
• How to check the transactions in the Accounting module "Accounting
Transactions" list
Please note that this tutorial explains how to create a Purchase Invoice
Transaction, but the exact same procedure will help you create a Sale Invoice
Transaction, only the first step is different-do not choose to create a
Purchase Invoice Transaction, but a Sale Invoice Transaction.
Note: in this session "IFRS Accounting", we will still use our company Hongzhao
as an example. So when you are practicing, please replace Hongzhao with the
company you created when you configured your ERP5 instance.
Login As Functional Test User
New Purchase Invoice Transaction
New Purchase Invoice Transaction
As shown in the above workflow, the first step will be to create a Purchase
Invoice Transaction manually. To do so, take this simple step, to which you
should be used now: in your ERP5 instance Home Page, click the New tab and
choose Purchase Invoice Transaction under the Accounting module as shown on the
picture.
waitForElementPresent //button[text()="Purchase Invoice Transaction"]
click //input[@name="editable"]
click //button[text()="Purchase Invoice Transaction"]
waitForElementPresent //input[@name="field_my_title"]
Edit Invoice View
Edit Invoice View
After the creation, you will be located firstly in the Invoice View tab of this
new Purchase Invoice Transaction. Edit this page in detail, such as the
information of your company who is the client, the supplier, the product to
purchase. You can also enter a description in the Description field, which will
be displayed on the Invoice for your company if you print it.
Then, what you should keep in mind to fill in, is a very important
information-the Purchase Trade Condition (circled in red). The idea is that
instead of filling all the remaining tabs of this invoice (Payment, Trade
Model, etc.), you can import this information from a Purchase Trade Condition .
If you haven't created this type of document before, we would recommend to read
the tutorial "How to create Trade Conditions" before taking the following
steps. ATTENTION: You must create a purchase trade condition instead of a sale
trade condition . So even, if you already did the tutorial, you still have to
create a new purchase trade condition.
Type the name of your Purchase Trade Condition in the field or click on the
little magnifying glass icon next to the Purchase Trade Condition field and
pick your Purchase Trade Condition from the displayed list. In our case, as you
see in the screenshot, we use "VAT France Purchase Trade Condition".
When you are done, save the changes and jump to next page.
select //select[@name= ZUITE-TEST-SALEORDER-ORGANISATION-001
"field_my_destination_section"]
type //input[@name="field_my_title"] ZUITE-TEST-PURCHASE-INVOICE-TRANSACTION-001
type //input[@name= ZUITE-TEST-SALEORDER-ORGANISATION-002
"field_my_source_section_title"]
fireEvent //input[@name= input
"field_my_source_section_title"]
waitForElementPresent //ul[@class="search_ul"]//li
click //ul[@class="search_ul"]//li[1]
type //input[@name= ZUITE-TEST-PURCHASE-INVOICE-TRANSACTIOn-001
"field_my_reference"]
type //input[@name= General Purchase Trade Condition
"field_my_specialise_title"]
fireEvent //input[@name= input
"field_my_specialise_title"]
waitForElementPresent //ul[@class="search_ul"]//li
click //ul[@class="search_ul"]//li[1]
type //input[@name= 04-05-2021
"field_my_stop_date"]
select //select[@name= EUR
"field_my_price_currency"]
select //select[@name= By Air
"field_my_delivery_mode"]
Apply Purchase Trade Condition
Apply Purchase Trade Condition
Once you selected your Purchase Trade Condition, it is time to apply. In order
to apply the Purchase Trade Condition, click on Apply Purchase Trade Condition
on the sidebar.
tal:block>
Add an Invoice Line
Add an Invoice Line
You can now see that some information have been imported from the Purchase
Trade Condition you just applied , such as the Currency. You can also browse
the Payment, Trade Model tabs, that should also have been updated from your
Purchase Trade Condition document. But you can still modify the details if
needed.
Add an Invoice Line 1
As shown in the Invoices workflow, when you create the invoice manually, you
will need to add invoice lines, which will present the products or services to
the Purchase Invoice Transaction. Indeed, in order for ERP5 to calculate the
amount of the transaction, it has to be linked with a product or a service . In
order to do this, we will create an Invoice Line that will bear the Product/
Service you purchase . In order to create an Invoice Line, click on "+ Add" and
select "Invoice Line" from the list, and click on "Create Document" .
After you are done the checking and adding the Invoice Line, jump to next page
in order to edit this line.
waitForElementPresent //a[text()="Add"]
click //a[text()="Add"]
waitForElementPresent //select[@name="field_your_select_action"]
select //select[@name="field_your_select_action"] Invoice Line
Edit Invoice Line
Edit Invoice Line
A new Invoice Line has been created. On this line, you will be able to link a
product to your Purchase Invoice Transaction, that will help ERP5 to calculate
the total amount of the Transaction.
Except for the Title and Reference, the first step we recommend to take is to
link a product to the new Invoice Line . Indeed, the reason of taking this step
first is that the information borne on the product document such as the price
will be imported automatically to the Invoice Line (If the product has not
variations). In order to link a product, enter the name of the product/service
you want to link in the Product field, or click on the magnifying glass Icon
next to the product field and choose the product or service from the displayed
list.
After you save the change in the "Product or Service" field, as you can see in
the next screenshot, some information will be updated as soon as your product
is linked to the Invoice Line . Indeed, these information has been imported
from the product document such as the Base Contribution which is now set as
Taxable, and the Price (If the product has not variations). If the product
linked has variation in prices, the Price field will not be updated
automatically, because ERP5 will not choose a price between different prices,
but we can set the price later .
In our case, as we link a complex product with variations, you can see also the
Variation filed has been updated (as shown in the next screenshot). Jump to
next page in order to understand how to set the price and quantity of
variations.
If your product has no variation, you will see the price is updated
automatically according to the purchase price set in the product document. So
the only step to take after this, is to enter in this View page the quantity
you purchase in the Quantity field . When this is done, click the Save button,
and you will see the "Total Price" be calculated by ERP5 .
This procedure to define the Quantity is a security procedure to be sure that
the price will be calculated depending upon the ordered quantity, because if
you have read the tutorial "How to create Products", you know that the purchase
/sale price of some products could depend upon the ordered quantity .
If your product has no Product Individual Variation, you are done with the
Invoice Line after you set the quantity, you can jump directly to the page
"Purchase Invoice Transaction" .
Choose variation for complex product
Choose variation
If you linked a product that has individual variations, you have to tell to
ERP5 which variations you want to link to this Invoice Line. To do so, choose
the Product Individual Variation shown in the Variation field which you want to
link to this Invoice Line, as circled in red on the screenshot. You should also
verify and edit the remaining information, such as Shipping and Delivery Dates,
etc.
Don't forget to click the Save button and then jump to next page.
The variation tabs
The variation tabs
As you can see in the case of product Variations, two new tabs have been
created for you to select the Quantity and the Price . These tabs will only be
created if you want to link a product with Product Individual Variations. Click
on the Quantity tab and jump to next page .
Set Quantity
Set Quantity
As you can see, this Quantity tab displays the Product Individual Variation you
have selected in last step, in order for you to enter a quantity for it. When
you would have set the quantity and saved your work, the price will be
calculated automatically, depending upon the quantity steps you defined, if you
did define it in the product document. If not, it will take the unique Purchase
Price you set in your product for this variation.
Type the Quantity you want to purchase in the quantity field, and click the
Save button . Jump to next page.
Check Price
Check Price
After set the Quantity, ERP5 will calculate the Price automatically . To check
the updated Price, click on the Price tab , you will see that the price of the
product variation, the Total Price and the Quantity has been updated from the
Quantity you set in last step.
Now you have finished setting the price and quantity of variations. You can go
back to your Purchase Invoice Transaction document. To do so, click on "
↑Invoice Line: JavaScript Patterns" on the screenshot. Note that the current
page is the Invoice Line document where you are located now, don't mix up with
the page of the Purchase Invoice Transaction.
Invoice Line added
Invoice Line added
Now we are back to the Invoice View tab of the Purchase Invoice Transaction we
created manually. You will see now in the Invoice Lines list the line of the
product we just added into this invoice.
Accounting View
Accounting View
After editing the Invoice View tab, we will now check the Accounting View tab,
where some information have been updated according to your inputs in Invoice
View tab. Click on the Accounting View tab of this Purchase Invoice Transaction
, you will see the updated information, such as Section, Title, Supplier,
Invoice Number, Accounting Operation Date, etc.
You will find that the section for Accounting Transaction Lines (circled in
red) are empty now because you haven't Journalise the transaction .
If you have read the previous tutorial "How to manage Invoices", you will know
the accounting transaction operation includes "Journalise Transaction", "Post
Transaction To General Ledger" and "Definitively Close Accounting Transaction".
But before Journalise the transaction, we still have to Confirm the transaction
. Please jump to next page.
Confirm Transaction
Confirm Transaction
You are now used to workflows, so you should know that the workflows are
available for each object without exceptions and can be found in the Action
item list.
As shown in the workflow of Invoices, after the creation of invoice, the next
step will be to Plan Transaction , but you can also Confirm Transaction
directly, if you want it to be taken into account, or if you want to be able to
start the accounting operation . Note that this step should be taken by the
company manager, and aims at saying to the accounting department that the
transaction is confirmed and that the Purchase will become effective.
In order to confirm this Purchase Invoice Transaction, click on Confirm
Transaction on the sidebar.
Then you can start the accounting transaction operation by doing Journalise
Transaction . Please jump to next page.
Journalise Transaction
Journalise Transaction
As you have learned in the previous tutorial "How to manage Invoices", and as
shown in the workflow of Invoices, after the Invoice is confirmed, you will
need to act Journalise Transaction to create the Accounting Transaction Lines.
So here, the action "Journalise Transaction" is to create accounting
transaction lines according to the purchased product linked to this invoice
into the Invoice Lines, which include the calculation considering the Trade
Model (tax, discount) set in the Purchase Trade Condition.
In order to journalise a purchase invoice transaction, click on Journalise
Transaction .
Check Accounting Transaction Lines
Check Accounting Transaction Lines
After journalised transaction, check the updating of accounting
transaction lines. There will be one line for Purchases Account, one line for
the VAT (if it is set in the Purchase Trade Condition you applied to this
purchase invoice), and one line for the Suppliers Account.
Note that you might need to modify the amounts directly in existing lines; "
Add Accounting Transaction Lines" (from the Action list on the sidebar); or
even delete some transaction lines (by click on the "Edit" in the highlighted
area on the screenshot, according to each particular transaction.
Create Related Payment
Create Related Payment
In order to create the related treasury movements, you will have to create the
related payment transaction. In order to do so, we would recommend you to read
the tutorial "How to create a Payment" first, to have a general ideal why and
how should we do this step. Then you can click on "Create Related Payment"
on the sidebar .
Go to Accounting Module
Go to Accounting Module
Once the related payment has been created, you can go back to the the
Accounting module and check the invoice and payment created by you. To do so,
click on Modules on the sidebar to go back to the page with all modules
displayed, and click on Accounting module to enter.
Check invoice and payment transactions in the Accounting Transactions List
Check invoice and payment transactions
The Accounting module displays all the transactions that you have entered in
your ERP5 . As you can see on the screenshot, you can find in this list the two
accounting transactions that we have created in this tutorial.
Wait for activities
Login As Manager
open ${base_url}/Zuite_tearDownSaleOrderTest
verifyTextPresent Clean Ok
Wait for activities