×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

MSO266 Invoice Load Script

MSO266 Invoice Load Script

MSO266 Invoice Load Script

(OP)
Looking for a MINT Script to load invoices for MSO266 or MSO265.  Anybody?

Regards,
Donna

RE: MSO266 Invoice Load Script

JOB LOAD265 'Carga de Facturas S/O.C con Iva'
/* CODIGO ORIGINAL: 02-01-2000.
DEFINE F_ERR  'C:\MINT\DATA\LOAD265.ERR'
DEFINE F_OK   'C:\MINT\DATA\LOAD265.OK'
DEFINE F_RES  'C:\MINT\DATA\LOAD265.RES'
DEFINE F_ENT  'C:\MINT\DATA\LOAD265.ENT'


SUBROUTINE ENABLE_SCREENS
ENABLE MSM265A
ENABLE MSM26JA
RETURN

SUBROUTINE DISABLE_ALL
DISABLE MSM265A
DISABLE MSM26JA
RETURN

SUBROUTINE ASIGNA_CABECERA SCREEN MSM265A
ABORT IF (LEER ='N')
ABORT IF NOT CSV_1    /*  si no hay datos return
/*ABORT IF (GRABAR_INVOICE ='SI')
SET 'PRIMER_REG ='

/* MSM265A
SET 'DSTRCT_CODE1I       ='  CSV_1
SET 'BRANCH_CODE1I       ='  CSV_2
SET 'BANK_ACCT_NO1I      ='  CSV_3
SET 'ACCOUNTANT1I        ='  CSV_4
SET 'SUPPLIER_NO1I       ='  CSV_5
SET 'INV_NO1I            ='  CSV_6
SET 'INV_DATE1I          ='  CSV_7
SET 'DUE_DATE1I          ='  CSV_8
SET 'INV_AMT1I           ='  CSV_9
SET 'CURRENCY_TYPE1I     ='  CSV_10
SET 'ADD_TAX_AMOUNT1I    ='  CSV_11
SET 'ATAX_CODE_HDR1I     ='  CSV_12
SET 'HANDLE_CDE1I        ='  CSV_13
SET 'AUTH_BY1I1          ='  CSV_14

RETURN

SUBROUTINE ASIGNA_DETALLE  SCREEN MSM265A
ABORT IF NOT CSV_1    /*  si no hay datos return
ABORT IF (GRABAR_INVOICE ='SI')

/* MSM265A

SET 'INV_ITEM_DESC1I1    ='  CSV_1
SET 'INV_ITEM_VALUE1I1   ='  CSV_2
SET 'ACCOUNT1I1          ='  CSV_3
SET 'INV_ITEM_DESC1I2    ='  CSV_4
SET 'INV_ITEM_VALUE1I2   ='  CSV_5
SET 'ACCOUNT1I2          ='  CSV_6
SET 'INV_ITEM_DESC1I3    ='  CSV_7
SET 'INV_ITEM_VALUE1I3   ='  CSV_8
SET 'ACCOUNT1I3          ='  CSV_9

RETURN

SUBROUTINE LEE_REG SCREEN MSM265A
ABORT IF (LEER ='N')
/* ABORT IF NOT CSV_1    /*  si no hay datos return
ABORT IF (LEIDO_PROVEED ='SI')
IMPORT FILE F_ENT FORMAT CSV EXTRACT
ABORT IF NOT CSV_1    /*  si no hay datos return
SET 'READ_CNTR=' READ_CNTR + '1'
SYSTEM 'ECHO LEIDOS ' READ_CNTR
ABORT IF (PRIMER_REG = 'SI')
ABORT IF NOT (CSV_1 = 'MLP')
SET 'GRABAR_INVOICE ='  'SI'
SET 'MUEVE_PRIMER_REG ='  'S'
PERFORM ASIGNA_CABECERA
RETURN

SUBROUTINE ESCRIBE_ENCAB MSM265A
ABORT IF (GRABAR_INVOICE ='SI')
ABORT IF (ESCRIBE_ENCABEZADO = 'N')
/* ABORT IF NOT CSV_1    /*  si no hay datos return
SET 'WRITE_CNTR=' WRITE_CNTR + '1'
SYSTEM 'ECHO  GRABADOS  ' WRITE_CNTR
EXPORT FILE F_OK APPEND FORMAT CSV
. DSTRCT_CODE1I BRANCH_CODE1I BANK_ACCT_NO1I ACCOUNTANT1I &
  SUPPLIER_NO1I INV_NO1I INV_DATE1I DUE_DATE1I &
  INV_AMT1I CURRENCY_TYPE1I ADD_TAX_AMOUNT1I &
  ATAX_CODE_HDR1I HANDLE_CDE1I AUTH_BY1I1

SET 'ESCRIBE_ENCABEZADO ='  'N'
/*SET 'LEER ='  'S'
RETURN

SUBROUTINE ESCRIBE_OK SCREEN MSM265A
ABORT IF (HAY_ERROR = 'S')
/* ABORT IF NOT CSV_1    /*  si no hay datos return
PERFORM ESCRIBE_ENCAB
/*ABORT IF (LEER ='N')
ABORT IF NOT (ESCRIBIR_DETALLE = 'S')
SET 'WRITE_CNTR=' WRITE_CNTR + '1'
SYSTEM 'ECHO  GRABADOS  ' WRITE_CNTR

PERFORM ASIGNA_DETALLE

EXPORT FILE F_OK APPEND FORMAT CSV
. INV_ITEM_DESC1I1 INV_ITEM_VALUE1I1 AUTH_BY1I1 ACCOUNT1I1 &
  INV_ITEM_DESC1I2 INV_ITEM_VALUE1I2 AUTH_BY1I1 ACCOUNT1I2 &
  INV_ITEM_DESC1I3 INV_ITEM_VALUE1I3 AUTH_BY1I1 ACCOUNT1I3
SET 'ESCRIBIR_DETALLE ='  
RETURN

SUBROUTINE MUEVE_DATOS_P1  SCREEN MSM265A
ABORT IF NOT CSV_1    /*  si no hay datos return
ABORT IF (GRABAR_INVOICE ='SI')

KEY
. !IF MUEVE_PRIMER_REG  !ENTER BRANCH_CODE1I       !TO @BRANCH_CODE1I
. !IF MUEVE_PRIMER_REG  !ENTER BANK_ACCT_NO1I      !TO @BANK_ACCT_NO1I
. !IF MUEVE_PRIMER_REG  !ENTER ACCOUNTANT1I        !TO @ACCOUNTANT1I
. !IF MUEVE_PRIMER_REG  !ENTER SUPPLIER_NO1I       !TO @SUPPLIER_NO1I
. !IF MUEVE_PRIMER_REG  !ENTER INV_NO1I            !TO @INV_NO1I
. !IF MUEVE_PRIMER_REG  !ENTER INV_DATE1I          !TO @INV_DATE1I
. !IF MUEVE_PRIMER_REG  !ENTER DUE_DATE1I          !TO @DUE_DATE1I  
. !IF MUEVE_PRIMER_REG  !ENTER INV_AMT1I           !TO @INV_AMT1I  
. !IF MUEVE_PRIMER_REG  !ENTER CURRENCY_TYPE1I     !TO @CURRENCY_TYPE1I
. !IF MUEVE_PRIMER_REG  !ENTER ADD_TAX_AMOUNT1I    !TO @ADD_TAX_AMOUNT1I
. !IF MUEVE_PRIMER_REG  !ENTER ATAX_CODE_HDR1I     !TO @ATAX_CODE_HDR1I
. !IF MUEVE_PRIMER_REG  !ENTER HANDLE_CDE1I        !TO @HANDLE_CDE1I
. !IF INV_ITEM_VALUE1I1 !ENTER INV_ITEM_DESC1I1    !TO @INV_ITEM_DESC1I1   
. !IF INV_ITEM_VALUE1I1 !ENTER INV_ITEM_VALUE1I1   !TO @INV_ITEM_VALUE1I1   
. !IF INV_ITEM_VALUE1I1 !ENTER AUTH_BY1I1          !TO @AUTH_BY1I1
. !IF INV_ITEM_VALUE1I1 !ENTER ACCOUNT1I1          !TO @ACCOUNT1I1
. !IF INV_ITEM_VALUE1I2 !ENTER INV_ITEM_DESC1I2    !TO @INV_ITEM_DESC1I2   
. !IF INV_ITEM_VALUE1I2 !ENTER INV_ITEM_VALUE1I2   !TO @INV_ITEM_VALUE1I2   
. !IF INV_ITEM_VALUE1I2 !ENTER AUTH_BY1I1          !TO @AUTH_BY1I2   
. !IF INV_ITEM_VALUE1I2 !ENTER ACCOUNT1I2          !TO @ACCOUNT1I2
. !IF INV_ITEM_VALUE1I3 !ENTER INV_ITEM_DESC1I3    !TO @INV_ITEM_DESC1I3   
. !IF INV_ITEM_VALUE1I3 !ENTER INV_ITEM_VALUE1I3   !TO @INV_ITEM_VALUE1I3   
. !IF INV_ITEM_VALUE1I3 !ENTER AUTH_BY1I1          !TO @AUTH_BY1I3   
. !IF INV_ITEM_VALUE1I3 !ENTER ACCOUNT1I3          !TO @ACCOUNT1I3
. !SEND

SET 'HAY_ERROR='
SET 'MESSAGE1='
SET 'MESSAGE2='
SET 'MUEVE_PRIMER_REG ='
SET 'ESCRIBIR_DETALLE ='  'S'

RETURN

SUBROUTINE DA_ENTER
KEY !SEND
RETURN

SUBROUTINE VER_SI_EOF SCREEN MSM265A
ABORT IF NOT (XERR2='Invoice')
ABORT IF CSV_1
PERFORM ESCRIBE_OK
SET 'F_FIN=' @DATE1I
SET 'H_FIN=' @TIME1I
PERFORM DISABLE_ALL
EXPORT FILE F_RES APPEND
. ' PROCESO * LOAD265 *'
. 'INICIO PROCESO        = ' F_INI ' ,' H_INI
. 'FIN    PROCESO        = ' F_FIN ' ,' H_FIN
. 'REGISTROS LEIDOS      = ' READ_CNTR
. 'REGISTROS O.K.        = ' WRITE_CNTR
. 'REGISTROS CON ERROR   = ' ERR_CNTR
KEY !F4            /* si no hay datos....press key F1
SYSTEM 'ECHO      ******   F  I N   ******'
KEY !F1            /* si no hay datos....press key F1
RETURN

SUBROUTINE ABORTAR SCREEN MSM265A
ABORT IF NOT (XERR2='Invoice')
ABORT IF CSV_1
SET 'F_FIN=' @DATE1I
SET 'H_FIN=' @TIME1I
PERFORM DISABLE_ALL
EXPORT FILE F_RES APPEND
. ' PROCESO * LOAD265 *'
. 'INICIO PROCESO        = ' F_INI ' ,' H_INI
. 'FIN    PROCESO        = ' F_FIN ' ,' H_FIN
. 'REGISTROS LEIDOS      = ' READ_CNTR
. 'REGISTROS O.K.        = ' WRITE_CNTR
. 'REGISTROS CON ERROR   = ' ERR_CNTR
KEY !F4            /* si no hay datos....press key F1
SYSTEM 'ECHO      ******   F  I N   ******'
KEY !F1            /* si no hay datos....press key F1
RETURN

SUBROUTINE ABORTAR_ERROR SCREEN MSM265A
SET 'F_FIN=' @DATE1I
SET 'H_FIN=' @TIME1I
PERFORM DISABLE_ALL
EXPORT FILE F_RES APPEND
. ' PROCESO * LOAD265 *'
. 'INICIO PROCESO        = ' F_INI ' ,' H_INI
. 'FIN    PROCESO        = ' F_FIN ' ,' H_FIN
. 'REGISTROS LEIDOS      = ' READ_CNTR
. 'REGISTROS O.K.        = ' WRITE_CNTR
. 'REGISTROS CON ERROR   = ' ERR_CNTR
KEY !F4            /* si no hay datos....press key F1
SYSTEM 'ECHO      ******   F  I N   ******'
KEY !F1            /* si no hay datos....press key F1
RETURN

SUBROUTINE VER_WARNING SCREEN MSM265A
ABORT IF NOT (XERR='N.B.')
KEY
. !SEND
RETURN

SUBROUTINE CAMBIA_PROVEEDOR SCREEN MSM265A
ABORT IF NOT (CSV_1 ='MLP')
SET 'LEIDO_PROVEED ='  'SI'
SET 'MUEVE_PRIMER_REG ='  'S'
SET 'ESCRIBE_ENCABEZADO ='  'S'
ABORT IF NOT CSV_1
/* PERFORM DA_ENTER
RETURN

SUBROUTINE VER_WARNING2 SCREEN MSM265A
ABORT IF NOT (XERR='4493')
KEY
. !ENTER CURRENCY_TYPE1I     !TO @CURRENCY_TYPE1I
. !SEND
/*PERFORM ESCRIBE_OK
PERFORM LEE_REG
PERFORM CAMBIA_PROVEEDOR
ABORT IF (CSV_1 ='MLP')
RETURN

SUBROUTINE VER_INVOICE SCREEN MSM265A
ABORT IF NOT (XERR2='Invoice')
PERFORM ESCRIBE_OK
EXPORT FILE F_OK APPEND FORMAT CSV
. '**** ' MESSAGE2
/*SET 'HAY_ERROR=' 'S'
SET 'GRABAR_INVOICE ='  
SET 'MUEVE_PRIMER_REG ='  'S'
SET 'ESCRIBE_ENCABEZADO ='  'S'
/* SET 'ESCRIBIR_DETALLE ='  'S'
ABORT IF (CSV_1 ='MLP')
SET 'GRABAR_INVOICE ='  'SI'
SET 'MUEVE_PRIMER_REG ='  
SET 'ESCRIBE_ENCABEZADO ='
PERFORM ABORTAR
RETURN

SUBROUTINE VER_SI_DAR_F3 SCREEN MSM265A
ABORT IF NOT CSV_1
ABORT IF NOT (XERR2='Invoice')
KEY !F3
RETURN


MANUAL MSM265A
SYSTEM 'DEL C:\MINT\DATA\LOAD265.ERR'
SYSTEM 'DEL C:\MINT\DATA\LOAD265.RES'
SYSTEM 'DEL C:\MINT\DATA\LOAD265.OK'
SET 'READ_CNTR=' '0'
SET 'WRITE_CNTR=' '0'
SET 'ERR_CNTR=' '0'
SET 'HAY_ERROR=' 'S'
SET 'MUEVE_PRIMER_REG ='  'S'
SET 'ESCRIBE_ENCABEZADO ='  'S'
SET 'ESCRIBIR_DETALLE ='  'S'
SET 'LEER ='  'S'
SET 'F_INI=' @DATE1I
SET 'H_INI=' @TIME1I
SET 'LEIDO_PROVEED ='  

SET 'PRIMER_REG=' 'SI'
SET 'GRABAR_INVOICE ='  
PERFORM ENABLE_SCREENS
KEY !F3


DYNAMIC MSM265A
 TRIGGER @ERRMESS1I
 . VALUE '     ' /* No error,
 . TRIGGER @FKEYS1I
 /*.  . VALUE 'XMIT-Validate, F5-Previous'
 /*.  .   PERFORM DA_ENTER
 .  . VALUE 'XMIT-Validate'
 .  .   PERFORM ESCRIBE_OK
 .  .   SET 'HAY_ERROR ='  'N'
 .  .   PERFORM LEE_REG
 .  .   PERFORM VER_SI_EOF
 .  .   SET 'LEIDO_PROVEED ='  
 .  .   PERFORM ASIGNA_CABECERA
 .  .   SET 'LEER ='  'S'
 .  .   PERFORM LEE_REG
 .  .   PERFORM ASIGNA_DETALLE
 .  .   PERFORM MUEVE_DATOS_P1
 .  .   SET 'LEER ='  'N'

 .  .   ABORT IF NOT CSV_1
 .  .   ABORT IF NOT (GRABAR_INVOICE ='SI')
 .  .   PERFORM DA_ENTER
 .  . VALUE 'XMIT-Update'
 .  .   PERFORM ESCRIBE_OK
 .  .   SET 'HAY_ERROR ='  'N'
 .  .   PERFORM LEE_REG
  .  .   PERFORM VER_SI_EOF
 .  .   SET 'LEIDO_PROVEED ='  
 .  .   PERFORM ASIGNA_CABECERA
 .  .   SET 'LEER ='  'S'
 .  .   PERFORM LEE_REG
 /*.  .   PERFORM CAMBIA_PROVEEDOR
 /*.  .   ABORT IF (CSV_1 ='MLP')
 .  .   PERFORM ASIGNA_DETALLE
 .  .   PERFORM MUEVE_DATOS_P1
 .  .   ABORT IF CSV_1
 .  .   PERFORM DA_ENTER
 .  . VALUE 'XMIT-Confirm'
 /*.  .   SET 'GRABAR_INVOICE ='  
 /*.  .   SET 'MUEVE_PRIMER_REG ='  'S'
 /*.  .   PERFORM ASIGNA_CABECERA
 .  .   PERFORM ESCRIBE_OK
 .  .   PERFORM DA_ENTER
 . VALUE' /* An error has occurred
 .   SET 'XERR='@ERRMESS1I[1,4]
 .   SET 'MESSAGE1='@ERRMESS1I
 .   PERFORM VER_WARNING
 .   ABORT IF (XERR='N.B.')
 .   PERFORM VER_WARNING2
 .   ABORT IF (XERR='4493')
 .   SET 'XERR2='@ERRMESS1I[1,7]
 .   SET 'MESSAGE2 ='@ERRMESS1I
 .   PERFORM VER_INVOICE
 .   PERFORM VER_SI_DAR_F3
 .   ABORT IF (XERR2='Invoice')
 .   EXPORT FILE F_ERR APPEND FORMAT CSV
 .  . DSTRCT_CODE1I BRANCH_CODE1I BANK_ACCT_NO1I ACCOUNTANT1I &
      SUPPLIER_NO1I INV_NO1I INV_DATE1I DUE_DATE1I &
      INV_AMT1I CURRENCY_TYPE1I ADD_TAX_AMOUNT1I &
      ATAX_CODE_HDR1I HANDLE_CDE1I AUTH_BY1I1
.   EXPORT FILE F_ERR APPEND FORMAT CSV
.   .  INV_ITEM_DESC1I1 INV_ITEM_VALUE1I1 AUTH_BY1I1 ACCOUNT1I1 &
       INV_ITEM_DESC1I2 INV_ITEM_VALUE1I2 AUTH_BY1I1 ACCOUNT1I2 &
       INV_ITEM_DESC1I3 INV_ITEM_VALUE1I3 AUTH_BY1I1 ACCOUNT1I3 &
       'MSM265A : ' @ERRMESS1I
 .   SET 'HAY_ERROR=' 'S'
 .   SET 'ERR_CNTR=' ERR_CNTR + '2'
 .   PERFORM ABORTAR_ERROR

DYNAMIC MSM26JA
 TRIGGER @ERRMESS1I
 . VALUE '     ' /* No error,
 . TRIGGER @FKEYS1I
 .  . VALUE 'XMIT-Update'
 .  .   PERFORM DA_ENTER
 . VALUE' /* An error has occurred
 .   EXPORT FILE F_ERR APPEND FORMAT CSV
 .  . DSTRCT_CODE1I BRANCH_CODE1I BANK_ACCT_NO1I ACCOUNTANT1I &
      SUPPLIER_NO1I INV_NO1I INV_DATE1I DUE_DATE1I &
      INV_AMT1I CURRENCY_TYPE1I ADD_TAX_AMOUNT1I &
      ATAX_CODE_HDR1I HANDLE_CDE1I AUTH_BY1I1
 .   EXPORT FILE F_ERR APPEND FORMAT CSV
 .   . INV_ITEM_DESC1I1 INV_ITEM_VALUE1I1 AUTH_BY1I1 ACCOUNT1I1 &
       INV_ITEM_DESC1I2 INV_ITEM_VALUE1I2 AUTH_BY1I1 ACCOUNT1I2 &
       INV_ITEM_DESC1I3 INV_ITEM_VALUE1I3 AUTH_BY1I1 ACCOUNT1I3 &
       'MSM26JA : ' @ERRMESS1I
 .   SET 'HAY_ERROR=' 'S'
 .   SET 'ERR_CNTR=' ERR_CNTR + '2'
 .   PERFORM ABORTAR_ERROR

END LOAD265


REGARDS
Beto_miranda@hotmail.com

RE: MSO266 Invoice Load Script

(OP)
Muchas Gracias Senor Beto!  Yo agredeci tu ayudo! (Hope that's right!)

Donna

RE: MSO266 Invoice Load Script

DPES1,

If you are looking at volumes of data, which Mint doesn't
handle well, let Chris or I know.

We have a batch load program for Invoices.

... Jeff

RE: MSO266 Invoice Load Script

(OP)
Jeff:

Hi! Got Carlin's NGB261 and are looking at modifications, just getting compile errors in version 4.1.  The MINT Script is not my favorite option either.  

Thanks!
Donna

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close