K1 & 1099B

We sold a PTP that we had held for years.  The sale involved some long-term and short-term transactions.  We received both a K1 from the partnership and a 1099B from our broker.  I am totally confused about how to enter this.  There is also a "worksheet" on the back of the K1 that has steps for calculating total gain/loss and capital gain/loss and what percent is long term, but I am quite confused about how this all goes into TT.