Debian Codegraph @

addons/l10n_es_pos/static/tests/tours/spanish_pos_tour.js

raw symbols SCIP
1 import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util";
2 import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util";
3 import * as ReceiptScreen from "@point_of_sale/../tests/pos/tours/utils/receipt_screen_util";
4 import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_util";
5 import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util";
6 import * as PartnerList from "@point_of_sale/../tests/pos/tours/utils/partner_list_util";
7 import { registry } from "@web/core/registry";
8 import { checkSimplifiedInvoiceNumber, checkCompanyState, pay } from "./utils/receipt_util";
9
10 const SIMPLIFIED_INVOICE_LIMIT = 1000;
11
12 registry.category("web_tour.tours").add("spanish_pos_tour", {
13 steps: () =>
14 [
15 Chrome.startPoS(),
16 Dialog.confirm("Open Register"),
17
18 ProductScreen.addOrderline("Desk Pad", "1"),
19 pay(),
20 checkSimplifiedInvoiceNumber("0001"),
21 ReceiptScreen.clickNextOrder(),
22
23 ProductScreen.addOrderline("Desk Pad", "1", SIMPLIFIED_INVOICE_LIMIT - 1),
24 pay(),
25 checkSimplifiedInvoiceNumber("0002"),
26 ReceiptScreen.clickNextOrder(),
27
28 ProductScreen.addOrderline("Desk Pad", "1", SIMPLIFIED_INVOICE_LIMIT + 1),
29 pay(),
30 Dialog.confirm(),
31
32 PaymentScreen.clickInvoiceButton(),
33 PaymentScreen.clickValidate(),
34 // verify that the pos requires the selection of a partner
35 Dialog.confirm(),
36 PartnerList.clickPartner(""),
37
38 PaymentScreen.isInvoiceOptionSelected(),
39 PaymentScreen.clickValidate(),
40 {
41 content:
42 "verify that the simplified invoice number does not appear on the receipt, because this order is invoiced, so it does not have a simplified invoice number",
43 trigger: ".receipt-screen:not(:has(.simplified-invoice-number))",
44 },
45 checkCompanyState("Badajoz"),
46 ReceiptScreen.clickNextOrder(),
47
48 ProductScreen.addOrderline("Desk Pad", "1"),
49 pay(),
50 checkSimplifiedInvoiceNumber("0003"),
51 checkCompanyState("Badajoz"),
52 ReceiptScreen.clickNextOrder(),
53 ProductScreen.addOrderline("Desk Pad", "1"),
54 ProductScreen.clickPayButton(),
55 PaymentScreen.clickPaymentMethod("Customer Account"),
56 PaymentScreen.clickValidate(),
57 Dialog.is({ title: "Customer Required" }),
58 ].flat(),
59 });
60
61 registry.category("web_tour.tours").add("l10n_es_pos_settle_account_due", {
62 steps: () =>
63 [
64 Chrome.startPoS(),
65 Dialog.confirm("Open Register"),
66 ProductScreen.clickPartnerButton(),
67 PartnerList.settleCustomerAccount("Partner Test 1", "10.0", "TSJ/", "/00001", true),
68 ProductScreen.clickPayButton(),
69 PaymentScreen.clickPaymentMethod("Bank"),
70 PaymentScreen.clickValidate(),
71 Chrome.confirmPopup(),
72 ReceiptScreen.isShown(),
73 ReceiptScreen.paymentLineContains("Bank", "10.00"),
74 ReceiptScreen.paymentLineContains("Customer Account", "-10.00"),
75 Chrome.endTour(),
76 ].flat(),
77 });
78
79 registry.category("web_tour.tours").add("test_simplified_invoice_not_override_set_pricelist", {
80 steps: () =>
81 [
82 Chrome.startPoS(),
83 Dialog.confirm("Open Register"),
84 ProductScreen.addOrderline("Desk Pad", "1"),
85 ProductScreen.clickPriceList("Test pricelist"),
86 ProductScreen.clickFiscalPosition("Original Tax"),
87 ProductScreen.clickPayButton(),
88 PaymentScreen.clickPaymentMethod("Cash"),
89 PaymentScreen.clickValidate(),
90 ReceiptScreen.isShown(),
91 ].flat(),
92 });