-
-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[17.0][MIG] pos_payment_method_cashdro
- Loading branch information
Showing
18 changed files
with
167 additions
and
149 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
To add a Cashdro payment terminal: | ||
|
||
1. Go to *Point of Sale \> Configuration \> Payment Methods* | ||
2. Choose a cash payment method or create a new one. | ||
3. Select *Cashdro* in the *Use a Payment Terminal* field. | ||
4. Configure the Cashdro terminal hostname and credentials. | ||
5. Configure the desired, Cashdro terminal in the proper PoS | ||
configurations. | ||
|
||
Note that if a single payment method was used for cash in different | ||
stores, it should be splitted in as many phisical stores there are. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- [Acysos S.L.](https://www.acysos.com): | ||
- Ignacio Ibeas | ||
- [Tecnativa](https://www.tecnativa.com) | ||
- David Vidal | ||
- [ACSONE SA/NV](https://acsone.eu): | ||
- Bejaoui Souheil |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module allows to make payments with a Cashdro | ||
(<https://www.cashdro.com>) terminal on the Point of Sale frontend. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Integrate cash control (money inputs / outputs). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
With the proper configuration made: | ||
|
||
1. Make a new PoS order and choose the cash payment method configured | ||
with the Cashdro settings. | ||
2. Click on *Send* to send the request to the Cashdro terminal that | ||
will ask the customer for the amount to pay. | ||
3. The cashier can cancel the amount request discarding the line | ||
clicking on the (x) symbol. | ||
4. When the customer pays the sale amount in the terminal, the Cashdro | ||
reports the amount received and change delivered back. | ||
5. The Point of Sale reflects it in the payment line and thus the order | ||
can be validated now. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
/** @odoo-module */ | ||
/* Copyright 2021 Tecnativa - David Vidal | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).*/ | ||
import {Order, register_payment_method} from "point_of_sale.models"; | ||
import {Order} from "@point_of_sale/app/store/models"; | ||
import {PaymentCashdro} from "./payment_cashdro.esm"; | ||
import Registries from "point_of_sale.Registries"; | ||
import {patch} from "@web/core/utils/patch"; | ||
import {register_payment_method} from "@point_of_sale/app/store/pos_store"; | ||
|
||
register_payment_method("cashdro", PaymentCashdro); | ||
|
||
const PaymentCashdroOrder = (OriginalOrder) => | ||
class extends OriginalOrder { | ||
constructor() { | ||
super(...arguments); | ||
this.in_cashdro_transaction = false; | ||
} | ||
/** | ||
* @override | ||
* Set the amount to 0 as it's going to be filled by the Cashdro response | ||
*/ | ||
add_paymentline() { | ||
const line = super.add_paymentline(...arguments); | ||
if (!line) { | ||
return line; | ||
} | ||
if ( | ||
line.payment_method && | ||
line.payment_method.use_payment_terminal === "cashdro" | ||
) { | ||
line.set_amount(0); | ||
} | ||
patch(Order.prototype, { | ||
setup() { | ||
super.setup(...arguments); | ||
this.in_cashdro_transaction = false; | ||
}, | ||
/** | ||
* @override | ||
* Set the amount to 0 as it's going to be filled by the Cashdro response | ||
*/ | ||
add_paymentline(payment_method) { | ||
const line = super.add_paymentline(payment_method); | ||
if (!line) { | ||
return line; | ||
} | ||
}; | ||
|
||
Registries.Model.extend(Order, PaymentCashdroOrder); | ||
if ( | ||
line.payment_method && | ||
line.payment_method.use_payment_terminal === "cashdro" | ||
) { | ||
line.set_amount(0); | ||
} | ||
return line; | ||
}, | ||
}); |
Oops, something went wrong.