Return to:
Database Reference Home Page
Return to:
Table Definitions Master List
*Table Name*
vendor_returns_header
*Description*
Vendor Credit/Returns header & line item tables..
Vendor Returns header table
*Schema*
CREATE TABLE vendor_returns_header (
"vendor_returns_header_id" serial
PRIMARY KEY, -- System generated unique ID
"vendor_code" varchar(25), -- Vendor Code
"company_id" int
NOT NULL -- References company_master.company_id
REFERENCES company_master (company_id),
"customer_code" varchar(128), -- References customer_master.customer_id
-- Usually references an Internal Account
"system_return_number" varchar(32) -- Reference return # in system
NOT NULL,
"warehouse_code" varchar(8) -- Sourcing warehouse code
NOT NULL,
"sales_order_header_id" int, -- External reference to sales order
"ra_number" varchar(32), -- R/A Number
"original_return_status" varchar(2), -- Original return status (State order was in when processed)
"last_return_status" varchar(2), -- Last return status
"return_status" varchar(2), -- Return status
-- O: Open; C: Closed;
-- A: V/C Detail; Z: Cancelled;
"return_type" varchar(2), -- RE=Stock Return, WC=Warranty Return,
-- DC=Dud/Core Return, CD=Customer Destroy
"entered_by" int, -- Employee who entered
"modified_by" int, -- Last Employee who modified order
"closed_by" int, -- Confirmed by employee ID
"freight_carrier" varchar(32), -- Freight Company
"freight_service" varchar(32), -- Freight Service
"freight_options" varchar(32), -- Freight Options
"freight_out" numeric(15,2), -- Freight out (What was charged for freight)
"freight_out_actual" numeric(15,2), -- Actual Freight Out (What it cost to ship)
"freight_out_flag" char(1)
NOT NULL, -- Freight out flag
-- P: Prepaid allow
-- B: Prepaid and add
-- C: Collect
-- T: Customer take (Local pickup)
"freight_taxable_flag" BOOLEAN -- Freight taxable flag
DEFAULT false,
"reported_freight_weight" numeric(8,2), -- Freight weight reported to shipping entity
"freight_tracking_number" varchar(32), -- Freight tracking #
"restock_fee" numeric(10,2) -- Vendor flat-rate restocking fee
DEFAULT 0,
"restock_percent" numeric(5,2) -- Vendor item percentage restocking fee
DEFAULT 0,
"billing_name" varchar(64), -- Billing Name
"billing_address_1" varchar(32), -- Billing address 1
"billing_address_2" varchar(32), -- Billing address 2
"billing_address_3" varchar(32), -- Billing address 3
"billing_city" varchar(32), -- Billing city
"billing_locality" varchar(32), -- Billing locality
"billing_mailing_code" varchar(16), -- Billing mailing code
"billing_country" varchar(32), -- Billing country
"billing_phone" varchar(32), -- Billing phone
"billing_fax" varchar(32), -- Billing Fax
"billing_email" varchar(128), -- Billing Email
"shipping_name" varchar(64), -- Shipping Name
"shipping_address_1" varchar(32), -- Shipping address 1
"shipping_address_2" varchar(32), -- Shipping address 2
"shipping_address_3" varchar(32), -- Shipping address 3
"shipping_city" varchar(32), -- Shipping city
"shipping_locality" varchar(32), -- Shipping locality
"shipping_mailing_code" varchar(16), -- Shipping mailing code
"shipping_country" varchar(32), -- Shipping country
"comments" varchar(75), -- Comments
"shipping_instructions" varchar(75), -- Shipping instructions
"date_entered" timestamp without time zone, -- Date/time entered
"date_closed" timestamp without time zone, -- Date/time closed
"date_shipped" timestamp without time zone, -- Date/time shipped
"date_invoiced" timestamp without time zone, -- Date/time order completed (billed)
"pick_ticket_counter" int, -- Counter for number of times invoice/pick-ticket has been printed
-- NULL: pick-ticket has not been printed
UNIQUE (company_id, system_return_number, warehouse_code),
FOREIGN KEY (company_id,customer_code)
REFERENCES customer_master (company_id,customer_code)
ON UPDATE cascade,
FOREIGN KEY (company_id,warehouse_code)
REFERENCES warehouse_master (company_id,warehouse_code)
ON UPDATE cascade
);
There are no comments on this page. [Add comment]