-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6455 cancelled prescription status #6509
Changes from 7 commits
97099a7
862c501
93d3496
3a38fee
c829b65
4540539
ee8886a
235287e
0a684f7
07b8f08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ export const prescriptionStatuses: InvoiceNodeStatus[] = [ | |
InvoiceNodeStatus.New, | ||
InvoiceNodeStatus.Picked, | ||
InvoiceNodeStatus.Verified, | ||
InvoiceNodeStatus.Cancelled, | ||
]; | ||
|
||
export const supplierReturnStatuses: InvoiceNodeStatus[] = [ | ||
|
@@ -85,6 +86,7 @@ const statusTranslation: Record<InvoiceNodeStatus, LocaleKey> = { | |
DELIVERED: 'label.delivered', | ||
NEW: 'label.new', | ||
VERIFIED: 'label.verified', | ||
CANCELLED: 'label.cancelled', | ||
}; | ||
|
||
export const getStatusTranslation = (status: InvoiceNodeStatus): LocaleKey => { | ||
|
@@ -184,6 +186,7 @@ export const isInboundDisabled = (inbound: InboundRowFragment): boolean => { | |
case InvoiceNodeStatus.Allocated: | ||
// Inbound shipments can be edited when having been delivered | ||
case InvoiceNodeStatus.Delivered: | ||
case InvoiceNodeStatus.Cancelled: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs to be in the disabled section, after Verified |
||
return false; | ||
case InvoiceNodeStatus.Picked: | ||
case InvoiceNodeStatus.Shipped: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ pub enum ActivityLogNodeType { | |
PrescriptionDeleted, | ||
PrescriptionStatusPicked, | ||
PrescriptionStatusVerified, | ||
PrescriptionStatusCancelled, | ||
SensorLocationChanged, | ||
AssetCreated, | ||
AssetUpdated, | ||
|
@@ -213,6 +214,7 @@ impl ActivityLogNodeType { | |
from::DemographicIndicatorUpdated => to::DemographicIndicatorUpdated, | ||
from::DemographicProjectionCreated => to::DemographicProjectionCreated, | ||
from::DemographicProjectionUpdated => to::DemographicProjectionUpdated, | ||
&repository::ActivityLogType::InvoiceStatusCancelled | &repository::ActivityLogType::PrescriptionStatusCancelled => todo!() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't really want to have
|
||
} | ||
} | ||
|
||
|
@@ -277,6 +279,7 @@ impl ActivityLogNodeType { | |
from::DemographicIndicatorUpdated => to::DemographicIndicatorUpdated, | ||
from::DemographicProjectionCreated => to::DemographicProjectionCreated, | ||
from::DemographicProjectionUpdated => to::DemographicProjectionUpdated, | ||
from::PrescriptionStatusCancelled => to::PrescriptionStatusCancelled, | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use crate::migrations::*; | ||
pub(crate) struct Migrate; | ||
|
||
impl MigrationFragment for Migrate { | ||
fn identifier(&self) -> &'static str { | ||
"add_cancelled_status_to_invoice" | ||
} | ||
|
||
fn migrate(&self, connection: &StorageConnection) -> anyhow::Result<()> { | ||
if cfg!(feature = "postgres") { | ||
sql!( | ||
connection, | ||
r#" | ||
ALTER TYPE invoice_status ADD VALUE IF NOT EXISTS 'CANCELLED'; | ||
"#, | ||
)?; | ||
} | ||
Ok(()) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -740,6 +740,7 @@ fn legacy_invoice_status(t: &InvoiceType, status: &InvoiceStatus) -> Option<Lega | |
InvoiceStatus::Shipped => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Delivered => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Verified => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Cancelled => LegacyTransactStatus::Fn, // TODO enable cancelled status to sync with mSupply https://github.com/msupply-foundation/open-msupply/issues/6495 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for these comments! |
||
}, | ||
InvoiceType::InboundShipment | InvoiceType::CustomerReturn => match status { | ||
InvoiceStatus::New => LegacyTransactStatus::Nw, | ||
|
@@ -748,6 +749,7 @@ fn legacy_invoice_status(t: &InvoiceType, status: &InvoiceStatus) -> Option<Lega | |
InvoiceStatus::Shipped => LegacyTransactStatus::Nw, | ||
InvoiceStatus::Delivered => LegacyTransactStatus::Cn, | ||
InvoiceStatus::Verified => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Cancelled => LegacyTransactStatus::Fn, // TODO enable cancelled status to sync with mSupply https://github.com/msupply-foundation/open-msupply/issues/6495 | ||
}, | ||
InvoiceType::Prescription => match status { | ||
InvoiceStatus::New => LegacyTransactStatus::Nw, | ||
|
@@ -756,6 +758,7 @@ fn legacy_invoice_status(t: &InvoiceType, status: &InvoiceStatus) -> Option<Lega | |
InvoiceStatus::Shipped => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Delivered => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Verified => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Cancelled => LegacyTransactStatus::Fn, // TODO enable cancelled status to sync with mSupply https://github.com/msupply-foundation/open-msupply/issues/6495 | ||
}, | ||
InvoiceType::InventoryAddition | InvoiceType::InventoryReduction | InvoiceType::Repack => { | ||
match status { | ||
|
@@ -765,6 +768,7 @@ fn legacy_invoice_status(t: &InvoiceType, status: &InvoiceStatus) -> Option<Lega | |
InvoiceStatus::Shipped => LegacyTransactStatus::Nw, | ||
InvoiceStatus::Delivered => LegacyTransactStatus::Nw, | ||
InvoiceStatus::Verified => LegacyTransactStatus::Fn, | ||
InvoiceStatus::Cancelled => LegacyTransactStatus::Fn, // TODO enable cancelled status to sync with mSupply https://github.com/msupply-foundation/open-msupply/issues/6495 | ||
} | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want something like this added, I think that will require chaging the PrescriptionRowFragment as well though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an issue follow up on this...