Skip to content

Commit

Permalink
PG-1260
Browse files Browse the repository at this point in the history
  + readded required CanCreateOrUpdateErpMaterial function in according tabs
   + fixed issue with missing name on observed description control
   + fixed typos in BOM Tabs
  • Loading branch information
coolOrange-Public committed Nov 30, 2022
1 parent 61c1539 commit a6246f3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Files/powerEvents/Events/TransferERPBomViaFileTab.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'File' -Action {

$erpBomTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\TransferERPBomTab.xaml")))

$statusMessage_label = $erpItemTab_control.FindName('lblStatusMessage')
$statusMessage_label = $erpBomTab_control.FindName('lblStatusMessage')
$erpServices = Get-ERPServices -Available
if (-not $erpServices) {
$statusMessage_label.Content = "One or more services are not available!"
Expand All @@ -53,13 +53,13 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'File' -Action {
return $erpBomTab_control
}

$unitOfMeasure_comboboxColumn = $tab_control.FindName('UnitOfMeasureComboboxColumn')
$unitOfMeasure_comboboxColumn = $erpBomTab_control.FindName('UnitOfMeasureComboboxColumn')
$unitOfMeasure_comboboxColumn.ItemsSource = @(GetUnitOfMeasuresList)

$bomStates_combobox = $erpItemTab_control.FindName('BomStates')
$bomStates_combobox = $erpBomTab_control.FindName('BomStates')
$bomStates_combobox.ItemsSource = @(GetBOMStateList)

$erpItemTab_GoToBOMButton = $erpItemTab_control.FindName('GoToBomButton')
$erpItemTab_GoToBOMButton = $erpBomTab_control.FindName('GoToBomButton')

$erpBomHeader = Get-ERPObject -EntitySet "BomHeaders" -Keys @{Number = $selectedFile._PartNumber } -Expand "BomRows"
if(-not $?) {
Expand Down Expand Up @@ -90,4 +90,4 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'File' -Action {
})

return $erpBomTab_control
}
}
10 changes: 5 additions & 5 deletions Files/powerEvents/Events/TransferERPBomViaItemTab.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'Item' -Action {

$erpBomTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\TransferERPBomTab.xaml")))

$statusMessage_label = $erpItemTab_control.FindName('lblStatusMessage')
$statusMessage_label = $erpBomTab_control.FindName('lblStatusMessage')
$erpServices = Get-ERPServices -Available
if (-not $erpServices) {
$statusMessage_label.Content = "One or more services are not available!"
Expand All @@ -53,13 +53,13 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'Item' -Action {
return $erpBomTab_control
}

$unitOfMeasure_comboboxColumn = $tab_control.FindName('UnitOfMeasureComboboxColumn')
$unitOfMeasure_comboboxColumn = $erpBomTab_control.FindName('UnitOfMeasureComboboxColumn')
$unitOfMeasure_comboboxColumn.ItemsSource = @(GetUnitOfMeasuresList)

$bomStates_combobox = $erpItemTab_control.FindName('BomStates')
$bomStates_combobox = $erpBomTab_control.FindName('BomStates')
$bomStates_combobox.ItemsSource = @(GetBOMStateList)

$erpItemTab_GoToBOMButton = $erpItemTab_control.FindName('GoToBomButton')
$erpItemTab_GoToBOMButton = $erpBomTab_control.FindName('GoToBomButton')

$erpBomHeader = Get-ERPObject -EntitySet "BomHeaders" -Keys @{Number = $selectedItem._Number } -Expand "BomRows"
if(-not $?) {
Expand Down Expand Up @@ -90,4 +90,4 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'Item' -Action {
})

return $erpBomTab_control
}
}
17 changes: 16 additions & 1 deletion Files/powerEvents/Events/TransferERPItemViaFileTab.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ $logPath = Join-Path $env:LOCALAPPDATA "coolOrange\Projects\VDS_Vault-powerGate.
Set-LogFilePath -Path $logPath


function CanCreateOrUpdateErpMaterial {
param(
$erpMaterial
)

#TODO: Setup obligatory fields that need to be filled out to activate the 'Create' button
if ($null -ne $erpMaterial.Type -and $erpMaterial.Type -ne "") {
$type = $true
}
if ($null -ne $erpMaterial.Description -and $erpMaterial.Description -ne "") {
$description = $true
}
return $type -and $description
}

Add-VaultTab -Name 'ERP Item' -EntityType 'File' -Action {
param($selectedFile)

Expand All @@ -62,7 +77,7 @@ Add-VaultTab -Name 'ERP Item' -EntityType 'File' -Action {
$categories_combobox = $erpItemTab_control.FindName('CategoryList')
$categories_combobox.ItemsSource = @(GetCategoryList)

$erpItemTab_CreateOrUpdateMaterialButton = $erpItemTab_control.FindName('CreateOrUpdateMaterialButton')
$Script:erpItemTab_CreateOrUpdateMaterialButton = $erpItemTab_control.FindName('CreateOrUpdateMaterialButton')
$erpItemTab_GoToMaterialButton = $erpItemTab_control.FindName('GoToMaterialButton')

$erpMaterial = Get-ERPObject -EntitySet "Materials" -Keys @{ Number = $selectedFile._PartNumber }
Expand Down
16 changes: 15 additions & 1 deletion Files/powerEvents/Events/TransferERPItemViaItemTab.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ Remove-CoolOrangeLogging
$logPath = Join-Path $env:LOCALAPPDATA "coolOrange\Projects\VDS_Vault-powerGate.log"
Set-LogFilePath -Path $logPath

function CanCreateOrUpdateErpMaterial {
param(
$erpMaterial
)

#TODO: Setup obligatory fields that need to be filled out to activate the 'Create' button
if ($null -ne $erpMaterial.Type -and $erpMaterial.Type -ne "") {
$type = $true
}
if ($null -ne $erpMaterial.Description -and $erpMaterial.Description -ne "") {
$description = $true
}
return $type -and $description
}

Add-VaultTab -Name 'ERP Item' -EntityType 'Item' -Action {
param($selectedItem)
Expand All @@ -61,7 +75,7 @@ Add-VaultTab -Name 'ERP Item' -EntityType 'Item' -Action {
$categories_combobox = $erpItemTab_control.FindName('CategoryList')
$categories_combobox.ItemsSource = @(GetCategoryList)

$erpItemTab_CreateOrUpdateMaterialButton = $erpItemTab_control.FindName('CreateOrUpdateMaterialButton')
$Script:erpItemTab_CreateOrUpdateMaterialButton = $erpItemTab_control.FindName('CreateOrUpdateMaterialButton')
$erpItemTab_GoToMaterialButton = $erpItemTab_control.FindName('GoToMaterialButton')

$erpMaterial = Get-ERPObject -EntitySet "Materials" -Keys @{ Number = $selectedItem._Number }
Expand Down
Empty file.

0 comments on commit a6246f3

Please sign in to comment.