Import nmi residuals file

From Meta, a Wikimedia project coordination wiki

Fetch the NMI file[edit]

This will log in to Transnational's gateway NMIEmulator portal and fetch the Commissions file in csv form for a certain month.

  • Log in to extractor.tnbci.com as ittech
  • Go into /home/ittech/scripts
  • There is a script there called fetch_nmi_file.pl. The syntax for running it is ./fetch_nmi_file.pl [-t] [MM] [YYYY]
  • Use the -t flag to see test output and not save anything to the database.
  • To import the NMI file for the previous month, type in ./fetch_nmi_file.pl without specifying the month or the year. If it's January 2012 today, it will get the file for December 2011.
  • You can specify the month and the year if you want to, e.g. ./fetch_nmi_file.pl 11 2011
  • After it has fetched the file, it will copy the file to the devimport server, at the /home/ittech folder.
  • It will then delete the file from extractor.
  • Log out.

Import the NMI file[edit]

This will insert NMI transactions into the Global table with a cardtype of NMI.

  • Important note: Import the global file before importing the NMI file.
  • Log in to the devimport server as ittech. The NMI file you just fetched should be in /home/ittech.
  • Go to the scripts folder.
  • There is a script there called import_nmi.pl. The syntax is SYNTAX: import_nmi.pl [-t|-h] [MM] [YYYY].
  • This will check the NMI file for errors such as missing MIDs or MIDs that don't exist in LH. This will NOT check for DBA's where the MID is different from the LH MID.
  • Use the -h flag to see syntax information.
  • Use the -t flag to see test output and to not save anything in the database.
  • You can optionally put in the month and the date of the NMI file you want to import. To just import last month's file, type in ./import_nmi.pl
  • If there are errors, they will be printed out and nothing will get saved. After these errors are fixed, try to import it again.
  • This script will also add in Gateway activation fees in the future, when that fee and the Gateway flag are in TMI production. In the meantime, code for that has been commented out.
  • If the import is successful, quickly check the global table for rows with an NMI cardtype.