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 Jul 9 13:43:54 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.env("EN_TEST_FAILED")) {
                    this.skip();
                }
                cy.query("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.query("DELETE FROM aqinvoices WHERE invoicenumber=\"My Invoice\"")
        Cypress.env('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.env("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: `cy.visit()` failed trying to load:

http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/acqui/invoice.pl?invoiceid=1

The response we received from your web server was:

  > 500: Internal Server Error

This was considered a failure because the status code was not `2xx`.

If you do not want status codes to cause failures pass the option: `failOnStatusCode: false`
    at <unknown> (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:131049:76)
    at visitFailedByErr (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:130463:12)
    at <unknown> (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:131032:13)
    at tryCatcher (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1807:23)
    at Promise._settlePromiseFromHandler (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1519:31)
    at Promise._settlePromise (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1576:18)
    at Promise._settlePromise0 (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1621:10)
    at Promise._settlePromises (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1697:18)
    at _drainQueueStep (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2407:12)
    at _drainQueue (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2400:9)
    at Async._drainQueues (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2416:5)
    at Async.drainQueues (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2286:14)
From Your Spec Code:
    at Context.eval (webpack://koha/./cypress/integration/acquisitions/adjustments2.ts:17:19)

Thumbnails


Current Thumbnail old

Current

Old screenshot