Login

Screenshots for the Koha manual

New screenshots | All screenshots | Full test results | Manuals (wip)
en de el es fr hi zh_Hant

Image details

adjustments2 (#79) ❌ Not validated

Job

Difficulty

Hard

Spec (updated on Thu Aug 27 12:11:20 2026)

describe("acquisitions/adjustments2", function () {
    const languages = ['en', 'es-ES', 'fr-FR', 'de-DE', 'el-GR', 'hi', 'zh-Hant-TW'];
    languages.forEach((lang) => {
        describe(`in ${lang}`, () => {
            beforeEach(function(){
                // Skip if 'en' test failed
                if (Cypress.expose("EN_TEST_FAILED")) {
                    this.skip();
                }
                cy.task("query", {sql: "INSERT INTO aqinvoices (invoicenumber, booksellerid, shipmentdate) VALUES (\"My Invoice\", 1, ADDDATE(NOW(), INTERVAL -1 day))"});
                cy.login();
                /* No specific padding defined */
                cy.set_cookie_lang(lang);
            });

            it("adjustments2", function () {
                cy.visit("/cgi-bin/koha/acqui/invoice.pl?invoiceid=1");
                cy.waitForPageLoad();
                cy.get("#show_invoice_adjustment a.toggle_invoice_adjustment").click();
                cy.wait_for_ajax();
                cy.get("#adjustment_new").type("\"0.01\"");
                cy.get("#note_new").type("\"Tax rounding adjustment\"");
                cy.get("#budget_id_new").select("\"Secondary fund\"", {force: true});
                cy.get("#encumber_new").check();
                cy.get("#add_invoice_adjustment").should('be.visible').screenshot("adjustments2");
            });
        });
    });
    afterEach(function () {
        cy.task("query", {sql: "DELETE FROM aqinvoices WHERE invoicenumber=\"My Invoice\""});
        Cypress.expose('PADDING_BEFORE_SCREENSHOT', undefined);
        // Set EN_TEST_FAILED if the 'en' test failed
        if (this.currentTest.parent.title.includes('in en') && this.currentTest.state === 'failed') {
            Cypress.expose("EN_TEST_FAILED", true);
        }
    });
});

Spec data

Page

acqui/invoice.pl?invoiceid=1

Interface

staff

Element selector

#add_invoice_adjustment

Missing selector

N

setup

sql INSERT INTO aqinvoices (invoicenumber, booksellerid, shipmentdate) VALUES ("My Invoice", 1, ADDDATE(NOW(), INTERVAL -1 day))

workflow

click #show_invoice_adjustment a.toggle_invoice_adjustment
wait_for_ajax
type #adjustment_new="0.01"
type #note_new="Tax rounding adjustment"
select #budget_id_new="Secondary fund"
check #encumber_new

teardown

sql DELETE FROM aqinvoices WHERE invoicenumber="My Invoice"

Notes

Currently not possible without a sample invoice in KTD.

Additional KTD data

We need a completed invoice in KTD for this one. "My Vendor" already has an open basket.
We should add another basket and receive and complete it so we have more to test.

Test failure

CypressError: Timed out retrying after 10000ms: `cy.select()` failed because it could not find a single `<option>` with value, index, or text matching: `"Secondary fund"`

https://on.cypress.io/select
    at getOptions (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:116554:72)
    at tryCatcher (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1777:23)
    at Promise.attempt.Promise.try (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:4285:29)
    at retryOptions (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:116586:70)
    at tryCatcher (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1777:23)
    at Promise.attempt.Promise.try (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:4285:29)
    at whenStable (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:152244:70)
    at <unknown> (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:152159:14)
    at tryCatcher (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1777:23)
    at Promise._settlePromiseFromHandler (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1489:31)
    at Promise._settlePromise (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1546:18)
    at Promise._settlePromise0 (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1591:10)
    at Promise._settlePromises (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1671:18)
    at Promise._fulfill (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1615:18)
    at <unknown> (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:5420:46)

Thumbnails


Current Thumbnail old

Current

Old screenshot