npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@daynite/workordersbyserialnumber

v2.6.0

Published

Pull work order information from sampro database using equipment serial numbers

Downloads

164

Readme

Usage:

Arguments into the getWO function are:

  1. String of comma seperated serial numbers
  2. A date filter (open date for wos where the wo open dates are >= given date). Date filter format is YYYY-MM-DD.
  3. API key

  const serialNumbers = '12345678,87654321';
  const key = 'XXXXXXXXXXXXXXXXXXXXXX';
  const dateFilter= '2024-01-12';
  try {
    const result = await getWOs(serialNumbers, dateFilter, key);
    console.log(result);
  } catch (error) {
    console.error('Error:', error);
  }

Result

Returns array of work order objects with nested equipment and purchase order objects.

Each item in the area should be a different work order and can have one or more equipment and zero or more purchase orders

Purchase orders can have the same ID but will have a different line number per purchase order id

structure of objects:

  WorkOrder Object{

	WorkOrder_id: string,
    WorkOrder_date: string ex. YYYY-MM-DD,
    OpenDate: string ex. YYYY-MM-DD,
    work_requested: string,
    status: string,
    woEquipment: array of woEquipment objects (see below)
    woPurchaseOrders: array of woPurchaseOrders objects (see below)
    WO_ID: string,
    Equipment_ID: string,
    Equipment_rn: string,
    Equipment_Serial: string,
    Date: string ex. YYYY-MM-DD,
    Category: string,
    SubCategory: string,
    Parts: Array of strings,
    Work_Type: string



    WorkOrder_id: string
    WorkOrder_date: string
    work_requested:string
    woEquipment: array of woEquipment objects (see below)
    woPurchaseOrders: array of woPurchaseOrders objects (see below)
  }

  woEquipment Object{
    WorkOrder_equipmentnumber: string
    WorkOrder_equipment_work_perf: string
    WorkOrder_equipment_work_req: string
    Equipment_name: string
    Equipment_rn: int,
    Serialnumber: string,
    Manufacturer: string,
    Model: string
  }

  woPurchaseOrders Object{
    PurchaseOrder_id: string
    prchseordrlst_ln: 1,
    PurchaseOrder_vendorpart_num: string
    PurchaseOrder_item_desc: string
    PurchaseOrder_quantity: int,
    PurchaseOrder_cost: float,
    PurchaseOrder_date_requested: string
    PurchaseOrder_date_promised: string
    Vendorname: string
  }

Return value example

[
	{
		"WorkOrder_id": "123456",
		"WorkOrder_date": "2023-01-01",
		"work_requested": "Some work requested text",
		"woEquipment": [
			{
				"WorkOrder_equipmentnumber": 7891234,
				"WorkOrder_equipment_work_perf": "Some work performed text",
				"WorkOrder_equipment_work_req": "",
				"Equipment_name": "Name",
				"Equipment_rn": 7891234,
				"Serialnumber": "123456",
				"Manufacturer": "STAR",
				"Model": "G12-Y"
			}
		],
		"woPurchaseOrders": [
			{
				"PurchaseOrder_id": "12345",
				"prchseordrlst_ln": 1,
				"PurchaseOrder_vendorpart_num": "2A-6904",
				"PurchaseOrder_item_desc": "LEG",
				"PurchaseOrder_quantity": 1,
				"PurchaseOrder_cost": 2.4,
				"PurchaseOrder_date_requested": "2010-04-27",
				"PurchaseOrder_date_promised": "1900-01-01",
				"Vendorname": "9 wire southern tech"
			}
		]
	}
]