USE [cloudERP]
GO
/****** Object:  UserDefinedTableType [db_sop].[tvp_sale_levies]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[tvp_sale_levies]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_termsandconditions_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_paymentterms_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_paymentterms_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_packinginstructions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_packinginstructions_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_itemaccessories_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_itemaccessories_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_installationinfo_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_installationinfo_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_documentsreqd_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_documentsreqd_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_discsummary_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_discsummary_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[order_deliveryschedule_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[order_deliveryschedule_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_saleorder_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[hdr_saleorder_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_sale_work_order_tvp0]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[hdr_sale_work_order_tvp0]
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_sale_work_order_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[hdr_sale_work_order_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_sale_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[hdr_sale_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_drcrnote]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[hdr_drcrnote]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_saleorder_tvp1]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_saleorder_tvp1]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_saleorder_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_saleorder_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_work_order_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_work_order_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_transportation_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_transportation_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_paymentterms_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_paymentterms_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_packinglist_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_packinglist_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_levies_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_levies_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_lc_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_lc_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_expcarriage_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_expcarriage_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_batches_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_sale_batches_tvp]
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_drcrnote]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[dtl_drcrnote]
GO
/****** Object:  UserDefinedTableType [db_sop].[contractreview_saleorder_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_sop].[contractreview_saleorder_tvp]
GO
/****** Object:  UserDefinedTableType [db_qc].[itemwise__tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_qc].[itemwise__tvp]
GO
/****** Object:  UserDefinedTableType [db_qc].[hdr_qctest_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_qc].[hdr_qctest_tvp]
GO
/****** Object:  UserDefinedTableType [db_qc].[hdr_qc_transactions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_qc].[hdr_qc_transactions_tvp]
GO
/****** Object:  UserDefinedTableType [db_qc].[dtl_qctest_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_qc].[dtl_qctest_tvp]
GO
/****** Object:  UserDefinedTableType [db_qc].[dtl_qc_transactions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_qc].[dtl_qc_transactions_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[template_parameters_movementcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[template_parameters_movementcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[template_item_movementcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[template_item_movementcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[template_equipments_movementcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[template_equipments_movementcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[mst_template_movementcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[mst_template_movementcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[machineparameters_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[machineparameters_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[jobheader_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[jobheader_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[itemparameters_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[itemparameters_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[hdr_wo_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[hdr_wo_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[hdr_productionplan_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[hdr_productionplan_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[hdr_jobcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[hdr_jobcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[generaterequisition_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[generaterequisition_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_wo_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[dtl_wo_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_releasebatch_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[dtl_releasebatch_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_productionplan_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[dtl_productionplan_tvp]
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_jobcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_production].[dtl_jobcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_mt].[hdr_ticket_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mt].[hdr_ticket_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[supplier_items_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[supplier_items_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[purchase_termsandconditions_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_paymentterms_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[purchase_paymentterms_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_followup_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[purchase_followup_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_deliveryschedule_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[purchase_deliveryschedule_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[mst_item_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[mst_item_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[mst_item]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[mst_item]
GO
/****** Object:  UserDefinedTableType [db_mm].[mst_gst_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[mst_gst_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[itemcategories_userrights_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[itemcategories_userrights_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[item_types_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[item_types_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[item_brands_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[item_brands_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[issuancebatchwise_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[issuancebatchwise_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_vendor_allocation_list_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_vendor_allocation_list_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_stktransfer_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_stktransfer_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_rgp_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_rgp_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_requisition_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_requisition_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_purchaseorder_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_purchaseorder_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_plan_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_plan_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_nrgp_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_nrgp_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_issuereturn_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_issuereturn_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_issuance_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_issuance_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_inwardnote_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_inwardnote_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_indent_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_indent_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_grn_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_grn_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_dpr_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_dpr_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_destruction_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_destruction_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_bom_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[hdr_bom_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[grnbatchwise_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[grnbatchwise_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_vendor_allocation_list_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_vendor_allocation_list_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_vendor_allocation_approval_list_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_vendor_allocation_approval_list_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_stktransfer_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_stktransfer_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_rgp_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_rgp_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_rgp_returnitems_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_rgp_returnitems_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_requisition_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_requisition_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_requisition_arwise_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_requisition_arwise_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_purchaseorder_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_purchaseorder_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_plan_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_plan_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_nrgp_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_nrgp_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_itemdimension_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_itemdimension_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_issuereturn_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_issuereturn_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_issuance_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_issuance_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_inwardnote_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_inwardnote_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_inwardadvice]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_inwardadvice]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_indent_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_indent_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_grn_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_grn_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_grn_levies_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_grn_levies_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_dpr_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_dpr_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_destruction_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_destruction_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_catgdimension_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_catgdimension_tvp]
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_bom_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mm].[dtl_bom_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quoteproforma_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quoteproforma_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_termsandconditions_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_sale_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_sale_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_pi_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_pi_termsandconditions_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_pi_paymentterms_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_pi_paymentterms_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[Quote_paymentterms_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[Quote_paymentterms_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_installationinfo_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_installationinfo_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_images_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_images_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_dtl_sale_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_dtl_sale_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_documentsreqd_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[quote_documentsreqd_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdrquote_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[hdrquote_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_sale_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[hdr_sale_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_quote_pi_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[hdr_quote_pi_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_enqbseg_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[hdr_enqbseg_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_enq_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[hdr_enq_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[enquirycategory_userrights_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[enquirycategory_userrights_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_sale_paymentterms_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_sale_paymentterms_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_sale_levies_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_sale_levies_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_quote_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_quote_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_quote_pi_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_quote_pi_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_qoute_pi_levies_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_qoute_pi_levies_tvp]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_enq_tvp1]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_enq_tvp1]
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_enq_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_mktg].[dtl_enq_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[users_tvp1]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[users_tvp1]
GO
/****** Object:  UserDefinedTableType [db_masters].[users_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[users_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[tenderitems_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[tenderitems_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[partymaster_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[partymaster_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[party_licenseinfo_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[party_licenseinfo_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[party_contactpersons_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[party_contactpersons_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[party_bank_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[party_bank_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[mst_machine_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[mst_machine_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[fixedassetregister_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[fixedassetregister_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[emprelation_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[emprelation_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[empreferals_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[empreferals_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[employee_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[employee_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[emphealthcard_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[emphealthcard_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[empexperience_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[empexperience_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[empeducation_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[empeducation_tvp]
GO
/****** Object:  UserDefinedTableType [db_masters].[emp_splstatus_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_masters].[emp_splstatus_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[hdr_training_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[hdr_training_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[hdr_resume_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[hdr_resume_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[hdr_appraisals_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[hdr_appraisals_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumeskills_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[dtl_resumeskills_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumequalification_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[dtl_resumequalification_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumeexperience_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[dtl_resumeexperience_tvp]
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumecategory]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[dtl_resumecategory]
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_appraisals_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_hr].[dtl_appraisals_tvp]
GO
/****** Object:  UserDefinedTableType [db_general].[user_rights]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_general].[user_rights]
GO
/****** Object:  UserDefinedTableType [db_general].[user_branches_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_general].[user_branches_tvp]
GO
/****** Object:  UserDefinedTableType [db_general].[pr_report_parameters1]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_general].[pr_report_parameters1]
GO
/****** Object:  UserDefinedTableType [db_general].[pr_report_parameters]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_general].[pr_report_parameters]
GO
/****** Object:  UserDefinedTableType [db_general].[images_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_general].[images_tvp]
GO
/****** Object:  UserDefinedTableType [db_general].[group_activity_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_general].[group_activity_tvp]
GO
/****** Object:  UserDefinedTableType [db_fcr].[hdr_complaint]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_fcr].[hdr_complaint]
GO
/****** Object:  UserDefinedTableType [db_fcr].[dtl_complaint]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_fcr].[dtl_complaint]
GO
/****** Object:  UserDefinedTableType [db_accounts].[vouchergeneration_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_accounts].[vouchergeneration_tvp]
GO
/****** Object:  UserDefinedTableType [db_accounts].[voucher_tvp1]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_accounts].[voucher_tvp1]
GO
/****** Object:  UserDefinedTableType [db_accounts].[voucher_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_accounts].[voucher_tvp]
GO
/****** Object:  UserDefinedTableType [db_accounts].[pmtreqconfirmation_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_accounts].[pmtreqconfirmation_tvp]
GO
/****** Object:  UserDefinedTableType [db_accounts].[paymentrequirement_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_accounts].[paymentrequirement_tvp]
GO
/****** Object:  UserDefinedTableType [db_accounts].[chequeissueddetail_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
DROP TYPE [db_accounts].[chequeissueddetail_tvp]
GO
/****** Object:  UserDefinedTableType [db_accounts].[chequeissueddetail_tvp]    Script Date: 1/15/2020 8:33:17 PM ******/
CREATE TYPE [db_accounts].[chequeissueddetail_tvp] AS TABLE(
	[id] [int] NULL,
	[reqid] [int] NULL,
	[chequeneft] [char](1) NULL,
	[tranamt] [decimal](18, 2) NULL,
	[transdate] [date] NULL,
	[bankacid] [int] NULL,
	[chequeno] [char](10) NULL,
	[nameoncheque] [char](100) NULL,
	[bankacno] [char](25) NULL,
	[ifsc] [char](15) NULL
)
GO
/****** Object:  UserDefinedTableType [db_accounts].[paymentrequirement_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_accounts].[paymentrequirement_tvp] AS TABLE(
	[id] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[userid] [int] NOT NULL,
	[reqno] [int] NOT NULL,
	[reqdate] [date] NOT NULL,
	[accountid] [int] NULL,
	[currentbalance] [decimal](18, 2) NOT NULL,
	[amounttopay] [decimal](18, 2) NOT NULL,
	[bankacno] [char](20) NOT NULL,
	[ifsc] [char](15) NOT NULL,
	[bankid] [int] NOT NULL,
	[remarks] [char](300) NULL,
	[paymenttype] [char](1) NOT NULL
)
GO
/****** Object:  UserDefinedTableType [db_accounts].[pmtreqconfirmation_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_accounts].[pmtreqconfirmation_tvp] AS TABLE(
	[id] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[userid] [int] NOT NULL,
	[passedamt] [decimal](18, 2) NOT NULL,
	[managementnotes] [char](300) NULL
)
GO
/****** Object:  UserDefinedTableType [db_accounts].[voucher_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_accounts].[voucher_tvp] AS TABLE(
	[id] [int] NULL,
	[COID] [int] NULL,
	[BOID] [int] NULL,
	[FYID] [int] NULL,
	[USERID] [int] NOT NULL,
	[VOUCHERNO] [bigint] NOT NULL,
	[ROWNO] [int] NOT NULL,
	[VOUCHERDATE] [date] NOT NULL,
	[VOUCHERAMOUNT] [decimal](18, 2) NOT NULL,
	[VOUCHERTYPE] [char](1) NOT NULL,
	[VOUCHERCATEGORY] [char](1) NOT NULL,
	[ACCOUNTID] [bigint] NOT NULL,
	[DRCR] [char](1) NOT NULL,
	[NARRATION] [char](300) NULL,
	[REFID] [bigint] NULL,
	[ISCONFIRM] [bit] NULL,
	[TRNTYPE] [int] NOT NULL,
	[CASHBANKID] [int] NULL,
	[TOTALAMOUNT] [decimal](18, 2) NOT NULL,
	[SUBTRNTYPEID] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_accounts].[voucher_tvp1]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_accounts].[voucher_tvp1] AS TABLE(
	[id] [int] NULL,
	[COID] [int] NULL,
	[BOID] [int] NULL,
	[FYID] [int] NULL,
	[USERID] [int] NOT NULL,
	[VOUCHERNO] [bigint] NOT NULL,
	[ROWNO] [int] NOT NULL,
	[VOUCHERDATE] [date] NOT NULL,
	[VOUCHERAMOUNT] [decimal](18, 2) NOT NULL,
	[VOUCHERTYPE] [char](1) NOT NULL,
	[VOUCHERCATEGORY] [char](1) NOT NULL,
	[ACCOUNTID] [bigint] NOT NULL,
	[DRCR] [char](1) NOT NULL,
	[NARRATION] [char](300) NULL,
	[REFID] [bigint] NULL,
	[ISCONFIRM] [bit] NULL,
	[TRNTYPE] [int] NOT NULL,
	[CASHBANKID] [int] NULL,
	[TOTALAMOUNT] [decimal](18, 2) NOT NULL,
	[SUBTRNTYPEID] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_accounts].[vouchergeneration_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_accounts].[vouchergeneration_tvp] AS TABLE(
	[id] [int] IDENTITY(1,1) NOT NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[userid] [int] NULL,
	[voucherno] [bigint] NOT NULL,
	[rowno] [int] NOT NULL,
	[voucherdate] [date] NULL,
	[voucheramount] [decimal](18, 2) NULL,
	[vouchertype] [char](1) NULL,
	[vouchercategory] [char](1) NULL,
	[accountid] [bigint] NULL,
	[drcr] [char](1) NULL,
	[narration] [char](300) NULL,
	[refid] [bigint] NULL,
	[isconfirm] [bit] NULL,
	[trntype] [int] NULL,
	[oppositeacid] [bigint] NULL,
	[fyid] [int] NULL,
	[subledgercode] [varchar](2) NULL,
	[cencaled] [bit] NULL,
	[createdby] [bigint] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [bigint] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_fcr].[dtl_complaint]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_fcr].[dtl_complaint] AS TABLE(
	[id] [bigint] NULL,
	[hdrid] [bigint] NULL,
	[productgroup] [int] NULL,
	[typeofcomplaint] [int] NULL,
	[complaint] [int] NULL,
	[possiblecauses] [int] NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_fcr].[hdr_complaint]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_fcr].[hdr_complaint] AS TABLE(
	[id] [bigint] NULL,
	[callno] [bigint] NULL,
	[calltypeid] [int] NULL,
	[calldate] [date] NOT NULL,
	[calltime] [varchar](20) NULL,
	[custid] [bigint] NULL,
	[contactperson] [varchar](100) NULL,
	[phone] [varchar](20) NULL,
	[remarks] [varchar](200) NULL,
	[ActiontakenId] [int] NULL,
	[fwdto] [bigint] NULL,
	[fwdfor] [bigint] NULL,
	[fwdby] [varchar](100) NULL,
	[attime] [varchar](20) NULL,
	[atdate] [date] NULL,
	[status] [int] NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_general].[group_activity_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_general].[group_activity_tvp] AS TABLE(
	[id] [int] NULL,
	[groupid] [int] NULL,
	[activity] [varchar](100) NULL,
	[referenceno] [varchar](10) NULL,
	[duedate] [date] NULL,
	[reminderdate] [date] NULL,
	[assignedto] [int] NULL,
	[taskstatus] [int] NULL,
	[actiontakenon] [datetime] NULL,
	[actiontakenby] [varchar](200) NULL,
	[esclatetouser] [int] NULL,
	[afterdays] [int] NULL,
	[afterhrs] [decimal](5, 1) NULL,
	[remarks] [varchar](500) NULL
)
GO
/****** Object:  UserDefinedTableType [db_general].[images_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_general].[images_tvp] AS TABLE(
	[srno] [int] NULL,
	[filename] [varchar](200) NULL,
	[remarks] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_general].[pr_report_parameters]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_general].[pr_report_parameters] AS TABLE(
	[id] [int] NULL,
	[name] [varchar](200) NULL,
	[value] [varchar](200) NULL
)
GO
/****** Object:  UserDefinedTableType [db_general].[pr_report_parameters1]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_general].[pr_report_parameters1] AS TABLE(
	[name] [varchar](200) NULL,
	[value] [varchar](200) NULL
)
GO
/****** Object:  UserDefinedTableType [db_general].[user_branches_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_general].[user_branches_tvp] AS TABLE(
	[id] [int] NULL,
	[userid] [int] NULL,
	[boid] [int] NULL,
	[coid] [int] NULL,
	[isactive] [int] NULL,
	[reportingto] [int] NULL,
	[roleid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_general].[user_rights]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_general].[user_rights] AS TABLE(
	[id] [int] NULL,
	[userid] [int] NULL,
	[moduleid] [int] NULL,
	[functionalityid] [int] NULL,
	[canview] [bit] NULL,
	[cancreate] [bit] NULL,
	[canedit] [bit] NULL,
	[candelete] [bit] NULL,
	[canprint] [bit] NULL,
	[canemail] [bit] NULL,
	[canimport] [bit] NULL,
	[canexport] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_appraisals_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_hr].[dtl_appraisals_tvp] AS TABLE(
	[id] [bigint] NULL,
	[apr_id] [bigint] NULL,
	[apr_kra_srno] [int] NULL,
	[apr_kraname] [varchar](200) NULL,
	[apr_kradetail] [varchar](max) NULL,
	[apr_marks_rating] [varchar](100) NULL,
	[apr_marksawarded] [int] NULL,
	[apr_max_marks] [int] NULL,
	[apr_remarks] [varchar](max) NULL,
	[apr_ratingid] [int] NULL,
	[apr_rating] [decimal](5, 2) NULL,
	[review_ratingid] [int] NULL,
	[review_rating] [decimal](5, 2) NULL,
	[review_marksawarded] [int] NULL,
	[review_max_remarks] [int] NULL,
	[review_remarks] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumecategory]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_hr].[dtl_resumecategory] AS TABLE(
	[id] [int] NULL,
	[resumeid] [int] NULL,
	[categoryid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumeexperience_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_hr].[dtl_resumeexperience_tvp] AS TABLE(
	[id] [int] NULL,
	[resumeid] [int] NULL,
	[organization] [varchar](100) NULL,
	[totexpyy] [int] NULL,
	[totexpmm] [int] NULL,
	[relevantexpyy] [int] NULL,
	[relevantexpmm] [int] NULL,
	[positionheld] [varchar](100) NULL,
	[reportingto] [varchar](100) NULL,
	[remarks] [varchar](500) NULL,
	[expfrom] [varchar](20) NULL,
	[expto] [varchar](20) NULL,
	[deptid] [int] NULL,
	[lastindustrysegment] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumequalification_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_hr].[dtl_resumequalification_tvp] AS TABLE(
	[id] [int] NULL,
	[resumeid] [int] NULL,
	[qualificationid] [int] NULL,
	[institute] [varchar](50) NULL,
	[passingyear] [int] NULL,
	[grades] [varchar](20) NULL,
	[remarks] [varchar](500) NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[dtl_resumeskills_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_hr].[dtl_resumeskills_tvp] AS TABLE(
	[id] [int] NULL,
	[resumeid] [int] NULL,
	[skillid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[hdr_appraisals_tvp]    Script Date: 1/15/2020 8:33:18 PM ******/
