yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { ViewBase } from '../../libappbase/viewbase';
import { ButtonFinancesContextMenuItem } from '../actionbarpages/abp.data';
import { AppMP } from '../appmp';
import { FormInventoryAccounts } from '../forms/form.inventoryaccounts';
import { FormInventoryCostPISP } from '../forms/form.inventorycostpisp';
import { FormInventoryCosts } from '../forms/form.inventorycosts';
 
/**
 * Data > Finances > Inventory Costs view.
 */
export class ViewInventoryCosts extends ViewBase {
  public readonly name = 'Inventory Costs';
  public readonly viewPath = 'Data > Finances > Inventory Costs';
 
  public frmInventoryAccounts = new FormInventoryAccounts();
  public frmInventoryCostPISP = new FormInventoryCostPISP();
  public frmInventoryCosts = new FormInventoryCosts();
 
  /**
   * Switch to Inventory cost view
   */
  public async switchTo(): Promise<void> {
    const appMP = AppMP.getInstance();
 
    // wait until abp develop is visible
    await appMP.abpData.isVisible();
    // Open Develop action bar page
    await appMP.abpData.click();
    // Click on Inventory Cost button
    await appMP.abpData.btnFinances.clickDropdownAndSelectMenu(ButtonFinancesContextMenuItem.InventoryCosts);
    // Wait until form inventory account, inventory cost and inventory cost pisp is present
    await this.frmInventoryAccounts.waitUntilPresent();
    await this.frmInventoryCostPISP.waitUntilPresent();
    await this.frmInventoryCosts.waitUntilPresent();
  }
}