{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function fieldcount, msg, dialog_box, ncr_comm\r\ndeclare subroutine create_note\r\n$insert logical\r\n$insert msg_equates\r\n$insert quote_sigs_equ\r\n$insert lsl_users_equ\r\n$insert ncr_equ\r\nequ CrLf$ to char(13):char(10)\r\n\r\nDeptResp = .departmentresp->text\r\nDeptManager = ''\r\nQSRec = xlate( 'CONFIG', 'QUOTE_SIGS', '', 'X' )\r\nbegin case\r\n   case DeptResp = 'Production'\r\n      DeptManager = QSRec<ProdMgr$>\r\n   case DeptResp = 'Engineering'\r\n      DeptManager = QSRec<EngMgr$>\r\n   case DeptResp = 'Maintenance'\r\n      DeptManager = QSRec<MaintMgr$>\r\n   case DeptResp = 'Facilities'\r\n      DeptManager = QSRec<FacilMgr$>\r\n   case DeptResp = 'Shipping'\r\n      DeptManager = QSRec<ShipMgr$>\r\nend case\r\n* NEED TO GET THE DEPARTMENT MANAGER'S NAME\r\nif ( @user4 = DeptManager ) or ( DeptResp = 'Customer' ) or ( DeptResp = 'Research' ) then\r\n\tDeptMgrSig = .dept_mgr_sig->text\r\n\tDeptMgrSigName = .dept_mgr_sig_name->text\r\n\tif DeptMgrSig <> '' then\r\n\t    MsgInfo = ''\r\n\t    MsgInfo<mtext$> = 'This NCR has already been signed by the manager.'\r\n\t    MsgInfo<micon$> = '!'\r\n\t    Void = msg( '', MsgInfo )\r\n\tend else\r\n\t    Valid = dialog_box( 'QUOTE_SIG_PWD_ENTRY', @window, @user4:@vm:xlate( 'LSL_USERS', @user4, lsl_users_password$, 'X' ) )\r\n\t\tif Valid then\r\n\t        .dept_mgr_sig->text = @user4\r\n\t        .dept_mgr_sig_name->text = xlate( 'LSL_USERS', @user4, 'FIRST_LAST', 'X' )\r\n            VpMfg = xlate( 'CONFIG', 'QUOTE_SIGS', VipMfg$, 'X' )\t\t\r\n\t\t    NCR = .ncr_id->text\r\n\t\t    Message = 'NCR# ':NCR:' was signed by department manager ':oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ):' on ':oconv( date(), 'D2/' ):' at ':oconv( time(), 'MTH' )\r\n\t\t    create_note( VpMfg, @user4, 'NCR# ':NCR:' signed by manager', Message, 'NCR', NCR )\r\n\t        @@window->savewarn = 1\r\n\t    end\r\n\tend\r\nend else\r\n    MsgInfo = ''\r\n    MsgInfo<mtext$> = 'You are not the ':DeptResp:' manager.'\r\n    MsgInfo<micon$> = '!'\r\n    Void = msg( '', MsgInfo )\r\nend\r\nreturn 0\r\n"
        }
    }
}