|
|
@@ -14,10 +14,22 @@ namespace PRSDesktop
|
|
|
{
|
|
|
internal class InvoiceLineGrid : DynamicDataGrid<InvoiceLine>
|
|
|
{
|
|
|
+ private Job? _job;
|
|
|
+ public Job? Job
|
|
|
+ {
|
|
|
+ get => _job;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ _job = value;
|
|
|
+ Reconfigure();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
protected override void Init()
|
|
|
{
|
|
|
base.Init();
|
|
|
- AddEditButton("Calculate", PRSDesktop.Resources.costcentre.AsBitmapImage(), CalculateLines);
|
|
|
+ AddEditButton("Calculate", PRSDesktop.Resources.costcentre.AsBitmapImage(), CalculateLines,
|
|
|
+ isVisible: options => Job is not null && Job.JobType == JobType.Service);
|
|
|
}
|
|
|
|
|
|
protected override void DoReconfigure(DynamicGridOptions options)
|