View | Details | Raw Unified | Return to bug 19166
Collapse All | Expand All

(-)a/C4/Budgets.pm (-2 / +2 lines)
Lines 338-344 sub GetBudgetSpent { Link Here
338
            datecancellationprinted IS NULL
338
            datecancellationprinted IS NULL
339
    |);
339
    |);
340
	$sth->execute($budget_id);
340
	$sth->execute($budget_id);
341
	my $sum = 0 + $sth->fetchrow_array;
341
    my $sum = 0 + $sth->fetchrow_array;
342
342
343
    $sth = $dbh->prepare(qq|
343
    $sth = $dbh->prepare(qq|
344
        SELECT SUM(shipmentcost) AS sum
344
        SELECT SUM(shipmentcost) AS sum
Lines 369-375 sub GetBudgetOrdered { Link Here
369
            datecancellationprinted IS NULL
369
            datecancellationprinted IS NULL
370
    |);
370
    |);
371
	$sth->execute($budget_id);
371
	$sth->execute($budget_id);
372
	my $sum =  0 + $sth->fetchrow_array;
372
    my $sum =  0 + $sth->fetchrow_array;
373
373
374
    my $adjustments = Koha::InvoiceAdjustments->search({budget_id => $budget_id, encumber_open => 1, closedate => undef},{ join => 'invoiceid' });
374
    my $adjustments = Koha::InvoiceAdjustments->search({budget_id => $budget_id, encumber_open => 1, closedate => undef},{ join => 'invoiceid' });
375
    while ( my $adj = $adjustments->next ){
375
    while ( my $adj = $adjustments->next ){
(-)a/installer/data/mysql/atomicupdate/bug_19166.perl (-1 / +1 lines)
Lines 13-19 if( CheckVersion( $DBversion ) ) { Link Here
13
            PRIMARY KEY (adjustment_id),
13
            PRIMARY KEY (adjustment_id),
14
            CONSTRAINT invoice_adjustments_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
14
            CONSTRAINT invoice_adjustments_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
15
            CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
15
            CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
16
        )
16
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
17
        " );
17
        " );
18
    $dbh->do("INSERT IGNORE INTO authorised_value_categories (category_name) VALUES ('ADJ_REASON')");
18
    $dbh->do("INSERT IGNORE INTO authorised_value_categories (category_name) VALUES ('ADJ_REASON')");
19
    SetVersion( $DBversion );
19
    SetVersion( $DBversion );
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 840-846 CREATE TABLE IF NOT EXISTS invoice_adjustments ( Link Here
840
    PRIMARY KEY (adjustment_id),
840
    PRIMARY KEY (adjustment_id),
841
    CONSTRAINT invoice_adjustments_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
841
    CONSTRAINT invoice_adjustments_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
842
    CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
842
    CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
843
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
843
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
844
844
845
--
845
--
846
-- Table structure for table `issuingrules`
846
-- Table structure for table `issuingrules`
847
- 

Return to bug 19166