WiseFish Fishing and Quota - Test - Quota Journal

Part of WiseFish Fishing and Quota - Test (automated tests) - Overview. 37 tests in 2 test codeunits (84001, 84002), all passing on a BC28 container (16.11.2026). Folder src/Quota; test library 84000 WiFiFQT Library - Quota.

Both codeunits test WiFiFQ Post Quota Log (codeunit 23014250). Unless stated: quota system Icelandic, quota rounding precision 0.01, GFE factor 1.5 and a line of 1000. Quantities are Recorded / Adjusted / Quota / Cod equivalent.

84001 WiFiFQT Quota Jnl Check (14 tests)

Tests the checks before a quota journal line is posted: CheckQuotaLines_u, and the permit and vessel checks in PostQuotaJnlLine_u per quota system.

#

Test

Scenario

Expected result

01

CheckLine_01_ValidCatchLinePasses

A Catch line with a quota year covering its date and a quota for its fish type in every area.

No error.

02

CheckLine_02_LineWithoutFishTypeIsSkipped

A line without fish type, dated outside every quota year.

No error: the line is not checked (WFFQ-152 issue 4).

03

CheckLine_03_LineWithoutQtyIsSkipped

A line with quantity 0, dated outside every quota year.

No error: the line is not checked (WFFQ-152 issue 4).

04

CheckLine_04_NoQuotaYearForDateFails

A line dated after the end of the quota year.

No Quota Year is found, naming the quota system and date.

05

CheckLine_05_QuotaYearOfOtherQuotaSystemFails

The fish type belongs to a quota system without quota years.

No Quota Year is found for that quota system.

06

CheckLine_06_NoQuotaForFishTypeFails

No Quota for Fish Types entry for the fish type.

No Quota for Fish Types entry, naming quota year, fish type and area.

07

CheckLine_07_QuotaForOtherAreaFails

A quota for area A only, and a line in area B.

No Quota for Fish Types entry, naming area B.

08

CheckLine_08_AreaInQuotaAreaFilterPasses

A quota for areas A|B, and a line in area B.

No error.

09

CheckLine_09_BlankAreaFilterCoversEveryArea

A quota with a blank area filter, and a line in some area.

No error.

10

CheckLine_10_LineWithoutAreaNeedsBlankAreaFilter

A quota for area A only, and a line without area.

No Quota for Fish Types entry for the blank area.

11

CheckLine_11_W1MissingPermitFails

Quota system W1, a line without permit code.

Permit Code must have a value.

12

CheckLine_12_NewZealandMissingPermitFails

Quota system New Zealand, a line without permit code.

Permit Code must have a value.

13

CheckLine_13_W1CatchWithUnknownVesselFails

Quota system W1, a Catch line with a vessel that does not exist.

Vessel not found, naming the vessel.

14

CheckLine_14_IcelandicUnknownVesselFailsForEveryType

Quota system Icelandic, a Purchased line with a vessel that does not exist.

Vessel not found, naming the vessel.

84002 WiFiFQT Quota Jnl Post (23 tests)

Tests posting: PostQuotaJnlLine_u (the quota entries, field by field) and OnRun (posting the journal, with its confirmations).

#

Test

Scenario

Expected result

01

Post_01_CatchCreatesNegativeEntry

Post a Catch line.

One entry: -1000 / -1000 / -1000 / -1500, with the line's date, vessel, permit, quota year, entry date and user.

02

Post_02_AllocationCreatesPositiveEntryWithoutTripData

Post an Allocation line with trip, equipment, size grade and export premium.

+1000 / +1000 / +1000 / +1500; trip, equipment, size grade and export premium cleared.

03

Post_03_SoldCreatesNegativeEntry

Post a Sold line without counterpart.

One entry with negative quantities.

04

Post_04_QtyIsRoundedToQuotaRoundingPrecision

Precision 1, an Allocation line of 1000.4.

Recorded 1000.

05

Post_05_QtyIsRoundedToWholeWithoutPrecision

Precision 0, an Allocation line of 1000.6.

Recorded 1001.

06

Post_06_UnguttedCatchUsesUnguttedFactor

An ungutted Catch line, factor ungutted to gutted 0.8.

-1000 / -800 / -800 / -1200.

07

Post_07_ProcessingMethodUsesConversionFactor

A processing method with conversion factor 1.2.

-1000 / -1200 / -1200 / -1800.

08

Post_08_YieldFactorIsUsedWithoutConversionFactor

A processing method without conversion factor, yield factor 1.25.

-1000 / -1250 / -1250 / -1875.

09

Post_09_ProcessingMethodWithoutFactorFails

A processing method with neither factor.

Conversion Factor must have a value.

10

Post_10_NewZealandIgnoresConversionFactor

New Zealand, conversion factor 1.2.

Adjusted and quota quantities equal the recorded 1000.

11

Post_11_NewZealandWithoutFactorPostsNothing

New Zealand, a processing method without any factor.

No quota entry.

12

Post_12_FishingEquipmentDiscountReducesCatch

Fishing equipment with a 10 % quota discount covering the date.

Quota -900, cod equivalent -1350.

13

Post_13_FishingEquipmentAtMaximumGivesNoDiscount

The same equipment with Maximum Obtained.

Quota -1000, cod equivalent -1500.

14

Post_14_ExportPremiumIncreasesCatch

Export premium on the line, 10 % for the fish type.

Quota -1100, cod equivalent -1650.

15

Post_15_SubstandardSizeAllowanceUsesSubstandardFactor

A substandard size grade, 10 % allowance, substandard factor 0.5.

Substandard, Substandard Qty -100, quota -950, cod equivalent -1425.

16

Post_16_VesselSizeGradeOverridesRawMaterialGrade

Substandard for the raw material, not for the vessel.

Not substandard; full count.

17

Post_17_FixedSubstandardMarksShareAsSubstandard

Fixed substandard 10 %, no size grade.

Substandard, Substandard Qty -100, quota -1000 (cod equivalent not checked, WFFQ-152 issue 6).

18

Post_18_RentedFromOtherVesselCreatesMirrorEntry

A Rented line from another vessel and permit.

+1000 entry, and a -1000 entry for the other vessel with vessels, permits and descriptions swapped.

19

Post_19_W1TransferNeedsFromPermit

W1, a Rented line from another vessel without From Permit Code.

From Permit Code must have a value.

20

Post_20_BudgetDocIsNotOnMirrorEntry

A Rented line with a budget document no.

Budget doc. on the receiving entry only; the mirror entry has it in Description 2.

21

Run_21_PostsJournalAndDeletesLines

Post a journal with an Allocation line and a Catch line on a trip; confirm.

Both posted; the journal is empty.

22

Run_22_CatchWithoutTripAsksToPostAnyway

A Catch line without fishing trip; answer Yes twice.

Asks to post anyway, then to post; posted, journal empty.

23

Run_23_DecliningPostAnywayPostsNothing

A Catch line without fishing trip; answer No.

Nothing posted; the journal line stays.