CREATE TYPE [db_hr].[hdr_appraisals_tvp] AS TABLE(
	[id] [bigint] NULL,
	[apr_kra_catgid] [int] NULL,
	[empid] [bigint] NULL,
	[current_designation] [varchar](200) NULL,
	[current_dept] [varchar](200) NULL,
	[deptid] [int] NULL,
	[fyid] [int] NULL,
	[apr_from] [date] NULL,
	[apr_upto] [date] NULL,
	[apr_stage] [int] NULL,
	[apr_byid] [bigint] NULL,
	[apr_completedon] [date] NULL,
	[apr_reviewbyid] [int] NULL,
	[review_completedon] [date] NULL,
	[apr_total_marks] [decimal](5, 2) NULL,
	[apr_max_marks] [decimal](5, 2) NULL,
	[apr_rating] [decimal](5, 2) NULL,
	[review_total_marks] [decimal](5, 2) NULL,
	[review_max_marks] [decimal](5, 2) NULL,
	[review_rating] [decimal](5, 2) NULL,
	[apr_final_remarks] [varchar](max) NULL,
	[review_final_remarks] [varchar](max) NULL,
	[apr_trg_needs] [varchar](max) NULL,
	[review_trg_needs] [varchar](max) NULL,
	[md_final_remarks] [varchar](max) NULL,
	[md_final_rating] [decimal](5, 2) NULL,
	[md_completed_date] [date] NULL,
	[md_trg_needs] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[hdr_resume_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_hr].[hdr_resume_tvp] AS TABLE(
	[id] [int] NULL,
	[sourceid] [int] NULL,
	[name] [varchar](100) NULL,
	[gender] [char](1) NULL,
	[dob] [date] NULL,
	[age] [int] NULL,
	[statusid] [int] NULL,
	[phone] [varchar](20) NULL,
	[email] [varchar](50) NULL,
	[totexpyy] [int] NULL,
	[totexpmm] [int] NULL,
	[currentsalary] [decimal](18, 0) NULL,
	[ctc] [decimal](18, 0) NULL,
	[expectedsalary] [decimal](18, 0) NULL,
	[fathername] [varchar](100) NULL,
	[mothername] [varchar](100) NULL,
	[husbandname] [varchar](100) NULL,
	[hometown] [varchar](100) NULL,
	[currentorg] [varchar](100) NULL,
	[currentdept] [varchar](100) NULL,
	[currentdesignation] [varchar](100) NULL,
	[currentlocation] [varchar](100) NULL,
	[references] [varchar](100) NULL,
	[remarks] [varchar](max) NULL,
	[documents] [bit] NULL,
	[isactive] [bit] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [bigint] NULL,
	[createdon] [varchar](100) NULL,
	[colorcode] [varchar](100) NULL,
	[lastindustrysegment] [varchar](10) NULL,
	[otherContactno] [varchar](20) NULL,
	[commaddress] [varchar](200) NULL,
	[co_deptid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_hr].[hdr_training_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_hr].[hdr_training_tvp] AS TABLE(
	[id] [bigint] NULL,
	[courserefno] [varchar](100) NULL,
	[courseid] [bigint] NULL,
	[coursedescription] [varchar](max) NULL,
	[coursedatefrom] [date] NOT NULL,
	[coursedateto] [date] NOT NULL,
	[coursedays] [int] NOT NULL,
	[coursestarttime] [time](7) NULL,
	[courseendtime] [time](7) NULL,
	[coursehours] [decimal](6, 2) NULL,
	[venuetype] [char](1) NULL,
	[venueid] [int] NULL,
	[coursestatusid] [int] NULL,
	[coursefacilities] [varchar](100) NULL,
	[facultytype] [char](1) NULL,
	[facultyid] [int] NULL,
	[coursemajorareaid] [int] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[trainingcost] [decimal](9, 2) NULL,
	[trainingbtchsize] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[emp_splstatus_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[emp_splstatus_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[empid] [bigint] NULL,
	[splstatusid] [int] NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[empeducation_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[empeducation_tvp] AS TABLE(
	[id] [bigint] NULL,
	[empid] [bigint] NOT NULL,
	[qualificationid] [int] NOT NULL,
	[institute] [varchar](50) NULL,
	[passingyear] [int] NULL,
	[grades] [varchar](20) NULL,
	[remarks] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[empexperience_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[empexperience_tvp] AS TABLE(
	[id] [bigint] NULL,
	[empid] [bigint] NULL,
	[organization] [varchar](100) NULL,
	[totexpyy] [int] NULL,
	[totexpmm] [int] NULL,
	[relevantexpyy] [int] NULL,
	[relevantexpmm] [int] NULL,
	[positionheld] [varchar](100) NULL,
	[reportingto] [varchar](100) NULL,
	[remarks] [varchar](max) NULL,
	[expfrom] [varchar](20) NULL,
	[expto] [varchar](20) NULL,
	[deptid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[emphealthcard_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[emphealthcard_tvp] AS TABLE(
	[id] [int] NULL,
	[empid] [bigint] NULL,
	[bloodgroup] [varchar](20) NULL,
	[rhfactor] [varchar](20) NULL,
	[heightcm] [decimal](7, 2) NULL,
	[weightkg] [decimal](7, 3) NULL,
	[eyesight] [varchar](50) NULL,
	[soscontactname] [varchar](100) NULL,
	[sosdoctorname] [varchar](100) NULL,
	[sosdoctorno] [varchar](50) NULL,
	[powerusingglasses] [varchar](100) NULL,
	[lastcheckup] [date] NULL,
	[nextcheckup] [date] NULL,
	[allergies] [varchar](max) NULL,
	[healthinscoid] [int] NULL,
	[healthinsvalidupto] [date] NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[employee_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[employee_tvp] AS TABLE(
	[id] [bigint] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[empno] [varchar](20) NULL,
	[empname] [varchar](200) NOT NULL,
	[designationid] [int] NULL,
	[current_address1] [varchar](500) NULL,
	[current_address2] [varchar](500) NULL,
	[current_state] [int] NULL,
	[current_city] [int] NULL,
	[current_country] [int] NULL,
	[permanent_address1] [varchar](500) NULL,
	[permanent_address2] [varchar](500) NULL,
	[permanent_state] [int] NULL,
	[permanent_city] [int] NULL,
	[permanent_country] [int] NULL,
	[religion] [int] NULL,
	[deptid] [int] NULL,
	[genderid] [int] NULL,
	[aadharno] [varchar](20) NULL,
	[nameinaadhar] [varchar](200) NULL,
	[nameinbank] [varchar](200) NULL,
	[mobile_no] [varchar](20) NULL,
	[other_phone] [varchar](50) NULL,
	[dob] [date] NULL,
	[doj] [date] NULL,
	[marital_statusid] [int] NULL,
	[esiflag] [bit] NULL,
	[esino] [varchar](20) NULL,
	[pfflag] [bit] NULL,
	[pfno] [varchar](20) NULL,
	[pfrate] [decimal](10, 2) NULL,
	[fpfrate] [decimal](10, 2) NULL,
	[uan] [varchar](20) NULL,
	[pfjoiningdate] [date] NULL,
	[esijoiningdate] [date] NULL,
	[domicile] [int] NULL,
	[citizen_of] [int] NULL,
	[esidispensaryid] [int] NULL,
	[voterid] [varchar](20) NULL,
	[passportno] [varchar](20) NULL,
	[passportissuedat] [date] NULL,
	[passportvalidupto] [date] NULL,
	[divinglicense_no] [varchar](20) NULL,
	[issuedat] [date] NULL,
	[validupto] [date] NULL,
	[bankid] [int] NULL,
	[bankacno] [varchar](20) NULL,
	[bankbranch] [varchar](200) NULL,
	[bankifsc] [varchar](15) NULL,
	[sports_ncc_info] [varchar](max) NULL,
	[civildefenceinfo] [varchar](max) NULL,
	[csrinfo] [varchar](max) NULL,
	[biometric_code] [varchar](20) NULL,
	[createdby] [bigint] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [bigint] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [bigint] NULL,
	[deactivatedon] [datetime] NULL,
	[source] [int] NULL,
	[referral_remarks] [varchar](max) NULL,
	[email] [varchar](100) NULL,
	[father_husbandname] [varchar](200) NULL,
	[mothername] [varchar](200) NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[empreferals_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[empreferals_tvp] AS TABLE(
	[id] [bigint] NULL,
	[empid] [bigint] NULL,
	[name] [varchar](200) NULL,
	[organization] [varchar](200) NULL,
	[contactno] [varchar](200) NULL,
	[email] [varchar](100) NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[emprelation_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[emprelation_tvp] AS TABLE(
	[id] [int] NULL,
	[empid] [int] NULL,
	[name] [varchar](200) NULL,
	[dependant_dob] [date] NULL,
	[genderid] [int] NULL,
	[dependant_bloodgroup] [int] NULL,
	[relationid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[fixedassetregister_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[fixedassetregister_tvp] AS TABLE(
	[id] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[mcid] [bigint] NULL,
	[assetno] [varchar](100) NULL,
	[currentloc] [varchar](100) NULL,
	[procuredon] [date] NULL,
	[installedon] [date] NULL,
	[operationalon] [date] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[mst_machine_tvp]    Script Date: 1/15/2020 8:33:19 PM ******/
CREATE TYPE [db_masters].[mst_machine_tvp] AS TABLE(
	[id] [bigint] NULL,
	[MachineName] [varchar](max) NULL,
	[MCCatgId] [int] NULL,
	[MCSRNO] [varchar](100) NULL,
	[MCChassisNo] [varchar](100) NULL,
	[MCModel] [varchar](100) NULL,
	[MCCapacity] [varchar](max) NULL,
	[MCSupplierId] [bigint] NULL,
	[MCManufacturer] [varchar](50) NULL,
	[MaintBy] [bit] NULL,
	[MainSupplierId] [bigint] NULL,
	[UnderWty] [bit] NULL,
	[Wtyupto] [date] NULL,
	[UnderAMC] [bit] NULL,
	[AMCFrom] [date] NULL,
	[AMCUpto] [date] NULL,
	[EmergencyContactNo] [varchar](max) NULL,
	[LastMaint] [date] NULL,
	[LMAfterOps] [bigint] NULL,
	[LastBDownMaint] [date] NULL,
	[BMAfterOps] [bigint] NULL,
	[NextMaint] [date] NULL,
	[NMAfterOps] [bigint] NULL,
	[SplTools] [varchar](max) NULL,
	[SplTeam] [varchar](max) NULL,
	[ProjLifeYY] [int] NULL,
	[ProjLifeMM] [int] NULL,
	[ProjLifeOps] [bigint] NULL,
	[ActualLifeYY] [int] NULL,
	[ActualLifeMM] [int] NULL,
	[ActualLifeOps] [bigint] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[party_bank_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[party_bank_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[bankid] [varchar](150) NULL,
	[bankacno] [varchar](50) NULL,
	[ifsc] [varchar](50) NULL,
	[isactive] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[party_contactpersons_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[party_contactpersons_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[name] [varchar](150) NULL,
	[mobile] [varchar](50) NULL,
	[phone] [varchar](50) NULL,
	[fax] [varchar](150) NULL,
	[email] [varchar](150) NULL,
	[position] [varchar](150) NULL,
	[isactive] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[party_licenseinfo_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[party_licenseinfo_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[licensetype] [varchar](100) NULL,
	[licenseno] [varchar](50) NULL,
	[validtill] [datetime] NULL,
	[authentication] [varchar](50) NULL,
	[isactive] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[partymaster_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[partymaster_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[title] [varchar](20) NULL,
	[vendorcode] [varchar](50) NULL,
	[name] [nvarchar](200) NOT NULL,
	[categoryid] [int] NOT NULL,
	[segmentid] [int] NULL,
	[gsTin] [nvarchar](50) NOT NULL,
	[pan] [nvarchar](50) NOT NULL,
	[address1] [nvarchar](250) NOT NULL,
	[address2] [nvarchar](250) NULL,
	[zone] [int] NULL,
	[area] [int] NULL,
	[region] [int] NULL,
	[city] [int] NOT NULL,
	[state] [int] NOT NULL,
	[country] [int] NOT NULL,
	[newCity] [nvarchar](20) NULL,
	[newCountry] [nvarchar](20) NULL,
	[newState] [nvarchar](20) NULL,
	[pin] [nvarchar](20) NOT NULL,
	[mobile_number] [nvarchar](50) NULL,
	[phone_number] [nvarchar](50) NULL,
	[fax] [nvarchar](150) NULL,
	[email] [nvarchar](150) NOT NULL,
	[website] [nvarchar](150) NULL,
	[tds_applicable] [bit] NULL,
	[tds_rate] [decimal](12, 2) NULL,
	[tcs_applicable] [bit] NULL,
	[tcs_rate] [decimal](12, 2) NULL,
	[vat_number] [nvarchar](20) NULL,
	[vat_date] [datetime] NULL,
	[excise_regn_number] [nvarchar](20) NULL,
	[excise_commissionerate] [nvarchar](20) NULL,
	[excise_division] [nvarchar](20) NULL,
	[excise_range] [nvarchar](20) NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[credit_days] [int] NULL,
	[credit_limit] [decimal](18, 2) NULL,
	[currency_preference] [nvarchar](20) NULL,
	[openingbal] [decimal](18, 2) NULL,
	[eximcode] [varchar](20) NULL,
	[iecno] [varchar](20) NULL,
	[isdealer] [bit] NULL,
	[associateacid] [bigint] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[tenderitems_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[tenderitems_tvp] AS TABLE(
	[id] [int] NULL,
	[catid] [int] NULL,
	[name] [varchar](500) NULL,
	[description] [varchar](100) NULL,
	[brandid] [varchar](50) NULL,
	[units] [varchar](200) NULL,
	[technicalspecs] [varchar](500) NULL,
	[remarks] [varchar](500) NULL,
	[code] [varchar](500) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[userid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[users_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[users_tvp] AS TABLE(
	[firstname] [varchar](200) NULL,
	[lastname] [varchar](200) NULL,
	[emailid] [varchar](100) NULL,
	[username] [varchar](50) NULL,
	[usrpwd] [varchar](200) NULL,
	[department] [varchar](200) NULL,
	[departmentid] [int] NULL,
	[designationid] [int] NULL,
	[mobile] [varchar](13) NULL,
	[isactive] [bit] NULL,
	[mobileuser] [bit] NULL,
	[designation] [varchar](200) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[userid] [int] NULL,
	[shifttimein] [varchar](20) NULL,
	[shifttimeout] [varchar](20) NULL
)
GO
/****** Object:  UserDefinedTableType [db_masters].[users_tvp1]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_masters].[users_tvp1] AS TABLE(
	[userid] [int] NULL,
	[firstname] [varchar](200) NULL,
	[lastname] [varchar](200) NULL,
	[shifttimein] [time](7) NULL,
	[shifttimeout] [time](7) NULL,
	[designationid] [int] NULL,
	[designation] [varchar](200) NULL,
	[departmentid] [int] NULL,
	[department] [varchar](200) NULL,
	[emailid] [varchar](100) NULL,
	[username] [varchar](50) NULL,
	[usrpwd] [varchar](200) NULL,
	[isactive] [bit] NULL,
	[mobileuser] [bit] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_enq_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_mktg].[dtl_enq_tvp] AS TABLE(
	[enqid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[itemtype] [char](1) NULL,
	[qtyreqd] [decimal](10, 3) NULL,
	[deliveryindays] [int] NULL,
	[itemremarks] [varchar](500) NULL,
	[buisnesssegment] [int] NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[lastfollowupdate] [datetime] NULL,
	[nextfollowupdate] [datetime] NULL,
	[uom] [varchar](20) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_enq_tvp1]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_mktg].[dtl_enq_tvp1] AS TABLE(
	[enqid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[itemtype] [char](1) NULL,
	[qtyreqd] [decimal](10, 3) NULL,
	[deliveryindays] [int] NULL,
	[itemremarks] [varchar](500) NULL,
	[buisnesssegment] [int] NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[lastfollowupdate] [datetime] NULL,
	[nextfollowupdate] [datetime] NULL,
	[uom] [varchar](20) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_qoute_pi_levies_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_mktg].[dtl_qoute_pi_levies_tvp] AS TABLE(
	[id] [bigint] NULL,
	[piid] [bigint] NULL,
	[levyid] [int] NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_quote_pi_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_mktg].[dtl_quote_pi_tvp] AS TABLE(
	[id] [bigint] NULL,
	[piid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[billingdescription] [varchar](200) NULL,
	[uom] [varchar](15) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[mrp] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[netrate] [decimal](13, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 3) NULL,
	[totalamt] [decimal](13, 2) NULL,
	[remarks] [varchar](100) NULL,
	[focqty] [decimal](15, 3) NULL,
	[hsnid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_quote_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_mktg].[dtl_quote_tvp] AS TABLE(
	[id] [bigint] NULL,
	[quoteid] [bigint] NOT NULL,
	[itemid] [bigint] NOT NULL,
	[billingdescription] [varchar](200) NULL,
	[isfoc] [bit] NULL,
	[issample] [bit] NULL,
	[specialcode] [varchar](50) NULL,
	[packing] [varchar](25) NULL,
	[uom] [varchar](15) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](10, 2) NULL,
	[sgstrate] [decimal](10, 2) NULL,
	[cgstrate] [decimal](10, 2) NULL,
	[cessrate] [decimal](10, 2) NULL,
	[basicamount] [decimal](13, 3) NULL,
	[mrp] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[netrate] [decimal](13, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 3) NULL,
	[totalamt] [decimal](13, 3) NULL,
	[remarks] [varchar](100) NULL,
	[qtyalreadydispatched] [decimal](10, 3) NULL,
	[qtytodispatch] [decimal](10, 3) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[focqty] [decimal](10, 3) NULL,
	[itemtype] [char](1) NULL,
	[hsnid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_sale_levies_tvp]    Script Date: 1/15/2020 8:33:20 PM ******/
CREATE TYPE [db_mktg].[dtl_sale_levies_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[piid] [bigint] NOT NULL,
	[levyid] [int] NOT NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[dtl_sale_paymentterms_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[dtl_sale_paymentterms_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[invid] [bigint] NOT NULL,
	[srno] [int] NULL,
	[paymentterm] [varchar](300) NOT NULL,
	[percent] [decimal](6, 2) NULL,
	[amount] [decimal](15, 5) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[enquirycategory_userrights_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[enquirycategory_userrights_tvp] AS TABLE(
	[id] [int] NULL,
	[userid] [int] NULL,
	[categoryid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_enq_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[hdr_enq_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[enqno] [bigint] NOT NULL,
	[enqdate] [date] NOT NULL,
	[enqsourceid] [int] NOT NULL,
	[enqtype] [int] NULL,
	[custtype] [char](1) NULL,
	[marketexecutive] [int] NULL,
	[fwdmarketexcecutive] [int] NULL,
	[businesssegment] [int] NULL,
	[enqstage] [int] NULL,
	[buisnesssizeid] [int] NULL,
	[custinteractiondoneby] [bigint] NULL,
	[custinteractiondoneon] [datetime] NULL,
	[custinteractionremarks] [varchar](max) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](500) NULL,
	[customeraddr1] [varchar](500) NULL,
	[customeraddr2] [varchar](500) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](20) NULL,
	[contactname] [varchar](200) NULL,
	[contactphone] [varchar](50) NULL,
	[contactdesignation] [varchar](100) NULL,
	[contactdept] [varchar](100) NULL,
	[contactemail] [varchar](100) NULL,
	[quoteid] [bigint] NULL,
	[quoteNo] [varchar](100) NULL,
	[quotedate] [date] NULL,
	[userid] [int] NULL,
	[enqstatus] [int] NULL,
	[enqstatusremarks] [varchar](max) NULL,
	[IsEnqFwd] [bit] NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[lastfollowupdate] [datetime] NULL,
	[nextfollowupdate] [datetime] NULL,
	[IsTender] [bit] NULL,
	[tender_openingon] [datetime] NULL,
	[tender_publishon] [datetime] NULL,
	[tender_dueon] [datetime] NULL,
	[enqrefremarks] [varchar](500) NULL,
	[splattn] [bit] NULL,
	[splremarks] [varchar](500) NULL,
	[tenderfee] [decimal](15, 2) NULL,
	[emdamt] [decimal](15, 2) NULL,
	[BGamt] [decimal](15, 2) NULL,
	[BGper] [varchar](10) NULL,
	[iscustomermeetingdone] [bit] NULL,
	[ishold] [bit] NULL,
	[holddate] [date] NULL,
	[holdremark] [varchar](300) NULL,
	[rejectionid] [int] NULL,
	[rejectionremark] [varchar](300) NULL,
	[intimationto] [int] NULL,
	[dealerid] [varchar](100) NULL,
	[deptid] [varchar](100) NULL,
	[country] [varchar](100) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_enqbseg_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[hdr_enqbseg_tvp] AS TABLE(
	[id] [bigint] NULL,
	[parentid] [int] NULL,
	[value] [decimal](18, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_quote_pi_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[hdr_quote_pi_tvp] AS TABLE(
	[id] [bigint] NULL,
	[piid] [bigint] NULL,
	[pino] [bigint] NULL,
	[pidate] [date] NULL,
	[quoteid] [bigint] NULL,
	[marketexecutive] [int] NULL,
	[custtype] [char](1) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](500) NULL,
	[customeraddr1] [varchar](max) NULL,
	[customeraddr2] [varchar](max) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[country] [varchar](100) NULL,
	[quoteNo] [varchar](100) NULL,
	[quotedate] [date] NULL,
	[bsegment] [int] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[totalamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 2) NULL,
	[roundoff] [decimal](6, 3) NULL,
	[userid] [int] NULL,
	[cancelledon] [datetime] NULL,
	[cancelledbyuserid] [int] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[pitype] [varchar](10) NULL,
	[isconverttoorder] [bit] NULL,
	[ordertype] [int] NULL,
	[conversionrate] [decimal](10, 2) NULL,
	[Currency] [varchar](10) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdr_sale_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[hdr_sale_tvp] AS TABLE(
	[id] [bigint] NULL,
	[quoteid] [bigint] NULL,
	[oaids] [varchar](200) NULL,
	[pino] [bigint] NULL,
	[pidate] [date] NULL,
	[confirmed] [bit] NULL,
	[confirmedbyuserid] [bigint] NULL,
	[confirmedon] [datetime] NULL,
	[invno] [bigint] NULL,
	[invdate] [date] NULL,
	[revisedbyuserid] [int] NULL,
	[revisedon] [datetime] NULL,
	[cancelledon] [datetime] NULL,
	[cancelledbyuserid] [bigint] NULL,
	[invprefix] [varchar](20) NULL,
	[invpostfix] [varchar](20) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](200) NULL,
	[customeraddr1] [varchar](100) NULL,
	[customeraddr2] [varchar](100) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[billtocustomerid] [bigint] NULL,
	[billtocustomername] [varchar](100) NULL,
	[billtocustomeraddr1] [varchar](100) NULL,
	[billtocustomeraddr2] [varchar](100) NULL,
	[billtocity] [varchar](50) NULL,
	[billtostate] [varchar](50) NULL,
	[billtopin] [varchar](12) NULL,
	[billtocustomergstno] [varchar](20) NULL,
	[consigneecustomerid] [bigint] NULL,
	[consigneecustomername] [varchar](100) NULL,
	[consigneecustomeraddr1] [varchar](100) NULL,
	[consigneecustomeraddr2] [varchar](100) NULL,
	[consigneecity] [varchar](50) NULL,
	[consigneestate] [varchar](50) NULL,
	[consigneepin] [varchar](12) NULL,
	[consigneecustomergstno] [varchar](20) NULL,
	[custPoNo] [varchar](100) NULL,
	[custPodate] [date] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[invamt] [decimal](13, 2) NULL,
	[userid] [bigint] NULL,
	[approvedbymarketingheaduserid] [bigint] NULL,
	[approvedbycommercialuserid] [bigint] NULL,
	[approvedbyaccountsuserid] [bigint] NULL,
	[remarks] [varchar](500) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[invoicetype] [varchar](20) NULL,
	[currency] [varchar](3) NULL,
	[conversionrate] [decimal](10, 3) NULL,
	[invcertification] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[hdrquote_tvp]    Script Date: 1/15/2020 8:33:21 PM ******/
CREATE TYPE [db_mktg].[hdrquote_tvp] AS TABLE(
	[id] [bigint] NULL,
	[quoteid] [bigint] NULL,
	[quoteno] [bigint] NULL,
	[quotedate] [date] NULL,
	[enqid] [bigint] NULL,
	[marketexecutive] [int] NULL,
	[custtype] [char](1) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](200) NULL,
	[customeraddr1] [varchar](100) NULL,
	[customeraddr2] [varchar](100) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[customercontactpersonname] [varchar](50) NULL,
	[customercontactpersonphone] [varchar](50) NULL,
	[customercontactpersondesignation] [varchar](50) NULL,
	[customercontactpersondepartment] [varchar](50) NULL,
	[enqNo] [varchar](100) NULL,
	[enqdate] [date] NULL,
	[quotstage] [int] NULL,
	[bsegment] [int] NULL,
	[ourquoteno] [varchar](100) NULL,
	[ourquotedate] [date] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[orderamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 2) NULL,
	[roundoff] [decimal](6, 3) NULL,
	[userid] [bigint] NULL,
	[orderstatus] [varchar](50) NULL,
	[remarks] [varchar](500) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[quoteratetype] [int] NULL,
	[senderinfo] [varchar](max) NULL,
	[country] [varchar](100) NULL,
	[ordertype] [int] NULL,
	[conversionrate] [decimal](10, 2) NULL,
	[currency] [varchar](12) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_documentsreqd_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_documentsreqd_tvp] AS TABLE(
	[id] [int] NULL,
	[quoteid] [int] NULL,
	[srno] [int] NULL,
	[documentid] [int] NULL,
	[documentinfo] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_dtl_sale_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_dtl_sale_tvp] AS TABLE(
	[id] [bigint] NULL,
	[fyid] [int] NULL,
	[invid] [bigint] NULL,
	[oaid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[billingdescription] [varchar](200) NULL,
	[isfoc] [bit] NULL,
	[issample] [bit] NULL,
	[specialcode] [varchar](50) NULL,
	[packing] [varchar](25) NULL,
	[uom] [varchar](25) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](13, 2) NULL,
	[netrate] [decimal](13, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[qtyalreadydispatched] [decimal](15, 3) NULL,
	[qtytodispatch] [decimal](15, 3) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 2) NULL,
	[totalamt] [decimal](13, 2) NULL,
	[remarks] [varchar](100) NULL,
	[batch] [varchar](20) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_images_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_images_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[quoteid] [bigint] NOT NULL,
	[srno] [int] NOT NULL,
	[imageinfo] [varchar](300) NOT NULL,
	[remarks] [varchar](max) NULL,
	[isactive] [bit] NOT NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_installationinfo_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_installationinfo_tvp] AS TABLE(
	[id] [int] NULL,
	[Quoteid] [int] NULL,
	[srno] [int] NULL,
	[installationid] [int] NULL,
	[installationinfo] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[Quote_paymentterms_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[Quote_paymentterms_tvp] AS TABLE(
	[id] [int] NULL,
	[Quoteid] [int] NULL,
	[srno] [int] NULL,
	[paymenttermid] [int] NULL,
	[paymentterm] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[percent] [decimal](6, 2) NULL,
	[amount] [decimal](15, 5) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_pi_paymentterms_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_pi_paymentterms_tvp] AS TABLE(
	[id] [int] NULL,
	[piid] [bigint] NULL,
	[srno] [int] NULL,
	[paymenttermid] [int] NULL,
	[paymentterm] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[percent] [decimal](6, 2) NULL,
	[amount] [decimal](15, 5) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_pi_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_pi_termsandconditions_tvp] AS TABLE(
	[id] [int] NULL,
	[piid] [bigint] NULL,
	[srno] [int] NULL,
	[termsandconditionsid] [int] NULL,
	[termsandcondition] [varchar](max) NULL,
	[createdby] [bigint] NULL,
	[createdon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_sale_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_sale_tvp] AS TABLE(
	[id] [bigint] NULL,
	[quoteid] [bigint] NULL,
	[oaids] [varchar](200) NULL,
	[pino] [bigint] NULL,
	[pidate] [date] NULL,
	[confirmed] [bit] NULL,
	[confirmedbyuserid] [bigint] NULL,
	[confirmedon] [date] NULL,
	[invno] [bigint] NULL,
	[invdate] [date] NULL,
	[revisedbyuserid] [int] NULL,
	[revisedon] [date] NULL,
	[cancelledon] [date] NULL,
	[cancelledbyuserid] [bigint] NULL,
	[invprefix] [varchar](20) NULL,
	[invpostfix] [varchar](20) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](200) NULL,
	[customeraddr1] [varchar](100) NULL,
	[customeraddr2] [varchar](100) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[billtocustomerid] [bigint] NULL,
	[billtocustomername] [varchar](100) NULL,
	[billtocustomeraddr1] [varchar](100) NULL,
	[billtocustomeraddr2] [varchar](100) NULL,
	[billtocity] [varchar](50) NULL,
	[billtostate] [varchar](50) NULL,
	[billtopin] [varchar](12) NULL,
	[billtocustomergstno] [varchar](20) NULL,
	[consigneecustomerid] [bigint] NULL,
	[consigneecustomername] [varchar](100) NULL,
	[consigneecustomeraddr1] [varchar](100) NULL,
	[consigneecustomeraddr2] [varchar](100) NULL,
	[consigneecity] [varchar](50) NULL,
	[consigneestate] [varchar](50) NULL,
	[consigneepin] [varchar](12) NULL,
	[consigneecustomergstno] [varchar](20) NULL,
	[custPoNo] [varchar](100) NULL,
	[custPodate] [date] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[invamt] [decimal](13, 2) NULL,
	[userid] [bigint] NULL,
	[approvedbymarketingheaduserid] [bigint] NULL,
	[approvedbycommercialuserid] [bigint] NULL,
	[approvedbyaccountsuserid] [bigint] NULL,
	[remarks] [varchar](500) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[invoicetype] [varchar](20) NULL,
	[currency] [varchar](3) NULL,
	[conversionrate] [decimal](10, 3) NULL,
	[invcertification] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quote_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quote_termsandconditions_tvp] AS TABLE(
	[id] [int] NULL,
	[quoteid] [int] NULL,
	[srno] [int] NULL,
	[termsandconditionsid] [int] NULL,
	[termsandcondition] [varchar](max) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mktg].[quoteproforma_tvp]    Script Date: 1/15/2020 8:33:22 PM ******/
CREATE TYPE [db_mktg].[quoteproforma_tvp] AS TABLE(
	[id] [bigint] NULL,
	[quoteid] [bigint] NULL,
	[quoteno] [bigint] NULL,
	[quotedate] [date] NULL,
	[enqid] [bigint] NULL,
	[marketexecutive] [int] NULL,
	[custtype] [char](1) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](200) NULL,
	[customeraddr1] [varchar](100) NULL,
	[customeraddr2] [varchar](100) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[customercontactpersonname] [varchar](50) NULL,
	[customercontactpersonphone] [varchar](50) NULL,
	[customercontactpersondesignation] [varchar](50) NULL,
	[customercontactpersondepartment] [varchar](50) NULL,
	[enqNo] [varchar](100) NULL,
	[enqdate] [date] NULL,
	[quotstage] [int] NULL,
	[bsegment] [int] NULL,
	[ourquoteno] [varchar](100) NULL,
	[ourquotedate] [date] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[orderamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 2) NULL,
	[roundoff] [decimal](6, 3) NULL,
	[userid] [bigint] NULL,
	[orderstatus] [varchar](50) NULL,
	[remarks] [varchar](500) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[quoteratetype] [int] NULL,
	[senderinfo] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_bom_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_bom_tvp] AS TABLE(
	[id] [int] NULL,
	[bomid] [int] NOT NULL,
	[pid] [int] NOT NULL,
	[cid] [int] NOT NULL,
	[unit] [int] NOT NULL,
	[quantity] [decimal](15, 3) NOT NULL,
	[tolerance] [decimal](15, 3) NULL,
	[brandid] [int] NOT NULL,
	[wastagequantity] [decimal](15, 3) NULL,
	[wastagepercent] [decimal](15, 3) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[componentweight] [decimal](15, 3) NULL,
	[rmtype] [int] NULL,
	[length] [decimal](15, 3) NULL,
	[width] [decimal](15, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_catgdimension_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_catgdimension_tvp] AS TABLE(
	[id] [int] NULL,
	[dimensionid] [int] NOT NULL,
	[createdby] [int] NULL,
	[createdon] [date] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_destruction_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_destruction_tvp] AS TABLE(
	[id] [int] NULL,
	[destructionid] [int] NULL,
	[itemid] [int] NULL,
	[suplid] [bigint] NULL,
	[quantity] [decimal](15, 3) NULL,
	[itemrate] [decimal](15, 5) NULL,
	[brandid] [int] NULL,
	[arnumber] [varchar](20) NULL,
	[grnno] [bigint] NULL,
	[batchno] [varchar](20) NULL,
	[batchmfgdate] [date] NULL,
	[batchexpdate] [date] NULL,
	[destructionreason] [nvarchar](100) NULL,
	[destructionmode] [nvarchar](50) NULL,
	[igstamount] [decimal](15, 2) NULL,
	[cgstamount] [decimal](15, 2) NULL,
	[sgstamount] [decimal](15, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_dpr_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_dpr_tvp] AS TABLE(
	[id] [int] NULL,
	[dprid] [int] NULL,
	[itemid] [int] NULL,
	[quantity] [decimal](15, 3) NULL,
	[rejectedquantity] [decimal](15, 3) NULL,
	[rejectionreason] [int] NULL,
	[batchno] [varchar](25) NULL,
	[mfgdate] [datetime] NULL,
	[expirydate] [datetime] NULL,
	[retestdate] [datetime] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[approvedby] [int] NULL,
	[approvedon] [datetime] NULL,
	[brandid] [int] NULL,
	[bomid] [int] NULL,
	[arnumber] [varchar](15) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_grn_levies_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_grn_levies_tvp] AS TABLE(
	[id] [int] NULL,
	[grnid] [int] NULL,
	[levyid] [int] NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_grn_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_grn_tvp] AS TABLE(
	[id] [int] NULL,
	[grnid] [int] NULL,
	[itemid] [int] NULL,
	[quantitybilled] [decimal](15, 3) NULL,
	[quantityreceived] [decimal](15, 3) NULL,
	[quantityrejected] [decimal](15, 3) NULL,
	[quantitshortage] [decimal](15, 3) NULL,
	[quantitysurplus] [decimal](15, 3) NULL,
	[quantitybroken] [decimal](15, 3) NULL,
	[itemrate] [decimal](15, 5) NULL,
	[itemdiscount] [decimal](10, 2) NULL,
	[ratediff] [decimal](15, 5) NULL,
	[itemtax] [decimal](10, 2) NULL,
	[brandid] [int] NULL,
	[hsncode] [varchar](8) NULL,
	[arnumber] [bigint] NULL,
	[qtyissued] [decimal](15, 3) NULL,
	[receiptuom] [varchar](5) NULL,
	[issueuom] [varchar](5) NULL,
	[batchno] [bigint] NULL,
	[expirydate] [datetime] NULL,
	[mfgdate] [datetime] NULL,
	[orderid] [int] NULL,
	[gstid] [bigint] NULL,
	[igstamount] [decimal](15, 2) NULL,
	[cgstamount] [decimal](15, 2) NULL,
	[sgstamount] [decimal](15, 2) NULL,
	[sampleqty] [decimal](15, 3) NULL,
	[qcdate] [datetime] NULL,
	[qcby] [int] NULL,
	[nextqcdate] [datetime] NULL,
	[assay] [decimal](5, 2) NULL,
	[lod] [decimal](5, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_indent_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_indent_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[indentid] [int] NOT NULL,
	[itemid] [int] NOT NULL,
	[quantityrequired] [decimal](15, 3) NULL,
	[quantityapproved] [decimal](15, 3) NULL,
	[quantitywoff] [decimal](15, 3) NULL,
	[suplname] [varchar](50) NULL,
	[itemrate] [decimal](15, 5) NULL,
	[poid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[approvedby] [int] NULL,
	[approvedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[brandid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[requiredby] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_inwardadvice]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_inwardadvice] AS TABLE(
	[id] [int] NULL,
	[adviceid] [int] NULL,
	[itemid] [int] NULL,
	[rate] [decimal](15, 5) NULL,
	[quantity] [decimal](15, 3) NULL,
	[amount] [decimal](15, 2) NULL,
	[discount] [decimal](10, 2) NULL,
	[orderid] [int] NULL,
	[porate] [decimal](15, 5) NULL,
	[indentid] [int] NULL,
	[billquantity] [decimal](15, 3) NULL,
	[recdquantity] [decimal](15, 3) NULL,
	[igstamount] [decimal](15, 2) NULL,
	[cgstamount] [decimal](15, 2) NULL,
	[sgstamount] [decimal](15, 2) NULL,
	[cessamount] [decimal](15, 2) NULL,
	[passedordeleted] [varchar](1) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_inwardnote_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_inwardnote_tvp] AS TABLE(
	[id] [int] NULL,
	[noteid] [int] NULL,
	[itemid] [int] NULL,
	[adviceid] [int] NULL,
	[rate] [decimal](15, 5) NULL,
	[quantity] [decimal](15, 3) NULL,
	[amount] [decimal](15, 2) NULL,
	[igstamount] [decimal](15, 2) NULL,
	[cgstamount] [decimal](15, 2) NULL,
	[sgstamount] [decimal](15, 2) NULL,
	[reference] [varchar](150) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_issuance_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_issuance_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[issuanceid] [int] NULL,
	[itemid] [int] NOT NULL,
	[brandid] [int] NOT NULL,
	[grnid] [int] NOT NULL,
	[arno] [varchar](15) NULL,
	[requestedquantity] [decimal](15, 3) NULL,
	[issuedquantity] [decimal](15, 3) NULL,
	[remarks] [varchar](max) NULL,
	[batchno] [varchar](10) NULL,
	[expirydate] [datetime] NULL,
	[mfgdate] [datetime] NULL,
	[storeid] [bigint] NULL,
	[assay] [decimal](5, 2) NULL,
	[lod] [decimal](5, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_issuereturn_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_issuereturn_tvp] AS TABLE(
	[id] [int] NULL,
	[issuereturnid] [int] NULL,
	[itemid] [int] NULL,
	[quantityreturned] [decimal](15, 3) NULL,
	[arno] [varchar](15) NULL,
	[batch] [varchar](20) NULL,
	[returnreason] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_itemdimension_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_itemdimension_tvp] AS TABLE(
	[coid] [int] NULL,
	[boid] [int] NULL,
	[id] [int] NULL,
	[itemid] [int] NULL,
	[dimensionid] [int] NOT NULL,
	[value] [decimal](15, 3) NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [date] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_nrgp_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_nrgp_tvp] AS TABLE(
	[id] [int] NULL,
	[nrgpid] [int] NULL,
	[itemid] [int] NULL,
	[quantity] [decimal](15, 3) NULL,
	[amount] [decimal](15, 2) NULL,
	[itemuom] [varchar](10) NULL,
	[rate] [decimal](15, 2) NULL,
	[brandid] [int] NULL,
	[gstid] [bigint] NULL,
	[igstamount] [decimal](15, 2) NULL,
	[cgstamount] [decimal](15, 2) NULL,
	[sgstamount] [decimal](15, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_plan_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_plan_tvp] AS TABLE(
	[id] [int] NULL,
	[planid] [int] NULL,
	[productid] [int] NULL,
	[batchid] [int] NULL,
	[bomid] [int] NULL,
	[orderquantity] [decimal](15, 3) NULL,
	[samplequantity] [decimal](15, 3) NULL,
	[inventoryquantity] [decimal](15, 3) NULL,
	[totalquantity] [decimal](15, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_purchaseorder_tvp]    Script Date: 1/15/2020 8:33:23 PM ******/
CREATE TYPE [db_mm].[dtl_purchaseorder_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[itemid] [int] NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[receivedquantity] [decimal](15, 3) NULL,
	[itemname] [varchar](100) NULL,
	[itemrate] [decimal](15, 5) NULL,
	[itemuom] [varchar](10) NULL,
	[itemdiscount] [decimal](10, 2) NULL,
	[itemtax] [decimal](10, 2) NULL,
	[netrate] [decimal](10, 2) NULL,
	[indentid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[brandid] [int] NULL,
	[gstid] [bigint] NULL,
	[igstamount] [decimal](15, 2) NULL,
	[cgstamount] [decimal](15, 2) NULL,
	[sgstamount] [decimal](15, 2) NULL,
	[selectedbrandid] [int] NULL,
	[bomversion] [int] NULL,
	[discpercent] [decimal](6, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_requisition_arwise_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_requisition_arwise_tvp] AS TABLE(
	[id] [int] NULL,
	[reqnid] [int] NULL,
	[itemid] [int] NULL,
	[brandid] [int] NULL,
	[arno] [varchar](15) NULL,
	[requestedquantity] [decimal](15, 3) NULL,
	[issuedquantity] [decimal](15, 3) NULL,
	[woffquantity] [decimal](15, 3) NULL,
	[remarks] [varchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_requisition_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_requisition_tvp] AS TABLE(
	[id] [int] NULL,
	[reqnid] [int] NULL,
	[itemid] [int] NULL,
	[brandid] [int] NULL,
	[grnid] [int] NULL,
	[arno] [bigint] NULL,
	[requestedquantity] [decimal](15, 3) NULL,
	[issuedquantity] [decimal](15, 3) NULL,
	[woffquantity] [decimal](15, 3) NULL,
	[remarks] [varchar](max) NULL,
	[receivedby] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_rgp_returnitems_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_rgp_returnitems_tvp] AS TABLE(
	[id] [int] NULL,
	[rgpid] [int] NULL,
	[itemid] [int] NOT NULL,
	[qty] [decimal](15, 5) NULL,
	[brandid] [int] NULL,
	[expecteddate] [date] NULL,
	[itemspecification] [varchar](250) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_rgp_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_rgp_tvp] AS TABLE(
	[id] [int] NULL,
	[rgpid] [int] NOT NULL,
	[itemid] [int] NOT NULL,
	[qtysent] [decimal](15, 5) NULL,
	[rate] [decimal](15, 2) NULL,
	[brandid] [int] NULL,
	[approxvalue] [decimal](12, 3) NULL,
	[qtyrecdunused] [decimal](15, 5) NULL,
	[qtyrecdwoff] [decimal](15, 5) NULL,
	[qtyrecdrejected] [decimal](15, 5) NULL,
	[itemspecification] [varchar](250) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_stktransfer_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_stktransfer_tvp] AS TABLE(
	[id] [int] NULL,
	[stktransferid] [int] NULL,
	[itemid] [int] NULL,
	[quantity] [decimal](15, 3) NULL,
	[arno] [varchar](15) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_vendor_allocation_approval_list_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_vendor_allocation_approval_list_tvp] AS TABLE(
	[id] [int] NULL,
	[approvalid] [int] NULL,
	[listid] [int] NULL,
	[itemid] [int] NULL,
	[qtyapproved] [decimal](10, 3) NULL,
	[qtyrejected] [decimal](10, 3) NULL,
	[approvedrate] [decimal](15, 5) NULL,
	[remarksforappvl] [nvarchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[dtl_vendor_allocation_list_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[dtl_vendor_allocation_list_tvp] AS TABLE(
	[id] [int] NULL,
	[listid] [int] NULL,
	[indentid] [int] NULL,
	[itemid] [int] NULL,
	[suplid] [int] NULL,
	[quoteno] [varchar](20) NULL,
	[quotedate] [varchar](20) NULL,
	[quoterate] [decimal](15, 5) NULL,
	[itemquantity] [decimal](10, 3) NULL,
	[itemrate] [decimal](15, 5) NULL,
	[laborrate] [decimal](15, 5) NULL,
	[poid] [int] NULL,
	[brandid] [int] NULL,
	[qtyapproved] [decimal](15, 3) NULL,
	[remarks] [nvarchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[grnbatchwise_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[grnbatchwise_tvp] AS TABLE(
	[id] [int] NULL,
	[grnid] [int] NULL,
	[itemid] [int] NULL,
	[quantity] [decimal](15, 3) NULL,
	[brandid] [int] NULL,
	[arnumber] [varchar](15) NULL,
	[expirydate] [datetime] NULL,
	[mfgdate] [datetime] NULL,
	[orderid] [int] NULL,
	[batchno] [varchar](20) NULL,
	[sampleqty] [decimal](15, 3) NULL,
	[qcdate] [datetime] NULL,
	[qcby] [bigint] NULL,
	[nextqcdate] [datetime] NULL,
	[assay] [decimal](5, 2) NULL,
	[lod] [decimal](5, 2) NULL,
	[releasedate] [datetime] NULL,
	[sampledate] [datetime] NULL,
	[supplierretestdate] [datetime] NULL,
	[quantityrejected] [decimal](15, 5) NULL,
	[confirmdate] [datetime] NULL,
	[rejectionreasonid] [int] NULL,
	[qcexpirydate] [datetime] NULL,
	[confirmedby] [bigint] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_bom_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[hdr_bom_tvp] AS TABLE(
	[bomid] [int] NOT NULL,
	[productid] [int] NOT NULL,
	[version] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[revisedby] [int] NULL,
	[revisedon] [datetime] NULL,
	[revisedreason] [varchar](max) NULL,
	[amendedby] [int] NULL,
	[amendedon] [datetime] NULL,
	[amendentmentreason] [varchar](max) NULL,
	[confirmedby] [int] NULL,
	[confirmedon] [datetime] NULL,
	[approvedby] [int] NULL,
	[approvedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[drawingno] [varchar](100) NULL,
	[batchsize] [decimal](13, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_destruction_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[hdr_destruction_tvp] AS TABLE(
	[destructionid] [bigint] NULL,
	[destructionno] [bigint] NULL,
	[olnrno] [bigint] NULL,
	[presenceofuserid1] [bigint] NULL,
	[presenceofuserid2] [bigint] NULL,
	[presenceofuserid3] [bigint] NULL,
	[approvedbyproduction] [bigint] NULL,
	[approvedbystorehead] [bigint] NULL,
	[approvedbyqa] [bigint] NULL,
	[igstamt] [decimal](15, 5) NULL,
	[cgstamt] [decimal](15, 5) NULL,
	[sgstamt] [decimal](15, 5) NULL,
	[totalamt] [decimal](15, 5) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[fyid] [int] NULL,
	[othercharges] [decimal](15, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_dpr_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[hdr_dpr_tvp] AS TABLE(
	[dprid] [int] NULL,
	[dprdate] [datetime] NULL,
	[dprnumber] [int] NULL,
	[departmentid] [int] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[confirmedby] [int] NULL,
	[confirmedon] [datetime] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[manualslipno] [varchar](20) NULL,
	[fyid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_grn_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[hdr_grn_tvp] AS TABLE(
	[grnid] [int] NULL,
	[grndate] [datetime] NULL,
	[grnnumber] [int] NOT NULL,
	[grncategoryid] [int] NOT NULL,
	[gatenoteid] [int] NOT NULL,
	[storeid] [int] NOT NULL,
	[suplid] [int] NOT NULL,
	[poid] [varchar](30) NULL,
	[billamount] [decimal](15, 5) NULL,
	[totaltaxamount] [decimal](15, 5) NULL,
	[billdiscount] [decimal](15, 5) NULL,
	[billroundoff] [decimal](15, 5) NULL,
	[billno] [varchar](50) NULL,
	[billdate] [datetime] NULL,
	[chalanno] [nvarchar](50) NULL,
	[chalandate] [datetime] NULL,
	[gateentryno] [int] NULL,
	[gateentrydate] [datetime] NULL,
	[purchaseaccount] [int] NULL,
	[grno] [int] NULL,
	[grdate] [datetime] NULL,
	[drcrnoteno] [int] NULL,
	[billpassamount] [decimal](15, 5) NULL,
	[boid] [int] NULL,
	[coid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NULL,
	[suplname] [nvarchar](max) NULL,
	[supladdress1] [nvarchar](max) NULL,
	[supladdress2] [nvarchar](max) NULL,
	[suplcity] [nvarchar](500) NULL,
	[suplstate] [nvarchar](500) NULL,
	[suplpincode] [nvarchar](6) NULL,
	[suplphoneno] [nvarchar](500) NULL,
	[igstamount] [decimal](15, 5) NULL,
	[cgstamount] [decimal](15, 5) NULL,
	[sgstamount] [decimal](15, 5) NULL,
	[freightandoctroi] [decimal](15, 5) NULL,
	[othercharges] [decimal](15, 5) NULL,
	[customduty] [decimal](15, 5) NULL,
	[otherdiscount] [decimal](15, 5) NULL,
	[jobworkamount] [decimal](15, 5) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_indent_tvp]    Script Date: 1/15/2020 8:33:24 PM ******/
CREATE TYPE [db_mm].[hdr_indent_tvp] AS TABLE(
	[indentid] [int] NOT NULL,
	[indentdate] [datetime] NOT NULL,
	[indentnumber] [int] NOT NULL,
	[indentpriority] [int] NULL,
	[indentorid] [int] NOT NULL,
	[departmentid] [int] NOT NULL,
	[billingdescription] [varchar](max) NULL,
	[remarks] [varchar](max) NULL,
	[costcentreid] [int] NOT NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[isactive] [bit] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[manualslipno] [varchar](20) NULL,
	[isjobwork] [bit] NULL,
	[productid] [int] NULL,
	[bomid] [int] NULL,
	[lotsize] [decimal](10, 3) NULL,
	[fyid] [int] NOT NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_inwardnote_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_inwardnote_tvp] AS TABLE(
	[noteid] [int] NULL,
	[noteno] [bigint] NULL,
	[notedate] [datetime] NULL,
	[notetype] [varchar](1) NULL,
	[billno] [varchar](30) NULL,
	[billdate] [datetime] NULL,
	[partyacid] [bigint] NULL,
	[purchaseacid] [bigint] NULL,
	[inwardid] [int] NULL,
	[drcrvoucherno] [bigint] NULL,
	[amount] [decimal](15, 5) NULL,
	[boid] [int] NULL,
	[coid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_issuance_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_issuance_tvp] AS TABLE(
	[issuanceid] [int] NULL,
	[issuanceno] [int] NOT NULL,
	[reqnid] [int] NOT NULL,
	[reqnno] [int] NOT NULL,
	[batchno] [varchar](10) NULL,
	[deptid] [int] NOT NULL,
	[costcentreid] [int] NULL,
	[storeid] [int] NOT NULL,
	[manualslipno] [varchar](10) NULL,
	[issuancedate] [datetime] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[confirmedby] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NOT NULL,
	[batchmfgdate] [date] NULL,
	[batchexpirydate] [date] NULL,
	[collectedby] [varchar](100) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_issuereturn_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_issuereturn_tvp] AS TABLE(
	[issuereturnid] [int] NULL,
	[issuereturnno] [int] NULL,
	[issuanceid] [int] NULL,
	[departmentid] [int] NULL,
	[storeid] [int] NULL,
	[costcentreid] [int] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_nrgp_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_nrgp_tvp] AS TABLE(
	[nrgpid] [int] NULL,
	[nrgpno] [int] NULL,
	[partyid] [int] NULL,
	[invid] [int] NULL,
	[invno] [int] NULL,
	[invdate] [datetime] NULL,
	[outtime] [time](7) NULL,
	[transportid] [int] NULL,
	[vehicletypeid] [int] NULL,
	[vehiclename] [nvarchar](50) NULL,
	[vehicleno] [int] NULL,
	[employeeid] [int] NULL,
	[deptid] [int] NULL,
	[storeid] [int] NULL,
	[boid] [int] NULL,
	[coid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deliveryaddress] [nvarchar](max) NULL,
	[fyid] [int] NULL,
	[approvedby] [int] NULL,
	[approvedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_plan_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_plan_tvp] AS TABLE(
	[planid] [int] NOT NULL,
	[planno] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[plandate] [datetime] NOT NULL,
	[confirmedby] [int] NULL,
	[confirmedon] [datetime] NULL,
	[approvedby] [int] NULL,
	[approvedon] [datetime] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_purchaseorder_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_purchaseorder_tvp] AS TABLE(
	[orderid] [int] NULL,
	[orderdate] [datetime] NULL,
	[ordernumber] [int] NULL,
	[ordertype] [varchar](1) NULL,
	[suplid] [int] NULL,
	[suplname] [nvarchar](2000) NULL,
	[supladdress1] [nvarchar](max) NULL,
	[supladdress2] [nvarchar](max) NULL,
	[suplcity] [nvarchar](500) NULL,
	[suplstate] [nvarchar](500) NULL,
	[suplpincode] [nvarchar](6) NULL,
	[suplphoneNo] [nvarchar](200) NULL,
	[suplcontactperson] [nvarchar](500) NULL,
	[supltaxregistrationnumber] [nvarchar](200) NULL,
	[billingaddress] [nvarchar](max) NULL,
	[billingcity] [nvarchar](500) NULL,
	[billingstate] [nvarchar](500) NULL,
	[billingpincode] [nvarchar](50) NULL,
	[billinggstin] [nvarchar](200) NULL,
	[shippingaddress] [nvarchar](max) NULL,
	[shippingcity] [nvarchar](500) NULL,
	[shippingstate] [nvarchar](500) NULL,
	[shippingpincode] [nvarchar](50) NULL,
	[shippinggstin] [nvarchar](50) NULL,
	[quotationid] [int] NULL,
	[poamount] [decimal](15, 5) NULL,
	[potaxamount] [decimal](15, 5) NULL,
	[podiscount] [decimal](15, 5) NULL,
	[pofrieghtamount] [decimal](15, 5) NULL,
	[amendmentnumber] [int] NULL,
	[frieghttype] [varchar](10) NULL,
	[customduty] [decimal](15, 5) NULL,
	[clgfwdcharges] [decimal](15, 5) NULL,
	[taxonclgfwdcharges] [decimal](15, 5) NULL,
	[currency] [varchar](2) NULL,
	[currencyrate] [decimal](15, 5) NULL,
	[postatus] [varchar](1) NULL,
	[boid] [int] NULL,
	[coid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[shiptoid] [int] NULL,
	[billtoid] [int] NULL,
	[fyid] [int] NULL,
	[quotationref] [nvarchar](200) NULL,
	[costcentreid] [bigint] NULL,
	[isjobwork] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_requisition_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_requisition_tvp] AS TABLE(
	[reqnid] [int] NOT NULL,
	[reqnno] [int] NOT NULL,
	[batchno] [varchar](10) NULL,
	[deptid] [int] NOT NULL,
	[costcentreid] [int] NULL,
	[storeid] [int] NOT NULL,
	[manualslipno] [varchar](10) NULL,
	[reqndate] [datetime] NULL,
	[isconfirm] [bit] NOT NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[confirmedby] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NULL,
	[productid] [int] NULL,
	[bomid] [int] NULL,
	[lotsize] [decimal](10, 3) NULL,
	[batchmfgdate] [date] NULL,
	[batchexpirydate] [date] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_rgp_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_rgp_tvp] AS TABLE(
	[id] [int] NULL,
	[rgpno] [int] NOT NULL,
	[rgpdate] [datetime] NULL,
	[orderid] [int] NULL,
	[partyid] [int] NOT NULL,
	[outtime] [time](7) NULL,
	[transportid] [int] NULL,
	[vehicletypeid] [int] NULL,
	[vehiclename] [nvarchar](50) NULL,
	[vehicleno] [nvarchar](20) NULL,
	[userid] [int] NULL,
	[cosigneeid] [bigint] NULL,
	[deliveryaddress] [nvarchar](max) NULL,
	[approvedby] [int] NULL,
	[approvedon] [datetime] NULL,
	[grno] [int] NULL,
	[grdate] [datetime] NULL,
	[deptid] [int] NULL,
	[storeid] [int] NULL,
	[boid] [int] NOT NULL,
	[coid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[remarks] [nvarchar](max) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[employeeid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_stktransfer_tvp]    Script Date: 1/15/2020 8:33:25 PM ******/
CREATE TYPE [db_mm].[hdr_stktransfer_tvp] AS TABLE(
	[stktransferid] [int] NULL,
	[stktransferno] [int] NULL,
	[manualslipno] [bigint] NULL,
	[trntype] [char](1) NULL,
	[departmentid] [int] NULL,
	[receivingstoreid] [int] NULL,
	[issuingstoreid] [int] NULL,
	[issuingboid] [int] NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[fyid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[hdr_vendor_allocation_list_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[hdr_vendor_allocation_list_tvp] AS TABLE(
	[listid] [bigint] NULL,
	[listno] [bigint] NULL,
	[listdate] [datetime] NULL,
	[userid] [int] NULL,
	[valuecustorder] [decimal](15, 3) NULL,
	[valuestkorder] [decimal](15, 3) NULL,
	[remarks] [varchar](max) NULL,
	[coid] [bigint] NULL,
	[boid] [int] NULL,
	[isactive] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[issuancebatchwise_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[issuancebatchwise_tvp] AS TABLE(
	[id] [int] NULL,
	[issuanceid] [bigint] NULL,
	[itemid] [int] NULL,
	[issuedquantity] [decimal](15, 3) NULL,
	[brandid] [bigint] NULL,
	[arno] [varchar](15) NULL,
	[batchno] [varchar](10) NULL,
	[expirydate] [datetime] NULL,
	[mfgdate] [datetime] NULL,
	[storeid] [bigint] NULL,
	[assay] [decimal](5, 2) NULL,
	[lod] [decimal](5, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[item_brands_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[item_brands_tvp] AS TABLE(
	[id] [int] NULL,
	[brandid] [int] NULL,
	[itemid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[item_types_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[item_types_tvp] AS TABLE(
	[id] [int] NULL,
	[typeid] [int] NULL,
	[itemid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[itemcategories_userrights_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[itemcategories_userrights_tvp] AS TABLE(
	[id] [int] NULL,
	[userid] [int] NULL,
	[itemcategoryid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[mst_gst_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[mst_gst_tvp] AS TABLE(
	[gstid] [int] NOT NULL,
	[description] [varchar](35) NOT NULL,
	[hsncode] [varchar](15) NOT NULL,
	[code] [varchar](5) NULL,
	[igst] [decimal](8, 2) NOT NULL,
	[cgst] [decimal](8, 2) NOT NULL,
	[sgst] [decimal](8, 2) NOT NULL,
	[cess] [decimal](8, 2) NULL,
	[igstinputacid] [numeric](8, 0) NULL,
	[cgstinputacid] [numeric](8, 0) NULL,
	[sgstinputacid] [numeric](8, 0) NULL,
	[cessinputacid] [numeric](8, 0) NULL,
	[igstoutputacid] [numeric](8, 0) NULL,
	[cgstoutputacid] [numeric](8, 0) NULL,
	[sgstoutputacid] [numeric](8, 0) NULL,
	[cessoutputacid] [numeric](8, 0) NULL,
	[remarks] [varchar](max) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[concessionaligst] [decimal](8, 3) NULL,
	[concessionalcgst] [decimal](8, 3) NULL,
	[concessionalsgst] [decimal](8, 3) NULL,
	[saleacid] [bigint] NULL,
	[purchaseacid] [bigint] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[mst_item]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[mst_item] AS TABLE(
	[id] [int] NOT NULL,
	[itemcategoryid] [int] NOT NULL,
	[itemcode] [varchar](50) NOT NULL,
	[itemname] [varchar](100) NOT NULL,
	[itemalias] [varchar](100) NULL,
	[billingdescription] [varchar](max) NULL,
	[itemspecification] [varchar](max) NULL,
	[oldcode] [varchar](50) NULL,
	[specialcode] [varchar](50) NULL,
	[hsncode] [varchar](80) NULL,
	[taxrate] [decimal](15, 5) NULL,
	[receivingunitid] [int] NOT NULL,
	[issuingunitid] [int] NULL,
	[unitconversionfactor] [varchar](50) NULL,
	[itemimage] [varchar](100) NULL,
	[itemdrawing] [varchar](100) NULL,
	[openingstock] [decimal](12, 3) NULL,
	[openingstockissuingunit] [decimal](12, 3) NULL,
	[openingrate] [decimal](15, 5) NULL,
	[openingvalue] [decimal](15, 5) NULL,
	[landedrate] [decimal](15, 5) NULL,
	[lastpurchaserate] [decimal](15, 5) NULL,
	[eoq] [decimal](12, 3) NULL,
	[moq] [decimal](12, 3) NULL,
	[itemclassABC] [varchar](1) NULL,
	[minlevel] [decimal](12, 3) NULL,
	[maxlevel] [decimal](12, 3) NULL,
	[rol] [decimal](12, 3) NULL,
	[previousitemid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[location] [varchar](50) NULL,
	[accessories] [varchar](max) NULL,
	[remarks] [varchar](max) NULL,
	[packing] [varchar](32) NULL,
	[gstid] [bigint] NULL,
	[mrp] [decimal](13, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[mst_item_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[mst_item_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[itemcategoryid] [int] NOT NULL,
	[itemcode] [varchar](50) NOT NULL,
	[itemname] [varchar](100) NOT NULL,
	[itemalias] [varchar](100) NULL,
	[billingdescription] [varchar](max) NULL,
	[itemspecification] [varchar](max) NULL,
	[oldcode] [varchar](50) NULL,
	[specialcode] [varchar](50) NULL,
	[hsncode] [varchar](80) NULL,
	[taxrate] [decimal](15, 5) NULL,
	[receivingunitid] [int] NOT NULL,
	[issuingunitid] [int] NULL,
	[unitconversionfactor] [varchar](50) NULL,
	[itemimage] [varchar](100) NULL,
	[itemdrawing] [varchar](100) NULL,
	[openingstock] [decimal](12, 3) NULL,
	[openingstockissuingunit] [decimal](12, 3) NULL,
	[openingrate] [decimal](15, 5) NULL,
	[openingvalue] [decimal](15, 5) NULL,
	[landedrate] [decimal](15, 5) NULL,
	[lastpurchaserate] [decimal](15, 5) NULL,
	[eoq] [decimal](12, 3) NULL,
	[moq] [decimal](12, 3) NULL,
	[itemclassABC] [varchar](1) NULL,
	[minlevel] [decimal](12, 3) NULL,
	[maxlevel] [decimal](12, 3) NULL,
	[rol] [decimal](12, 3) NULL,
	[previousitemid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[location] [varchar](50) NULL,
	[accessories] [varchar](max) NULL,
	[remarks] [varchar](max) NULL,
	[packing] [varchar](32) NULL,
	[gstid] [bigint] NULL,
	[mrp] [decimal](13, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_deliveryschedule_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[purchase_deliveryschedule_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[itemid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[deliverydate] [datetime] NULL,
	[requiredqty] [decimal](10, 3) NULL,
	[receivedqty] [decimal](10, 3) NULL,
	[receivedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_followup_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[purchase_followup_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[date] [datetime] NULL,
	[contactperson] [varchar](50) NULL,
	[contactphone] [varchar](30) NULL,
	[remarks] [nvarchar](max) NULL,
	[settled] [bit] NULL DEFAULT ((0))
)
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_paymentterms_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[purchase_paymentterms_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[paymenttermid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[paymentterm] [varchar](300) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[purchase_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[purchase_termsandconditions_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[termsandconditionsid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL,
	[termsandcondition] [varchar](300) NULL
)
GO
/****** Object:  UserDefinedTableType [db_mm].[supplier_items_tvp]    Script Date: 1/15/2020 8:33:26 PM ******/
CREATE TYPE [db_mm].[supplier_items_tvp] AS TABLE(
	[id] [int] NULL,
	[suplid] [int] NULL,
	[itemid] [int] NULL,
	[brandid] [int] NULL,
	[suplitemcode] [varchar](50) NULL,
	[suplitemrate] [decimal](15, 5) NULL,
	[leadtimeair] [decimal](5, 2) NULL,
	[leadtimesurface] [decimal](5, 2) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[isactive] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_mt].[hdr_ticket_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_mt].[hdr_ticket_tvp] AS TABLE(
	[id] [bigint] NULL,
	[mtno] [bigint] NULL,
	[mtdate] [date] NULL,
	[mttime] [time](7) NULL,
	[mtduedate] [date] NULL,
	[mtduetime] [time](7) NULL,
	[mtmoid] [bigint] NULL,
	[mttype] [char](1) NULL,
	[mtcatg] [char](1) NULL,
	[mttempid] [bigint] NULL,
	[mtdeptid] [int] NULL,
	[mtassetid] [bigint] NULL,
	[mtassetlocation] [varchar](100) NULL,
	[mtfreqid] [smallint] NULL,
	[mtpriorityid] [smallint] NULL,
	[mtownerid] [bigint] NULL,
	[mtstatusid] [smallint] NULL,
	[mtlastmaintdate] [date] NULL,
	[mtproblem] [nvarchar](1000) NULL,
	[mtdelaydays] [smallint] NULL,
	[mtdocuploaded] [bit] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_jobcard_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[dtl_jobcard_tvp] AS TABLE(
	[id] [bigint] NULL,
	[jobid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[quantityrequested] [decimal](13, 2) NULL,
	[quantitydelivered] [decimal](13, 2) NULL,
	[stage] [int] NULL,
	[userid] [int] NULL,
	[status] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_productionplan_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[dtl_productionplan_tvp] AS TABLE(
	[id] [bigint] NULL,
	[planid] [bigint] NULL,
	[oaid] [bigint] NULL,
	[itemid] [int] NULL,
	[bomid] [int] NULL,
	[domqty] [decimal](15, 3) NULL,
	[expqty] [decimal](15, 3) NULL,
	[stockqty] [decimal](15, 3) NULL,
	[finalqty] [decimal](15, 3) NULL,
	[instructioninfo] [nvarchar](500) NULL,
	[productcp] [decimal](15, 2) NULL,
	[wipstage] [varchar](30) NULL,
	[wipcost] [decimal](15, 2) NULL,
	[itemtypeid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_releasebatch_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[dtl_releasebatch_tvp] AS TABLE(
	[id] [bigint] NULL,
	[batchid] [bigint] NULL,
	[qtytobereleased] [decimal](12, 3) NULL,
	[releasedate] [datetime] NULL,
	[userid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[dtl_wo_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[dtl_wo_tvp] AS TABLE(
	[id] [bigint] NULL,
	[woid] [bigint] NULL,
	[oaid] [bigint] NULL,
	[itemid] [int] NULL,
	[bomid] [int] NULL,
	[quantity] [decimal](15, 3) NULL,
	[expectedcompletiondate] [datetime] NULL,
	[deliverypromised] [datetime] NULL,
	[wipstage] [varchar](30) NULL,
	[wipcost] [decimal](15, 2) NULL,
	[itemtypeid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[generaterequisition_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[generaterequisition_tvp] AS TABLE(
	[itemid] [bigint] NULL,
	[itemtypeid] [int] NULL,
	[netReqd] [decimal](13, 2) NULL,
	[quantity] [decimal](13, 2) NULL,
	[level] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[hdr_jobcard_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[hdr_jobcard_tvp] AS TABLE(
	[jobid] [bigint] NULL,
	[batchid] [bigint] NULL,
	[supervisorid] [int] NULL,
	[startdate] [datetime] NULL,
	[enddate] [datetime] NULL,
	[status] [int] NULL DEFAULT ((0)),
	[isactive] [bit] NULL DEFAULT ((0))
)
GO
/****** Object:  UserDefinedTableType [db_production].[hdr_productionplan_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[hdr_productionplan_tvp] AS TABLE(
	[planid] [int] NULL,
	[plandate] [datetime] NULL,
	[oaid] [bigint] NULL,
	[planno] [varchar](15) NULL,
	[remarks] [varchar](300) NULL,
	[status] [varchar](30) NULL,
	[considerschedule] [bit] NULL,
	[confirmedon] [datetime] NULL,
	[confirmedby] [int] NULL,
	[approvedon] [datetime] NULL,
	[approvedby] [int] NULL,
	[isactive] [bit] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[hdr_wo_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[hdr_wo_tvp] AS TABLE(
	[woid] [int] NOT NULL,
	[wodate] [datetime] NULL,
	[wono] [varchar](15) NULL,
	[wocategoryid] [int] NULL,
	[remarks] [varchar](300) NULL,
	[status] [varchar](30) NULL,
	[expectedstartdate] [datetime] NULL,
	[expectedcompletiondate] [datetime] NULL,
	[actualstartdate] [datetime] NULL,
	[actualcompletiondate] [datetime] NULL,
	[boid] [int] NULL,
	[coid] [int] NULL,
	[isactive] [bit] NOT NULL,
	[fyid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[itemparameters_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[itemparameters_tvp] AS TABLE(
	[id] [int] NULL,
	[itemid] [int] NULL,
	[qtyofferedtoqc] [int] NULL,
	[isrework] [bit] NULL,
	[okqty] [decimal](18, 0) NULL,
	[toreworkqty] [int] NULL,
	[rejqty] [decimal](18, 0) NULL,
	[reworkreasonid] [int] NULL,
	[rejreasonid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[jobheader_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[jobheader_tvp] AS TABLE(
	[id] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[batchdate] [varchar](1) NULL,
	[batchid] [bigint] NULL,
	[supervisorid] [int] NULL,
	[templateid] [int] NULL,
	[fromstageid] [int] NULL,
	[tostageid] [int] NULL,
	[dateofrelease] [varchar](1) NULL,
	[timeofrelease] [varchar](1) NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[machineparameters_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[machineparameters_tvp] AS TABLE(
	[id] [int] NULL,
	[itemid] [int] NULL,
	[machineid] [int] NULL,
	[operatorid] [int] NULL,
	[actualtimetaken] [varchar](1) NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[mst_template_movementcard_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[mst_template_movementcard_tvp] AS TABLE(
	[id] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[templatename] [nvarchar](50) NULL,
	[itemid] [bigint] NULL,
	[effectivefromdate] [datetime] NULL,
	[isactive] [bit] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[deactivatedby] [int] NULL,
	[deactivatedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[template_equipments_movementcard_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[template_equipments_movementcard_tvp] AS TABLE(
	[id] [int] NULL,
	[templateid] [int] NULL,
	[machineid] [int] NULL,
	[activityid] [int] NULL,
	[sequenceorder] [int] NULL,
	[machine] [nvarchar](200) NULL,
	[toolsconsumable] [nvarchar](max) NULL,
	[stdtimehrs] [int] NULL,
	[stdtimemins] [int] NULL,
	[stdtimesecs] [int] NULL,
	[costperhour] [decimal](10, 2) NULL,
	[remarks] [nvarchar](max) NULL,
	[alternateofmachineid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[template_item_movementcard_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[template_item_movementcard_tvp] AS TABLE(
	[templateid] [int] NULL,
	[itemid] [bigint] NULL,
	[effectivefromdate] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_production].[template_parameters_movementcard_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_production].[template_parameters_movementcard_tvp] AS TABLE(
	[id] [int] NULL,
	[templateid] [int] NULL,
	[activityid] [int] NULL,
	[activity] [nvarchar](200) NULL,
	[operationsequence] [int] NULL,
	[stdtimehrs] [int] NULL,
	[stdtimemins] [int] NULL,
	[stdtimesecs] [int] NULL,
	[costperhour] [decimal](10, 2) NULL,
	[remarks] [nvarchar](max) NULL
)
GO
/****** Object:  UserDefinedTableType [db_qc].[dtl_qc_transactions_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_qc].[dtl_qc_transactions_tvp] AS TABLE(
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[id] [bigint] NULL,
	[testid] [bigint] NULL,
	[qcparameterid] [int] NULL,
	[qcparametername] [varchar](1) NULL,
	[qcstdvalue1] [decimal](13, 3) NULL,
	[qcstdvalue2] [decimal](13, 3) NULL,
	[qcobservedvalue1] [decimal](13, 3) NULL,
	[qcobservedvalue2] [decimal](13, 3) NULL,
	[createdby] [int] NULL,
	[createdon] [date] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [date] NULL
)
GO
/****** Object:  UserDefinedTableType [db_qc].[dtl_qctest_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_qc].[dtl_qctest_tvp] AS TABLE(
	[id] [bigint] NULL,
	[testid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[qctestid] [int] NULL,
	[qcvaluetypeid] [int] NULL,
	[qcstdvalue1] [varchar](30) NULL,
	[qcstdvalue2] [varchar](30) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[operatorid] [int] NULL,
	[unitid] [int] NULL,
	[groupid] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[userid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_qc].[hdr_qc_transactions_tvp]    Script Date: 1/15/2020 8:33:27 PM ******/
CREATE TYPE [db_qc].[hdr_qc_transactions_tvp] AS TABLE(
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[id] [bigint] NULL,
	[testid] [bigint] NULL,
	[testno] [bigint] NULL,
	[qcintimationno] [bigint] NULL,
	[qcintimationdate] [date] NULL,
	[qclablocationid] [int] NULL,
	[arno] [varchar](200) NULL,
	[date] [date] NULL,
	[grnno] [bigint] NULL,
	[grndate] [date] NULL,
	[grnid] [bigint] NULL,
	[grnqty] [decimal](13, 3) NULL,
	[itemid] [int] NULL,
	[brandid] [int] NULL,
	[mfgdate] [date] NULL,
	[expirydate] [date] NULL,
	[batchno] [varchar](1) NULL,
	[qty] [decimal](13, 3) NULL,
	[sampleqty] [decimal](13, 3) NULL,
	[samplecollectedon] [date] NULL,
	[qcby] [int] NULL,
	[nextqcdate] [date] NULL,
	[releasedate] [date] NULL,
	[okqty] [decimal](13, 3) NULL,
	[quantityrejected] [decimal](13, 3) NULL,
	[remarks] [varchar](300) NULL,
	[generalobservations] [varchar](300) NULL,
	[isdeviation] [bit] NULL,
	[deviationrefno] [varchar](30) NULL,
	[deviationrefdt] [date] NULL,
	[deviationapprovedby] [varchar](50) NULL,
	[deviationapprovedon] [date] NULL,
	[createdby] [int] NULL,
	[createdon] [date] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [date] NULL,
	[supplierid] [bigint] NULL,
	[ref_no] [varchar](1) NULL,
	[ref_date] [date] NULL,
	[aprvl_remarks] [varchar](200) NULL,
	[qctype] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_qc].[hdr_qctest_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_qc].[hdr_qctest_tvp] AS TABLE(
	[id] [int] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[userid] [int] NULL,
	[fyid] [int] NULL,
	[qctypeid] [int] NULL,
	[testno] [bigint] NULL,
	[testdate] [date] NULL,
	[qctestname] [varchar](200) NULL
)
GO
/****** Object:  UserDefinedTableType [db_qc].[itemwise__tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_qc].[itemwise__tvp] AS TABLE(
	[id] [bigint] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[userid] [int] NULL,
	[testid] [bigint] NULL,
	[itemid] [bigint] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[contractreview_saleorder_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[contractreview_saleorder_tvp] AS TABLE(
	[id] [bigint] NULL,
	[oaid] [bigint] NULL,
	[crdate] [date] NULL,
	[dealerexpenses] [nvarchar](100) NULL,
	[emddetailrequired] [bit] NULL,
	[emddetail] [nvarchar](100) NULL,
	[emddate] [date] NULL,
	[securitydepositrequired] [bit] NULL,
	[securitydepositdetail] [nvarchar](100) NULL,
	[securitydepositdate] [date] NULL,
	[ldclause] [nvarchar](100) NULL,
	[agreement] [nvarchar](100) NULL,
	[inspection] [nvarchar](200) NULL,
	[deliveryrequestedbycustomer] [date] NULL,
	[datecommittedbyproduction] [date] NULL,
	[qcandpackingdate] [date] NULL,
	[receivedbycustomerdate] [date] NULL,
	[stockorder] [nvarchar](100) NULL,
	[technicalquery] [nvarchar](500) NULL,
	[installationInfo] [nvarchar](500) NULL,
	[exciseexemption] [nvarchar](500) NULL,
	[ewaybillrequired] [bit] NULL,
	[customerpendency] [nvarchar](500) NULL,
	[companypendency] [nvarchar](500) NULL,
	[contactuser] [nvarchar](100) NULL,
	[freight] [varchar](100) NULL,
	[remarks] [nvarchar](500) NULL,
	[reviewone] [nvarchar](500) NULL,
	[reviewtwo] [nvarchar](500) NULL,
	[reviewthree] [nvarchar](500) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_drcrnote]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_drcrnote] AS TABLE(
	[id] [int] NULL,
	[noteid] [int] NULL,
	[itemid] [int] NULL,
	[billedqty] [decimal](18, 0) NULL,
	[noteqty] [decimal](18, 0) NULL,
	[rate] [decimal](18, 0) NULL,
	[taxableamt] [decimal](18, 0) NULL,
	[gstid] [int] NULL,
	[igst] [decimal](18, 0) NULL,
	[sgst] [decimal](18, 0) NULL,
	[cgst] [decimal](18, 0) NULL,
	[igstamt] [decimal](18, 0) NULL,
	[sgstamt] [decimal](18, 0) NULL,
	[cgstamt] [decimal](18, 0) NULL,
	[totalamt] [decimal](18, 0) NULL,
	[notetypeid] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_batches_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_batches_tvp] AS TABLE(
	[id] [bigint] NULL,
	[invid] [bigint] NULL,
	[oaid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[packing] [varchar](25) NULL,
	[qty] [decimal](15, 3) NULL,
	[focqty] [decimal](15, 3) NULL,
	[batch] [varchar](20) NULL,
	[mfgdate] [date] NULL,
	[expdate] [date] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_expcarriage_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_expcarriage_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[invid] [bigint] NOT NULL,
	[precarriageby] [varchar](200) NULL,
	[placeofreceiptbyprecarriage] [varchar](200) NULL,
	[vesselflightno] [varchar](100) NULL,
	[portofloading] [varchar](200) NULL,
	[portofdischarge] [varchar](200) NULL,
	[postcarriageby] [varchar](200) NULL,
	[placeofreceiptbypostcarriage] [varchar](200) NULL,
	[finaldestination] [varchar](200) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_lc_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_lc_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[invid] [bigint] NOT NULL,
	[lcno] [varchar](100) NULL,
	[lcdate] [datetime] NULL,
	[lcamendmentno] [varchar](100) NULL,
	[lcamendmentdate] [datetime] NULL,
	[lcdescription] [varchar](max) NULL,
	[lcbankname] [varchar](300) NULL,
	[lcbankbranch] [varchar](300) NULL,
	[lcareacode] [varchar](50) NULL,
	[lctinno] [varchar](50) NULL,
	[lcvatno] [varchar](50) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_levies_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_levies_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[invid] [bigint] NOT NULL,
	[levyid] [int] NOT NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_packinglist_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_packinglist_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[catno] [varchar](100) NULL,
	[couriertype] [varchar](50) NULL,
	[description] [varchar](max) NULL,
	[qty] [decimal](10, 3) NULL,
	[unit] [varchar](300) NULL,
	[netweight] [decimal](13, 3) NULL,
	[grossweight] [decimal](13, 3) NULL,
	[length] [decimal](10, 3) NULL,
	[breadth] [decimal](10, 3) NULL,
	[height] [decimal](10, 3) NULL,
	[totalweight] [decimal](13, 3) NULL,
	[amount] [decimal](15, 2) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_paymentterms_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_paymentterms_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[invid] [bigint] NOT NULL,
	[srno] [int] NULL,
	[paymentterm] [varchar](300) NOT NULL,
	[percent] [decimal](6, 2) NULL,
	[amount] [decimal](15, 5) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_transportation_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_transportation_tvp] AS TABLE(
	[id] [int] NOT NULL,
	[invid] [bigint] NOT NULL,
	[transportid] [int] NOT NULL,
	[transportname] [varchar](100) NULL,
	[dispatchqty] [decimal](15, 3) NULL,
	[dispatchdate] [datetime] NULL,
	[expecteddeliverydate] [datetime] NULL,
	[glrno] [varchar](50) NULL,
	[glrdate] [datetime] NULL,
	[vehicleno] [nvarchar](25) NULL,
	[weight] [decimal](15, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_tvp] AS TABLE(
	[id] [bigint] NULL,
	[fyid] [int] NULL,
	[invid] [bigint] NULL,
	[oaid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[billingdescription] [varchar](200) NULL,
	[isfoc] [bit] NULL,
	[issample] [bit] NULL,
	[specialcode] [varchar](50) NULL,
	[packing] [varchar](25) NULL,
	[uom] [varchar](25) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](13, 2) NULL,
	[netrate] [decimal](13, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[qtyalreadydispatched] [decimal](15, 3) NULL,
	[qtytodispatch] [decimal](15, 3) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 2) NULL,
	[totalamt] [decimal](13, 2) NULL,
	[remarks] [varchar](100) NULL,
	[batch] [varchar](20) NULL,
	[totalamtinfc] [decimal](15, 3) NULL,
	[rateinfc] [decimal](15, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_sale_work_order_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_sale_work_order_tvp] AS TABLE(
	[id] [bigint] NULL,
	[swoid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[itemname] [varchar](max) NULL,
	[itemcode] [varchar](100) NULL,
	[remarks] [varchar](max) NULL,
	[bomid] [bigint] NULL,
	[bomtype] [char](1) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_saleorder_tvp]    Script Date: 1/15/2020 8:33:28 PM ******/
CREATE TYPE [db_sop].[dtl_saleorder_tvp] AS TABLE(
	[id] [bigint] NULL,
	[orderid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[billingdescription] [varchar](200) NULL,
	[isfoc] [bit] NULL,
	[issample] [bit] NULL,
	[specialcode] [varchar](50) NULL,
	[packing] [varchar](25) NULL,
	[uom] [varchar](25) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[mrp] [decimal](15, 2) NULL,
	[rate] [decimal](15, 2) NULL,
	[netrate] [decimal](15, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](15, 2) NULL,
	[netamt] [decimal](15, 2) NULL,
	[igstamt] [decimal](15, 2) NULL,
	[cgstamt] [decimal](15, 2) NULL,
	[sgstamt] [decimal](15, 2) NULL,
	[cessamt] [decimal](15, 3) NULL,
	[totalamt] [decimal](15, 2) NULL,
	[remarks] [varchar](500) NULL,
	[qtyalreadydispatched] [decimal](15, 3) NULL,
	[qtytodispatch] [decimal](15, 3) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[focqty] [decimal](15, 3) NULL,
	[technicalspecs] [varchar](max) NULL,
	[hsncode] [varchar](20) NULL,
	[totalamtinfc] [decimal](15, 3) NULL,
	[rateinfc] [decimal](15, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[dtl_saleorder_tvp1]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[dtl_saleorder_tvp1] AS TABLE(
	[id] [bigint] NULL,
	[orderid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[billingdescription] [varchar](200) NULL,
	[isfoc] [bit] NULL,
	[issample] [bit] NULL,
	[specialcode] [varchar](50) NULL,
	[packing] [varchar](25) NULL,
	[uom] [varchar](10) NULL,
	[gstid] [bigint] NULL,
	[igstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[cessrate] [decimal](6, 3) NULL,
	[basicamount] [decimal](13, 2) NULL,
	[mrp] [decimal](15, 2) NULL,
	[rate] [decimal](15, 2) NULL,
	[netrate] [decimal](15, 2) NULL,
	[orderedquantity] [decimal](15, 3) NULL,
	[itemdiscpercent] [decimal](6, 2) NULL,
	[itemdiscamt] [decimal](15, 2) NULL,
	[netamt] [decimal](15, 2) NULL,
	[igstamt] [decimal](15, 2) NULL,
	[cgstamt] [decimal](15, 2) NULL,
	[sgstamt] [decimal](15, 2) NULL,
	[cessamt] [decimal](15, 3) NULL,
	[totalamt] [decimal](15, 2) NULL,
	[remarks] [varchar](500) NULL,
	[qtyalreadydispatched] [decimal](15, 3) NULL,
	[qtytodispatch] [decimal](15, 3) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[focqty] [decimal](15, 3) NULL,
	[technicalspecs] [varchar](max) NULL,
	[hsncode] [varchar](20) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_drcrnote]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[hdr_drcrnote] AS TABLE(
	[id] [int] NULL,
	[noteno] [int] NULL,
	[notedate] [datetime] NULL,
	[partyid] [int] NULL,
	[name] [varchar](100) NULL,
	[address] [varchar](300) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[country] [varchar](50) NULL,
	[gstin] [varchar](15) NULL,
	[drcr] [char](1) NULL,
	[invid] [int] NULL,
	[reasonid] [int] NULL,
	[taxableamt] [decimal](18, 0) NULL,
	[igstamt] [decimal](18, 0) NULL,
	[sgstamt] [decimal](18, 0) NULL,
	[cgstamt] [decimal](18, 0) NULL,
	[totalamt] [decimal](18, 0) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_sale_tvp]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[hdr_sale_tvp] AS TABLE(
	[id] [bigint] NULL,
	[oaids] [varchar](200) NULL,
	[pino] [bigint] NULL,
	[pidate] [date] NULL,
	[confirmed] [bit] NULL,
	[confirmedbyuserid] [bigint] NULL,
	[confirmedon] [datetime] NULL,
	[invno] [bigint] NULL,
	[invdate] [date] NULL,
	[revisedbyuserid] [int] NULL,
	[revisedon] [datetime] NULL,
	[cancelledon] [datetime] NULL,
	[cancelledbyuserid] [bigint] NULL,
	[invprefix] [varchar](20) NULL,
	[invpostfix] [varchar](20) NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](500) NULL,
	[customeraddr1] [varchar](max) NULL,
	[customeraddr2] [varchar](max) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[billtocustomerid] [bigint] NULL,
	[billtocustomername] [varchar](500) NULL,
	[billtocustomeraddr1] [varchar](max) NULL,
	[billtocustomeraddr2] [varchar](max) NULL,
	[billtocity] [varchar](50) NULL,
	[billtostate] [varchar](50) NULL,
	[billtopin] [varchar](12) NULL,
	[billtocustomergstno] [varchar](20) NULL,
	[consigneecustomerid] [bigint] NULL,
	[consigneecustomername] [varchar](500) NULL,
	[consigneecustomeraddr1] [varchar](max) NULL,
	[consigneecustomeraddr2] [varchar](max) NULL,
	[consigneecity] [varchar](50) NULL,
	[consigneestate] [varchar](50) NULL,
	[consigneepin] [varchar](12) NULL,
	[consigneecustomergstno] [varchar](20) NULL,
	[custPoNo] [varchar](100) NULL,
	[custPodate] [date] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[invamt] [decimal](13, 2) NULL,
	[userid] [bigint] NULL,
	[approvedbymarketingheaduserid] [bigint] NULL,
	[approvedbycommercialuserid] [bigint] NULL,
	[approvedbyaccountsuserid] [bigint] NULL,
	[remarks] [varchar](500) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[invoicetype] [varchar](20) NULL,
	[currency] [varchar](3) NULL,
	[conversionrate] [decimal](10, 3) NULL,
	[invcertification] [varchar](max) NULL,
	[totalamtinfc] [decimal](15, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_sale_work_order_tvp]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[hdr_sale_work_order_tvp] AS TABLE(
	[swoid] [bigint] NULL,
	[swodate] [datetime] NULL,
	[oaid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[itemname] [varchar](max) NULL,
	[itemcode] [varchar](100) NULL,
	[remarks] [varchar](max) NULL,
	[bomid] [bigint] NULL,
	[bomtype] [char](1) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_sale_work_order_tvp0]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[hdr_sale_work_order_tvp0] AS TABLE(
	[swoid] [bigint] IDENTITY(1,1) NOT NULL,
	[swodate] [datetime] NULL,
	[oaid] [bigint] NULL,
	[itemid] [bigint] NULL,
	[itemname] [varchar](max) NULL,
	[itemcode] [varchar](100) NULL,
	[remarks] [varchar](max) NULL,
	[bomid] [bigint] NULL,
	[bomtype] [char](1) NULL,
	[coid] [int] NOT NULL,
	[boid] [int] NOT NULL,
	[fyid] [int] NOT NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[hdr_saleorder_tvp]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[hdr_saleorder_tvp] AS TABLE(
	[oaid] [bigint] NULL,
	[oano] [bigint] NULL,
	[oadate] [date] NULL,
	[customerid] [bigint] NULL,
	[customername] [varchar](200) NULL,
	[customeraddr1] [varchar](100) NULL,
	[customeraddr2] [varchar](100) NULL,
	[city] [varchar](50) NULL,
	[state] [varchar](50) NULL,
	[pin] [varchar](12) NULL,
	[customergstno] [varchar](20) NULL,
	[customercontactpersonname] [varchar](50) NULL,
	[customercontactpersonphone] [varchar](50) NULL,
	[customercontactpersondesignation] [varchar](50) NULL,
	[customercontactpersondepartment] [varchar](50) NULL,
	[billtocustomerid] [bigint] NULL,
	[billtocustomername] [varchar](100) NULL,
	[billtocustomeraddr1] [varchar](100) NULL,
	[billtocustomeraddr2] [varchar](100) NULL,
	[billtocity] [varchar](50) NULL,
	[billtostate] [varchar](50) NULL,
	[billtopin] [varchar](12) NULL,
	[billtocustomergstno] [varchar](20) NULL,
	[consigneecustomerid] [bigint] NULL,
	[consigneecustomername] [varchar](100) NULL,
	[consigneecustomeraddr1] [varchar](100) NULL,
	[consigneecustomeraddr2] [varchar](100) NULL,
	[consigneecity] [varchar](50) NULL,
	[consigneestate] [varchar](50) NULL,
	[consigneepin] [varchar](12) NULL,
	[consigneecustomergstno] [varchar](20) NULL,
	[custPoNo] [varchar](100) NULL,
	[custPodate] [date] NULL,
	[ourquoteno] [varchar](100) NULL,
	[ourquotedate] [date] NULL,
	[basicamt] [decimal](13, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[netamt] [decimal](13, 2) NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[orderamt] [decimal](13, 2) NULL,
	[cessamt] [decimal](13, 2) NULL,
	[userid] [bigint] NULL,
	[orderstatus] [varchar](50) NULL,
	[confirmedbyuserid] [bigint] NULL,
	[approvedbymarketingheaduserid] [bigint] NULL,
	[approvedbycommercialuserid] [bigint] NULL,
	[approvedbyrandduserid] [bigint] NULL,
	[approvedbyproductionuserid] [bigint] NULL,
	[approvedbyceouserid] [bigint] NULL,
	[amendmentno] [int] NULL,
	[amendmentdate] [date] NULL,
	[cancelledon] [datetime] NULL,
	[cancelledbyuserid] [bigint] NULL,
	[remarks] [varchar](500) NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[fyid] [int] NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[ordertype] [int] NULL,
	[marketexecutive] [int] NULL,
	[concessionaltax] [bit] NULL,
	[advancereceived] [decimal](13, 2) NULL,
	[packinginstructions] [varchar](500) NULL,
	[installationinfo] [varchar](500) NULL,
	[roundoff] [decimal](6, 3) NULL,
	[totalamtinfc] [decimal](15, 3) NULL,
	[currency] [varchar](3) NULL,
	[conversionrate] [decimal](12, 3) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_deliveryschedule_tvp]    Script Date: 1/15/2020 8:33:29 PM ******/
CREATE TYPE [db_sop].[order_deliveryschedule_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[itemid] [int] NULL,
	[remarks] [nvarchar](max) NULL,
	[deliverydate] [datetime] NULL,
	[qtytobedispatch] [decimal](10, 3) NULL,
	[dispatchqty] [decimal](10, 3) NULL,
	[dispatchon] [datetime] NULL,
	[deliverydatebyproduction] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_discsummary_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_discsummary_tvp] AS TABLE(
	[id] [bigint] NOT NULL,
	[orderid] [bigint] NOT NULL,
	[discdescid] [int] NULL,
	[name] [varchar](200) NULL,
	[totalamt] [decimal](18, 2) NULL,
	[disc] [decimal](9, 2) NULL,
	[discamt] [decimal](13, 2) NULL,
	[createdby] [int] NOT NULL,
	[createdon] [datetime] NOT NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_documentsreqd_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_documentsreqd_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[srno] [int] NULL,
	[documentid] [int] NULL,
	[documentinfo] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_installationinfo_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_installationinfo_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[srno] [int] NULL,
	[installationid] [int] NULL,
	[installationinfo] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_itemaccessories_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_itemaccessories_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[itemid] [int] NULL,
	[accessorieid] [int] NULL,
	[accessorieqty] [decimal](10, 3) NULL,
	[accesoriebrand] [int] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_packinginstructions_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_packinginstructions_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[srno] [int] NULL,
	[instructionid] [int] NULL,
	[instruction] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_paymentterms_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_paymentterms_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[srno] [int] NULL,
	[paymenttermid] [int] NULL,
	[paymentterm] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL,
	[coid] [int] NULL,
	[boid] [int] NULL,
	[percent] [decimal](6, 2) NULL,
	[amount] [decimal](15, 5) NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[order_termsandconditions_tvp]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[order_termsandconditions_tvp] AS TABLE(
	[id] [int] NULL,
	[orderid] [int] NULL,
	[srno] [int] NULL,
	[termsandconditionsid] [int] NULL,
	[termsandcondition] [varchar](300) NULL,
	[createdby] [int] NULL,
	[createdon] [datetime] NULL,
	[modifiedby] [int] NULL,
	[modifiedon] [datetime] NULL
)
GO
/****** Object:  UserDefinedTableType [db_sop].[tvp_sale_levies]    Script Date: 1/15/2020 8:33:30 PM ******/
CREATE TYPE [db_sop].[tvp_sale_levies] AS TABLE(
	[id] [bigint] NOT NULL,
	[invid] [bigint] NOT NULL,
	[levyid] [int] NOT NULL,
	[quantity] [decimal](13, 2) NULL,
	[rate] [decimal](13, 2) NULL,
	[uom] [varchar](20) NULL,
	[uomid] [int] NULL,
	[amount] [decimal](13, 2) NULL,
	[hsncode] [varchar](8) NULL,
	[gstid] [int] NULL,
	[igstamt] [decimal](13, 2) NULL,
	[cgstamt] [decimal](13, 2) NULL,
	[sgstamt] [decimal](13, 2) NULL,
	[igstrate] [decimal](6, 3) NULL,
	[cgstrate] [decimal](6, 3) NULL,
	[sgstrate] [decimal](6, 3) NULL
)
GO
