UPDATE
  tbAppointments
SET
  BookedByID = @nBookedByID,
  ConsultantID = @nConsultantID,
  ConsultantBranchID = @nConsultantBranchID,
  AccountBookType = @aAccountBookType,
  AccountBookID = @nAccountBookID,
  AttendanceDate = @aAttendanceDate,
  AttendanceTime = CONCAT(@aAttendanceDate, ' ', @aAttendanceTime),
  Duration = @nDuration,
  ClientID = @nClientID,
  ClientBranchID = @nClientBranchID,
  ProductID = @nProductID,
  ClientBranchProductID = @nClientBranchProductID,
  ClientOrderNumber = @aClientOrderNumber,
  EmployeeParticulars = @aEmployeeParticulars,
  IRChargeType = @aIRChargeType,
  IRFinding = @aIRFinding,
  IRRecommendationID = @nIRRecommendationID,
  AttendanceTypeID = @nAttendanceTypeID,
  SubAttendanceType = @aSubAttendanceType,
  TimeSpent = @nTimeSpent,
  ActualHoursSpent = @nTimeSpent,
  AppointmentStage = IF(@aAppointmentStage = 'AuthReady', 'AuthReady', 'Appointment'),
  BillingYearMonth = NULL,
  TimeSpentRate = @nTimeSpentRate,
  TimeSpentTotal = (@nTimeSpent * @nTimeSpentRate),
  DontDeductFromCover = @bDontDeductFromCover,
  TrainingRequired = @bTrainingRequired,
  ReferralRequested = @bReferralRequested,
  ProjectID = @nProjectID,
  CaseID = @nCaseID,
  LastChangeDate = NOW(),

  --
  -- Client satisfaction details.
  --
  ClientSatisfactionRating = @nClientSatisfactionRating,
  ClientSatisfactionComment = @aClientSatisfactionComment,
  ClientHasComplained = @bClientHasComplained,
  IsCancelImminent = @bIsCancelImminent
WHERE
  AppointmentID = @nAppointmentID