Skip to content

Commit

Permalink
Merge pull request #1862 from bcgov/fix/daniel-transfer-fixes-1861
Browse files Browse the repository at this point in the history
fix: Check from organization balance
  • Loading branch information
dhaselhan authored Jan 30, 2025
2 parents 807aaa3 + 8c8a0d4 commit 36fb96c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 25 deletions.
4 changes: 3 additions & 1 deletion backend/lcfs/web/api/organization/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ async def update_transfer(
transfer_create.current_status in LCFS_Constants.FROM_ORG_TRANSFER_STATUSES
)

await self.check_available_balance(organization_id, transfer_create.quantity)
await self.check_available_balance(
transfer_create.from_organization_id, transfer_create.quantity
)
if (
transfer_create.from_organization_id == organization_id and valid_status
) or ( # status changes allowed for from-organization
Expand Down
1 change: 0 additions & 1 deletion frontend/src/assets/locales/en/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
},
"returnConfirmText": "Are you sure you want to return the transaction to the Analyst? This will change the status of the transaction back to a draft state.",
"returnWarningText": "<p>It is helpful to provide a reason to the analyst on why the transaction is being returned.</p>",
"description": "<p>The <b>effective date</b> assigned to a transaction determines which <b>compliance period</b> (calendar year) the compliance units can be applied to. To use compliance units during a <b>reporting period</b> (January 1 to March 31), transactions must be completed on or before March 31 following the compliance period. Compliance units purchased or received after March 31 can only be applied to future compliance period obligations.</p><p>The <b>available compliance unit balance</b> displays the units in an organization’s balance that can be applied to a compliance obligation in that compliance period. Compliance units that are pending the completion of a transaction or transfer are held in <b>reserve</b> and are not included in an organization’s available balance.</p><p>Available compliance units for a given compliance period include:<br />(1) credits generated from the supply of fuel in the compliance period and/or previous compliance periods; and<br />(2) credits issued under initiative agreements or acquired through transfers on or before the reporting deadline (March 31).</p><p>Example: credits issued under an initiative agreement with an effective date of March 15, 2024 can be used for compliance with the 2023 compliance period as well as any future compliance periods (e.g., 2024, 2025, etc.). Credits issued under an initiative agreement with an effective date of April 20, 2024 can only be used for compliance for the 2024 and future compliance periods (e.g., 2025, 2026, etc.).</p>",
"effectiveDate": "<b>Effective date</b> (optional, if blank will be effective on the date of director approval):",
"effectiveDateLabel": "Effective date:",
"complianceUnits": "<b>Compliance units</b> (negative or positive amounts for administrative adjustment):",
Expand Down
17 changes: 2 additions & 15 deletions frontend/src/views/Transactions/components/TransactionDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,14 @@ export const TransactionDetails = ({ transactionId, isEditable }) => {
<Grid container>
<Grid item lg={12}>
<BCBox>
<InputLabel htmlFor="orgLegalName" sx={{ pb: 1 }}>
<InputLabel htmlFor="txnEffectiveDate" sx={{ pb: 1 }}>
<BCTypography
variant="body3"
dangerouslySetInnerHTML={{ __html: t('txn:effectiveDate') }}
></BCTypography>
</InputLabel>
<TextField
id="txnEffectiveDate"
data-test="txn-effective-date"
{...register('transactionEffectiveDate')}
type="date"
Expand All @@ -291,20 +292,6 @@ export const TransactionDetails = ({ transactionId, isEditable }) => {
/>
</BCBox>
</Grid>
<Grid item lg={12} mt={3}>
<BCTypography
variant="body3"
sx={{
'& p': {
marginBottom: '16px'
},
'& p:last-child': {
marginBottom: '0'
}
}}
dangerouslySetInnerHTML={{ __html: t('txn:description') }}
></BCTypography>
</Grid>
</Grid>
</BCBox>
</LabelBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ export const TransactionView = ({ transaction }) => {
</Grid>
</Grid>
</BCBox>
<BCBox sx={{ bgcolor: '#f2f2f2' }} p={3} m={1} mt={2}>
<Grid item lg={12}>
<BCTypography
variant="body3"
dangerouslySetInnerHTML={{ __html: t('txn:description') }}
/>
</Grid>
</BCBox>
</LabelBox>
</BCBox>
)
Expand Down

0 comments on commit 36fb96c

Please sign in to comment.