Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FBAABDL

FBAABDL.m

Go to the documentation of this file.
  1. FBAABDL ;AISC/DMK - DELETE A BATCH ;7/14/14 12:07
  1. ;;3.5;FEE BASIS;**132,154**;JAN 30, 1995;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;This routine allows the deletion of a batch that has no line
  1. ;items associated with it. Access is restricted to the user
  1. ;who opened the batch or the holder of the 'FBAA LEVEL 2'
  1. ;security key.
  1. BT ;select batch
  1. S FBNO=1
  1. W ! S DIC="^FBAA(161.7,",DIC(0)="AEQZ",DIC("S")=$S($D(^XUSEC("FBAA LEVEL 2",DUZ)):"",1:"I $P(^(0),U,5)=DUZ")
  1. D ^DIC K DIC G END:X=""!(X="^") G BT:Y<0 S FBBAT=+Y,FBBAT(0)=Y(0)
  1. ;
  1. I $$GET1^DIQ(161.7,FBBAT_",",25,"I")=1 W !!,"Batch cannot be deleted because:",!?5,$P($T(NOGO+6),";;",2) S FBNO=0 D END G BT
  1. ;reset batch line count and total dollars first
  1. I $G(FBBAT) N FBTOTAL,FBLCNT D
  1. . D CNTTOT^FBAARB(FBBAT) S DA=FBBAT,DIE="^FBAA(161.7,",DR="10////^S X=FBLCNT;8////^S X=FBTOTAL;S:FBLCNT!(FBTOTAL) Y="""";9///@" D ^DIE K DIE,DR,DA D
  1. ..S:FBTOTAL=0 $P(^FBAA(161.7,+FBBAT,0),U,9)=""
  1. ..S:FBLCNT=0 $P(^FBAA(161.7,+FBBAT,0),U,11)=""
  1. . S FBBAT(0)=^FBAA(161.7,+FBBAT,0)
  1. ;
  1. ;check to see if batch meets criteria for deletion
  1. ;Total Dollars '>0 Invoice Count '>0
  1. ;Payment Line Count '>0 Rejects Pending flag '= "Y"
  1. ;
  1. F I=9,10,11 I $P(FBBAT(0),U,I)>0 W !!?5,$P($T(NOGO+(I-8)),";;",2) S FBNO=0 D END G BT
  1. ;check to see if any invoices point to batch
  1. S FBTYPE=$P(^FBAA(161.7,FBBAT,0),"^",3) I $S(FBTYPE="B3":$D(^FBAAC("AC",FBBAT)),FBTYPE="B5":$D(^FBAA(162.1,"AE",FBBAT)),FBTYPE="B9":$D(^FBAAI("AC",FBBAT)),FBTYPE="B2":$D(^FBAAC("AD",FBBAT)),1:0) D D END G BT
  1. .W !!?5,$P($T(NOGO+5),";;",2)
  1. I $P(FBBAT(0),U,17)="Y" W !!?5,$P($T(NOGO+4),";;",2) S FBNO=0 D END G BT
  1. ;display batch and ask if sure want to delete
  1. W !! S DIC="^FBAA(161.7,",DA=FBBAT,DR="0:1;ST" D EN^DIQ K DIC,DR,DA
  1. ;
  1. S DIR(0)="Y",DIR("B")="No",DIR("A")="Sure you want to DELETE this batch" D ^DIR K DIR S:'Y FBNO=0
  1. I $D(DIRUT)!('Y) D END G BT
  1. ;
  1. ;delete batch
  1. I $G(FBNO) S DA=FBBAT,DIK="^FBAA(161.7," D ^DIK K DIK
  1. W !!?5,*7,"Batch Deleted.",!
  1. D END G BT
  1. ;
  1. END K DA,I,FBBAT,FBNO,X,Y,FBTYPE Q
  1. ;
  1. NOGO ;reasons why batch cannot be deleted
  1. ;;TOTAL DOLLARS in batch is greater than zero.
  1. ;;INVOICE COUNT in batch is greater than zero.
  1. ;;PAYMENT LINE COUNT in batch is greater than zero.
  1. ;;REJECTS PENDING flag in batch is set to 'YES'.
  1. ;;Batch has INVOICES associated with it.
  1. ;;Batch was rejected using the Reprocess Overdue Batch option.